summaryrefslogtreecommitdiff
path: root/test/openssl/test_x509name.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-12-24 10:27:18 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-12-24 10:33:32 +0900
commite954be14d07e54b8dbf71c0fa227e5818eaa01e6 (patch)
tree9da2e7d220397e67ce1a5c6fdde61bcf0895cbb7 /test/openssl/test_x509name.rb
parent992aa2cda50140abbca165024682eae998756e2d (diff)
Get rid of false positive misspellings
[Bug #16437]
Diffstat (limited to 'test/openssl/test_x509name.rb')
-rw-r--r--test/openssl/test_x509name.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/openssl/test_x509name.rb b/test/openssl/test_x509name.rb
index f0146595d6..8a4596ea6e 100644
--- a/test/openssl/test_x509name.rb
+++ b/test/openssl/test_x509name.rb
@@ -242,15 +242,16 @@ class OpenSSL::TestX509Name < OpenSSL::TestCase
assert_match(/^multi-valued RDN is not supported: #{dn_r}/, ex.message)
}
+ bad_dc = "exa#{"pm"}le" # <- typo of "example"
[
- ["DC=org,DC=exapmle,CN", "CN"],
+ ["DC=org,DC=#{bad_dc},CN", "CN"],
["DC=org,DC=example,", ""],
- ["DC=org,DC=exapmle,CN=www.example.org;", "CN=www.example.org;"],
- ["DC=org,DC=exapmle,CN=#www.example.org", "CN=#www.example.org"],
- ["DC=org,DC=exapmle,CN=#777777.example.org", "CN=#777777.example.org"],
- ["DC=org,DC=exapmle,CN=\"www.example\".org", "CN=\"www.example\".org"],
- ["DC=org,DC=exapmle,CN=www.\"example.org\"", "CN=www.\"example.org\""],
- ["DC=org,DC=exapmle,CN=www.\"example\".org", "CN=www.\"example\".org"],
+ ["DC=org,DC=#{bad_dc},CN=www.example.org;", "CN=www.example.org;"],
+ ["DC=org,DC=#{bad_dc},CN=#www.example.org", "CN=#www.example.org"],
+ ["DC=org,DC=#{bad_dc},CN=#777777.example.org", "CN=#777777.example.org"],
+ ["DC=org,DC=#{bad_dc},CN=\"www.example\".org", "CN=\"www.example\".org"],
+ ["DC=org,DC=#{bad_dc},CN=www.\"example.org\"", "CN=www.\"example.org\""],
+ ["DC=org,DC=#{bad_dc},CN=www.\"example\".org", "CN=www.\"example\".org"],
].each{|dn, msg|
ex = scanner.call(dn) rescue $!
assert_match(/^malformed RDN: .*=>#{Regexp.escape(msg)}/, ex.message)