aws-sdk-sns 1.53.0 → 1.54.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-sns/client.rb +1 -1
- data/lib/aws-sdk-sns/message_verifier.rb +21 -4
- data/lib/aws-sdk-sns.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 383b2dbe66be2da64df9234092d71187dbc18592809f34b1e53ba88d9cd893c7
|
4
|
+
data.tar.gz: f2aa8f1ecdc003e86d566959091e3666d3f26bb32411d9fef8de108367b8fef6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a47088977b4883aa12a4092501962b27b0b06f114a43ad93161abef1b944d986b8432efd837be6ff96f4356618c6abf27bde30ef888f9f2bc1998de022ed808
|
7
|
+
data.tar.gz: e87dab42cef1a28c641cb16b23add12ce6669bd7694e373ae72da8b6b4c369ddddb0c60d950e3fbc51d76169e693cdb7497343385cc2571fa0bdb2d3a9872ed6
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.54.0
|
data/lib/aws-sdk-sns/client.rb
CHANGED
@@ -65,11 +65,15 @@ module Aws
|
|
65
65
|
def authenticate!(message_body)
|
66
66
|
msg = Json.load(message_body)
|
67
67
|
msg = convert_lambda_msg(msg) if is_from_lambda(msg)
|
68
|
-
|
69
|
-
|
68
|
+
|
69
|
+
case msg['SignatureVersion']
|
70
|
+
when '1'
|
71
|
+
verify!(msg, sha1)
|
72
|
+
when '2'
|
73
|
+
verify!(msg, sha256)
|
70
74
|
else
|
71
|
-
|
72
|
-
raise VerificationError,
|
75
|
+
error_msg = 'Invalid SignatureVersion'
|
76
|
+
raise VerificationError, error_msg
|
73
77
|
end
|
74
78
|
end
|
75
79
|
|
@@ -88,10 +92,23 @@ module Aws
|
|
88
92
|
message
|
89
93
|
end
|
90
94
|
|
95
|
+
def verify!(msg, hash_alg)
|
96
|
+
if public_key(msg).verify(hash_alg, signature(msg), canonical_string(msg))
|
97
|
+
true
|
98
|
+
else
|
99
|
+
msg = 'the authenticity of the message cannot be verified'
|
100
|
+
raise VerificationError, msg
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
91
104
|
def sha1
|
92
105
|
OpenSSL::Digest::SHA1.new
|
93
106
|
end
|
94
107
|
|
108
|
+
def sha256
|
109
|
+
OpenSSL::Digest::SHA256.new
|
110
|
+
end
|
111
|
+
|
95
112
|
def signature(message)
|
96
113
|
Base64.decode64(message['Signature'])
|
97
114
|
end
|
data/lib/aws-sdk-sns.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-sns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.54.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|