Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e909d69

Browse files
committedMar 25, 2024
Refactor the tests
1 parent 346bf27 commit e909d69

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎DynamoDbEncryption/dafny/DynamoDbEncryption/test/DynamoDbGetEncryptedDataKeyDescriptionTest.dfy

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,12 @@ module DynamoDbGetEncryptedDataKeyDescriptionTest {
4040
expect EdkWrapping.GetProviderWrappedMaterial(expectedHead.dataKeys[0].ciphertext, algorithmSuite).Success?;
4141
var providerWrappedMaterial := EdkWrapping.GetProviderWrappedMaterial(expectedHead.dataKeys[0].ciphertext, algorithmSuite).Extract();
4242

43-
expect |providerWrappedMaterial| >= (28 + 16);
44-
var expectedBranchKeyVersionUuid := UUID.FromByteArray(providerWrappedMaterial[28 .. (28 + 16)]);
43+
// The ciphertext structure in the hierarchy keyring contains Salt and IV before Version.
44+
// The length of Salt is 16 and IV is 12 bytes. The length of Version is 16 bytes.
45+
// https://github.com/awslabs/aws-encryption-sdk-specification/blob/master/framework/aws-kms/aws-kms-hierarchical-keyring.md#ciphertext
46+
47+
expect |providerWrappedMaterial| >= (16 + 12 + 16);
48+
var expectedBranchKeyVersionUuid := UUID.FromByteArray(providerWrappedMaterial[16 + 12 .. (16 + 12 + 16)]);
4549
var ddbEncResources :- expect DynamoDbEncryption.DynamoDbEncryption();
4650

4751
var inputVariable: Types.GetEncryptedDataKeyDescriptionInput :=

0 commit comments

Comments
 (0)
Please sign in to comment.