Skip to content

Commit 551ec1b

Browse files
committed
added explicit zero out for temporary utf8 password - relates to github #2143
1 parent 3bd7525 commit 551ec1b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

prov/src/main/java/org/bouncycastle/jcajce/provider/keystore/pkcs12/PKCS12KeyStoreSpi.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,6 +2078,8 @@ private byte[] calculatePbeMac(
20782078

20792079
CipherParameters key = generator.generateDerivedParameters(BigIntegers.intValueExact(pbkdf2Params.getKeyLength()) * 8);
20802080

2081+
Arrays.clear(generator.getPassword());
2082+
20812083
hMac.init(key);
20822084
hMac.update(data, 0, data.length);
20832085
byte[] res = new byte[hMac.getMacSize()];

0 commit comments

Comments
 (0)