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 c792a30

Browse files
committedMar 28, 2025··
m
1 parent d8eb45d commit c792a30

File tree

6 files changed

+110
-35
lines changed

6 files changed

+110
-35
lines changed
 

‎DynamoDbEncryption/dafny/DynamoDbEncryption/Model/AwsCryptographyDbEncryptionSdkDynamoDbTypes.dfy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.internald
1717
import AwsCryptographyKeyStoreTypes
1818
import AwsCryptographyPrimitivesTypes
1919
import ComAmazonawsDynamodbTypes
20-
// Generic helpers for verification of mock/unit tests.
20+
// Generic helpers for verification of mock/unit tests.
2121
datatype DafnyCallEvent<I, O> = DafnyCallEvent(input: I, output: O)
2222

2323
// Begin Generated Types

‎DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/Model/AwsCryptographyDbEncryptionSdkDynamoDbTransformsTypes.dfy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.transform
1717
import AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes
1818
import AwsCryptographyMaterialProvidersTypes
1919
import ComAmazonawsDynamodbTypes
20-
// Generic helpers for verification of mock/unit tests.
20+
// Generic helpers for verification of mock/unit tests.
2121
datatype DafnyCallEvent<I, O> = DafnyCallEvent(input: I, output: O)
2222

2323
// Begin Generated Types

‎DynamoDbEncryption/dafny/DynamoDbItemEncryptor/Model/AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorTypes.dfy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencry
1717
import AwsCryptographyMaterialProvidersTypes
1818
import AwsCryptographyPrimitivesTypes
1919
import ComAmazonawsDynamodbTypes
20-
// Generic helpers for verification of mock/unit tests.
20+
// Generic helpers for verification of mock/unit tests.
2121
datatype DafnyCallEvent<I, O> = DafnyCallEvent(input: I, output: O)
2222

2323
// Begin Generated Types

‎DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations.dfy

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,11 +1058,16 @@ module AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations refines Abs
10581058
//# using the configured [Attribute Flags](./ddb-table-encryption-config.md) as input.
10591059
// Note: InternalLegacyOverride.DecryptItem checks that the legacy policy is correct.
10601060
if config.internalLegacyOverride.Some? && config.internalLegacyOverride.value.IsLegacyInput(input) {
1061-
var decryptItemOutput :- config.internalLegacyOverride.value.DecryptItem(input);
1062-
//= specification/dynamodb-encryption-client/decrypt-item.md#behavior
1063-
//# The item returned by this operation MUST be the item outputted by the
1064-
//# [Legacy Encryptor](./ddb-table-encryption-config.md#legacy-encryptor).
1065-
return Success(decryptItemOutput);
1061+
if config.internalLegacyOverride.value.policy == DDBE.LegacyPolicy.FORBID_LEGACY_ENCRYPT_FORBID_LEGACY_DECRYPT {
1062+
return Failure(E("Item is legacy encrypted, but legacy policy is FORBID_LEGACY_ENCRYPT_FORBID_LEGACY_DECRYPT."));
1063+
// We raise this error if internalLegacyOverride is None, because they might be expecting to see it with plaintextOverride.
1064+
} else {
1065+
var decryptItemOutput :- config.internalLegacyOverride.value.DecryptItem(input);
1066+
//= specification/dynamodb-encryption-client/decrypt-item.md#behavior
1067+
//# The item returned by this operation MUST be the item outputted by the
1068+
//# [Legacy Encryptor](./ddb-table-encryption-config.md#legacy-encryptor).
1069+
return Success(decryptItemOutput);
1070+
}
10661071
}
10671072

10681073
if (

‎DynamoDbEncryption/dafny/StructuredEncryption/Model/AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.dfy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module {:extern "software.amazon.cryptography.dbencryptionsdk.structuredencrypti
1111
import opened UTF8
1212
import AwsCryptographyMaterialProvidersTypes
1313
import AwsCryptographyPrimitivesTypes
14-
// Generic helpers for verification of mock/unit tests.
14+
// Generic helpers for verification of mock/unit tests.
1515
datatype DafnyCallEvent<I, O> = DafnyCallEvent(input: I, output: O)
1616

1717
// Begin Generated Types

‎DynamoDbEncryption/runtimes/net/Generated/DynamoDbEncryptionTransforms/TypeConversion.cs

Lines changed: 96 additions & 26 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.