source: EcnlProtoTool/trunk/mrbgems/mruby-tls-openssl/test/openssl.rb@ 331

Last change on this file since 331 was 331, checked in by coas-nagasima, 6 years ago

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-ruby
File size: 981 bytes
Line 
1assert('certificate identity matching') do
2 def ok(ref_id, pr_id)
3 msg = "matching TLS identity: reference=#{ref_id.inspect}, presented=#{pr_id.inspect}"
4 assert_true(OpenSSLTest.match_dns_id(ref_id, pr_id), msg)
5 end
6 def ng(ref_id, pr_id)
7 msg = "matching TLS identity: reference=#{ref_id.inspect}, presented=#{pr_id.inspect}"
8 assert_false(OpenSSLTest.match_dns_id(ref_id, pr_id), msg)
9 end
10
11 ok "www.example.com", "www.example.com"
12 ok "WwW.ExAmPlE.CoM", "wWw.eXaMpLe.cOm"
13
14 ok "www.example.com", "*.example.com"
15 ok "WwW.ExAmPlE.CoM", "*.eXaMpLe.cOm"
16 ok "www.a.example.com", "*.a.example.com"
17
18 ng "www.example.com", "*"
19 ng "www.example.com", "w*.example.com"
20 ng "www.example.com", "*w.example.com"
21 ng "www.example.com", "www.*.com"
22 ng "example.com", "*."
23 ng "example.com", "*.com"
24 ng "example.com.", "*.com."
25
26 ng "example.com", "*.example.com"
27 ng "foo.bar.example.com", "*.example.com"
28 ng "foo.bar.example.com", "*.*.example.com"
29end
Note: See TracBrowser for help on using the repository browser.