diff --git a/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/QueryTransform.dfy b/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/QueryTransform.dfy index 6eefe7fa2..e9d601f94 100644 --- a/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/QueryTransform.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/QueryTransform.dfy @@ -92,16 +92,6 @@ module QueryTransform { var decryptRes := tableConfig.itemEncryptor.DecryptItem(decryptInput); var decrypted :- MapError(decryptRes); - // If the decrypted result was plaintext, i.e. has no parsedHeader - // then this is expected IFF the table config allows plaintext read - assert decrypted.parsedHeader.None? ==> - && EncOps.IsPlaintextItem(encryptedItems[x]) - && !tableConfig.plaintextOverride.FORBID_PLAINTEXT_WRITE_FORBID_PLAINTEXT_READ? - && ( - || tableConfig.plaintextOverride.FORBID_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ? - || tableConfig.plaintextOverride.FORCE_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ? - ); - if keyId.KeyId? && decrypted.parsedHeader.Some? { :- Need(|decrypted.parsedHeader.value.encryptedDataKeys| == 1, E("Query result has more than one Encrypted Data Key")); if decrypted.parsedHeader.value.encryptedDataKeys[0].keyProviderInfo == keyIdUtf8 { diff --git a/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/ScanTransform.dfy b/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/ScanTransform.dfy index 034cd7943..e412e5121 100644 --- a/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/ScanTransform.dfy +++ b/DynamoDbEncryption/dafny/DynamoDbEncryptionTransforms/src/ScanTransform.dfy @@ -90,16 +90,6 @@ module ScanTransform { var decryptRes := tableConfig.itemEncryptor.DecryptItem(decryptInput); var decrypted :- MapError(decryptRes); - // If the decrypted result was plaintext, i.e. has no parsedHeader - // then this is expected IFF the table config allows plaintext read - assert decrypted.parsedHeader.None? ==> - && EncOps.IsPlaintextItem(encryptedItems[x]) - && !tableConfig.plaintextOverride.FORBID_PLAINTEXT_WRITE_FORBID_PLAINTEXT_READ? - && ( - || tableConfig.plaintextOverride.FORBID_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ? - || tableConfig.plaintextOverride.FORCE_PLAINTEXT_WRITE_ALLOW_PLAINTEXT_READ? - ); - if keyId.KeyId? && decrypted.parsedHeader.Some? { :- Need(|decrypted.parsedHeader.value.encryptedDataKeys| == 1, E("Scan result has more than one Encrypted Data Key")); if decrypted.parsedHeader.value.encryptedDataKeys[0].keyProviderInfo == keyIdUtf8 {