@@ -39,7 +39,7 @@ def test_ctx_options
39
39
end
40
40
41
41
def test_ctx_options_config
42
- omit "LibreSSL does not support OPENSSL_CONF" if libressl?
42
+ omit "LibreSSL and AWS-LC do not support OPENSSL_CONF" if libressl? || aws_lc ?
43
43
44
44
Tempfile . create ( "openssl.cnf" ) { |f |
45
45
f . puts ( <<~EOF )
@@ -680,6 +680,8 @@ def test_sslctx_set_params
680
680
end
681
681
682
682
def test_post_connect_check_with_anon_ciphers
683
+ omit "AWS-LC does not support DHE ciphersuites" if aws_lc?
684
+
683
685
ctx_proc = -> ctx {
684
686
ctx . max_version = OpenSSL ::SSL ::TLS1_2_VERSION
685
687
ctx . ciphers = "aNULL"
@@ -1410,7 +1412,7 @@ def test_minmax_version
1410
1412
end
1411
1413
1412
1414
def test_minmax_version_system_default
1413
- omit "LibreSSL does not support OPENSSL_CONF" if libressl?
1415
+ omit "LibreSSL and AWS-LC do not support OPENSSL_CONF" if libressl? || aws_lc ?
1414
1416
1415
1417
Tempfile . create ( "openssl.cnf" ) { |f |
1416
1418
f . puts ( <<~EOF )
@@ -1454,7 +1456,7 @@ def test_minmax_version_system_default
1454
1456
end
1455
1457
1456
1458
def test_respect_system_default_min
1457
- omit "LibreSSL does not support OPENSSL_CONF" if libressl?
1459
+ omit "LibreSSL and AWS-LC do not support OPENSSL_CONF" if libressl? || aws_lc ?
1458
1460
1459
1461
Tempfile . create ( "openssl.cnf" ) { |f |
1460
1462
f . puts ( <<~EOF )
@@ -1737,20 +1739,22 @@ def test_get_ephemeral_key
1737
1739
end
1738
1740
end
1739
1741
1740
- # DHE
1741
- # TODO: SSL_CTX_set1_groups() is required for testing this with TLS 1.3
1742
- ctx_proc2 = proc { |ctx |
1743
- ctx . max_version = OpenSSL ::SSL ::TLS1_2_VERSION
1744
- ctx . ciphers = "EDH"
1745
- ctx . tmp_dh = Fixtures . pkey ( "dh-1" )
1746
- }
1747
- start_server ( ctx_proc : ctx_proc2 ) do |port |
1748
- ctx = OpenSSL ::SSL ::SSLContext . new
1749
- ctx . max_version = OpenSSL ::SSL ::TLS1_2_VERSION
1750
- ctx . ciphers = "EDH"
1751
- server_connect ( port , ctx ) { |ssl |
1752
- assert_instance_of OpenSSL ::PKey ::DH , ssl . tmp_key
1742
+ if !aws_lc? # AWS-LC does not support DHE ciphersuites.
1743
+ # DHE
1744
+ # TODO: SSL_CTX_set1_groups() is required for testing this with TLS 1.3
1745
+ ctx_proc2 = proc { |ctx |
1746
+ ctx . max_version = OpenSSL ::SSL ::TLS1_2_VERSION
1747
+ ctx . ciphers = "EDH"
1748
+ ctx . tmp_dh = Fixtures . pkey ( "dh-1" )
1753
1749
}
1750
+ start_server ( ctx_proc : ctx_proc2 ) do |port |
1751
+ ctx = OpenSSL ::SSL ::SSLContext . new
1752
+ ctx . max_version = OpenSSL ::SSL ::TLS1_2_VERSION
1753
+ ctx . ciphers = "EDH"
1754
+ server_connect ( port , ctx ) { |ssl |
1755
+ assert_instance_of OpenSSL ::PKey ::DH , ssl . tmp_key
1756
+ }
1757
+ end
1754
1758
end
1755
1759
1756
1760
# ECDHE
@@ -1814,12 +1818,13 @@ def test_fallback_scsv
1814
1818
ctx2 . enable_fallback_scsv
1815
1819
ctx2 . max_version = OpenSSL ::SSL ::TLS1_1_VERSION
1816
1820
s2 = OpenSSL ::SSL ::SSLSocket . new ( sock2 , ctx2 )
1821
+ # AWS-LC has slightly different error messages in all-caps.
1817
1822
t = Thread . new {
1818
- assert_raise_with_message ( OpenSSL ::SSL ::SSLError , /inappropriate fallback/ ) {
1823
+ assert_raise_with_message ( OpenSSL ::SSL ::SSLError , /inappropriate fallback|INAPPROPRIATE_FALLBACK / ) {
1819
1824
s2 . connect
1820
1825
}
1821
1826
}
1822
- assert_raise_with_message ( OpenSSL ::SSL ::SSLError , /inappropriate fallback/ ) {
1827
+ assert_raise_with_message ( OpenSSL ::SSL ::SSLError , /inappropriate fallback|INAPPROPRIATE_FALLBACK / ) {
1823
1828
s1 . accept
1824
1829
}
1825
1830
t . join
@@ -1830,6 +1835,8 @@ def test_fallback_scsv
1830
1835
end
1831
1836
1832
1837
def test_tmp_dh_callback
1838
+ omit "AWS-LC does not support DHE ciphersuites" if aws_lc?
1839
+
1833
1840
dh = Fixtures . pkey ( "dh-1" )
1834
1841
called = false
1835
1842
ctx_proc = -> ctx {
@@ -1880,9 +1887,10 @@ def test_ciphersuites_method_frozen_object
1880
1887
1881
1888
def test_ciphersuites_method_bogus_csuite
1882
1889
ssl_ctx = OpenSSL ::SSL ::SSLContext . new
1890
+ # AWS-LC has slightly different error messages in all-caps.
1883
1891
assert_raise_with_message (
1884
1892
OpenSSL ::SSL ::SSLError ,
1885
- /SSL_CTX_set_ciphersuites: no cipher match/i
1893
+ /SSL_CTX_set_ciphersuites: ( no cipher match|NO_CIPHER_MATCH) /i
1886
1894
) { ssl_ctx . ciphersuites = 'BOGUS' }
1887
1895
end
1888
1896
@@ -1920,13 +1928,16 @@ def test_ciphers_method_frozen_object
1920
1928
def test_ciphers_method_bogus_csuite
1921
1929
ssl_ctx = OpenSSL ::SSL ::SSLContext . new
1922
1930
1931
+ # AWS-LC has slightly different error messages in all-caps.
1923
1932
assert_raise_with_message (
1924
1933
OpenSSL ::SSL ::SSLError ,
1925
- /SSL_CTX_set_cipher_list: no cipher match/i
1934
+ /SSL_CTX_set_cipher_list: ( no cipher match|NO_CIPHER_MATCH) /i
1926
1935
) { ssl_ctx . ciphers = 'BOGUS' }
1927
1936
end
1928
1937
1929
1938
def test_connect_works_when_setting_dh_callback_to_nil
1939
+ omit "AWS-LC does not support DHE ciphersuites" if aws_lc?
1940
+
1930
1941
ctx_proc = -> ctx {
1931
1942
ctx . max_version = :TLS1_2
1932
1943
ctx . ciphers = "DH:!NULL" # use DH
@@ -1942,6 +1953,8 @@ def test_connect_works_when_setting_dh_callback_to_nil
1942
1953
end
1943
1954
1944
1955
def test_tmp_dh
1956
+ omit "AWS-LC does not support DHE ciphersuites" if aws_lc?
1957
+
1945
1958
dh = Fixtures . pkey ( "dh-1" )
1946
1959
ctx_proc = -> ctx {
1947
1960
ctx . max_version = :TLS1_2
@@ -2009,9 +2022,8 @@ def test_ecdh_curves_tls13
2009
2022
2010
2023
def test_security_level
2011
2024
ctx = OpenSSL ::SSL ::SSLContext . new
2012
- begin
2013
- ctx . security_level = 1
2014
- rescue NotImplementedError
2025
+ ctx . security_level = 1
2026
+ if aws_lc? # AWS-LC does not support security levels.
2015
2027
assert_equal ( 0 , ctx . security_level )
2016
2028
return
2017
2029
end
0 commit comments