Backport #1276 ยป ossl_x509ext.patch
ext/openssl/ossl_x509ext.c (working copy) | ||
---|---|---|
ossl_raise(eX509ExtError, "malloc error");
|
||
memcpy(s, RSTRING_PTR(data), RSTRING_LEN(data));
|
||
if(!(asn1s = ASN1_OCTET_STRING_new())){
|
||
free(s);
|
||
OPENSSL_free(s);
|
||
ossl_raise(eX509ExtError, NULL);
|
||
}
|
||
if(!M_ASN1_OCTET_STRING_set(asn1s, s, RSTRING_LEN(data))){
|
||
free(s);
|
||
OPENSSL_free(s);
|
||
ASN1_OCTET_STRING_free(asn1s);
|
||
ossl_raise(eX509ExtError, NULL);
|
||
}
|
||
free(s);
|
||
OPENSSL_free(s);
|
||
GetX509Ext(self, ext);
|
||
X509_EXTENSION_set_data(ext, asn1s);
|
||