Skip to content

Commit 41dafb8

Browse files
committed
chore: Update .NET SDK dependencies to v4.0.0-preview.8
1 parent 2c79866 commit 41dafb8

8 files changed

+32
-37
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"Projects": [
3+
{
4+
"Name": "Amazon.Extensions.S3.Encryption",
5+
"Type": "Patch",
6+
"ChangelogMessages": [
7+
"Update .NET SDK dependencies to v4.0.0-preview.8"
8+
]
9+
}
10+
]
11+
}

src/Amazon.Extensions.S3.Encryption.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
</ItemGroup>
4242

4343
<ItemGroup>
44-
<PackageReference Include="AWSSDK.Core" Version="4.0.0-preview.4" />
45-
<PackageReference Include="AWSSDK.S3" Version="4.0.0-preview.4" />
46-
<PackageReference Include="AWSSDK.KeyManagementService" Version="4.0.0-preview.4" />
44+
<PackageReference Include="AWSSDK.Core" Version="4.0.0-preview.8" />
45+
<PackageReference Include="AWSSDK.S3" Version="4.0.0-preview.8" />
46+
<PackageReference Include="AWSSDK.KeyManagementService" Version="4.0.0-preview.8" />
4747
<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0" />
4848
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
4949
</ItemGroup>

src/EncryptionUtilsV2.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,12 @@ private static byte[] DecryptedDataKeyFromDecryptedEnvelopeKey(byte[] decryptedE
112112
/// <param name="instructions">
113113
/// The instruction that will be used to encrypt the object data.
114114
/// </param>
115-
/// <param name="shouldUseCachingStream">
116-
/// Flag indicating if the caching stream should be used or not.
117-
/// </param>
118115
/// <returns>
119116
/// Encrypted stream, i.e input stream wrapped into encrypted stream
120117
/// </returns>
121-
internal static Stream EncryptRequestUsingInstructionV2(Stream toBeEncrypted, EncryptionInstructions instructions, bool shouldUseCachingStream)
118+
internal static Stream EncryptRequestUsingInstructionV2(Stream toBeEncrypted, EncryptionInstructions instructions)
122119
{
123-
Stream gcmEncryptStream = (shouldUseCachingStream ?
124-
new AesGcmEncryptCachingStream(toBeEncrypted, instructions.EnvelopeKey, instructions.InitializationVector, DefaultTagBitsLength)
125-
: new AesGcmEncryptStream(toBeEncrypted, instructions.EnvelopeKey, instructions.InitializationVector, DefaultTagBitsLength)
126-
);
127-
return gcmEncryptStream;
120+
return new AesGcmEncryptCachingStream(toBeEncrypted, instructions.EnvelopeKey, instructions.InitializationVector, DefaultTagBitsLength);
128121
}
129122

130123
/// <summary>

src/Internal/SetupEncryptionHandlerV2.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ protected override PutObjectRequest GenerateEncryptedObjectRequestUsingInstructi
119119
EncryptionUtils.AddUnencryptedContentLengthToMetadata(putObjectRequest);
120120

121121
// Encrypt the object data with the instruction
122-
putObjectRequest.InputStream = EncryptionUtils.EncryptRequestUsingInstructionV2(putObjectRequest.InputStream, instructions, putObjectRequest.CalculateContentMD5Header);
122+
putObjectRequest.InputStream = EncryptionUtils.EncryptRequestUsingInstructionV2(putObjectRequest.InputStream, instructions);
123123

124124
// Create request for uploading instruction file
125125
PutObjectRequest instructionFileRequest = EncryptionUtils.CreateInstructionFileRequestV2(putObjectRequest, instructions);
@@ -150,7 +150,7 @@ protected override void GenerateEncryptedObjectRequestUsingMetadata(PutObjectReq
150150
EncryptionUtils.AddUnencryptedContentLengthToMetadata(putObjectRequest);
151151

152152
// Encrypt the object data with the instruction
153-
putObjectRequest.InputStream = EncryptionUtils.EncryptRequestUsingInstructionV2(putObjectRequest.InputStream, instructions, putObjectRequest.CalculateContentMD5Header);
153+
putObjectRequest.InputStream = EncryptionUtils.EncryptRequestUsingInstructionV2(putObjectRequest.InputStream, instructions);
154154

155155
// Update the metadata
156156
EncryptionUtils.UpdateMetadataWithEncryptionInstructionsV2(putObjectRequest, instructions, EncryptionClient);

test/IntegrationTests/Amazon.Extensions.S3.Encryption.IntegrationTests.NetFramework.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
</ItemGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="AWSSDK.SecurityToken" Version="4.0.0-preview.2" />
15-
<PackageReference Include="AWSSDK.SimpleNotificationService" Version="4.0.0-preview.2" />
16-
<PackageReference Include="AWSSDK.ResourceGroupsTaggingAPI" Version="4.0.0-preview.2" />
14+
<PackageReference Include="AWSSDK.SecurityToken" Version="4.0.0-preview.8" />
15+
<PackageReference Include="AWSSDK.SimpleNotificationService" Version="4.0.0-preview.8" />
16+
<PackageReference Include="AWSSDK.ResourceGroupsTaggingAPI" Version="4.0.0-preview.8" />
1717
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
1818
<PackageReference Include="xunit" Version="1.9.2" />
1919
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />

test/IntegrationTests/Amazon.Extensions.S3.Encryption.IntegrationTests.NetStandard.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
</ItemGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="AWSSDK.SecurityToken" Version="4.0.0-preview.2" />
16-
<PackageReference Include="AWSSDK.SimpleNotificationService" Version="4.0.0-preview.2" />
17-
<PackageReference Include="AWSSDK.ResourceGroupsTaggingAPI" Version="4.0.0-preview.2" />
15+
<PackageReference Include="AWSSDK.SecurityToken" Version="4.0.0-preview.8" />
16+
<PackageReference Include="AWSSDK.SimpleNotificationService" Version="4.0.0-preview.8" />
17+
<PackageReference Include="AWSSDK.ResourceGroupsTaggingAPI" Version="4.0.0-preview.8" />
1818
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
1919
<PackageReference Include="xunit" Version="2.4.1" />
2020
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />

test/IntegrationTests/_bcl/Utilities/EncryptionTestsUtils.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ public static void TestTransferUtilityCalculateMD5(IAmazonS3 s3EncryptionClient,
6666
using (var transferUtility = new TransferUtility(s3EncryptionClient))
6767
{
6868
var uploadRequest = CreateUploadDirRequest(directoryPath, keyPrefix, bucketName);
69-
uploadRequest.CalculateContentMD5Header = true;
7069
transferUtility.UploadDirectory(uploadRequest);
7170

7271
var newDir = TransferUtilityTests.GenerateDirectoryPath();
@@ -259,8 +258,7 @@ public static void MultipartEncryptionTestCalculateMD5(AmazonS3Client s3Encrypti
259258
UploadId = initResponse.UploadId,
260259
PartNumber = 1,
261260
PartSize = 5 * MegaByteSize,
262-
InputStream = inputStream,
263-
CalculateContentMD5Header = true
261+
InputStream = inputStream
264262
};
265263

266264
var up1Response = s3EncryptionClient.UploadPart(uploadRequest);
@@ -273,8 +271,7 @@ public static void MultipartEncryptionTestCalculateMD5(AmazonS3Client s3Encrypti
273271
UploadId = initResponse.UploadId,
274272
PartNumber = 2,
275273
PartSize = 5 * MegaByteSize,
276-
InputStream = inputStream,
277-
CalculateContentMD5Header = true
274+
InputStream = inputStream
278275
};
279276

280277
var up2Response = s3EncryptionClient.UploadPart(uploadRequest);
@@ -287,8 +284,7 @@ public static void MultipartEncryptionTestCalculateMD5(AmazonS3Client s3Encrypti
287284
UploadId = initResponse.UploadId,
288285
PartNumber = 3,
289286
InputStream = inputStream,
290-
IsLastPart = true,
291-
CalculateContentMD5Header = true
287+
IsLastPart = true
292288
};
293289

294290
var up3Response = s3EncryptionClient.UploadPart(uploadRequest);
@@ -398,8 +394,7 @@ internal static void TestPutGetCalculateMD5(IAmazonS3 s3EncryptionClient, IAmazo
398394
Key = $"key-{Guid.NewGuid()}",
399395
FilePath = filePath,
400396
InputStream = inputStreamBytes == null ? null : new MemoryStream(inputStreamBytes),
401-
ContentBody = contentBody,
402-
CalculateContentMD5Header = true
397+
ContentBody = contentBody
403398
};
404399

405400
var response = s3EncryptionClient.PutObject(request);

test/IntegrationTests/netstandard/Utilities/EncryptionTestsUtils.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,7 @@ public static async Task MultipartEncryptionTestCalculateMD5Async(AmazonS3Client
199199
UploadId = initResponse.UploadId,
200200
PartNumber = 1,
201201
PartSize = 5 * MegaBytesSize,
202-
InputStream = inputStream,
203-
CalculateContentMD5Header = true
202+
InputStream = inputStream
204203
};
205204

206205
UploadPartResponse up1Response =
@@ -214,8 +213,7 @@ public static async Task MultipartEncryptionTestCalculateMD5Async(AmazonS3Client
214213
UploadId = initResponse.UploadId,
215214
PartNumber = 2,
216215
PartSize = 5 * MegaBytesSize,
217-
InputStream = inputStream,
218-
CalculateContentMD5Header = true
216+
InputStream = inputStream
219217
};
220218

221219
UploadPartResponse up2Response =
@@ -229,8 +227,7 @@ public static async Task MultipartEncryptionTestCalculateMD5Async(AmazonS3Client
229227
UploadId = initResponse.UploadId,
230228
PartNumber = 3,
231229
InputStream = inputStream,
232-
IsLastPart = true,
233-
CalculateContentMD5Header = true
230+
IsLastPart = true
234231
};
235232

236233
UploadPartResponse up3Response =
@@ -336,8 +333,7 @@ public static async Task TestPutGetCalculateMD5Async(AmazonS3Client s3Encryption
336333
Key = $"key-{Guid.NewGuid()}",
337334
FilePath = filePath,
338335
InputStream = inputStreamBytes == null ? null : new MemoryStream(inputStreamBytes),
339-
ContentBody = contentBody,
340-
CalculateContentMD5Header = true
336+
ContentBody = contentBody
341337
};
342338
PutObjectResponse response = await s3EncryptionClient.PutObjectAsync(request).ConfigureAwait(false);
343339
await TestGetAsync(request.Key, expectedContent, s3DecryptionClient, bucketName).ConfigureAwait(false);

0 commit comments

Comments
 (0)