aws-sdk-s3 1.228.1 → 1.228.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 707edfd91b8b1c3422d80e345a544b90757ca353b282ffa6df8856de6afd263e
4
- data.tar.gz: b2fe82651b7ca955e7c6cadfb19d4f70a8b01e76005ac12f904fd6bc71f4c811
3
+ metadata.gz: 5957df832c6080c73dbf559974579e122f334320e4ce7c81a780f08e3b73b820
4
+ data.tar.gz: 4e3921416a74055d610ca07144e6e21aa846fe153fce09b065cc8e62f4ee5294
5
5
  SHA512:
6
- metadata.gz: e332ec84f826bbb1d50c457b61b05b52b660bca9723121231c58f8d9d11621ac53b09fd989a1e97734440e5e836bc5c1e267203164357a10d205ff16d458e6d1
7
- data.tar.gz: 20425c6e9ecdfa528eeae37b322b7d32ad82a20ccb0c3bb94f109643995f718498103371892fc6bd47425021ea81017e542981a153c110a2b351e0d1be289af2
6
+ metadata.gz: adc68f9009d30922126bed8afd6fe8ba849ce29f4aa623331f42d867341076e78a85a9b2784334657c0763f7d86a66d41dac7601a522bfa7fdfb8bebd261da76
7
+ data.tar.gz: e850c4122c4fb0304cd2b7c3cac882cc9e64883a43913a7c936f68bb21831f88c5f74936f092977c17b4d653a900438ff31fc47463c758973cd2477bb5593d62
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.228.2 (2026-07-30)
5
+ ------------------
6
+
7
+ * Issue - S3 Encryption Client, encryptionV2 and encryptionV3, returns a decryption error for a malformed material description.
8
+
4
9
  1.228.1 (2026-07-23)
5
10
  ------------------
6
11
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.228.1
1
+ 1.228.2
@@ -24102,7 +24102,7 @@ module Aws::S3
24102
24102
  tracer: tracer
24103
24103
  )
24104
24104
  context[:gem_name] = 'aws-sdk-s3'
24105
- context[:gem_version] = '1.228.1'
24105
+ context[:gem_version] = '1.228.2'
24106
24106
  Seahorse::Client::Request.new(handlers, context)
24107
24107
  end
24108
24108
 
@@ -50,7 +50,7 @@ module Aws
50
50
  # @return [Cipher] Given an encryption envelope, returns a
51
51
  # decryption cipher.
52
52
  def decryption_cipher(envelope, options = {})
53
- encryption_context = Json.load(envelope['x-amz-matdesc'])
53
+ encryption_context = extract_encryption_context(envelope['x-amz-matdesc'])
54
54
  cek_alg = envelope['x-amz-cek-alg']
55
55
 
56
56
  case envelope['x-amz-wrap-alg']
@@ -115,6 +115,19 @@ module Aws
115
115
 
116
116
  private
117
117
 
118
+ # Raise a decryption error for a malformed material description. A
119
+ # material description must be a JSON object.
120
+ def extract_encryption_context(matdesc)
121
+ context = Json.load(matdesc) if matdesc.is_a?(String)
122
+ unless context.is_a?(Hash)
123
+ raise Errors::DecryptionError, 'Malformed material description'
124
+ end
125
+
126
+ context
127
+ rescue Aws::Json::ParseError, EncodingError
128
+ raise Errors::DecryptionError, 'Malformed material description'
129
+ end
130
+
118
131
  def validate_key_wrap(key_wrap_schema)
119
132
  case key_wrap_schema
120
133
  when :kms_context then 'kms+context'
@@ -54,7 +54,7 @@ module Aws
54
54
  cek_alg = envelope['x-amz-c']
55
55
  encryption_context =
56
56
  if !envelope['x-amz-t'].nil?
57
- Json.load(envelope['x-amz-t'])
57
+ extract_encryption_context(envelope['x-amz-t'])
58
58
  else
59
59
  ##= ../specification/s3-encryption/data-format/content-metadata.md#v3-only
60
60
  ##% If the mapkey x-amz-t is not present, the default Material Description value MUST be set to an empty map (`{}`).
@@ -102,6 +102,18 @@ module Aws
102
102
 
103
103
  private
104
104
 
105
+ # Raise a decryption error for a malformed material description.
106
+ def extract_encryption_context(matdesc)
107
+ context = Json.load(matdesc) if matdesc.is_a?(String)
108
+ unless context.is_a?(Hash)
109
+ raise Errors::DecryptionError, 'Malformed material description'
110
+ end
111
+
112
+ context
113
+ rescue Aws::Json::ParseError, EncodingError
114
+ raise Errors::DecryptionError, 'Malformed material description'
115
+ end
116
+
105
117
  def validate_key_wrap(key_wrap_schema)
106
118
  case key_wrap_schema
107
119
  when :kms_context then '12'
data/lib/aws-sdk-s3.rb CHANGED
@@ -75,7 +75,7 @@ module Aws::S3
75
75
  autoload :ObjectVersion, 'aws-sdk-s3/object_version'
76
76
  autoload :EventStreams, 'aws-sdk-s3/event_streams'
77
77
 
78
- GEM_VERSION = '1.228.1'
78
+ GEM_VERSION = '1.228.2'
79
79
 
80
80
  end
81
81
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.228.1
4
+ version: 1.228.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services