diff options
Diffstat (limited to 'ext/openssl/ossl_pkey_dsa.c')
-rw-r--r-- | ext/openssl/ossl_pkey_dsa.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/openssl/ossl_pkey_dsa.c b/ext/openssl/ossl_pkey_dsa.c index 2f86d07248..976e15eeef 100644 --- a/ext/openssl/ossl_pkey_dsa.c +++ b/ext/openssl/ossl_pkey_dsa.c @@ -162,22 +162,29 @@ ossl_dsa_initialize(int argc, VALUE *argv, VALUE self) dsa = PEM_read_bio_DSAPrivateKey(in, NULL, ossl_pem_passwd_cb, passwd); if (!dsa) { (void)BIO_reset(in); + (void)ERR_get_error(); dsa = PEM_read_bio_DSAPublicKey(in, NULL, NULL, NULL); } if (!dsa) { (void)BIO_reset(in); + (void)ERR_get_error(); dsa = PEM_read_bio_DSA_PUBKEY(in, NULL, NULL, NULL); } if (!dsa) { (void)BIO_reset(in); + (void)ERR_get_error(); dsa = d2i_DSAPrivateKey_bio(in, NULL); } if (!dsa) { (void)BIO_reset(in); + (void)ERR_get_error(); dsa = d2i_DSA_PUBKEY_bio(in, NULL); } BIO_free(in); - if (!dsa) ossl_raise(eDSAError, "Neither PUB key nor PRIV key:"); + if (!dsa) { + (void)ERR_get_error(); + ossl_raise(eDSAError, "Neither PUB key nor PRIV key:"); + } } if (!EVP_PKEY_assign_DSA(pkey, dsa)) { DSA_free(dsa); |