Fix BoringSSL compatibility for Bun runtime #1516
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
'sha256'explicitly instead ofnullgenerateKeyPairSync,sign) for better compatibilityBackground:
When
nullis passed tocrypto.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