1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLSocket#post_connection_chech):

treat wildcard character in commonName. [ruby-dev:28121]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
gotoyuzo 2005-12-26 23:31:04 +00:00
parent 89eb20764e
commit 40761f5925
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Tue Dec 27 08:29:18 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLSocket#post_connection_chech):
treat wildcard character in commonName. [ruby-dev:28121]
Mon Dec 26 22:32:47 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_eval), gc.c (gc_mark_children), node.h (NEW_ALIAS,

View file

@ -82,8 +82,9 @@ module OpenSSL
}
if check_common_name
cert.subject.to_a.each{|oid, value|
if oid == "CN" && value.casecmp(hostname) == 0
return true
if oid == "CN"
reg = Regexp.escape(value).gsub(/\\\*/, "[^.]+")
return true if /\A#{reg}\z/i =~ hostname
end
}
end