diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-29 22:49:02 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-29 22:49:02 +0000 |
| commit | 1dd5d8e4f00692b3cdc32f7781e590ac00e70f5e (patch) | |
| tree | 7462405bbfccc001c0385900a968a97c962f9230 | |
| parent | e95144436f8dccb3a30b5a1d59f8df8e52afb994 (diff) | |
merges r31242 from trunk into ruby_1_9_2.
--
* ext/openssl/ossl_pkey_rsa.c (ossl_rsa_initialize):
pop pushed error after each try of reading. fixes #4550
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@31795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | ext/openssl/ossl_pkey_rsa.c | 10 | ||||
| -rw-r--r-- | version.h | 2 |
3 files changed, 15 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Wed Apr 6 11:36:44 2011 NARUSE, Yui <naruse@ruby-lang.org> + + * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_initialize): + pop pushed error after each try of reading. fixes #4550 + Mon Apr 4 21:41:26 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com> * io.c (rb_io_syswrite): While local FS writes are usually diff --git a/ext/openssl/ossl_pkey_rsa.c b/ext/openssl/ossl_pkey_rsa.c index bfaeb43fbe..1b8a85332c 100644 --- a/ext/openssl/ossl_pkey_rsa.c +++ b/ext/openssl/ossl_pkey_rsa.c @@ -152,26 +152,34 @@ ossl_rsa_initialize(int argc, VALUE *argv, VALUE self) rsa = PEM_read_bio_RSAPrivateKey(in, NULL, ossl_pem_passwd_cb, passwd); if (!rsa) { (void)BIO_reset(in); + (void)ERR_get_error(); rsa = PEM_read_bio_RSAPublicKey(in, NULL, NULL, NULL); } if (!rsa) { (void)BIO_reset(in); + (void)ERR_get_error(); rsa = PEM_read_bio_RSA_PUBKEY(in, NULL, NULL, NULL); } if (!rsa) { (void)BIO_reset(in); + (void)ERR_get_error(); rsa = d2i_RSAPrivateKey_bio(in, NULL); } if (!rsa) { (void)BIO_reset(in); + (void)ERR_get_error(); rsa = d2i_RSAPublicKey_bio(in, NULL); } if (!rsa) { (void)BIO_reset(in); + (void)ERR_get_error(); rsa = d2i_RSA_PUBKEY_bio(in, NULL); } BIO_free(in); - if (!rsa) ossl_raise(eRSAError, "Neither PUB key nor PRIV key:"); + if (!rsa) { + (void)ERR_get_error(); + ossl_raise(eRSAError, "Neither PUB key nor PRIV key:"); + } } if (!EVP_PKEY_assign_RSA(pkey, rsa)) { RSA_free(rsa); @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 222 +#define RUBY_PATCHLEVEL 223 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 |
