Skip to content

Commit

Permalink
Merge pull request #27 from pshipton/cka
Browse files Browse the repository at this point in the history
8325254: CKA_TOKEN private and secret keys are not necessarily sensitive
  • Loading branch information
keithc-ca authored Feb 28, 2024
2 parents 658edbf + 1b42f44 commit 687a145
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,9 @@ static PrivateKey privateKey(Session session, long keyID, String algorithm,
new CK_ATTRIBUTE(CKA_EXTRACTABLE),
});

boolean keySensitive = (attrs[0].getBoolean() ||
attrs[1].getBoolean() || !attrs[2].getBoolean());
boolean keySensitive =
(attrs[0].getBoolean() && P11Util.isNSS(session.token)) ||
attrs[1].getBoolean() || !attrs[2].getBoolean();

if (keySensitive && (SunPKCS11.mysunpkcs11 != null) && "RSA".equals(algorithm)) {
try {
Expand Down

0 comments on commit 687a145

Please sign in to comment.