[openssl-users] EVP_get_digestbyobj fails for ecdsa-with-SHA256
chris.bare at gmail.com
Thu Jul 7 18:08:08 UTC 2016
EVP_get_digestbyobj fails for ecdsa-with-SHA256
I'm trying to perform a standard signature verification using the EVP_*
I think my code is correct, because it all runs fine if the digest is
I have an ASN1_OBJECT that specifics the signature/disgest type.
Here is my code that dumps out all the intermediate steps called by
ASN1_OBJECT * ;
OBJ_obj2txt(name, 256, sig_alg_oid, 1);
printf ("NAME %s", name);
printf ("NID = %d", OBJ_obj2nid(sig_alg_oid));
printf ("sn = %s", OBJ_nid2sn(OBJ_obj2nid(sig_alg_oid)));
printf ("OBJ_NAME_get = %p",
const EVP_MD* md = EVP_get_digestbyobj(sig_alg_oid);
if(md == NULL)
printf ("EVP_get_digestbyobj failed");
When I call this with the RSA-SHA256 I get:
NID = 668
sn = RSA-SHA256
OBJ_NAME_get = 0x7fe8846f1ee0
and the rest of the steps succeeed.
Then when I call the same code (in the same program, so I'm sure the
openssl library is correctly initialized) with
ecdsa-with-SHA256, I get:
NID = 794
sn = ecdsa-with-SHA256
OBJ_NAME_get = (nil)
So it looks like my sig_alg_oid is good, but OBJ_NAME_get fails.
I am using openssl 1.0.2d-0ubuntu1.5 in ubuntu 15.10
Am I doing something wrong, or could this be a bug in the library?
Any suggestions appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the openssl-users