~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/public_key/test/pkits_SUITE.erl

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
%%
2
2
%% %CopyrightBegin%
3
3
%% 
4
 
%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
 
4
%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
5
5
%% 
6
6
%% The contents of this file are subject to the Erlang Public License,
7
7
%% Version 1.1, (the "License"); you may not use this file except in
25
25
 
26
26
-compile(export_all).
27
27
 
28
 
%%-include_lib("public_key/include/public_key.hrl").
29
 
-include("public_key.hrl").
 
28
-include_lib("public_key/include/public_key.hrl").
 
29
%%-include("public_key.hrl").
30
30
 
31
31
-define(error(Format,Args), error(Format,Args,?FILE,?LINE)).
32
32
-define(warning(Format,Args), warning(Format,Args,?FILE,?LINE)).
43
43
-define(NIST6, "2.16.840.1.101.3.2.1.48.6").
44
44
 
45
45
%%
46
 
all(doc) ->
47
 
    ["PKITS tests for RFC3280 compliance"];
48
 
all(suite) ->    
49
 
    [signature_verification,
50
 
     validity_periods,
 
46
suite() -> [{ct_hooks,[ts_install_cth]}].
 
47
 
 
48
all() -> 
 
49
    [signature_verification, validity_periods,
51
50
     verifying_name_chaining,
52
 
     %% basic_certificate_revocation_tests,
53
51
     verifying_paths_with_self_issued_certificates,
54
 
     verifying_basic_constraints,
55
 
     key_usage,
56
 
%%      certificate_policies,
57
 
%%      require_explicit_policy,
58
 
%%      policy_mappings,
59
 
%%      inhibit_policy_mapping,
60
 
%%      inhibit_any_policy,
61
 
     name_constraints,       
62
 
%%      distribution_points,
63
 
%%      delta_crls,
64
 
     private_certificate_extensions].
 
52
     verifying_basic_constraints, key_usage,
 
53
     name_constraints, private_certificate_extensions].
 
54
 
 
55
groups() -> 
 
56
    [].
 
57
 
 
58
init_per_group(_GroupName, Config) ->
 
59
    Config.
 
60
 
 
61
end_per_group(_GroupName, Config) ->
 
62
    Config.
 
63
 
65
64
 
66
65
signature_verification(doc) ->    [""];
67
66
signature_verification(suite) -> [];
129
128
    run(private_certificate_extensions()).
130
129
    
131
130
run() ->
132
 
    catch crypto:start(),
133
131
    Tests = 
134
132
        [signature_verification(),
135
133
         validity_periods(),
187
185
read_certs(Test) ->
188
186
    File = test_file(Test),
189
187
    %% io:format("Read ~p ",[File]),
190
 
    {ok, Ders} = public_key:pem_to_der(File),
 
188
    Ders = erl_make_certs:pem_to_der(File),
191
189
    %% io:format("Ders ~p ~n",[length(Ders)]),
192
 
    [Cert || {cert,Cert,not_encrypted} <- Ders].
 
190
    [Cert || {'Certificate', Cert, not_encrypted} <- Ders].
193
191
 
194
192
test_file(Test) ->
195
193
    file(?CONV, lists:append(string:tokens(Test, " -")) ++ ".pem").
581
579
    put(datadir, Datadir),
582
580
    Config.
583
581
 
584
 
fin_per_testcase(_Func, Config) ->
 
582
end_per_testcase(_Func, Config) ->
585
583
    %% Nodes = select_nodes(all, Config, ?FILE, ?LINE),
586
584
    %% rpc:multicall(Nodes, mnesia, lkill, []),
587
585
    Config.
588
586
 
589
587
init_per_suite(Config) ->
590
 
    crypto:start(),
591
 
    Config.
 
588
    try crypto:start() of
 
589
        ok ->
 
590
            Config
 
591
    catch _:_ ->
 
592
            {skip, "Crypto did not start"}
 
593
    end.
592
594
 
593
595
end_per_suite(_Config) ->
594
 
    crypto:stop().
 
596
    application:stop(crypto).
595
597
 
596
598
error(Format, Args, File0, Line) ->
597
599
    File = filename:basename(File0),