aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/dh/dh_key.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2011-04-22 11:12:56 +0000
committerDr. Stephen Henson <steve@openssl.org>2011-04-22 11:12:56 +0000
commit74fac927b0b7d89aa6cdb88b12669e1cd8f4e841 (patch)
tree1d355c3255bd229e2312dddf326a54ad6033b66c /crypto/dh/dh_key.c
parentda9ead8db245e70b153faaa10f8fce3b704aa105 (diff)
downloadopenssl-74fac927b0b7d89aa6cdb88b12669e1cd8f4e841.tar.gz
Return errors instead of aborting when selftest fails.
Diffstat (limited to 'crypto/dh/dh_key.c')
-rw-r--r--crypto/dh/dh_key.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/dh/dh_key.c b/crypto/dh/dh_key.c
index 50e8011c83..6c0c745c8d 100644
--- a/crypto/dh/dh_key.c
+++ b/crypto/dh/dh_key.c
@@ -301,7 +301,11 @@ static int dh_bn_mod_exp(const DH *dh, BIGNUM *r,
static int dh_init(DH *dh)
{
#ifdef OPENSSL_FIPS
- FIPS_selftest_check();
+ if(FIPS_selftest_failed())
+ {
+ FIPSerr(FIPS_F_DH_INIT,FIPS_R_FIPS_SELFTEST_FAILED);
+ return 0;
+ }
#endif
dh->flags |= DH_FLAG_CACHE_MONT_P;
return(1);