Author: Richard Plangger <[email protected]>
Branch: py3.5-ssl
Changeset: r88429:d4d6dd1d67d1
Date: 2016-11-17 13:45 +0100
http://bitbucket.org/pypy/pypy/changeset/d4d6dd1d67d1/
Log: some simplifications, removed comments
diff --git a/lib_pypy/openssl/_cffi_src/openssl/ssl.py
b/lib_pypy/openssl/_cffi_src/openssl/ssl.py
--- a/lib_pypy/openssl/_cffi_src/openssl/ssl.py
+++ b/lib_pypy/openssl/_cffi_src/openssl/ssl.py
@@ -248,8 +248,6 @@
Cryptography_STACK_OF_X509_NAME *SSL_load_client_CA_file(const char *);
const char *SSL_get_servername(const SSL *, const int);
-//long SSL_CTX_callback_ctrl(SSL_CTX *, int, void (*)(void));
-//long SSL_CTX_ctrl(SSL_CTX *, int, long, void *);
"""
MACROS = """
diff --git a/lib_pypy/openssl/_cffi_src/openssl/x509v3.py
b/lib_pypy/openssl/_cffi_src/openssl/x509v3.py
--- a/lib_pypy/openssl/_cffi_src/openssl/x509v3.py
+++ b/lib_pypy/openssl/_cffi_src/openssl/x509v3.py
@@ -183,12 +183,9 @@
GENERAL_NAMES *GENERAL_NAMES_new(void);
void GENERAL_NAMES_free(GENERAL_NAMES *);
void *X509V3_EXT_d2i(X509_EXTENSION *);
-/* X509_get_ext_d2i is already defined, there might be a better solution
- to expose it to the lib object? */
-void * _X509_get_ext_d2i(X509 *, int, int *, int *);
/* X509 is private, there is no way to access the field crldp other than
adding it to the typedef or expose a function like this: */
-Cryptography_STACK_OF_DIST_POINT * _X509_get_crldp(const X509 *);
+Cryptography_STACK_OF_DIST_POINT * Cryptography_X509_get_crldp(const X509 *);
int X509_check_ca(X509 *);
"""
@@ -302,15 +299,17 @@
DIST_POINT_NAME *DIST_POINT_NAME_new(void);
void DIST_POINT_NAME_free(DIST_POINT_NAME *);
+void * X509_get_ext_d2i(const X509 *, int, int *, int *);
"""
CUSTOMIZATIONS = """
-void * _X509_get_ext_d2i(X509 * x, int nid, int * a, int * b) {
- return X509_get_ext_d2i(x, nid, a, b);
+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
+Cryptography_STACK_OF_DIST_POINT * Cryptography_X509_get_crldp(const X509 * x)
{
+ return x->crldp;
}
-#if OPENSSL_VERSION_NUMBER >= 0x10001000L
-Cryptography_STACK_OF_DIST_POINT * _X509_get_crldp(const X509 * x) {
- return x->crldp;
+#else
+Cryptography_STACK_OF_DIST_POINT * Cryptography_X509_get_crldp(const X509 * x)
{
+ return NULL;
}
#endif
"""
diff --git a/lib_pypy/openssl/_stdssl/certificate.py
b/lib_pypy/openssl/_stdssl/certificate.py
--- a/lib_pypy/openssl/_stdssl/certificate.py
+++ b/lib_pypy/openssl/_stdssl/certificate.py
@@ -26,7 +26,7 @@
return (name, value)
def _get_aia_uri(certificate, nid):
- info = lib._X509_get_ext_d2i(certificate, lib.NID_info_access, ffi.NULL,
ffi.NULL)
+ info = lib.X509_get_ext_d2i(certificate, lib.NID_info_access, ffi.NULL,
ffi.NULL)
if (info == ffi.NULL):
return None;
if lib.sk_ACCESS_DESCRIPTION_num(info) == 0:
@@ -244,16 +244,12 @@
def _get_crl_dp(certificate):
-# STACK_OF(DIST_POINT) *dps;
-# int i, j;
-# PyObject *lst, *res = NULL;
-#
if lib.OPENSSL_VERSION_NUMBER < 0x10001000:
dps = lib.X509_get_ext_d2i(certificate,
lib.NID_crl_distribution_points, ffi.NULL, ffi.NULL)
else:
# Calls x509v3_cache_extensions and sets up crldp
lib.X509_check_ca(certificate)
- dps = lib._X509_get_crldp(certificate)
+ dps = lib.Cryptography_X509_get_crldp(certificate)
if dps is ffi.NULL:
return None
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit