diff options
author | Jean-Paul Calderone <exarkun@twistedmatrix.com> | 2012-03-09 14:56:35 -0800 |
---|---|---|
committer | Jean-Paul Calderone <exarkun@twistedmatrix.com> | 2012-03-09 14:56:35 -0800 |
commit | 3f79ceaf76cabb14228f63813a1101b6944fbf39 (patch) | |
tree | 6250aa7288ebfaa70c556003ec21587d28ebf9d6 /OpenSSL/crypto | |
parent | bc2c186728161ceff19e7fd6db1dfab907c723a4 (diff) | |
download | pyopenssl-3f79ceaf76cabb14228f63813a1101b6944fbf39.tar.gz |
Fix test_export_invalid with certain versions of OpenSSL. Previously OpenSSL did the NULL check for us, now we do it.
Diffstat (limited to 'OpenSSL/crypto')
-rw-r--r-- | OpenSSL/crypto/crl.c | 10 |
1 files changed, 10 insertions, 0 deletions
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) { |