aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/test
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2011-09-28 11:59:22 +0200
committerSverker Eriksson <[email protected]>2011-09-28 11:59:22 +0200
commit0843769ab9c3263b368b49b95a8b97478a82dbea (patch)
tree817ec4dd451b4ce9c8aeb50a1280ba2ef3d187b9 /lib/crypto/test
parentdf20d15f2229fa5da1c9b7ab8b41b2d706d586f8 (diff)
parent2fa5d1e5146513f933c584c9bd444b7f03793820 (diff)
downloadotp-0843769ab9c3263b368b49b95a8b97478a82dbea.tar.gz
otp-0843769ab9c3263b368b49b95a8b97478a82dbea.tar.bz2
otp-0843769ab9c3263b368b49b95a8b97478a82dbea.zip
Merge branch 'dev' into major
Diffstat (limited to 'lib/crypto/test')
-rw-r--r--lib/crypto/test/crypto_SUITE.erl30
1 files changed, 8 insertions, 22 deletions
diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl
index 26d10d892a..486751766b 100644
--- a/lib/crypto/test/crypto_SUITE.erl
+++ b/lib/crypto/test/crypto_SUITE.erl
@@ -1083,30 +1083,16 @@ rsa_sign_test(Config) when is_list(Config) ->
PrivKey = [crypto:mpint(PubEx), crypto:mpint(Mod), crypto:mpint(PrivEx)],
PubKey = [crypto:mpint(PubEx), crypto:mpint(Mod)],
- ?line Sig = crypto:rsa_sign(sized_binary(Msg), PrivKey),
- ?line m(crypto:rsa_verify(sized_binary(Msg), sized_binary(Sig),PubKey), true),
+ ?line Sig1 = crypto:rsa_sign(sized_binary(Msg), PrivKey),
+ ?line m(crypto:rsa_verify(sized_binary(Msg), sized_binary(Sig1),PubKey), true),
- ?line Sig_md2 = crypto:rsa_sign(md2, sized_binary(Msg), PrivKey),
- ?line Sig_md5 = crypto:rsa_sign(md5, sized_binary(Msg), PrivKey),
- ?line Sig_sha = crypto:rsa_sign(sha, sized_binary(Msg), PrivKey),
-
- ?line m(Sig =:= Sig_sha, true),
- ?line m(Sig_md2 =:= Sig_md5, false),
- ?line m(Sig_md2 =:= Sig_sha, false),
- ?line m(Sig_md5 =:= Sig_sha, false),
+ ?line Sig2 = crypto:rsa_sign(md5, sized_binary(Msg), PrivKey),
+ ?line m(crypto:rsa_verify(md5, sized_binary(Msg), sized_binary(Sig2),PubKey), true),
+
+ ?line m(Sig1 =:= Sig2, false),
+ ?line m(crypto:rsa_verify(md5, sized_binary(Msg), sized_binary(Sig1),PubKey), false),
+ ?line m(crypto:rsa_verify(sha, sized_binary(Msg), sized_binary(Sig1),PubKey), true),
- ?line m(crypto:rsa_verify(md2, sized_binary(Msg), sized_binary(Sig_md2),PubKey), true),
- ?line m(crypto:rsa_verify(md2, sized_binary(Msg), sized_binary(Sig_md5),PubKey), false),
- ?line m(crypto:rsa_verify(md2, sized_binary(Msg), sized_binary(Sig_sha),PubKey), false),
-
- ?line m(crypto:rsa_verify(md5, sized_binary(Msg), sized_binary(Sig_md2),PubKey), false),
- ?line m(crypto:rsa_verify(md5, sized_binary(Msg), sized_binary(Sig_md5),PubKey), true),
- ?line m(crypto:rsa_verify(md5, sized_binary(Msg), sized_binary(Sig_sha),PubKey), false),
-
- ?line m(crypto:rsa_verify(sha, sized_binary(Msg), sized_binary(Sig_md2),PubKey), false),
- ?line m(crypto:rsa_verify(sha, sized_binary(Msg), sized_binary(Sig_md5),PubKey), false),
- ?line m(crypto:rsa_verify(sha, sized_binary(Msg), sized_binary(Sig_sha),PubKey), true),
-
ok.
dsa_sign_test(doc) ->