Follow-up Comment #2, bug #91483 (project xrootd):
I changed that constructor it to either call PEM_write_bio_PUBKEY or
PEM_write_bio_PrivateKey, but PEM_write_bio_PrivateKey also fills in the
public key (i.e. fEVP->pkey.rsa->n and fEVP->pkey.rsa->e) so I believe it is
effectively the same.
The problem will calling both PEM_write_bio_PUBKEY and then
PEM_write_bio_PrivateKey (the latter with the same EVP_PKEY pointer as
created by the first) is that openssl (at least 0.9.8e) is that I saw it
leaks memory in that situation. Some elements of the EVP_PKEY are recomputed
and reset without freeing up the previous value.
Apparently man pem(3) mentions the issue in broad terms in the BUGS section,
although not specifically for that function:
[...] The PEM read routines in some versions of OpenSSL will not correctly
reuse an existing structure. [...]
_______________________________________________________
Reply to this item at:
<http://savannah.cern.ch/bugs/?91483>
_______________________________________________
Message sent via/by LCG Savannah
http://savannah.cern.ch/
########################################################################
Use REPLY-ALL to reply to list
To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1
|