mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 03:28:19 +00:00
Fix recently introduced double free in OpenSSL code.
This commit is contained in:
parent
6a93abea32
commit
03f98c7022
1 changed files with 6 additions and 0 deletions
|
@ -153,7 +153,13 @@ RecordVal* file_analysis::X509::ParseCertificate(X509Val* cert_val, const char*
|
|||
// key later. Otherwise it will just fail to parse the certificate key.
|
||||
|
||||
if ( OBJ_obj2nid(algorithm) == NID_md5WithRSAEncryption )
|
||||
{
|
||||
ASN1_OBJECT *copy = OBJ_dup(algorithm); // the next line will destroy the original algorithm.
|
||||
X509_PUBKEY_set0_param(X509_get_X509_PUBKEY(ssl_cert), OBJ_nid2obj(NID_rsaEncryption), 0, NULL, NULL, 0);
|
||||
algorithm = copy;
|
||||
// we do not have to worry about freeing algorithm in that case - since it will be re-assigned using
|
||||
// set0_param and the cert will take ownership.
|
||||
}
|
||||
else
|
||||
algorithm = 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue