diff options
author | Werner Koch <wk@gnupg.org> | 2009-01-22 11:51:22 +0000 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2009-01-22 11:51:22 +0000 |
commit | ff60ddae4e4002bf5bbb92ce847cd203360e87de (patch) | |
tree | 658b64d9a38721c69e74c9f8e9b1f46d8700a423 | |
parent | 8e33fe95bdf1b4ecba3456921965fa91728b7070 (diff) | |
download | libgcrypt-ff60ddae4e4002bf5bbb92ce847cd203360e87de.tar.gz |
DSA Tweak for the CAVS test script
-rw-r--r-- | THANKS | 1 | ||||
-rw-r--r-- | tests/ChangeLog | 2 | ||||
-rwxr-xr-x | tests/cavs_driver.pl | 7 | ||||
-rwxr-xr-x | tests/cavs_tests.sh | 9 |
4 files changed, 16 insertions, 3 deletions
@@ -119,6 +119,7 @@ Serge Munhoven munhoven@mema.ucl.ac.be Simon Josefsson jas@extundo.com SL Baur steve@xemacs.org Stephan Austermuehle au@hcsd.de +Stephan Müller smueller at atsec com Stephane Corthesy stephane@sente.ch Stefan Karrmann S.Karrmann@gmx.net Stefan Keller dres@cs.tu-berlin.de diff --git a/tests/ChangeLog b/tests/ChangeLog index bf9eae62..8122d236 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,5 +1,7 @@ 2009-01-22 Werner Koch <wk@g10code.com> + * cavs_tests.sh: Pass option -D to driver if required. + * fipsdrv.c (run_dsa_sign): Use hash of the data. (dsa_gen_with_seed): New. (run_dsa_pqg_gen): Add args SEED and SEEDLEN and use them. diff --git a/tests/cavs_driver.pl b/tests/cavs_driver.pl index 19a15b61..28500c2d 100755 --- a/tests/cavs_driver.pl +++ b/tests/cavs_driver.pl @@ -1,6 +1,6 @@ #!/usr/bin/env perl # -# $Id: cavs_driver.pl 1494 2009-01-21 19:30:16Z smueller $ +# $Id: cavs_driver.pl 1495 2009-01-22 10:47:13Z smueller $ # # CAVS test driver (based on the OpenSSL driver) # Written by: Stephan Müller <sm@atsec.com> @@ -1518,6 +1518,11 @@ sub dsa_pqggen_driver($$) { die "Return value does not contain all expected values of P, Q, G, Seed, c, H for dsa_pqggen" if (!defined($P) || !defined($Q) || !defined($G) || !defined($Seed) || !defined($c) || !defined($H)); + + # now change the counter to decimal as CAVS wants decimal + # counter value although all other is HEX + $c = hex($c); + $out .= "P = $P\n"; $out .= "Q = $Q\n"; $out .= "G = $G\n"; diff --git a/tests/cavs_tests.sh b/tests/cavs_tests.sh index 7351af6b..b9aa6216 100755 --- a/tests/cavs_tests.sh +++ b/tests/cavs_tests.sh @@ -46,6 +46,7 @@ function run_one_test () { local rspfile local tmprspfile local respdir + local dflag="" tmprspfile=$(echo "$reqfile" | sed 's,.req$,.rsp,') rspfile=$(echo "$tmprspfile" | sed 's,/req/,/resp/,' ) @@ -53,8 +54,12 @@ function run_one_test () { [ -f "$tmprspfile" ] && rm "$tmprspfile" [ -d "$respdir" ] || mkdir "$respdir" [ -f "$rspfile" ] && rm "$rspfile" + + if echo "$reqfile" | grep '/DSA/req/' >/dev/null 2>/dev/null; then + dflag="-D" + fi - if ./cavs_driver.pl -I libgcrypt "$reqfile"; then + if ./cavs_driver.pl -I libgcrypt $dflag "$reqfile"; then if [ -f "$tmprspfile" ]; then mv "$tmprspfile" "$rspfile" else @@ -119,7 +124,7 @@ done if [ -f "$errors_seen_file" ]; then rm "$errors_seen_file" - echo "Error enountered - not packing up response file" >&2 + echo "Error encountered - not packing up response file" >&2 exit 1 fi |