Blame SOURCES/m2crypto-0.21.1-SSL_CTX_new.patch

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