@@ -39,7 +39,7 @@ def test_ctx_options
3939 end
4040
4141 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 ?
4343
4444 Tempfile . create ( "openssl.cnf" ) { |f |
4545 f . puts ( <<~EOF )
@@ -680,6 +680,8 @@ def test_sslctx_set_params
680680 end
681681
682682 def test_post_connect_check_with_anon_ciphers
683+ omit "AWS-LC does not support DHE ciphersuites" if aws_lc?
684+
683685 ctx_proc = -> ctx {
684686 ctx . max_version = OpenSSL ::SSL ::TLS1_2_VERSION
685687 ctx . ciphers = "aNULL"
@@ -1410,7 +1412,7 @@ def test_minmax_version
14101412 end
14111413
14121414 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 ?
14141416
14151417 Tempfile . create ( "openssl.cnf" ) { |f |
14161418 f . puts ( <<~EOF )
@@ -1454,7 +1456,7 @@ def test_minmax_version_system_default
14541456 end
14551457
14561458 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 ?
14581460
14591461 Tempfile . create ( "openssl.cnf" ) { |f |
14601462 f . puts ( <<~EOF )
@@ -1737,20 +1739,22 @@ def test_get_ephemeral_key
17371739 end
17381740 end
17391741
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" )
17531749 }
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
17541758 end
17551759
17561760 # ECDHE
@@ -1814,12 +1818,13 @@ def test_fallback_scsv
18141818 ctx2 . enable_fallback_scsv
18151819 ctx2 . max_version = OpenSSL ::SSL ::TLS1_1_VERSION
18161820 s2 = OpenSSL ::SSL ::SSLSocket . new ( sock2 , ctx2 )
1821+ # AWS-LC has slightly different error messages in all-caps.
18171822 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 / ) {
18191824 s2 . connect
18201825 }
18211826 }
1822- assert_raise_with_message ( OpenSSL ::SSL ::SSLError , /inappropriate fallback/ ) {
1827+ assert_raise_with_message ( OpenSSL ::SSL ::SSLError , /inappropriate fallback|INAPPROPRIATE_FALLBACK / ) {
18231828 s1 . accept
18241829 }
18251830 t . join
@@ -1830,6 +1835,8 @@ def test_fallback_scsv
18301835 end
18311836
18321837 def test_tmp_dh_callback
1838+ omit "AWS-LC does not support DHE ciphersuites" if aws_lc?
1839+
18331840 dh = Fixtures . pkey ( "dh-1" )
18341841 called = false
18351842 ctx_proc = -> ctx {
@@ -1880,9 +1887,10 @@ def test_ciphersuites_method_frozen_object
18801887
18811888 def test_ciphersuites_method_bogus_csuite
18821889 ssl_ctx = OpenSSL ::SSL ::SSLContext . new
1890+ # AWS-LC has slightly different error messages in all-caps.
18831891 assert_raise_with_message (
18841892 OpenSSL ::SSL ::SSLError ,
1885- /SSL_CTX_set_ciphersuites: no cipher match/i
1893+ /SSL_CTX_set_ciphersuites: ( no cipher match|NO_CIPHER_MATCH) /i
18861894 ) { ssl_ctx . ciphersuites = 'BOGUS' }
18871895 end
18881896
@@ -1920,13 +1928,16 @@ def test_ciphers_method_frozen_object
19201928 def test_ciphers_method_bogus_csuite
19211929 ssl_ctx = OpenSSL ::SSL ::SSLContext . new
19221930
1931+ # AWS-LC has slightly different error messages in all-caps.
19231932 assert_raise_with_message (
19241933 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
19261935 ) { ssl_ctx . ciphers = 'BOGUS' }
19271936 end
19281937
19291938 def test_connect_works_when_setting_dh_callback_to_nil
1939+ omit "AWS-LC does not support DHE ciphersuites" if aws_lc?
1940+
19301941 ctx_proc = -> ctx {
19311942 ctx . max_version = :TLS1_2
19321943 ctx . ciphers = "DH:!NULL" # use DH
@@ -1942,6 +1953,8 @@ def test_connect_works_when_setting_dh_callback_to_nil
19421953 end
19431954
19441955 def test_tmp_dh
1956+ omit "AWS-LC does not support DHE ciphersuites" if aws_lc?
1957+
19451958 dh = Fixtures . pkey ( "dh-1" )
19461959 ctx_proc = -> ctx {
19471960 ctx . max_version = :TLS1_2
@@ -2009,9 +2022,8 @@ def test_ecdh_curves_tls13
20092022
20102023 def test_security_level
20112024 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.
20152027 assert_equal ( 0 , ctx . security_level )
20162028 return
20172029 end
0 commit comments