Skip to content

Use PK11_CreatePrivateKeyFromTemplate instead of the CreateGenericObject/FindKeyByKeyID workaround - #7456

Open
Frosne wants to merge 4 commits into
mozilla:mainfrom
Frosne:rc_crypto-create-private-key-from-template
Open

Use PK11_CreatePrivateKeyFromTemplate instead of the CreateGenericObject/FindKeyByKeyID workaround#7456
Frosne wants to merge 4 commits into
mozilla:mainfrom
Frosne:rc_crypto-create-private-key-from-template

Conversation

@Frosne

@Frosne Frosne commented Jun 30, 2026

Copy link
Copy Markdown

This patch replaces the PK11_CreateGenericObject/PK11_FindKeyByKeyID workaround in rc_crypto with a direct call to PK11_CreatePrivateKeyFromTemplate.

This requires NSS 3.126 or newer, so the pinned NSS version needs to be updated -- I got libs/build-all.sh bumped to 3.126 here, but I was not sure how to do it for mac.

  • Breaking changes: This PR follows our breaking change policy
    • [ X] This PR follows the breaking change policy:
      • This PR has no breaking API changes, or
      • There are corresponding PRs for our consumer applications that resolve the breaking changes and have been approved

No breaking change. The only consumer-facing change is the minimum NSS version, now 3.126.

  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.

Builds and automation/tests.py rust-tests pass on Linux. Btw, I'd like it someone helped me to make sure it works on MacOS.

  • Tests: This PR includes thorough tests or an explanation of why it does not

No new test. The patch already contains tests testing the existing functionality (for example, test_compute_public_key_known_values)

  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one

Nothing, the previous NSS bumps did not require any.

  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due diligence applied in selecting them.

NSS 3.125 → 3.126 only.

@Frosne
Frosne force-pushed the rc_crypto-create-private-key-from-template branch from 7049523 to b0aaf87 Compare August 18, 2026 16:38
@Frosne
Frosne force-pushed the rc_crypto-create-private-key-from-template branch from b0aaf87 to 79c8b8a Compare August 18, 2026 16:41
@Frosne
Frosne marked this pull request as ready for review August 18, 2026 16:46
PK11_CreatePrivateKeyFromTemplate was added in NSS 3.126, but libs/
pinned 3.125. Rust does not check extern "C" declarations against
real symbols, so rc_crypto built fine and only failed at link time
with "undefined symbol: PK11_CreatePrivateKeyFromTemplate".

Same NSPR (4.39), so this is a drop-in bump. Both CI caches key on
libs/ contents, so they invalidate on their own.

Note: this does not cover macOS, which does not build NSS from source
but pulls a prebuilt dist pinned in taskcluster/kinds/fetch/kind.yml
and libs/build-nss-desktop.sh. That artifact is still NSS 3.125 and
needs rebuilding from 3.126+ separately.
@Frosne
Frosne force-pushed the rc_crypto-create-private-key-from-template branch from f80a632 to ec76214 Compare August 20, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant