@@ -11,7 +11,7 @@ def test_generic_oid_inspect_rsa
11
11
end
12
12
13
13
def test_generic_oid_inspect_x25519
14
- omit "X25519 not supported" unless openssl? ( 1 , 1 , 0 ) || libressl? ( 3 , 7 , 0 )
14
+ omit "X25519 not supported" if openssl? && ! openssl? ( 1 , 1 , 0 )
15
15
omit_on_fips
16
16
17
17
# X25519 private key
@@ -85,8 +85,7 @@ def test_hmac_sign_verify
85
85
def test_ed25519
86
86
# Ed25519 is not FIPS-approved.
87
87
omit_on_fips
88
- # See EVP_PKEY_sign in Changelog for 3.7.0: https://github.com/libressl/portable/blob/master/ChangeLog
89
- omit "Ed25519 not supported" unless openssl? ( 1 , 1 , 1 ) || libressl? ( 3 , 7 , 0 )
88
+ omit "Ed25519 not supported" if openssl? && !openssl? ( 1 , 1 , 1 )
90
89
91
90
# Test vector from RFC 8032 Section 7.1 TEST 2
92
91
priv_pem = <<~EOF
@@ -137,7 +136,7 @@ def test_ed25519
137
136
end
138
137
139
138
def test_x25519
140
- omit "X25519 not supported" unless openssl? ( 1 , 1 , 0 ) || libressl? ( 3 , 7 , 0 )
139
+ omit "X25519 not supported" if openssl? && ! openssl? ( 1 , 1 , 0 )
141
140
omit_on_fips
142
141
143
142
# Test vector from RFC 7748 Section 6.1
@@ -160,7 +159,7 @@ def test_x25519
160
159
assert_equal bob_pem , bob . public_to_pem
161
160
assert_equal [ shared_secret ] . pack ( "H*" ) , alice . derive ( bob )
162
161
163
- unless openssl? ( 1 , 1 , 1 ) || libressl? ( 3 , 7 , 0 )
162
+ if openssl? && ! openssl? ( 1 , 1 , 1 )
164
163
omit "running OpenSSL version does not have raw public key support"
165
164
end
166
165
alice_private = OpenSSL ::PKey . new_raw_private_key ( "X25519" , alice . raw_private_key )
@@ -176,7 +175,7 @@ def test_x25519
176
175
end
177
176
178
177
def test_raw_initialize_errors
179
- omit "Ed25519 not supported" unless openssl? ( 1 , 1 , 1 ) || libressl? ( 3 , 7 , 0 )
178
+ omit "Ed25519 not supported" if openssl? && ! openssl? ( 1 , 1 , 1 )
180
179
181
180
assert_raise ( OpenSSL ::PKey ::PKeyError ) { OpenSSL ::PKey . new_raw_private_key ( "foo123" , "xxx" ) }
182
181
assert_raise ( OpenSSL ::PKey ::PKeyError ) { OpenSSL ::PKey . new_raw_private_key ( "ED25519" , "xxx" ) }
0 commit comments