Skip to content

Commit

Permalink
only trim secrets when it's for TlsPremasterSecret
Browse files Browse the repository at this point in the history
  • Loading branch information
wangweij committed Jan 6, 2025
1 parent 8507cee commit 345178c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,8 @@ private SecretKey nativeGenerateSecret(String algorithm)
int keyLen = (int)lenAttributes[0].getLong();
SecretKey key = P11Key.secretKey
(session, keyID, algorithm, keyLen << 3, attributes);
if ("RAW".equals(key.getFormat())) {
if ("RAW".equals(key.getFormat())
&& algorithm.equalsIgnoreCase("TlsPremasterSecret")) {
// Workaround for Solaris bug 6318543.
// Strip leading zeroes ourselves if possible (key not sensitive).
// This should be removed once the Solaris fix is available
Expand Down

0 comments on commit 345178c

Please sign in to comment.