Commit 0f1de0ee authored by Matti Picus's avatar Matti Picus
Browse files

backport fix using wrong free in _ssl (issue 3871)

parent 7d291ea0f80a
......@@ -184,6 +184,7 @@ typedef void (*sk_GENERAL_NAME_freefunc)(GENERAL_NAME *);
typedef void (*sk_DIST_POINT_freefunc)(DIST_POINT *);
typedef void (*sk_POLICYINFO_freefunc)(POLICYINFO *);
typedef void (*sk_ACCESS_DESCRIPTION_freefunc)(ACCESS_DESCRIPTION *);
typedef ... AUTHORITY_INFO_ACCESS;
"""
......@@ -315,6 +316,7 @@ void GENERAL_NAME_free(GENERAL_NAME *);
ISSUING_DIST_POINT *ISSUING_DIST_POINT_new(void);
void ISSUING_DIST_POINT_free(ISSUING_DIST_POINT *);
void AUTHORITY_INFO_ACCESS_free(AUTHORITY_INFO_ACCESS *);
"""
CUSTOMIZATIONS = """
......
......@@ -30,7 +30,7 @@ def _get_aia_uri(certificate, nid):
if (info == ffi.NULL):
return None;
if lib.sk_ACCESS_DESCRIPTION_num(info) == 0:
lib.sk_ACCESS_DESCRIPTION_free(info)
lib.AUTHORITY_INFO_ACCESS_free(info)
return None
lst = []
......@@ -44,7 +44,7 @@ def _get_aia_uri(certificate, nid):
uri = ad.location.d.uniformResourceIdentifier
ostr = _str_with_len(uri.data, uri.length)
lst.append(ostr)
lib.sk_ACCESS_DESCRIPTION_free(info)
lib.AUTHORITY_INFO_ACCESS_free(info)
# convert to tuple or None
if len(lst) == 0: return None
......@@ -301,8 +301,7 @@ def _get_crl_dp(certificate):
ouri = _str_with_len(uri.data, uri.length)
lst.append(ouri)
if lib.OPENSSL_VERSION_NUMBER < 0x10001000:
lib.sk_DIST_POINT_free(dps);
lib.CRL_DIST_POINTS_free(dps);
if len(lst) == 0: return None
return tuple(lst)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment