@@ -111,12 +111,12 @@ def test_ed25519
111111
112112 begin
113113 assert_equal "4ccd089b28ff96da9db6c346ec114e0f5b8a319f35aba624da8cf6ed4fb8a6fb" ,
114- priv . private_to_raw . unpack1 ( "H*" )
115- assert_equal OpenSSL ::PKey . private_new ( "ED25519" , priv . private_to_raw ) . private_to_pem ,
114+ priv . raw_private_key . unpack1 ( "H*" )
115+ assert_equal OpenSSL ::PKey . new_raw_private_key ( "ED25519" , priv . raw_private_key ) . private_to_pem ,
116116 priv . private_to_pem
117117 assert_equal "3d4017c3e843895a92b70aa74d1b7ebc9c982ccf2ec4968cc0cd55f12af4660c" ,
118- priv . public_to_raw . unpack1 ( "H*" )
119- assert_equal OpenSSL ::PKey . public_new ( "ED25519" , priv . public_to_raw ) . public_to_pem ,
118+ priv . raw_public_key . unpack1 ( "H*" )
119+ assert_equal OpenSSL ::PKey . new_raw_public_key ( "ED25519" , priv . raw_public_key ) . public_to_pem ,
120120 pub . public_to_pem
121121 rescue NoMethodError
122122 pend "running OpenSSL version does not have raw public key support"
@@ -169,10 +169,10 @@ def test_x25519
169169 assert_equal bob_pem , bob . public_to_pem
170170 assert_equal [ shared_secret ] . pack ( "H*" ) , alice . derive ( bob )
171171 begin
172- alice_private = OpenSSL ::PKey . private_new ( "X25519" , alice . private_to_raw )
173- bob_public = OpenSSL ::PKey . public_new ( "X25519" , bob . public_to_raw )
174- alice_private_raw = alice . private_to_raw . unpack1 ( "H*" )
175- bob_public_raw = bob . public_to_raw . unpack1 ( "H*" )
172+ alice_private = OpenSSL ::PKey . new_raw_private_key ( "X25519" , alice . raw_private_key )
173+ bob_public = OpenSSL ::PKey . new_raw_public_key ( "X25519" , bob . raw_public_key )
174+ alice_private_raw = alice . raw_private_key . unpack1 ( "H*" )
175+ bob_public_raw = bob . raw_public_key . unpack1 ( "H*" )
176176 rescue NoMethodError
177177 # OpenSSL < 1.1.1
178178 pend "running OpenSSL version does not have raw public key support"
@@ -190,10 +190,10 @@ def test_x25519
190190 def raw_initialize
191191 pend "Ed25519 is not implemented" unless OpenSSL ::OPENSSL_VERSION_NUMBER >= 0x10101000 && # >= v1.1.1
192192
193- assert_raise ( OpenSSL ::PKey ::PKeyError ) { OpenSSL ::PKey . private_new ( "foo123" , "xxx" ) }
194- assert_raise ( OpenSSL ::PKey ::PKeyError ) { OpenSSL ::PKey . private_new ( "ED25519" , "xxx" ) }
195- assert_raise ( OpenSSL ::PKey ::PKeyError ) { OpenSSL ::PKey . public_new ( "foo123" , "xxx" ) }
196- assert_raise ( OpenSSL ::PKey ::PKeyError ) { OpenSSL ::PKey . public_new ( "ED25519" , "xxx" ) }
193+ assert_raise ( OpenSSL ::PKey ::PKeyError ) { OpenSSL ::PKey . new_raw_private_key ( "foo123" , "xxx" ) }
194+ assert_raise ( OpenSSL ::PKey ::PKeyError ) { OpenSSL ::PKey . new_raw_private_key ( "ED25519" , "xxx" ) }
195+ assert_raise ( OpenSSL ::PKey ::PKeyError ) { OpenSSL ::PKey . new_raw_public_key ( "foo123" , "xxx" ) }
196+ assert_raise ( OpenSSL ::PKey ::PKeyError ) { OpenSSL ::PKey . new_raw_public_key ( "ED25519" , "xxx" ) }
197197 end
198198
199199 def test_compare?
0 commit comments