diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-04-06 06:14:05 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-04-06 06:14:05 +0000 |
commit | d5b1fde5c783bdf3a7e316760313d08d5a0c868e (patch) | |
tree | 250444ce5cddf990808b59816d7a37621f9a864d /ext/openssl/ossl_pkey_ec.c | |
parent | 6fc7c377bc818269926b777b5b767dd57efb0c27 (diff) | |
download | ruby-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_ec.c')
-rw-r--r-- | ext/openssl/ossl_pkey_ec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/openssl/ossl_pkey_ec.c b/ext/openssl/ossl_pkey_ec.c index 8a3c278fd5..4e084b08d9 100644 --- a/ext/openssl/ossl_pkey_ec.c +++ b/ext/openssl/ossl_pkey_ec.c @@ -187,14 +187,17 @@ static VALUE ossl_ec_key_initialize(int argc, VALUE *argv, VALUE self) ec = PEM_read_bio_ECPrivateKey(in, NULL, NULL, NULL); if (!ec) { (void)BIO_reset(in); + (void)ERR_get_error(); ec = PEM_read_bio_EC_PUBKEY(in, NULL, NULL, NULL); } if (!ec) { (void)BIO_reset(in); + (void)ERR_get_error(); ec = d2i_ECPrivateKey_bio(in, NULL); } if (!ec) { (void)BIO_reset(in); + (void)ERR_get_error(); ec = d2i_EC_PUBKEY_bio(in, NULL); } @@ -204,6 +207,7 @@ static VALUE ossl_ec_key_initialize(int argc, VALUE *argv, VALUE self) const char *name = StringValueCStr(arg); int nid = OBJ_sn2nid(name); + (void)ERR_get_error(); if (nid == NID_undef) ossl_raise(eECError, "unknown curve name (%s)\n", name); |