summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--OpenSSL/ssl/context.c4
-rw-r--r--OpenSSL/ssl/ssl.c4
-rw-r--r--OpenSSL/ssl/ssl.h2
3 files changed, 8 insertions, 2 deletions
diff --git a/OpenSSL/ssl/context.c b/OpenSSL/ssl/context.c
index 69bc4e5..a0b9a72 100644
--- a/OpenSSL/ssl/context.c
+++ b/OpenSSL/ssl/context.c
@@ -171,7 +171,7 @@ global_verify_callback(int ok, X509_STORE_CTX *x509_ctx)
MY_END_ALLOW_THREADS(conn->tstate);
- cert = crypto_X509_New(X509_STORE_CTX_get_current_cert(x509_ctx), 0);
+ cert = new_x509(X509_STORE_CTX_get_current_cert(x509_ctx), 0);
errnum = X509_STORE_CTX_get_error(x509_ctx);
errdepth = X509_STORE_CTX_get_error_depth(x509_ctx);
@@ -1036,7 +1036,7 @@ ssl_Context_get_cert_store(ssl_ContextObj *self, PyObject *args)
}
else
{
- return (PyObject *)crypto_X509Store_New(store, 0);
+ return (PyObject *)new_x509store(store, 0);
}
}
diff --git a/OpenSSL/ssl/ssl.c b/OpenSSL/ssl/ssl.c
index efc6310..9e7d6f1 100644
--- a/OpenSSL/ssl/ssl.c
+++ b/OpenSSL/ssl/ssl.c
@@ -81,9 +81,13 @@ PyOpenSSL_MODINIT(SSL) {
PyOpenSSL_MODRETURN(NULL);
}
+ new_x509 = (crypto_X509NameObj* (*)(X509*, int))GetProcAddress(crypto, "crypto_X509_New");
new_x509name = (crypto_X509NameObj* (*)(X509_NAME*, int))GetProcAddress(crypto, "crypto_X509Name_New");
+ new_x509store = (crypto_X509NameObj* (*)(X509_STORE*, int))GetProcAddress(crypto, "crypto_X509Store_New");
# else
+ new_x509 = crypto_X509_New;
new_x509name = crypto_X509Name_New;
+ new_x509store = crypto_X509Store_New;
# endif
#endif
diff --git a/OpenSSL/ssl/ssl.h b/OpenSSL/ssl/ssl.h
index 15ae959..933f578 100644
--- a/OpenSSL/ssl/ssl.h
+++ b/OpenSSL/ssl/ssl.h
@@ -46,7 +46,9 @@ extern int _pyOpenSSL_tstate_key;
extern ssl_Context_New_RETURN ssl_Context_New ssl_Context_New_PROTO;
extern ssl_Connection_New_RETURN ssl_Connection_New ssl_Connection_New_PROTO;
+crypto_X509Obj* (*new_x509)(X509*, int);
crypto_X509NameObj* (*new_x509name)(X509_NAME*, int);
+crypto_X509StoreObj* (*new_x509store)(X509_STORE*, int);
#else /* SSL_MODULE */