Skip to content

PKCS11: Add support for raw asymmetric authentication - #539

Open
aveenismail wants to merge 9 commits into
masterfrom
auth_salt
Open

aveenismail wants to merge 9 commits into
masterfrom
auth_salt

Conversation

@aveenismail

Copy link
Copy Markdown
Member

No description provided.

@aveenismail
aveenismail force-pushed the auth_salt branch 9 times, most recently from e673728 to 11087a9 Compare August 12, 2026 11:31
@aveenismail
aveenismail force-pushed the auth_salt branch 5 times, most recently from a09c24f to 241d8b3 Compare August 27, 2026 07:40
Comment thread pkcs11/yubihsm_pkcs11.c Fixed
@aveenismail aveenismail changed the title Githubactions: Add test build with OpenSSL FIPS on PKCS11: Add support for raw asymmetric authentication Sep 8, 2026
@aveenismail
aveenismail requested a balanced review from Copilot September 8, 2026 13:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

File-backed authentication can bypass PIN protection for unencrypted keys, while CI changes remove key pre-merge validation.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds file-backed P-256 authentication keys to PKCS#11 and introduces FIPS-focused CI changes.

Changes:

  • Adds authkey-file configuration and PEM private-key loading.
  • Clears authentication key material after session creation.
  • Adds FIPS workflows while rescheduling existing CI.
File summaries
File Description
pkcs11/yubihsm_pkcs11.h Stores authentication key-file mappings.
pkcs11/yubihsm_pkcs11.c Parses mappings and loads raw P-256 keys.
pkcs11/cmdline.ggo Defines the new configuration option.
.github/workflows/integration_test.yml Replaces standard integration coverage with FIPS testing.
.github/workflows/build_and_test.yml Adds a FIPS build and changes triggers.
.github/workflows/build_and_test_windows.yml Reschedules Windows validation.
.github/workflows/release.yml Reschedules release-package validation.
Review details

Suppressed comments (1)

.github/workflows/integration_test.yml:10

  • Commenting out main disables the existing Ubuntu/Fedora build, command-line tests, OpenSC tests, and SunPKCS11 matrix. The replacement FIPS job does not run those in-repository suites, so this substantially reduces regression coverage; retain the existing job and add the FIPS job alongside it.
#  main:
  • Files reviewed: 7/7 changed files
  • Comments generated: 9
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkcs11/yubihsm_pkcs11.c
return false;
}

EVP_PKEY *pkey = PEM_read_bio_PrivateKey(bio, NULL, NULL, pass_cstr);
Comment thread .github/workflows/build_and_test.yml Resolved
Comment thread .github/workflows/integration_test.yml Outdated
schedule:
# Run this every wednesday at 3:40. https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
- cron: '40 3 * * 3'
on: [push, pull_request]
Comment thread .github/workflows/release.yml Resolved
Comment thread pkcs11/yubihsm_pkcs11.c Outdated
yubihsm_pkcs11_authkey_file akf = {0};
akf.id = id;
memcpy(akf.path, path, path_len);
list_append(&g_ctx.authkey_files, &akf);
Comment thread pkcs11/yubihsm_pkcs11.c
yrc = yh_create_session_asym(session->slot->connector, key_id, sk_oce,
sizeof(sk_oce), pk_sd, pk_sd_len,
&session->slot->device_session);
insecure_memzero(sk_oce, sizeof(sk_oce));
Comment thread pkcs11/cmdline.ggo
option "noproxy" - "Comma separated list of hosts ignore proxy for" string optional
option "timeout" - "Timeout to use for initial connection to connector" int optional default="5"
option "device-pubkey" - "List of device public keys allowed for asymmetric authentication" string optional multiple
option "authkey-file" - "Map an authentication key ID to a password-protected file containing the corresponding EC P256 private key, format <4-hex-digit key ID>:<path>" string optional multiple
Comment thread pkcs11/yubihsm_pkcs11.c
Comment on lines +6608 to +6611
const char *authkey_file = find_authkey_file(key_id);
if (authkey_file != NULL) {
if (load_ec_p256_privkey_from_file(authkey_file, pPin, ulPinLen, sk_oce,
sizeof(sk_oce)) == false) {
@aveenismail
aveenismail force-pushed the auth_salt branch 2 times, most recently from a88f72e to 797a238 Compare December 2, 2026 12:48
@aveenismail
aveenismail force-pushed the auth_salt branch 8 times, most recently from c410000 to 4dc78f0 Compare December 3, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants