diff options
author | Tomas Mraz <tomas@openssl.org> | 2021-01-21 12:37:21 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-01-26 15:26:49 +0100 |
commit | 59b64259b8392fea1c88dc992eaed9ba8b29fa80 (patch) | |
tree | caba22c06bf248482189a8eea3af6508117c95e3 /test | |
parent | adffee9753d5237951e3a7963f948e5d3fd881ef (diff) |
ssl_old_test.c: Replace use of deprecated EC functions
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13139)
Diffstat (limited to 'test')
-rw-r--r-- | test/ssl_old_test.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/test/ssl_old_test.c b/test/ssl_old_test.c index f63ec67854..69b01b7e0a 100644 --- a/test/ssl_old_test.c +++ b/test/ssl_old_test.c @@ -718,21 +718,17 @@ static void sv_usage(void) static void print_key_details(BIO *out, EVP_PKEY *key) { int keyid = EVP_PKEY_id(key); -#if 0 + #ifndef OPENSSL_NO_EC if (keyid == EVP_PKEY_EC) { - EC_KEY *ec = EVP_PKEY_get1_EC_KEY(key); - int nid; - const char *cname; - nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec)); - EC_KEY_free(ec); - cname = EC_curve_nid2nist(nid); - if (!cname) - cname = OBJ_nid2sn(nid); - BIO_printf(out, "%d bits EC (%s)", EVP_PKEY_bits(key), cname); + char group[80]; + size_t size; + + if (!EVP_PKEY_get_group_name(key, group, sizeof(group), &size)) + strcpy(group, "unknown group"); + BIO_printf(out, "%d bits EC (%s)", EVP_PKEY_bits(key), group); } else #endif -#endif { const char *algname; switch (keyid) { |