From 456d883a2596cb5792a8c18588fa2a906f726c5a Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Wed, 21 Sep 2011 18:42:12 +0000 Subject: [PATCH] Don't print out errors in cases where errors are expected: testing DSA parameter validity and EC public key validity. --- fips/dsa/fips_dssvs.c | 2 ++ fips/ecdsa/fips_ecdsavs.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/fips/dsa/fips_dssvs.c b/fips/dsa/fips_dssvs.c index b8c6bd15bd..d355fcb6ff 100644 --- a/fips/dsa/fips_dssvs.c +++ b/fips/dsa/fips_dssvs.c @@ -314,6 +314,7 @@ static void pqgver(FILE *in, FILE *out) dsa->p = BN_dup(p); dsa->q = BN_dup(q); } + no_err = 1; if (!dsa2 && !dsa_builtin_paramgen(dsa, L, N, md, seed, seedlen, NULL, &counter2, &h2, NULL)) @@ -328,6 +329,7 @@ static void pqgver(FILE *in, FILE *out) fprintf(stderr, "Parameter Generation error\n"); exit(1); } + no_err = 0; if (idx >= 0) { if (BN_cmp(dsa->g, g)) diff --git a/fips/ecdsa/fips_ecdsavs.c b/fips/ecdsa/fips_ecdsavs.c index 1245f854e7..4cf536cee8 100644 --- a/fips/ecdsa/fips_ecdsavs.c +++ b/fips/ecdsa/fips_ecdsavs.c @@ -284,7 +284,9 @@ static int PKV(FILE *in, FILE *out) return 0; } key = EC_KEY_new_by_curve_name(curve_nid); + no_err = 1; rv = EC_KEY_set_public_key_affine_coordinates(key, Qx, Qy); + no_err = 0; fprintf(out, "Result = %s\n", rv ? "P":"F"); } -- 2.25.1