Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ public Map<String, AttributeValue> decryptRecord(
materials.getVerificationKey(),
signature
);
DynamoDbSigner.putCacheIfEmpty(signer);
itemAttributes.remove(materialDescriptionFieldName);

actualDecryption(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,14 @@ static DynamoDbSigner getInstance(String signingAlgorithm, SecureRandom rnd) {
DynamoDbSigner result = cache.get(signingAlgorithm);
if (result == null) {
result = new DynamoDbSigner(signingAlgorithm, rnd);
cache.putIfAbsent(signingAlgorithm, result);
}
return result;
}

static void putCacheIfEmpty(DynamoDbSigner signer) {
cache.putIfAbsent(signer.getSigningAlgorithm(), signer);
}

/**
* @param signingAlgorithm is the algorithm used for asymmetric signing (ex: SHA256withRSA). This
* is ignored for symmetric HMACs as that algorithm is fully specified by the key.
Expand Down
Loading