From: Ian R. <iro...@us...> - 2006-11-11 07:38:18
|
Update of /cvsroot/perl-openssl/Crypt/OpenSSL/RSA/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25648/t Modified Files: rsa.t Log Message: verify that a sig for one plaintext won't verify against another plaintext Index: rsa.t =================================================================== RCS file: /cvsroot/perl-openssl/Crypt/OpenSSL/RSA/t/rsa.t,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** rsa.t 12 Apr 2006 06:05:06 -0000 1.7 --- rsa.t 11 Nov 2006 07:38:16 -0000 1.8 *************** *** 5,9 **** use Crypt::OpenSSL::RSA; ! BEGIN { plan tests => 31 + (UNIVERSAL::can("Crypt::OpenSSL::RSA", "use_sha512_hash") ? 3*4 : 0) } sub _Test_Encrypt_And_Decrypt --- 5,9 ---- use Crypt::OpenSSL::RSA; ! BEGIN { plan tests => 39 + (UNIVERSAL::can("Crypt::OpenSSL::RSA", "use_sha512_hash") ? 3*6 : 0) } sub _Test_Encrypt_And_Decrypt *************** *** 38,41 **** --- 38,45 ---- ok(! $rsa_pub->verify($plaintext, pack("H*", $false_sig))); ok(! $rsa->verify($plaintext, pack("H*", $false_sig))); + + my $sig_of_other = $rsa->sign("different"); + ok(!$rsa_pub->verify($plaintext, $sig_of_other)); + ok(!$rsa->verify($plaintext, $sig_of_other)); } |