path: root/ext
diff options
authoremboss <emboss@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-05 21:08:04 +0000
committeremboss <emboss@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-05 21:08:04 +0000
commita3a62f87e144be31b9ca8ad6415b207f43f4e126 (patch)
tree42efede0fb5c81922f67ff7075a30e261fbbfb5b /ext
parentc62aca26c561d7ff129d4408c81cb6f838490509 (diff)
* 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:// b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/openssl/lib/openssl/ssl.rb b/ext/openssl/lib/openssl/ssl.rb
index 04eb59246c2..741274a5f91 100644
--- a/ext/openssl/lib/openssl/ssl.rb
+++ b/ext/openssl/lib/openssl/ssl.rb
@@ -98,7 +98,7 @@ module OpenSSL
should_verify_common_name = true
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)
case san.tag