From f4e43726a8e25e15a6caa6129954988c81bc8c2e Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Fri, 31 Mar 2006 22:44:20 +0000 Subject: [PATCH] Check flag before calling FIPS_dsa_check(). --- crypto/dsa/dsa_sign.c | 8 ++++---- crypto/dsa/dsa_vrf.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crypto/dsa/dsa_sign.c b/crypto/dsa/dsa_sign.c index 46601102b5..37c65efb20 100644 --- a/crypto/dsa/dsa_sign.c +++ b/crypto/dsa/dsa_sign.c @@ -72,8 +72,8 @@ DSA_SIG * DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) { #ifdef OPENSSL_FIPS - if(FIPS_mode() && !FIPS_dsa_check(dsa) - && !(dsa->flags & DSA_FLAG_FIPS_EXTERNAL_METHOD_ALLOW)) + if(FIPS_mode() && !(dsa->flags & DSA_FLAG_FIPS_EXTERNAL_METHOD_ALLOW) + && !FIPS_dsa_check(dsa)) return NULL; #endif return dsa->meth->dsa_do_sign(dgst, dlen, dsa); @@ -97,8 +97,8 @@ int DSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig, int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) { #ifdef OPENSSL_FIPS - if(FIPS_mode() && !FIPS_dsa_check(dsa) - && !(dsa->flags & DSA_FLAG_FIPS_EXTERNAL_METHOD_ALLOW)) + if(FIPS_mode() && !(dsa->flags & DSA_FLAG_FIPS_EXTERNAL_METHOD_ALLOW) + && !FIPS_dsa_check(dsa)) return 0; #endif return dsa->meth->dsa_sign_setup(dsa, ctx_in, kinvp, rp); diff --git a/crypto/dsa/dsa_vrf.c b/crypto/dsa/dsa_vrf.c index 608431ca56..c9784bed48 100644 --- a/crypto/dsa/dsa_vrf.c +++ b/crypto/dsa/dsa_vrf.c @@ -74,8 +74,8 @@ int DSA_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig, DSA *dsa) { #ifdef OPENSSL_FIPS - if(FIPS_mode() && !FIPS_dsa_check(dsa) - && !(dsa->flags & DSA_FLAG_FIPS_EXTERNAL_METHOD_ALLOW)) + if(FIPS_mode() && !(dsa->flags & DSA_FLAG_FIPS_EXTERNAL_METHOD_ALLOW) + && !FIPS_dsa_check(dsa)) return -1; #endif return dsa->meth->dsa_do_verify(dgst, dgst_len, sig, dsa); -- 2.40.0