Files
maka/patches/@tufjs+models+5.0.0.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

12 lines
779 B
Diff

diff --git a/node_modules/@tufjs/models/dist/utils/verify.js b/node_modules/@tufjs/models/dist/utils/verify.js
--- a/node_modules/@tufjs/models/dist/utils/verify.js
+++ b/node_modules/@tufjs/models/dist/utils/verify.js
@@ -9,5 +9,6 @@ const crypto_1 = __importDefault(require("crypto"));
const verifySignature = (metaDataSignedData, key, signature) => {
const canonicalData = Buffer.from((0, canonical_json_1.canonicalize)(metaDataSignedData));
- return crypto_1.default.verify(undefined, canonicalData, key, Buffer.from(signature, 'hex'));
+ const algorithm = key.key.asymmetricKeyType === 'ed25519' ? null : 'sha256';
+ return crypto_1.default.verify(algorithm, canonicalData, key, Buffer.from(signature, 'hex'));
};
exports.verifySignature = verifySignature;