aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2022-12-17 19:06:09 +0200
committerMatti Picus <matti.picus@gmail.com>2022-12-17 19:06:09 +0200
commitdf222322f17445a1f070758ebca45a4b76d71309 (patch)
treeadda416027c4a4a1d2972e3e79cf58d2decd85a4
parentmerge gc-hooks2 which adds pinned_objects count to on_gc_collet hook report (diff)
downloadpypy-df222322f17445a1f070758ebca45a4b76d71309.tar.gz
pypy-df222322f17445a1f070758ebca45a4b76d71309.tar.bz2
pypy-df222322f17445a1f070758ebca45a4b76d71309.zip
backport fix using wrong free in _ssl (issue 3871)
-rw-r--r--lib_pypy/_cffi_ssl/_cffi_src/openssl/x509v3.py2
-rw-r--r--lib_pypy/_cffi_ssl/_stdssl/certificate.py7
2 files changed, 5 insertions, 4 deletions
diff --git a/lib_pypy/_cffi_ssl/_cffi_src/openssl/x509v3.py b/lib_pypy/_cffi_ssl/_cffi_src/openssl/x509v3.py
index 6cae4f1443..39dc1b6e36 100644
--- a/lib_pypy/_cffi_ssl/_cffi_src/openssl/x509v3.py
+++ b/lib_pypy/_cffi_ssl/_cffi_src/openssl/x509v3.py
@@ -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 = """
diff --git a/lib_pypy/_cffi_ssl/_stdssl/certificate.py b/lib_pypy/_cffi_ssl/_stdssl/certificate.py
index 993b723a58..6d4323ff79 100644
--- a/lib_pypy/_cffi_ssl/_stdssl/certificate.py
+++ b/lib_pypy/_cffi_ssl/_stdssl/certificate.py
@@ -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)