diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2011-10-22 17:24:27 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2011-10-22 17:24:27 +0000 |
commit | 5fd722600b3c53f31900442b9a0f9d0ce7dfc629 (patch) | |
tree | 9cb09c51162dc8cf98c21a283a9598ea54d45607 /crypto/ecdsa/ecs_ossl.c | |
parent | 5b198d5eea726b68925d5487a9c28b66b6d6a717 (diff) | |
download | openssl-5fd722600b3c53f31900442b9a0f9d0ce7dfc629.tar.gz |
Check for selftest failure in various places.
Diffstat (limited to 'crypto/ecdsa/ecs_ossl.c')
-rw-r--r-- | crypto/ecdsa/ecs_ossl.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/crypto/ecdsa/ecs_ossl.c b/crypto/ecdsa/ecs_ossl.c index acdeea83d4..8336bceb67 100644 --- a/crypto/ecdsa/ecs_ossl.c +++ b/crypto/ecdsa/ecs_ossl.c @@ -238,6 +238,14 @@ static ECDSA_SIG *ecdsa_do_sign(const unsigned char *dgst, int dgst_len, ECDSA_DATA *ecdsa; const BIGNUM *priv_key; +#ifdef OPENSSL_FIPS + if(FIPS_selftest_failed()) + { + FIPSerr(FIPS_F_ECDSA_DO_SIGN,FIPS_R_FIPS_SELFTEST_FAILED); + return NULL; + } +#endif + ecdsa = ecdsa_check(eckey); group = EC_KEY_get0_group(eckey); priv_key = EC_KEY_get0_private_key(eckey); @@ -373,6 +381,14 @@ static int ecdsa_do_verify(const unsigned char *dgst, int dgst_len, const EC_GROUP *group; const EC_POINT *pub_key; +#ifdef OPENSSL_FIPS + if(FIPS_selftest_failed()) + { + FIPSerr(FIPS_F_ECDSA_DO_VERIFY,FIPS_R_FIPS_SELFTEST_FAILED); + return -1; + } +#endif + /* check input values */ if (eckey == NULL || (group = EC_KEY_get0_group(eckey)) == NULL || (pub_key = EC_KEY_get0_public_key(eckey)) == NULL || sig == NULL) |