[openssl-users] ECDSA_SIG_new and ECDSA_SIG_free details

Ken Goldman kgoldman at us.ibm.com
Tue Jan 3 19:55:35 UTC 2017


1 - Is this a bit of a bug?

ECDSA_SIG_free() frees the r and s BIGNUMs before is frees the structure 
itself.  However, ECDSA_SIG_new() doesn't set r and s to
NULL.  It calls zalloc, which sets them to 0x00 bytes.

OK, in most platforms, the NULL pointer is an all 0x00 bytes value, but 
it's not guaranteed by the C standard.

E.g., http://c-faq.com/null/confusion4.html


2 - It would be nice if the man page advised that ECDSA_SIG_free() frees 
the two r and s BIGNUMs before is frees the structure iteslf



More information about the openssl-users mailing list