ret->flags = ret->meth->flags;
+#ifndef FIPS_MODE
if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DH, ret, &ret->ex_data))
goto err;
+#endif
if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
DHerr(DH_F_DH_NEW_METHOD, ERR_R_INIT_FAIL);
ENGINE_finish(r->engine);
#endif
+#ifndef FIPS_MODE
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, r, &r->ex_data);
+#endif
CRYPTO_THREAD_lock_free(r->lock);
return ((i > 1) ? 1 : 0);
}
+#ifndef FIPS_MODE
int DH_set_ex_data(DH *d, int idx, void *arg)
{
return CRYPTO_set_ex_data(&d->ex_data, idx, arg);
{
return CRYPTO_get_ex_data(&d->ex_data, idx);
}
+#endif
int DH_bits(const DH *dh)
{
int seedlen;
BIGNUM *counter;
CRYPTO_REF_COUNT references;
+#ifndef FIPS_MODE
CRYPTO_EX_DATA ex_data;
+#endif
const DH_METHOD *meth;
ENGINE *engine;
CRYPTO_RWLOCK *lock;
#ifndef FIPS_MODE
-DSA *DSA_new(void)
-{
- return DSA_new_method(NULL);
-}
-
int DSA_set_ex_data(DSA *d, int idx, void *arg)
{
return CRYPTO_set_ex_data(&d->ex_data, idx, arg);
ret->flags = ret->meth->flags & ~DSA_FLAG_NON_FIPS_ALLOW;
+#ifndef FIPS_MODE
if (!crypto_new_ex_data_ex(libctx, CRYPTO_EX_INDEX_DSA, ret, &ret->ex_data))
goto err;
+#endif
if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
DSAerr(DSA_F_DSA_NEW_METHOD, ERR_R_INIT_FAIL);
return dsa_new_method(NULL, engine);
}
-DSA *dsa_new(OPENSSL_CTX *libctx)
+DSA *DSA_new(void)
{
- return dsa_new_method(libctx, NULL);
+ return DSA_new_method(NULL);
}
void DSA_free(DSA *r)
ENGINE_finish(r->engine);
#endif
+#ifndef FIPS_MODE
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, r, &r->ex_data);
+#endif
CRYPTO_THREAD_lock_free(r->lock);
/* Normally used to cache montgomery values */
BN_MONT_CTX *method_mont_p;
CRYPTO_REF_COUNT references;
+#ifndef FIPS_MODE
CRYPTO_EX_DATA ex_data;
+#endif
const DSA_METHOD *meth;
/* functional reference if 'meth' is ENGINE-provided */
ENGINE *engine;
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));
return 1;
}
+#ifndef FIPS_MODE
/*
* Get and set the EXDATA
*/
{
return CRYPTO_get_ex_data(&drbg->ex_data, idx);
}
-
+#endif
/*
* The following functions provide a RAND_METHOD that works on the
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 {
#endif
ret->flags = ret->meth->flags & ~RSA_FLAG_NON_FIPS_ALLOW;
+#ifndef FIPS_MODE
if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_RSA, ret, &ret->ex_data)) {
goto err;
}
+#endif
if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
RSAerr(RSA_F_RSA_NEW_METHOD, ERR_R_INIT_FAIL);
ENGINE_finish(r->engine);
#endif
+#ifndef FIPS_MODE
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_RSA, r, &r->ex_data);
+#endif
CRYPTO_THREAD_lock_free(r->lock);
return i > 1 ? 1 : 0;
}
+#ifndef FIPS_MODE
int RSA_set_ex_data(RSA *r, int idx, void *arg)
{
return CRYPTO_set_ex_data(&r->ex_data, idx, arg);
{
return CRYPTO_get_ex_data(&r->ex_data, idx);
}
+#endif
/*
* Define a scaling constant for our fixed point arithmetic.
STACK_OF(RSA_PRIME_INFO) *prime_infos;
/* If a PSS only key this contains the parameter restrictions */
RSA_PSS_PARAMS *pss;
+#ifndef FIPS_MODE
/* be careful using this if the RSA structure is shared */
CRYPTO_EX_DATA ex_data;
+#endif
CRYPTO_REF_COUNT references;
int flags;
/* Used to cache montgomery values */
#include <openssl/dsa.h>
-DSA *dsa_new(OPENSSL_CTX *libctx);
int dsa_sign_int(OPENSSL_CTX *libctx, int type, const unsigned char *dgst,
int dlen, unsigned char *sig, unsigned int *siglen, DSA *dsa);