summaryrefslogtreecommitdiffstats
path: root/crypto/rand
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-01-14 02:32:42 +0100
committerRichard Levitte <levitte@openssl.org>2020-01-15 23:45:41 +0100
commita3327784d9526fd69649089ea5c78a55906e9b2c (patch)
tree8ca8921d5d7a6e3d9445f122e5fb026282f9d007 /crypto/rand
parent62c3fed0cd52316259e4e2c0e5878bcfa69b38f9 (diff)
CRYPTO: Remove support for ex_data fields when building the FIPS module
These fields are purely application data, and applications don't reach into the bowels of the FIPS module, so these fields are never used there. Fixes #10835 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/10837)
Diffstat (limited to 'crypto/rand')
-rw-r--r--crypto/rand/drbg_lib.c5
-rw-r--r--crypto/rand/rand_local.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/crypto/rand/drbg_lib.c b/crypto/rand/drbg_lib.c
index 52e6743230..2c9ed3fb6d 100644
--- a/crypto/rand/drbg_lib.c
+++ b/crypto/rand/drbg_lib.c
@@ -503,7 +503,9 @@ void RAND_DRBG_free(RAND_DRBG *drbg)
drbg->meth->uninstantiate(drbg);
rand_pool_free(drbg->adin_pool);
CRYPTO_THREAD_lock_free(drbg->lock);
+#ifndef FIPS_MODE
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_RAND_DRBG, drbg, &drbg->ex_data);
+#endif
if (drbg->secure)
OPENSSL_secure_clear_free(drbg, sizeof(*drbg));
@@ -1098,6 +1100,7 @@ int rand_drbg_enable_locking(RAND_DRBG *drbg)
return 1;
}
+#ifndef FIPS_MODE
/*
* Get and set the EXDATA
*/
@@ -1110,7 +1113,7 @@ void *RAND_DRBG_get_ex_data(const RAND_DRBG *drbg, int idx)
{
return CRYPTO_get_ex_data(&drbg->ex_data, idx);
}
-
+#endif
/*
* The following functions provide a RAND_METHOD that works on the
diff --git a/crypto/rand/rand_local.h b/crypto/rand/rand_local.h
index 7817df80d0..310f03fc17 100644
--- a/crypto/rand/rand_local.h
+++ b/crypto/rand/rand_local.h
@@ -308,8 +308,10 @@ struct rand_drbg_st {
size_t seedlen;
DRBG_STATUS state;
+#ifndef FIPS_MODE
/* Application data, mainly used in the KATs. */
CRYPTO_EX_DATA ex_data;
+#endif
/* Implementation specific data */
union {