|
0 |
From: Tomas Mraz <tomas@openssl.org>
|
|
1 |
Date: Thu, 5 May 2022 08:11:24 +0200
|
|
2 |
Subject: EVP_PKEY_Q_keygen: Call OPENSSL_init_crypto to init strcasecmp
|
|
3 |
|
|
4 |
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
|
|
5 |
Reviewed-by: Matt Caswell <matt@openssl.org>
|
|
6 |
(Merged from https://github.com/openssl/openssl/pull/18247)
|
|
7 |
|
|
8 |
(cherry picked from commit b807c2fbab2128cf3746bb2ebd51cbe3bb6914a9)
|
|
9 |
---
|
|
10 |
crypto/evp/evp_lib.c | 7 +++++++
|
|
11 |
1 file changed, 7 insertions(+)
|
|
12 |
|
|
13 |
diff --git a/crypto/evp/evp_lib.c b/crypto/evp/evp_lib.c
|
|
14 |
index 3fe4743761c4..d9b8c0af4124 100644
|
|
15 |
--- a/crypto/evp/evp_lib.c
|
|
16 |
+++ b/crypto/evp/evp_lib.c
|
|
17 |
@@ -24,6 +24,7 @@
|
|
18 |
#include <openssl/dh.h>
|
|
19 |
#include <openssl/ec.h>
|
|
20 |
#include "crypto/evp.h"
|
|
21 |
+#include "crypto/cryptlib.h"
|
|
22 |
#include "internal/provider.h"
|
|
23 |
#include "evp_local.h"
|
|
24 |
|
|
25 |
@@ -1094,6 +1095,8 @@ int EVP_CIPHER_CTX_test_flags(const EVP_CIPHER_CTX *ctx, int flags)
|
|
26 |
return (ctx->flags & flags);
|
|
27 |
}
|
|
28 |
|
|
29 |
+#if !defined(FIPS_MODULE)
|
|
30 |
+
|
|
31 |
int EVP_PKEY_CTX_set_group_name(EVP_PKEY_CTX *ctx, const char *name)
|
|
32 |
{
|
|
33 |
OSSL_PARAM params[] = { OSSL_PARAM_END, OSSL_PARAM_END };
|
|
34 |
@@ -1169,6 +1172,8 @@ EVP_PKEY *EVP_PKEY_Q_keygen(OSSL_LIB_CTX *libctx, const char *propq,
|
|
35 |
|
|
36 |
va_start(args, type);
|
|
37 |
|
|
38 |
+ OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL);
|
|
39 |
+
|
|
40 |
if (OPENSSL_strcasecmp(type, "RSA") == 0) {
|
|
41 |
bits = va_arg(args, size_t);
|
|
42 |
params[0] = OSSL_PARAM_construct_size_t(OSSL_PKEY_PARAM_RSA_BITS, &bits);
|
|
43 |
@@ -1189,3 +1194,5 @@ EVP_PKEY *EVP_PKEY_Q_keygen(OSSL_LIB_CTX *libctx, const char *propq,
|
|
44 |
va_end(args);
|
|
45 |
return ret;
|
|
46 |
}
|
|
47 |
+
|
|
48 |
+#endif /* !defined(FIPS_MODULE) */
|