diff options
author | Matt Caswell <matt@openssl.org> | 2019-05-29 17:31:22 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2019-06-12 09:16:43 +0100 |
commit | 636b087e3e3eb3401ac4d1a55bd2da0c15a728d5 (patch) | |
tree | afa8a4dfbebbd1d494d90e7a80397e0287e9cc90 /crypto/bn/bn_ctx.c | |
parent | 4ac6227621255ecde99aff3b11737c912f7a499b (diff) | |
download | openssl-new-636b087e3e3eb3401ac4d1a55bd2da0c15a728d5.tar.gz |
Make BIGNUM code available from within the FIPS module
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/9130)
Diffstat (limited to 'crypto/bn/bn_ctx.c')
-rw-r--r-- | crypto/bn/bn_ctx.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/crypto/bn/bn_ctx.c b/crypto/bn/bn_ctx.c index 4857661d2d..882f3bc06e 100644 --- a/crypto/bn/bn_ctx.c +++ b/crypto/bn/bn_ctx.c @@ -90,6 +90,7 @@ struct bignum_ctx { OPENSSL_CTX *libctx; }; +#ifndef FIPS_MODE /* Debugging functionality */ static void ctxdbg(BIO *channel, const char *text, BN_CTX *ctx) { @@ -118,10 +119,14 @@ static void ctxdbg(BIO *channel, const char *text, BN_CTX *ctx) BIO_printf(channel, "\n"); } -#define CTXDBG(str, ctx) \ +# define CTXDBG(str, ctx) \ OSSL_TRACE_BEGIN(BN_CTX) { \ ctxdbg(trc_out, str, ctx); \ } OSSL_TRACE_END(BN_CTX) +#else +/* TODO(3.0): Consider if we want to do this in FIPS mode */ +# define CTXDBG(str, ctx) do {} while(0) +#endif /* FIPS_MODE */ BN_CTX *BN_CTX_new_ex(OPENSSL_CTX *ctx) { @@ -238,6 +243,11 @@ BIGNUM *BN_CTX_get(BN_CTX *ctx) return ret; } +OPENSSL_CTX *bn_get_lib_ctx(BN_CTX *ctx) +{ + return ctx->libctx; +} + /************/ /* BN_STACK */ /************/ |