summaryrefslogtreecommitdiffstats
path: root/crypto/ecdh
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2011-10-22 17:24:27 +0000
committerDr. Stephen Henson <steve@openssl.org>2011-10-22 17:24:27 +0000
commit5fd722600b3c53f31900442b9a0f9d0ce7dfc629 (patch)
tree9cb09c51162dc8cf98c21a283a9598ea54d45607 /crypto/ecdh
parent5b198d5eea726b68925d5487a9c28b66b6d6a717 (diff)
Check for selftest failure in various places.
Diffstat (limited to 'crypto/ecdh')
-rw-r--r--crypto/ecdh/ech_ossl.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/ecdh/ech_ossl.c b/crypto/ecdh/ech_ossl.c
index f93dfcb4f7..94a8f4b696 100644
--- a/crypto/ecdh/ech_ossl.c
+++ b/crypto/ecdh/ech_ossl.c
@@ -119,6 +119,14 @@ static int ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key,
size_t buflen, len;
unsigned char *buf=NULL;
+#ifdef OPENSSL_FIPS
+ if(FIPS_selftest_failed())
+ {
+ FIPSerr(FIPS_F_ECDH_COMPUTE_KEY,FIPS_R_FIPS_SELFTEST_FAILED);
+ return -1;
+ }
+#endif
+
if (outlen > INT_MAX)
{
ECDHerr(ECDH_F_ECDH_COMPUTE_KEY,ERR_R_MALLOC_FAILURE); /* sort of, anyway */