Skip to content

Commit ff3acac

Browse files
authored
fix: ensure algorithmSuite is properly copied in getTableConfig for E… (#1474)
* fix: ensure algorithmSuite is properly copied in getTableConfig for EnhancedClient
1 parent 1abb2dd commit ff3acac

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

DynamoDbEncryption/runtimes/java/src/main/java/software/amazon/cryptography/dbencryptionsdk/dynamodb/enhancedclient/DynamoDbEnhancedClientEncryption.java

+4
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,10 @@ private static DynamoDbTableEncryptionConfig getTableConfig(
382382
builder = builder.plaintextOverride(configWithSchema.plaintextOverride());
383383
}
384384

385+
if (!Objects.isNull(configWithSchema.algorithmSuiteId())) {
386+
builder = builder.algorithmSuiteId(configWithSchema.algorithmSuiteId());
387+
}
388+
385389
return builder
386390
.allowedUnsignedAttributePrefix(
387391
configWithSchema.allowedUnsignedAttributePrefix()

DynamoDbEncryption/runtimes/java/src/test/java/software/amazon/cryptography/dbencryptionsdk/dynamodb/enhancedclient/DynamoDbEnhancedClientEncryptionTest.java

+7
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ public void TestMultipleTables() {
5656
.keyring(createKmsKeyring())
5757
.allowedUnsignedAttributes(Arrays.asList("doNothing"))
5858
.schemaOnEncrypt(simpleSchema)
59+
.algorithmSuiteId(
60+
DBEAlgorithmSuiteId.ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_SYMSIG_HMAC_SHA384
61+
)
5962
.build()
6063
);
6164
tableConfigs.put(
@@ -102,6 +105,10 @@ public void TestMultipleTables() {
102105
.config()
103106
.tableEncryptionConfigs()
104107
.get("SimpleClassTestTable");
108+
assertEquals(
109+
DBEAlgorithmSuiteId.ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_SYMSIG_HMAC_SHA384,
110+
simpleConfig.algorithmSuiteId()
111+
);
105112
assertEquals(
106113
CryptoAction.DO_NOTHING,
107114
simpleConfig.attributeActionsOnEncrypt().get("doNothing")

0 commit comments

Comments
 (0)