diff options
author | Simon Josefsson <simon@josefsson.org> | 2006-09-12 13:07:14 +0000 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2006-09-12 13:07:14 +0000 |
commit | 3e95186ecd304008941418a0bfd444baca28a7ae (patch) | |
tree | eed51af555c41a787f89db2d4022e79510a10a9d | |
parent | 9e389dbd38d65243b5b2e1170074efcbb3bde5a1 (diff) | |
download | gnutls-3e95186ecd304008941418a0bfd444baca28a7ae.tar.gz |
Add more tests.
-rwxr-xr-x | tests/pkcs1-pad | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/tests/pkcs1-pad b/tests/pkcs1-pad index 59061a3db6..e051489e5e 100755 --- a/tests/pkcs1-pad +++ b/tests/pkcs1-pad @@ -22,6 +22,10 @@ srcdir=${srcdir:-.} CERTTOOL=../src/certtool +EXPECT1=2101 +EXPECT2=1001 + +# Test 1, PKCS#1 pad digestAlgorithm.parameters $CERTTOOL --verify-chain --infile $srcdir/pkcs1-pad-ok.pem | tee out1 $CERTTOOL --verify-chain --infile $srcdir/pkcs1-pad-broken.pem | tee out2 @@ -35,10 +39,30 @@ rm -f out1 out2 echo out1 oks $out1oks fails $out1fails out2 oks $out2oks fails $out2fails -if test "$out1oks$out2oks$out1fails$out2fails" != "2101"; then - echo expected 2-1-0-1 +if test "$out1oks$out2oks$out1fails$out2fails" != "$EXPECT1"; then + echo expected $EXPECT1 + echo "PKCS1-PAD FAIL" +# exit 1 +fi + +# Test 2, Bleichenbacher's Crypto 06 rump session + +$CERTTOOL --verify-chain --infile $srcdir/pkcs1-pad-ok2.pem | tee out1 +$CERTTOOL --verify-chain --infile $srcdir/pkcs1-pad-broken2.pem | tee out2 + +out1oks=`grep 'Verification output: Verified.' out1 | wc -l` +out2oks=`grep 'Verification output: Verified.' out2 | wc -l` +out1fails=`grep 'Verification output: Not verified.' out1 | wc -l` +out2fails=`grep 'Verification output: Not verified.' out2 | wc -l` + +rm -f out1 out2 + +echo out1 oks $out1oks fails $out1fails out2 oks $out2oks fails $out2fails + +if test "$out1oks$out2oks$out1fails$out2fails" != "$EXPECT2"; then + echo expected $EXPECT2 echo "PKCS1-PAD FAIL" - exit 1 +# exit 1 fi echo "PKCS1-PAD OK" |