Move the crypto extension module aside to make way for an incremental rewrite in Python
diff --git a/OpenSSL/crypto.py b/OpenSSL/crypto.py
new file mode 100644
index 0000000..24d4bdc
--- /dev/null
+++ b/OpenSSL/crypto.py
@@ -0,0 +1,2 @@
+from OpenSSL.xcrypto import *
+from OpenSSL.xcrypto import _exception_from_error_queue
diff --git a/OpenSSL/crypto/crypto.c b/OpenSSL/crypto/crypto.c
index ad35ce9..78f3ed7 100644
--- a/OpenSSL/crypto/crypto.c
+++ b/OpenSSL/crypto/crypto.c
@@ -816,7 +816,7 @@
#ifdef PY3
static struct PyModuleDef cryptomodule = {
PyModuleDef_HEAD_INIT,
- "crypto",
+ "xcrypto",
crypto_doc,
-1,
crypto_methods
@@ -829,7 +829,7 @@
* Arguments: None
* Returns: None
*/
-PyOpenSSL_MODINIT(crypto) {
+PyOpenSSL_MODINIT(xcrypto) {
#ifndef PY3
static void *crypto_API[crypto_API_pointers];
PyObject *c_api_object;
@@ -842,7 +842,7 @@
#ifdef PY3
module = PyModule_Create(&cryptomodule);
#else
- module = Py_InitModule3("crypto", crypto_methods, crypto_doc);
+ module = Py_InitModule3("xcrypto", crypto_methods, crypto_doc);
#endif
if (module == NULL) {
diff --git a/OpenSSL/crypto/crypto.h b/OpenSSL/crypto/crypto.h
index 4006e71..d0dba6b 100644
--- a/OpenSSL/crypto/crypto.h
+++ b/OpenSSL/crypto/crypto.h
@@ -118,7 +118,7 @@
#define import_crypto() \
{ \
- PyObject *crypto_module = PyImport_ImportModule("OpenSSL.crypto"); \
+ PyObject *crypto_module = PyImport_ImportModule("OpenSSL.xcrypto"); \
if (crypto_module != NULL) { \
PyObject *crypto_dict, *crypto_api_object; \
crypto_dict = PyModule_GetDict(crypto_module); \