diff options
author | Natalia Kulatova <nkulatova@mozilla.com> | 2022-01-05 13:23:33 +0000 |
---|---|---|
committer | Natalia Kulatova <nkulatova@mozilla.com> | 2022-01-05 13:23:33 +0000 |
commit | c00e222c7159a73158f40a0233d669aea559d814 (patch) | |
tree | a7271aa4674b911adfc31f0b36f67928002dcafa | |
parent | fc61f6102f37bba961a86b0f34e7c78c8ef1ece0 (diff) | |
download | nss-hg-c00e222c7159a73158f40a0233d669aea559d814.tar.gz |
Bug 1748245 - Run ECDSA test vectors from bltest as part of the CI tests. r=nkulatova
Differential Revision: https://phabricator.services.mozilla.com/D134866
-rwxr-xr-x | tests/cipher/cipher.sh | 58 | ||||
-rw-r--r-- | tests/cipher/cipher.txt | 4 |
2 files changed, 42 insertions, 20 deletions
diff --git a/tests/cipher/cipher.sh b/tests/cipher/cipher.sh index 11a621815..6425ff62b 100755 --- a/tests/cipher/cipher.sh +++ b/tests/cipher/cipher.sh @@ -52,6 +52,22 @@ cipher_init() fi } +############################## cipher_ecdsa ############################# +# local shell function to test NSS ciphers +# it is a modified version of the cipher_main function +# the function does not use the -1 -2 offsets +# because ./bltest -T -m ecdsa -S -d returns the self-test of all test vectors provided +######################################################################## +cipher_ecdsa() +{ + echo "bltest -T -m $PARAM -d $CIPHERTESTDIR" + ${PROFTOOL} ${BINDIR}/bltest${PROG_SUFFIX} -T -m $PARAM -d $CIPHERTESTDIR + if [ $? -ne 0 ]; then + html_msg 1 $EXP_RET "$TESTNAME" + echo "$failedStr" + fi +} + ############################## cipher_main ############################# # local shell function to test NSS ciphers ######################################################################## @@ -64,27 +80,31 @@ cipher_main() TESTNAME=`echo $TESTNAME | sed -e "s/_/ /g"` echo "$SCRIPTNAME: $TESTNAME --------------------------------" failedStr="" - inOff=0 res=0 - while [ $inOff -lt 8 ] - do - outOff=0 - while [ $outOff -lt 8 ] - do - echo "bltest -T -m $PARAM -d $CIPHERTESTDIR -1 $inOff -2 $outOff" - ${PROFTOOL} ${BINDIR}/bltest${PROG_SUFFIX} -T -m $PARAM -d $CIPHERTESTDIR -1 $inOff -2 $outOff - if [ $? -ne 0 ]; then - failedStr="$failedStr[$inOff:$outOff]" - fi - outOff=`expr $outOff + 1` - done - inOff=`expr $inOff + 1` - done - if [ -n "$failedStr" ]; then - html_msg 1 $EXP_RET "$TESTNAME (Failed in/out offset pairs:" \ - " $failedStr)" + if [[ "$TESTNAME" == "ECDSA Sign" || "$TESTNAME" == "ECDSA Verify" ]] ; then + cipher_ecdsa else - html_msg $res $EXP_RET "$TESTNAME" + inOff=0 + while [ $inOff -lt 8 ] + do + outOff=0 + while [ $outOff -lt 8 ] + do + echo "bltest -T -m $PARAM -d $CIPHERTESTDIR -1 $inOff -2 $outOff" + ${PROFTOOL} ${BINDIR}/bltest${PROG_SUFFIX} -T -m $PARAM -d $CIPHERTESTDIR -1 $inOff -2 $outOff + if [ $? -ne 0 ]; then + failedStr="$failedStr[$inOff:$outOff]" + fi + outOff=`expr $outOff + 1` + done + inOff=`expr $inOff + 1` + done + if [ -n "$failedStr" ]; then + html_msg 1 $EXP_RET "$TESTNAME (Failed in/out offset pairs:" \ + " $failedStr)" + else + html_msg $res $EXP_RET "$TESTNAME" + fi fi fi done < ${CIPHER_TXT} diff --git a/tests/cipher/cipher.txt b/tests/cipher/cipher.txt index 4e47a9f97..483b6465e 100644 --- a/tests/cipher/cipher.txt +++ b/tests/cipher/cipher.txt @@ -48,10 +48,12 @@ 0 rsa_-K RSA_Populate 0 dsa_-S DSA_Sign 0 dsa_-V DSA_Verify + 0 ecdsa_-S ECDSA_Sign + 0 ecdsa_-V ECDSA_Verify 0 md2_-H MD2_Hash 0 md5_-H MD5_Hash 0 sha1_-H SHA1_Hash 0 sha224_-H SHA224_Hash 0 sha256_-H SHA256_Hash 0 sha384_-H SHA384_Hash - 0 sha512_-H SHA512_Hash + 0 sha512_-H SHA512_Hash
\ No newline at end of file |