Skip to content

Commit

Permalink
Bring back the ED25519 test
Browse files Browse the repository at this point in the history
  • Loading branch information
anakinj committed Mar 26, 2024
1 parent 38ad166 commit 2e7bc32
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/openssl/test_pkey.rb
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,15 @@ def test_s_from_parameters_dh_with_invalid_parameter
e = assert_raise(OpenSSL::PKey::PKeyError) { OpenSSL::PKey.from_parameters("DH", invalid: 1234) }
assert_match(/Invalid parameter "invalid"/, e.message)
end

def test_s_from_parameters_ed25519
# Ed25519 is not FIPS-approved.
omit_on_fips

key = OpenSSL::PKey.from_parameters("ED25519", pub: "\xD0\x8E\xA8\x96\xB6Fbi{$k\xAC\xB8\xA2V\xF4n\xC3\xD06}R\x8A\xE6I\xA7r\xF6D{W\x84")
assert_instance_of OpenSSL::PKey::PKey, key
assert_equal "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA0I6olrZGYml7JGusuKJW9G7D0DZ9UormSady9kR7V4Q=\n-----END PUBLIC KEY-----\n", key.public_to_pem
end
else
def test_from_parameter_raises_on_pre_3_openssl
e = assert_raise(OpenSSL::PKey::PKeyError) {
Expand Down

0 comments on commit 2e7bc32

Please sign in to comment.