Adjust coding style & fix test failures.

I am still not 100% convinced that there is no memory leak hidden
somwehere...

This also makes everything compile with OpenSSL 1.0.2 for me.
This commit is contained in:
Johanna Amann 2017-12-07 14:01:47 -08:00
parent ea4cf7dbe9
commit 6a93abea32
4 changed files with 53 additions and 44 deletions

View file

@ -240,10 +240,13 @@ void file_analysis::X509Common::ParseExtension(X509_EXTENSION* ex, EventHandlerP
BIO *bio = BIO_new(BIO_s_mem());
if( ! X509V3_EXT_print(bio, ex, 0, 0))
{
unsigned char **buf = NULL;
int len = i2d_ASN1_OCTET_STRING(X509_EXTENSION_get_data(ex), buf);
if (len >=0 )
BIO_write(bio, *buf, len);
unsigned char *buf = nullptr;
int len = i2d_ASN1_OCTET_STRING(X509_EXTENSION_get_data(ex), &buf);
if ( len >=0 )
{
BIO_write(bio, &buf, len);
OPENSSL_free(buf);
}
}
StringVal* ext_val = GetExtensionFromBIO(bio);