Skip to content

Commit

Permalink
simplify by using sign instead of sign_raw
Browse files Browse the repository at this point in the history
  • Loading branch information
geemus committed Dec 10, 2024
1 parent 192f8a6 commit 49b9af6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/fog/aws/requests/kms/sign.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ def sign(identifier, message, algorithm, _options = {})

# FIXME: SM2 support?
sha = "SHA#{algorithm.split('_SHA_').last}"
hash = OpenSSL::Digest.digest(sha, message)

signopts = {}
signopts[:rsa_padding_mode] = 'pss' if algorithm.start_with?('RSASSA_PSS')

signature = pkey.sign_raw(sha, hash, signopts)
signature = pkey.sign(sha, message, signopts)

response.body = {
'KeyId' => identifier,
Expand Down

0 comments on commit 49b9af6

Please sign in to comment.