-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
97 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,21 @@ | ||
--- ./openssl.c 2021-12-09 10:02:45.000000000 -0500 | ||
+++ ./openssl.c 2021-12-09 10:23:48.000000000 -0500 | ||
@@ -1484,8 +1484,11 @@ | ||
{ | ||
int ret = 0; | ||
char* key_file_path; | ||
+#ifndef USE_EVP_PKEY_EC | ||
BIGNUM *exp; | ||
RSA *rsa; | ||
+#else /* #ifndef USE_EVP_PKEY_EC */ | ||
+#endif | ||
EVP_PKEY *key; | ||
|
||
key_file_path = make_certs_path(csp->config->certificate_directory, | ||
@@ -1504,6 +1507,7 @@ | ||
return 0; | ||
} | ||
|
||
+#ifndef USE_EVP_PKEY_EC | ||
exp = BN_new(); | ||
rsa = RSA_new(); | ||
key = EVP_PKEY_new(); | ||
@@ -1536,7 +1540,18 @@ | ||
ret = -1; | ||
--- ./openssl.c 2025-01-25 05:54:54 | ||
+++ ./openssl.c 2025-01-25 10:15:55 | ||
@@ -1537,10 +1537,18 @@ | ||
goto exit; | ||
} | ||
- | ||
#else | ||
+#ifndef USE_EVP_PKEY_EC | ||
key = EVP_RSA_gen(RSA_KEYSIZE); | ||
+#else /* #ifndef USE_EVP_PKEY_EC */ | ||
+ /* | ||
+ * https://www.openssl.org/docs/manmaster/man7/EVP_PKEY-EC.html | ||
+ */ | ||
+ key = EVP_EC_gen(EC_GROUP_NAME); | ||
+ if (key == NULL) | ||
+ { | ||
+ log_ssl_errors(LOG_LEVEL_ERROR, "EC key generation error"); | ||
+ ret = -1; | ||
+ goto exit; | ||
+ } | ||
+#endif | ||
/* | ||
* Exporting private key into file | ||
*/ | ||
@@ -1552,6 +1567,7 @@ | ||
/* | ||
* Freeing used variables | ||
*/ | ||
+#ifndef USE_EVP_PKEY_EC | ||
if (exp) | ||
+#endif /* #ifndef USE_EVP_PKEY_EC */ | ||
if (key == NULL) | ||
{ | ||
BN_free(exp); | ||
@@ -1560,6 +1576,8 @@ | ||
{ | ||
RSA_free(rsa); | ||
} | ||
+#ifndef USE_EVP_PKEY_EC | ||
log_error(LOG_LEVEL_ERROR, "EVP_RSA_gen() failed"); | ||
+#else /* #ifndef USE_EVP_PKEY_EC */ | ||
+#endif | ||
if (key) | ||
{ | ||
EVP_PKEY_free(key); | ||
+ log_error(LOG_LEVEL_ERROR, "EVP_EC_gen() failed"); | ||
+#endif /* #ifndef USE_EVP_PKEY_EC */ | ||
ret = -1; | ||
goto exit; | ||
} |