Skip to content

Commit 0f5f3c9

Browse files
committed
8325254: CKA_TOKEN private and secret keys are not necessarily sensitive
Reviewed-by: valeriep
1 parent 4b1e367 commit 0f5f3c9

File tree

1 file changed

+3
-2
lines changed
  • src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11

1 file changed

+3
-2
lines changed

src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,9 @@ static PrivateKey privateKey(Session session, long keyID, String algorithm,
395395
new CK_ATTRIBUTE(CKA_EXTRACTABLE),
396396
});
397397

398-
boolean keySensitive = (attrs[0].getBoolean() ||
399-
attrs[1].getBoolean() || !attrs[2].getBoolean());
398+
boolean keySensitive =
399+
(attrs[0].getBoolean() && P11Util.isNSS(session.token)) ||
400+
attrs[1].getBoolean() || !attrs[2].getBoolean();
400401

401402
return switch (algorithm) {
402403
case "RSA" -> P11RSAPrivateKeyInternal.of(session, keyID, algorithm,

0 commit comments

Comments
 (0)