Skip to content

Commit 49b9af6

Browse files
committed
simplify by using sign instead of sign_raw
1 parent 192f8a6 commit 49b9af6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/fog/aws/requests/kms/sign.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,11 @@ def sign(identifier, message, algorithm, _options = {})
3434

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

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

42-
signature = pkey.sign_raw(sha, hash, signopts)
41+
signature = pkey.sign(sha, message, signopts)
4342

4443
response.body = {
4544
'KeyId' => identifier,

0 commit comments

Comments
 (0)