{
size_t i;
EC_GROUP *ret = NULL;
if (nid <= 0)
return NULL;
for (i=0; i<curve_list_length; i++)
if (curve_list[i].nid == nid)
{
ret = ec_group_new_from_data(curve_list[i].data);
break;
}
if (ret == NULL)
{
ECerr(EC_F_EC_GROUP_NEW_BY_CURVE_NAME, EC_R_UNKNOWN_GROUP);
return NULL;
}
EC_GROUP_set_curve_name(ret, nid);
return ret;
}
"
Your curve must be in the curve list, but the NID_ecdsa_with_SHA256 is not. You must use one of curves listed in the array curve_list in the file crypto/ec/ec_curve.c.
For example: NID_secp112r1
Att,
printf("Got here 1!\r\n");
EC_KEY *eckey; = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); // or NID_secp256k1
printf("Got here 2!\r\n");
if(eckey == NULL)
{
printf("ERROR: NULL EC_KEY!\r\n");
return 0;
}
I know it's very likely to be user's error again (sorry I'm new at openssl). But do you guys know the cause of this seg fault? Thank you very much.
________________________________________
From: owner-ope...@openssl.org [owner-ope...@openssl.org] on behalf of Matt Caswell (fr...@baggins.org) [fr...@baggins.org]
Sent: Tuesday, May 22, 2012 11:08 AM
To: openss...@openssl.org
Subject: Re: EC_KEY_new_by_curve_name returns NULL