Replace deprecated jsrsasign dependency in @azure/attestation - #39766
Draft
Jeremy Meng (jeremymeng) wants to merge 1 commit into
Draft
Replace deprecated jsrsasign dependency in @azure/attestation#39766Jeremy Meng (jeremymeng) wants to merge 1 commit into
Jeremy Meng (jeremymeng) wants to merge 1 commit into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1c3d3029-218c-4152-ba5f-09e19ef12976
|
Azure Pipelines: Successfully started running 1 pipeline(s). 9 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
This was referenced Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Copilot agent
(on behalf of Jeremy Meng (@jeremymeng)): This PR replaces the deprecated
jsrsasignproduction dependency in@azure/attestationwhile preserving its synchronous GA token APIs and Node >=22, browser, and React Native build targets.Design
@noble/curvesP-256 primitives for synchronous ES256 signing and verification.node-forge1.4+ for synchronous RS256/PKCS#1 v1.5 instead of hand-rolling modular exponentiation, padding, or DigestInfo encoding.alg: none) tokens, canonical x5c encoding, token validation, tamper rejection, and private-key/certificate matching.ktyfrom the subject public-key algorithm rather than the certificate issuer's signature algorithm.josewas explicitly evaluated but was not usable here because its Web Crypto operations are asynchronous and would break the stable synchronous API. A separate X.509 dependency was not needed.Dependencies and security
jsrsasign.@noble/curves: ^2.0.1(MIT; lockfile resolves 2.3.0).node-forge: ^1.4.0(BSD-3-Clause licensing option; lockfile resolves 1.4.0). The minimum version excludes earlier RSA signature-forgery vulnerabilities, and verification additionally enforces the RSA modulus signature length.@types/node-forge: ^1.3.13as a development dependency.Validation
pnpm formatandpnpm check-formatpnpm lint(no errors; four existingno-param-reassignwarnings)pnpm turbo build --filter=@azure/attestation... --token 1(browser, React Native, ESM, CommonJS, and API extraction)pnpm build:samplespnpm test:node— 44 passed, 5 skipped across 6 filespnpm test:browser— 49 passed, 5 skipped across 7 files in ChromiumThe regression coverage includes SDK-to-Node and Node-to-SDK RS256/ES256 interoperability, browser-native RSA/EC paths, tampered tokens, malformed signing material, and mismatched RSA/EC keys.
Remaining limitation
The package has no React Native device/runtime test harness. The React Native target compiles successfully, and the same isomorphic dependency graph bundles and executes in Chromium without Node built-ins.
Fixes #39762