aws-sdk-s3 1.228.0 → 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: fe2533aad3235a6cf67c16f38d9805ec0aca46995678eb8deda7f08ab788ffba
4
- data.tar.gz: 7b2bc5855ea45c2c60e51126c73576b3a15bcd61d949269c5660d5d92bc90f0d
3
+ metadata.gz: 5957df832c6080c73dbf559974579e122f334320e4ce7c81a780f08e3b73b820
4
+ data.tar.gz: 4e3921416a74055d610ca07144e6e21aa846fe153fce09b065cc8e62f4ee5294
5
5
  SHA512:
6
- metadata.gz: f7c856929d54f29f463c253c333c58a5f14195813b639ce948df18256b6784c655db2ed2f7fc313f76d9447525e8b9caf82db87640e22c0d53f0e70a8bd3def6
7
- data.tar.gz: e52b55c1f7f50ba07cdb6c191e6bf9b7d1ae60dfc04b92fcf7be8760711bb70733932580a43e1e074fb77008b3b3d612e71d9408266173c9c7b04124053d311e
6
+ metadata.gz: adc68f9009d30922126bed8afd6fe8ba849ce29f4aa623331f42d867341076e78a85a9b2784334657c0763f7d86a66d41dac7601a522bfa7fdfb8bebd261da76
7
+ data.tar.gz: e850c4122c4fb0304cd2b7c3cac882cc9e64883a43913a7c936f68bb21831f88c5f74936f092977c17b4d653a900438ff31fc47463c758973cd2477bb5593d62
data/CHANGELOG.md CHANGED
@@ -1,6 +1,16 @@
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
+
9
+ 1.228.1 (2026-07-23)
10
+ ------------------
11
+
12
+ * Issue - Ensure the source file is closed on multipart `upload_file` part failure, preventing leaked file descriptors (#3408).
13
+
4
14
  1.228.0 (2026-07-16)
5
15
  ------------------
6
16
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.228.0
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.0'
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'
@@ -154,7 +154,6 @@ module Aws
154
154
  Thread.current[:net_http_override_body_stream_chunk] = @http_chunk_size if @http_chunk_size
155
155
  update_progress(progress, p)
156
156
  resp = @client.upload_part(p)
157
- p[:body].close
158
157
  completed_part = { etag: resp.etag, part_number: p[:part_number] }
159
158
  apply_part_checksum(resp, completed_part)
160
159
  completed.push(completed_part)
@@ -162,6 +161,7 @@ module Aws
162
161
  abort_upload = true
163
162
  errors << e
164
163
  ensure
164
+ p[:body].close
165
165
  Thread.current[:net_http_override_body_stream_chunk] = nil if @http_chunk_size
166
166
  completion_queue << :done
167
167
  end
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.0'
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.0
4
+ version: 1.228.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services