Skip to content

Commit

Permalink
[ruby/openssl] test/openssl/test_ossl.rb: relax assertion for error m…
Browse files Browse the repository at this point in the history
…essages

The test case test_error_data utilizes the error message generated by
X509V3_EXT_nconf_nid(). The next commit will use X509V3_EXT_nconf(),
which generates a slightly different error message. Let's adapt the
check to it.

ruby/openssl@9cdfa3a4d1
  • Loading branch information
rhenium authored and hsbt committed Sep 6, 2023
1 parent 91e5f51 commit 1d4a43e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/openssl/test_ossl.rb
Expand Up @@ -67,8 +67,9 @@ def test_error_data
#
# The generated message should look like:
# "subjectAltName = IP:not.a.valid.ip.address: bad ip address (value=not.a.valid.ip.address)"
# "subjectAltName = IP:not.a.valid.ip.address: error in extension (name=subjectAltName, value=IP:not.a.valid.ip.address)"
ef = OpenSSL::X509::ExtensionFactory.new
assert_raise_with_message(OpenSSL::X509::ExtensionError, /\(value=not.a.valid.ip.address\)/) {
assert_raise_with_message(OpenSSL::X509::ExtensionError, /value=(IP:)?not.a.valid.ip.address\)/) {
ef.create_ext("subjectAltName", "IP:not.a.valid.ip.address")
}
end
Expand Down

0 comments on commit 1d4a43e

Please sign in to comment.