aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test/test_modified_x420.erl
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2013-02-06 14:47:12 +0100
committerErlang/OTP <[email protected]>2013-02-06 14:47:12 +0100
commita30a45e158978a6bc13684505f10d5e3824ee819 (patch)
treebd07c843b963495026af782b4aad284bed628d9a /lib/asn1/test/test_modified_x420.erl
parentb4b0029f031818a9dce605b73551bca2ed3a01f4 (diff)
parent0fd671609f7b31a9313d1575434e7273f3f2cd09 (diff)
downloadotp-a30a45e158978a6bc13684505f10d5e3824ee819.tar.gz
otp-a30a45e158978a6bc13684505f10d5e3824ee819.tar.bz2
otp-a30a45e158978a6bc13684505f10d5e3824ee819.zip
Merge branch 'bjorn/asn1/open-type-error/OTP-10805' into maint-r15
* bjorn/asn1/open-type-error/OTP-10805: asn1_erl_nif: Correct broken length encoding asn1_SUITE: Mend broken test_modified_x420/1
Diffstat (limited to 'lib/asn1/test/test_modified_x420.erl')
-rw-r--r--lib/asn1/test/test_modified_x420.erl22
1 files changed, 8 insertions, 14 deletions
diff --git a/lib/asn1/test/test_modified_x420.erl b/lib/asn1/test/test_modified_x420.erl
index 2e9dfeee87..ae9d1989fb 100644
--- a/lib/asn1/test/test_modified_x420.erl
+++ b/lib/asn1/test/test_modified_x420.erl
@@ -18,27 +18,21 @@
%%
%%
-module(test_modified_x420).
-
-%-compile(export_all).
--export([test_io/1]).
+-export([test/1]).
-include_lib("test_server/include/test_server.hrl").
-test_io(Config) ->
- io:format("~p~n~n", [catch test(Config)]).
-
test(Config) ->
- ?line DataDir = ?config(data_dir,Config),
-% ?line OutDir = ?config(priv_dir,Config),
+ DataDir = ?config(data_dir,Config),
- ?line Der = read_pem(filename:join([DataDir,modified_x420,"p7_signed_data.pem"])),
- ?line {ok, {_,_,SignedData}} = 'PKCS7':decode('ContentInfo', Der),
- ?line {ok,_} = 'PKCS7':decode('SignedData', SignedData).
+ Der = read_pem(filename:join([DataDir,modified_x420,"p7_signed_data.pem"])),
+ {ok,{_,_,SignedData}} = asn1_wrapper:decode('PKCS7', 'ContentInfo', Der),
+ {ok,_} = asn1_wrapper:decode('PKCS7', 'SignedData', SignedData).
read_pem(File) ->
- ?line {ok, Bin} = file:read_file(File),
- ?line ssl_base64:join_decode(lists:flatten(extract_base64(Bin))).
-
+ {ok,Bin} = file:read_file(File),
+ Der = base64:mime_decode(lists:flatten(extract_base64(Bin))),
+ binary_to_list(Der).
extract_base64(Binary) ->