Skip to content

Conversation

@keithagroves
Copy link

Summary

Resolves #1515. Bun uses BoringSSL which requires an explicit digest algorithm for EC key signing, but the ephemeral signer was using crypto.sign(null, ...) which only works with Node's OpenSSL implementation.

Changes:

  • Updated ephemeral.ts to use 'sha256' explicitly instead of null
  • Changed from default crypto import to named imports (generateKeyPairSync, sign) for better compatibility
  • Both Node.js (OpenSSL) and Bun (BoringSSL) now work correctly

Background:

When null is passed to crypto.sign() with OpenSSL, it treats the data as pre-computed hash and signs it directly. BoringSSL doesn't support this mode for ECDSA - it requires an explicit hash algorithm. By specifying 'sha256' (the standard pairing for P-256 ECDSA per NIST specifications), the code works consistently across both implementations.

Release Note

Fixed BoringSSL compatibility in ephemeral signer to enable Bun runtime support.

Documentation

NONE

Bun uses BoringSSL which requires an explicit digest algorithm for EC key
signing, but the ephemeral signer was using crypto.sign(null, ...) which
only works with Node's OpenSSL implementation.

Changes:
- Updated ephemeral signer to use 'sha256' explicitly instead of null
- Changed from default crypto import to named imports for better compatibility
- Both Node.js (OpenSSL) and Bun (BoringSSL) now work correctly

This enables Bun users to use @sigstore/sign without any patches or workarounds.

Signed-off-by: keithagroves <[email protected]>
@keithagroves keithagroves requested a review from a team as a code owner December 4, 2025 12:42
@changeset-bot
Copy link

changeset-bot bot commented Dec 4, 2025

🦋 Changeset detected

Latest commit: 4875066

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sigstore/sign Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

@sigstore/sign incompatible with Bun runtime

1 participant