aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_pkey_dsa.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-04-06 06:14:05 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-04-06 06:14:05 +0000
commitd5b1fde5c783bdf3a7e316760313d08d5a0c868e (patch)
tree250444ce5cddf990808b59816d7a37621f9a864d /ext/openssl/ossl_pkey_dsa.c
parent6fc7c377bc818269926b777b5b767dd57efb0c27 (diff)
downloadruby-d5b1fde5c783bdf3a7e316760313d08d5a0c868e.tar.gz
* ext/openssl/ossl_pkey_dh.c (ossl_dh_initialize):
pop pushed error after each try of reading. fixes #4550 * ext/openssl/ossl_pkey_dsa.c (ossl_dsa_initialize): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_initialize): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_pkey_dsa.c')
-rw-r--r--ext/openssl/ossl_pkey_dsa.c9
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);