Fix test_export_invalid with certain versions of OpenSSL. Previously OpenSSL did the NULL check for us, now we do it.
diff --git a/OpenSSL/crypto/crl.c b/OpenSSL/crypto/crl.c
index 614a606..543708e 100644
--- a/OpenSSL/crypto/crl.c
+++ b/OpenSSL/crypto/crl.c
@@ -138,6 +138,16 @@
return NULL;
}
+ /* Some versions of OpenSSL check for this, but more recent versions seem
+ * not to.
+ */
+ if (!key->pkey->ameth) {
+ PyErr_SetString(
+ crypto_Error, "Cannot export with an unitialized key");
+ return NULL;
+ }
+
+
bio = BIO_new(BIO_s_mem());
tmptm = ASN1_TIME_new();
if (!tmptm) {