Skip to content

Commit c16f39c

Browse files
committed
switch to sign_pss, hopefully compatible with 3.0
1 parent 49b9af6 commit c16f39c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@ def sign(identifier, message, algorithm, _options = {})
3535
# FIXME: SM2 support?
3636
sha = "SHA#{algorithm.split('_SHA_').last}"
3737

38-
signopts = {}
39-
signopts[:rsa_padding_mode] = 'pss' if algorithm.start_with?('RSASSA_PSS')
40-
41-
signature = pkey.sign(sha, message, signopts)
38+
signature = if algorithm.start_with?('RSASSA_PSS')
39+
pkey.sign_pss(sha, message, salt_length: :max, mgf1_hash: sha)
40+
else
41+
pkey.sign(sha, message)
42+
end
4243

4344
response.body = {
4445
'KeyId' => identifier,

0 commit comments

Comments
 (0)