diff options
author | emboss <emboss@ruby-lang.org> | 2013-07-05 21:08:04 +0000 |
---|---|---|
committer | emboss <emboss@ruby-lang.org> | 2013-07-05 21:08:04 +0000 |
commit | e741d420c2aef600c28ee995e7c8ba75ca511f9d (patch) | |
tree | 17adca837e3cdabee7eae74df5275349da2baf54 /lib | |
parent | 1361d122740eb12aa00d14f094da75286b505411 (diff) | |
download | ruby-openssl-history-e741d420c2aef600c28ee995e7c8ba75ca511f9d.tar.gz |
* lib/openssl/ssl.rb: Fix SSL client connection crash for SAN marked
critical.
The patch for CVE-2013-4073 caused SSL crash when a SSL server returns
the certificate that has critical SAN value. X509 extension could
include 2 or 3 elements in it:
[id, criticality, octet_string] if critical,
[id, octet_string] if not.
Making sure to pick the last element of X509 extension and use it as
SAN value.
[ruby-core:55685] [Bug #8575]
Thank you @nahi for providing the patch!
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/openssl/ssl.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/openssl/ssl.rb b/lib/openssl/ssl.rb index 04eb592..741274a 100644 --- a/lib/openssl/ssl.rb +++ b/lib/openssl/ssl.rb @@ -98,7 +98,7 @@ module OpenSSL should_verify_common_name = true cert.extensions.each{|ext| next if ext.oid != "subjectAltName" - id, ostr = OpenSSL::ASN1.decode(ext.to_der).value + ostr = OpenSSL::ASN1.decode(ext.to_der).value.last sequence = OpenSSL::ASN1.decode(ostr.value) sequence.value.each{|san| case san.tag |