summaryrefslogtreecommitdiff
path: root/test/openssl/test_x509name.rb
diff options
context:
space:
mode:
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)