ruby-changes:19481
From: emboss <ko1@a...>
Date: Thu, 12 May 2011 06:52:16 +0900 (JST)
Subject: [ruby-changes:19481] Ruby:r31520 (trunk): Thu May 12 07:27:31 2011 Martin Bosslet <Martin.Bosslet@g...>
emboss 2011-05-12 06:51:52 +0900 (Thu, 12 May 2011) New Revision: 31520 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31520 Log: Thu May 12 07:27:31 2011 Martin Bosslet <Martin.Bosslet@g...> * ext/openssl/ossl_pkey_rsa.c: Use generic X.509 SubjectPublicKeyInfo format for encoding RSA public keys. [ruby-core:35327] [Bug #4421] Previous revision: 31507 M ChangeLog M ext/openssl/ossl_pkey_rsa.c Modified files: trunk/ChangeLog trunk/ext/openssl/ossl_pkey_rsa.c Index: ChangeLog =================================================================== --- ChangeLog (revision 31519) +++ ChangeLog (revision 31520) @@ -1,3 +1,9 @@ +Thu May 12 07:27:31 2011 Martin Bosslet <Martin.Bosslet@g...> + + * ext/openssl/ossl_pkey_rsa.c: Use generic X.509 SubjectPublicKeyInfo + format for encoding RSA public keys. + [ruby-core:35327] [Bug #4421] + Wed May 11 19:45:27 2011 Keiju Ishitsuka <keiju@i...> * lib/forwardable.rb: support 'delegate :foo => :bar' for to meet Index: ext/openssl/ossl_pkey_rsa.c =================================================================== --- ext/openssl/ossl_pkey_rsa.c (revision 31519) +++ ext/openssl/ossl_pkey_rsa.c (revision 31520) @@ -159,27 +159,27 @@ if (!rsa) { (void)BIO_reset(in); (void)ERR_get_error(); - rsa = PEM_read_bio_RSAPublicKey(in, NULL, NULL, NULL); + rsa = PEM_read_bio_RSA_PUBKEY(in, NULL, NULL, NULL); } if (!rsa) { (void)BIO_reset(in); (void)ERR_get_error(); - rsa = PEM_read_bio_RSA_PUBKEY(in, NULL, NULL, NULL); + rsa = d2i_RSAPrivateKey_bio(in, NULL); } if (!rsa) { (void)BIO_reset(in); (void)ERR_get_error(); - rsa = d2i_RSAPrivateKey_bio(in, NULL); + rsa = d2i_RSA_PUBKEY_bio(in, NULL); } if (!rsa) { (void)BIO_reset(in); (void)ERR_get_error(); - rsa = d2i_RSAPublicKey_bio(in, NULL); + rsa = PEM_read_bio_RSAPublicKey(in, NULL, NULL, NULL); } if (!rsa) { (void)BIO_reset(in); (void)ERR_get_error(); - rsa = d2i_RSA_PUBKEY_bio(in, NULL); + rsa = d2i_RSAPublicKey_bio(in, NULL); } BIO_free(in); if (!rsa) { @@ -268,7 +268,7 @@ ossl_raise(eRSAError, NULL); } } else { - if (!PEM_write_bio_RSAPublicKey(out, pkey->pkey.rsa)) { + if (!PEM_write_bio_RSA_PUBKEY(out, pkey->pkey.rsa)) { BIO_free(out); ossl_raise(eRSAError, NULL); } @@ -297,7 +297,7 @@ if(RSA_HAS_PRIVATE(pkey->pkey.rsa)) i2d_func = i2d_RSAPrivateKey; else - i2d_func = i2d_RSAPublicKey; + i2d_func = (int (*)(const RSA*, unsigned char**))i2d_RSA_PUBKEY; if((len = i2d_func(pkey->pkey.rsa, NULL)) <= 0) ossl_raise(eRSAError, NULL); str = rb_str_new(0, len); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/