Skip to content

Commit 7bd9062

Browse files
committed
8325254: CKA_TOKEN private and secret keys are not necessarily sensitive
Backport-of: 0f5f3c9b9718c610406088327401210486447462
1 parent 3c0b302 commit 7bd9062

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
switch (algorithm) {
402403
case "RSA":

0 commit comments

Comments
 (0)