ssl_old_test.c: Replace use of deprecated EC functions
@@ -718,20 +718,16 @@ 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;
