Files
maka/patches/@sigstore+core+4.0.1.patch
agent-radar 7be535059e
Dependency audit / audit (push) Canceled after 0s
CI / plan (push) Canceled after 0s
Gitoxide helper admission / macos-latest (push) Canceled after 0s
Gitoxide helper admission / ubuntu-latest (push) Canceled after 0s
Gitoxide helper admission / windows-latest (push) Canceled after 0s
Runtime Host peer admission / quality (push) Canceled after 0s
Windows recovery / windows_recovery (push) Canceled after 0s
CI / heavy (push) Canceled after 0s
CI / test (push) Canceled after 0s
源码快照 @ 2026-09-01 (source-only, 剔除非源码素材)
2026-09-01 19:05:14 +08:00

17 lines
935 B
Diff

diff --git a/node_modules/@sigstore/core/dist/crypto.js b/node_modules/@sigstore/core/dist/crypto.js
--- a/node_modules/@sigstore/core/dist/crypto.js
+++ b/node_modules/@sigstore/core/dist/crypto.js
@@ -51,4 +51,12 @@ function verify(data, key, signature, algorithm) {
// The try/catch is to work around an issue in Node 14.x where verify throws
// an error in some scenarios if the signature is invalid.
try {
+ if (algorithm === undefined) {
+ const keyObject = key instanceof crypto_1.default.KeyObject
+ ? key
+ : key?.key instanceof crypto_1.default.KeyObject
+ ? key.key
+ : crypto_1.default.createPublicKey(key);
+ algorithm = keyObject.asymmetricKeyType === 'ed25519' || keyObject.asymmetricKeyType === 'ed448' ? null : 'sha256';
+ }
return crypto_1.default.verify(algorithm, data, key, signature);