summaryrefslogtreecommitdiffstats
path: root/ssl/ssl_lib.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2020-05-18 23:37:18 +0100
committerMatt Caswell <matt@openssl.org>2020-06-19 10:19:31 +0100
commit9d2d857f135abd281591ee0c2b58e01a710c3cea (patch)
tree6b0bab33c78f0366d0448f633d43333fc991fb51 /ssl/ssl_lib.c
parent82ec09ec6d4e35ef359a7cb22c0cb46662f18155 (diff)
Modify libssl to discover supported groups based on available providers
Now that we have added the TLS-GROUP capability to the default provider we can use that to discover the supported group list based on the loaded providers. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11914)
Diffstat (limited to 'ssl/ssl_lib.c')
-rw-r--r--ssl/ssl_lib.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index 9fb65b6825..0473433c46 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -3171,6 +3171,9 @@ SSL_CTX *SSL_CTX_new_with_libctx(OPENSSL_CTX *libctx, const char *propq,
goto err2;
+ if (!ssl_load_groups(ret))
+ goto err2;
+
if (!SSL_CTX_set_ciphersuites(ret, OSSL_default_ciphersuites()))
goto err;
@@ -3326,6 +3329,7 @@ int SSL_CTX_up_ref(SSL_CTX *ctx)
void SSL_CTX_free(SSL_CTX *a)
{
int i;
+ size_t j;
if (a == NULL)
return;
@@ -3385,10 +3389,16 @@ void SSL_CTX_free(SSL_CTX *a)
ssl_evp_md_free(a->md5);
ssl_evp_md_free(a->sha1);
- for (i = 0; i < SSL_ENC_NUM_IDX; i++)
- ssl_evp_cipher_free(a->ssl_cipher_methods[i]);
- for (i = 0; i < SSL_MD_NUM_IDX; i++)
- ssl_evp_md_free(a->ssl_digest_methods[i]);
+ for (j = 0; j < SSL_ENC_NUM_IDX; j++)
+ ssl_evp_cipher_free(a->ssl_cipher_methods[j]);
+ for (j = 0; j < SSL_MD_NUM_IDX; j++)
+ ssl_evp_md_free(a->ssl_digest_methods[j]);
+ for (j = 0; j < a->group_list_len; j++) {
+ OPENSSL_free(a->group_list[j].tlsname);
+ OPENSSL_free(a->group_list[j].realname);
+ OPENSSL_free(a->group_list[j].algorithm);
+ }
+ OPENSSL_free(a->group_list);
OPENSSL_free(a->sigalg_lookup_cache);