Skip to content

Commit 5e88171

Browse files
Updated to appropriate error datatype
1 parent 4c88676 commit 5e88171

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

DynamoDbEncryption/dafny/DynamoDbEncryption/src/AwsCryptographyDbEncryptionSdkDynamoDbOperations.dfy

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ module AwsCryptographyDbEncryptionSdkDynamoDbOperations refines AbstractAwsCrypt
88
import EdkWrapping
99
import UUID
1010
import AlgorithmSuites
11-
import DynamoToStruct
1211
import Header = StructuredEncryptionHeader
1312
import opened DynamoDbEncryptionUtil
1413

@@ -60,7 +59,7 @@ module AwsCryptographyDbEncryptionSdkDynamoDbOperations refines AbstractAwsCrypt
6059
case header(headerItem) =>
6160
header := headerItem;
6261
}
63-
var deserializedHeader :- Header.PartialDeserialize(header).MapFailure(e => E("Failed to deserialize header."));
62+
var deserializedHeader :- Header.PartialDeserialize(header).MapFailure(e => AwsCryptographyDbEncryptionSdkStructuredEncryption(e));
6463
var datakeys := deserializedHeader.dataKeys;
6564
var list : EncryptedDataKeyDescriptionList := [];
6665
for i := 0 to |datakeys| {
@@ -88,7 +87,7 @@ module AwsCryptographyDbEncryptionSdkDynamoDbOperations refines AbstractAwsCrypt
8887
var extractedKeyProviderIdInfo :- UTF8.Decode(datakeys[i].keyProviderInfo).MapFailure(e => E(e));
8988

9089
if extractedKeyProviderId == "aws-kms-hierarchy" {
91-
var providerWrappedMaterial :- EdkWrapping.GetProviderWrappedMaterial(datakeys[i].ciphertext, algorithmSuite).MapFailure(e => E("Failed to get provider wrapped material" ));
90+
var providerWrappedMaterial :- EdkWrapping.GetProviderWrappedMaterial(datakeys[i].ciphertext, algorithmSuite).MapFailure(e => AwsCryptographyMaterialProviders(e));
9291

9392
// The ciphertext structure in the hierarchy keyring contains Salt and IV before Version.
9493
// The length of Salt is 16 and IV is 12 bytes. The length of Version is 16 bytes.

0 commit comments

Comments
 (0)