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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b6f154476c3297f02a632bf653d99ee0524f6b91e1774425fcccbdf0a870409
4
- data.tar.gz: 1be2d0b83fb50f775586ecb69a52282378bb89749aba8780c7b0ac0b5fd4654c
3
+ metadata.gz: 383b2dbe66be2da64df9234092d71187dbc18592809f34b1e53ba88d9cd893c7
4
+ data.tar.gz: f2aa8f1ecdc003e86d566959091e3666d3f26bb32411d9fef8de108367b8fef6
5
5
  SHA512:
6
- metadata.gz: 06a7bf149674a38b31e18f5c06658e6a0ae20cb0bad8a5affc539dfb59e15dabb15f8fb6fb6a56f29cde1b96b7d98c66c852a852b8227309d329b26d952dbad4
7
- data.tar.gz: 836b33235bd2db0c92c0c7b9741ed757874b8382ecd53b5eea08ff04d35fa67b46181cc041a7200bd59a8daf21176c32b0383c5de46562df063a4995816b6add
6
+ metadata.gz: 5a47088977b4883aa12a4092501962b27b0b06f114a43ad93161abef1b944d986b8432efd837be6ff96f4356618c6abf27bde30ef888f9f2bc1998de022ed808
7
+ data.tar.gz: e87dab42cef1a28c641cb16b23add12ce6669bd7694e373ae72da8b6b4c369ddddb0c60d950e3fbc51d76169e693cdb7497343385cc2571fa0bdb2d3a9872ed6
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.54.0 (2022-08-22)
5
+ ------------------
6
+
7
+ * Feature - Adding SHA256 message verification
8
+
4
9
  1.53.0 (2022-02-24)
5
10
  ------------------
6
11
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.53.0
1
+ 1.54.0
@@ -2606,7 +2606,7 @@ module Aws::SNS
2606
2606
  params: params,
2607
2607
  config: config)
2608
2608
  context[:gem_name] = 'aws-sdk-sns'
2609
- context[:gem_version] = '1.53.0'
2609
+ context[:gem_version] = '1.54.0'
2610
2610
  Seahorse::Client::Request.new(handlers, context)
2611
2611
  end
2612
2612
 
@@ -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
- if public_key(msg).verify(sha1, signature(msg), canonical_string(msg))
69
- true
68
+
69
+ case msg['SignatureVersion']
70
+ when '1'
71
+ verify!(msg, sha1)
72
+ when '2'
73
+ verify!(msg, sha256)
70
74
  else
71
- msg = 'the authenticity of the message cannot be verified'
72
- raise VerificationError, msg
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
@@ -52,6 +52,6 @@ require_relative 'aws-sdk-sns/customizations'
52
52
  # @!group service
53
53
  module Aws::SNS
54
54
 
55
- GEM_VERSION = '1.53.0'
55
+ GEM_VERSION = '1.54.0'
56
56
 
57
57
  end
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.53.0
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-02-24 00:00:00.000000000 Z
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