diff options
author | Henrik Nord <[email protected]> | 2011-09-20 11:19:21 +0200 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2011-09-20 11:19:21 +0200 |
commit | ec36499d7e329b4dc69a1a3be3422eac7907c260 (patch) | |
tree | 3fae5bd47f85aa8a3ac40519b2328c4451a00c18 /lib/crypto/test | |
parent | 532c72b3ffeb9219bdb7e6a7f5d21fe26f0f0629 (diff) | |
parent | 53cf0b70c705e0bf6c09f83f2ce2709d79593ce6 (diff) | |
download | otp-ec36499d7e329b4dc69a1a3be3422eac7907c260.tar.gz otp-ec36499d7e329b4dc69a1a3be3422eac7907c260.tar.bz2 otp-ec36499d7e329b4dc69a1a3be3422eac7907c260.zip |
Merge branch 'dev' into major
Conflicts:
erts/aclocal.m4
erts/include/internal/ethread_header_config.h.in
Diffstat (limited to 'lib/crypto/test')
-rw-r--r-- | lib/crypto/test/crypto_SUITE.erl | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl index 8d2f42469b..2fa058c852 100644 --- a/lib/crypto/test/crypto_SUITE.erl +++ b/lib/crypto/test/crypto_SUITE.erl @@ -1082,16 +1082,30 @@ 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 Sig1 = crypto:rsa_sign(sized_binary(Msg), PrivKey), - ?line m(crypto:rsa_verify(sized_binary(Msg), sized_binary(Sig1),PubKey), true), + ?line Sig = crypto:rsa_sign(sized_binary(Msg), PrivKey), + ?line m(crypto:rsa_verify(sized_binary(Msg), sized_binary(Sig),PubKey), true), - ?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 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 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) -> |