-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve implementations for skipping and conditions. #860
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -39,7 +39,9 @@ def test_ctx_options | |||||||
end | ||||||||
|
||||||||
def test_ctx_options_config | ||||||||
omit "LibreSSL and AWS-LC do not support OPENSSL_CONF" if libressl? || aws_lc? | ||||||||
if libressl? || aws_lc? | ||||||||
omit "LibreSSL and AWS-LC do not support OPENSSL_CONF" | ||||||||
end | ||||||||
|
||||||||
Tempfile.create("openssl.cnf") { |f| | ||||||||
f.puts(<<~EOF) | ||||||||
|
@@ -838,7 +840,9 @@ def test_post_connection_check_wildcard_san | |||||||
|
||||||||
# LibreSSL 3.5.0+ doesn't support other wildcard certificates | ||||||||
# (it isn't required to, as RFC states MAY, not MUST) | ||||||||
return if libressl? | ||||||||
if libressl? | ||||||||
omit "LibreSSL 3.5.0+ doesn't support some wildcard certificates" | ||||||||
end | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #861 is an alternative to this. This test case should run with LibreSSL too. |
||||||||
|
||||||||
assert_equal(true, OpenSSL::SSL.verify_certificate_identity( | ||||||||
create_cert_with_san('DNS:*baz.example.com'), 'foobaz.example.com')) | ||||||||
|
@@ -1412,7 +1416,9 @@ def test_minmax_version | |||||||
end | ||||||||
|
||||||||
def test_minmax_version_system_default | ||||||||
omit "LibreSSL and AWS-LC do not support OPENSSL_CONF" if libressl? || aws_lc? | ||||||||
if libressl? || aws_lc? | ||||||||
omit "LibreSSL and AWS-LC do not support OPENSSL_CONF" | ||||||||
end | ||||||||
|
||||||||
Tempfile.create("openssl.cnf") { |f| | ||||||||
f.puts(<<~EOF) | ||||||||
|
@@ -1456,7 +1462,9 @@ def test_minmax_version_system_default | |||||||
end | ||||||||
|
||||||||
def test_respect_system_default_min | ||||||||
omit "LibreSSL and AWS-LC do not support OPENSSL_CONF" if libressl? || aws_lc? | ||||||||
if libressl? || aws_lc? | ||||||||
omit "LibreSSL and AWS-LC do not support OPENSSL_CONF" | ||||||||
end | ||||||||
|
||||||||
Tempfile.create("openssl.cnf") { |f| | ||||||||
f.puts(<<~EOF) | ||||||||
|
@@ -1619,7 +1627,7 @@ def test_alpn_protocol_selection_cancel | |||||||
end | ||||||||
|
||||||||
def test_npn_protocol_selection_ary | ||||||||
return unless OpenSSL::SSL::SSLContext.method_defined?(:npn_select_cb) | ||||||||
omit unless OpenSSL::SSL::SSLContext.method_defined?(:npn_select_cb) | ||||||||
|
||||||||
advertised = ["http/1.1", "spdy/2"] | ||||||||
ctx_proc = proc { |ctx| ctx.npn_protocols = advertised } | ||||||||
|
@@ -1638,7 +1646,7 @@ def test_npn_protocol_selection_ary | |||||||
end | ||||||||
|
||||||||
def test_npn_protocol_selection_enum | ||||||||
return unless OpenSSL::SSL::SSLContext.method_defined?(:npn_select_cb) | ||||||||
omit unless OpenSSL::SSL::SSLContext.method_defined?(:npn_select_cb) | ||||||||
|
||||||||
advertised = Object.new | ||||||||
def advertised.each | ||||||||
|
@@ -1661,7 +1669,7 @@ def advertised.each | |||||||
end | ||||||||
|
||||||||
def test_npn_protocol_selection_cancel | ||||||||
return unless OpenSSL::SSL::SSLContext.method_defined?(:npn_select_cb) | ||||||||
omit unless OpenSSL::SSL::SSLContext.method_defined?(:npn_select_cb) | ||||||||
|
||||||||
ctx_proc = Proc.new { |ctx| ctx.npn_protocols = ["http/1.1"] } | ||||||||
start_server(ctx_proc: ctx_proc, ignore_listener_error: true) { |port| | ||||||||
|
@@ -1673,7 +1681,7 @@ def test_npn_protocol_selection_cancel | |||||||
end | ||||||||
|
||||||||
def test_npn_advertised_protocol_too_long | ||||||||
return unless OpenSSL::SSL::SSLContext.method_defined?(:npn_select_cb) | ||||||||
omit unless OpenSSL::SSL::SSLContext.method_defined?(:npn_select_cb) | ||||||||
|
||||||||
ctx = OpenSSL::SSL::SSLContext.new | ||||||||
assert_raise(OpenSSL::SSL::SSLError) do | ||||||||
|
@@ -1683,7 +1691,7 @@ def test_npn_advertised_protocol_too_long | |||||||
end | ||||||||
|
||||||||
def test_npn_selected_protocol_too_long | ||||||||
return unless OpenSSL::SSL::SSLContext.method_defined?(:npn_select_cb) | ||||||||
omit unless OpenSSL::SSL::SSLContext.method_defined?(:npn_select_cb) | ||||||||
|
||||||||
ctx_proc = Proc.new { |ctx| ctx.npn_protocols = ["http/1.1"] } | ||||||||
start_server(ctx_proc: ctx_proc, ignore_listener_error: true) { |port| | ||||||||
|
@@ -1739,7 +1747,7 @@ def test_get_ephemeral_key | |||||||
end | ||||||||
end | ||||||||
|
||||||||
if !aws_lc? # AWS-LC does not support DHE ciphersuites. | ||||||||
unless aws_lc? # AWS-LC does not support DHE ciphersuites. | ||||||||
# DHE | ||||||||
# TODO: SSL_CTX_set1_groups() is required for testing this with TLS 1.3 | ||||||||
ctx_proc2 = proc { |ctx| | ||||||||
|
@@ -1774,7 +1782,7 @@ def test_get_ephemeral_key | |||||||
|
||||||||
def test_fallback_scsv | ||||||||
supported = check_supported_protocol_versions | ||||||||
return unless supported.include?(OpenSSL::SSL::TLS1_1_VERSION) && | ||||||||
omit unless supported.include?(OpenSSL::SSL::TLS1_1_VERSION) && | ||||||||
supported.include?(OpenSSL::SSL::TLS1_2_VERSION) | ||||||||
Comment on lines
+1785
to
1786
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can assume all libssl versions support TLS 1.2 and TLS 1.3, so a check for TLS 1.2 is no longer necessary. #841 overlooked this. I agree an explicit omission would be useful here, since TLS 1.1 is not typically disabled, and this should be noted.
Suggested change
|
||||||||
|
||||||||
pend "Fallback SCSV is not supported" unless \ | ||||||||
|
@@ -2023,9 +2031,9 @@ def test_ecdh_curves_tls13 | |||||||
def test_security_level | ||||||||
ctx = OpenSSL::SSL::SSLContext.new | ||||||||
ctx.security_level = 1 | ||||||||
if aws_lc? # AWS-LC does not support security levels. | ||||||||
if aws_lc? | ||||||||
assert_equal(0, ctx.security_level) | ||||||||
return | ||||||||
omit "AWS-LC does not support security levels" | ||||||||
end | ||||||||
assert_equal(1, ctx.security_level) | ||||||||
|
||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, this change is because the line length was more than 80 bytes. I didn't like it. I was working with a sleepy brain. I shouldn't include this change in this commit. I will revert this part.