Forum: Ruby-core [ext/openssl] Fix RSA public key encoding

Posted by uggsoutlet (uggsoutlet uggsoutlet) (Guest)
on 2012-11-22 07:32
(Received via mailing list)
Issue #4421 has been updated by uggsoutlet (uggsoutlet uggsoutlet).


=begin
would be an excellent rule. Such an attitude would emphasize  ((<uggs on 
sale|URL:http://www.gooduggboots.org/>)) sharply the value of life. 
Every day we should with gentleness, vigor, hold ((<cheap ugg 
boots|URL:http://www.gooduggboots.org/>)) the heart of thanksgiving to 
life. But when the time for endless days, months and years passed in 
((<uggs outlet|URL:http://www.gooduggboots.org/>)) front of us, we are 
often not the seed feeling. Of course, there is also " eat, drink, enjoy 
.458gyu854
=end
----------------------------------------
Bug #4421: [ext/openssl] Fix RSA public key encoding
https://bugs.ruby-lang.org/issues/4421#change-33475

Author: MartinBosslet (Martin Bosslet)
Status: Closed
Priority: Normal
Assignee: MartinBosslet (Martin Bosslet)
Category: ext
Target version: 1.9.3
ruby -v: -


=begin
 When calling RSA#to_der and RSA#to_pem on RSA public keys, they 
currently
 get encoded using i2d_RSAPublicKey and PEM_write_bio_RSAPublicKey. This 
encoding
 was specified in PKCS#1 and is specific to RSA. It is also not the 
default
 encoding used by OpenSSL itself, which rather uses the generic format 
generated
 by i2d_RSA_PUBKEY and PEM_write_bio_RSA_PUBKEY. This format is the same 
that is
 used in a certificate's SubjectPublicKeyInfo, the advantage being that 
the format
 is generic and can be used to represent public keys of all kinds, 
including RSA,
 DSA and Elliptic Curve.

 The attached patch will make use of the generic format for encoding RSA 
keys. The
 change should not cause compatibility problems, since RSA#initialize 
uses several
 fallback scenarios that cover public keys of both formats.

 The fallbacks are also re-prioritized according to these changes.

 Regards,
 Martin
=end
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.