From 3f79ceaf76cabb14228f63813a1101b6944fbf39 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Fri, 9 Mar 2012 14:56:35 -0800 Subject: Fix test_export_invalid with certain versions of OpenSSL. Previously OpenSSL did the NULL check for us, now we do it. --- OpenSSL/crypto/crl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 @@ crypto_CRL_export(crypto_CRLObj *self, PyObject *args, PyObject *keywds) { 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) { -- cgit v1.2.1