Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Handling PKCS#11 Tokens Requiring PIN on Operations #282

Open
microshine opened this issue Jan 8, 2024 · 0 comments
Open

Issue with Handling PKCS#11 Tokens Requiring PIN on Operations #282

microshine opened this issue Jan 8, 2024 · 0 comments
Labels

Comments

@microshine
Copy link
Contributor

Description

The @webcrypto-local/server module is experiencing an issue with PKCS#11 tokens that necessitate the entry of a PIN when performing operations. Although the node-webcrypto-p11 module, which is utilized by the library, supports this mechanism, it is not currently being leveraged by the @webcrypto-local/server.

Steps to Reproduce

Below is an example snippet demonstrating the intended usage:

// Adding an always authenticate handler
crypto.onAlwaysAuthenticate = async () => {
  return "your pin";
};

// Checking the always authenticate requirement
const signingKey = await crypto.keyStorage.getItem(keys[0]);
console.log("Always authenticate: ", signingKey.alwaysAuthenticate);

Expected Behavior

The library should handle the PIN entry for PKCS#11 tokens when required by certain operations, using the mechanism provided by node-webcrypto-p11.

Actual Behavior

The current implementation results in a CKR_USER_NOT_LOGGED_IN error for keys that require authentication.

@microshine microshine added the bug label Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant