Blame SOURCES/m2crypto-0.21.1-SSL_CTX_new.patch

cf4299
diff -ur M2Crypto/SWIG/_ssl.i M2Crypto-0.21.1/SWIG/_ssl.i
cf4299
--- M2Crypto/SWIG/_ssl.i	2013-12-07 05:11:09.638393899 +0100
cf4299
+++ M2Crypto-0.21.1/SWIG/_ssl.i	2013-12-07 05:54:06.791902199 +0100
cf4299
@@ -60,8 +60,18 @@
cf4299
 %rename(tlsv1_method) TLSv1_method;
cf4299
 extern SSL_METHOD *TLSv1_method(void);
cf4299
 
cf4299
+%typemap(out) SSL_CTX * {
cf4299
+    if ($1 != NULL)
cf4299
+        $result = SWIG_NewPointerObj($1, $1_descriptor, 0);
cf4299
+    else {
cf4299
+        PyErr_SetString(_ssl_err, ERR_reason_error_string(ERR_get_error()));
cf4299
+        $result = NULL;
cf4299
+    }
cf4299
+}
cf4299
 %rename(ssl_ctx_new) SSL_CTX_new;
cf4299
 extern SSL_CTX *SSL_CTX_new(SSL_METHOD *);
cf4299
+%typemap(out) SSL_CTX *;
cf4299
+
cf4299
 %rename(ssl_ctx_free) SSL_CTX_free;
cf4299
 extern void SSL_CTX_free(SSL_CTX *);
cf4299
 %rename(ssl_ctx_set_verify_depth) SSL_CTX_set_verify_depth;