Skip to content

Commit 0e15a35

Browse files
authored
Merge pull request #66 from bdonlan/kms-cache-remove
Remove the KMS client cache
2 parents b5282ce + b609e26 commit 0e15a35

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## 1.3.5
4+
5+
(nothing yet)
6+
7+
## 1.3.4
8+
9+
### Minor Changes
10+
11+
* Removed the KMS client cache, which could result in a memory leak when
12+
decrypting certain malformed ciphertexts. This may reduce performance slightly
13+
in some scenarios.
14+
315
## 1.3.3
416

517
### Minor Changes

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ You can get the latest release from Maven:
4545
<dependency>
4646
<groupId>com.amazonaws</groupId>
4747
<artifactId>aws-encryption-sdk-java</artifactId>
48-
<version>1.3.3</version>
48+
<version>1.3.4</version>
4949
</dependency>
5050
```
5151

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>com.amazonaws</groupId>
66
<artifactId>aws-encryption-sdk-java</artifactId>
7-
<version>1.3.3</version>
7+
<version>1.3.5-SNAPSHOT</version>
88
<packaging>jar</packaging>
99

1010
<name>aws-encryption-sdk-java</name>

src/main/java/com/amazonaws/encryptionsdk/kms/KmsMasterKeyProvider.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,10 @@ private RegionalClientSupplier clientFactory() {
259259
AWSKMSClientBuilder builder = templateBuilder_ != null ? cloneClientBuilder(templateBuilder_)
260260
: AWSKMSClientBuilder.standard();
261261

262-
ConcurrentHashMap<String, AWSKMS> clientCache = new ConcurrentHashMap<>();
263-
264-
return region -> clientCache.computeIfAbsent(region, region2 -> {
262+
return region -> {
265263
// Clone yet again as we're going to change the region field.
266-
return cloneClientBuilder(builder).withRegion(region2).build();
267-
});
264+
return cloneClientBuilder(builder).withRegion(region).build();
265+
};
268266
}
269267
}
270268

0 commit comments

Comments
 (0)