We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crypto.timingSafeEqual
undefined
[email protected] [email protected] [email protected]
[email protected]
According to Misc | Node Crypto, the timingSafeEqual function should be supported by nodejs_compat.
timingSafeEqual
nodejs_compat
However, when logging import crypto from "node:crypto";, you see
import crypto from "node:crypto";
{ DiffieHellman: [Function: DiffieHellman], DiffieHellmanGroup: [Function: DiffieHellmanGroup], createDiffieHellman: [Function: createDiffieHellman], createDiffieHellmanGroup: [Function: createDiffieHellmanGroup], getDiffieHellman: [Function: getDiffieHellman], KeyObject: [class KeyObject], PublicKeyObject: [class PublicKeyObject extends AsymmetricKeyObject], PrivateKeyObject: [class PrivateKeyObject extends AsymmetricKeyObject], SecretKeyObject: [class SecretKeyObject extends KeyObject], generateKey: [Function: generateKey], generateKeyPair: [Function: generateKeyPair], generateKeyPairSync: [Function: generateKeyPairSync], generateKeySync: [Function: generateKeySync], createPrivateKey: [Function: createPrivateKey], createPublicKey: [Function: createPublicKey], createSecretKey: [Function: createSecretKey], getRandomValues: [Function: getRandomValues], randomBytes: [Function: randomBytes], randomFillSync: [Function: randomFillSync], randomFill: [Function: randomFill], randomInt: [Function: randomInt], randomUUID: [Function: randomUUID], generatePrime: [Function: generatePrime], generatePrimeSync: [Function: generatePrimeSync], checkPrime: [Function: checkPrime], checkPrimeSync: [Function: checkPrimeSync], Hash: [Function: Hash], Hmac: [Function: Hmac], createHash: [Function: createHash], createHmac: [Function: createHmac], getHashes: [Function: getHashes], hkdf: [Function: hkdf], hkdfSync: [Function: hkdfSync], pbkdf2: [Function: pbkdf2], pbkdf2Sync: [Function: pbkdf2Sync], getCiphers: [Function: getCiphers], getCurves: [Function: getCurves], secureHeapUsed: [Function: secureHeapUsed], setEngine: [Function: setEngine], timingSafeEqual: undefined, getFips: [Function: getFips], setFips: [Function: setFips], fips: [Getter/Setter], subtle: SubtleCrypto {}, webcrypto: Crypto { subtle: SubtleCrypto {} } }
where it appears that timingSafeEqual is defined as undefined...
The text was updated successfully, but these errors were encountered:
Probably https://github.com/cloudflare/workerd/blame/2646a2a245c44125c22d55ef8200a71b17844a53/src/node/crypto.ts#L13 needs to be
export const timingSafeEqual = crypto.subtle.timingSafeEqual;
For some reason, node crypto and web crypto define it in different places, I remember this from miniflare 2 😅
Sorry, something went wrong.
Fixup timingSafeEqual export for node crypto
7516fa2
Fixes: #2172
jasnell
Successfully merging a pull request may close this issue.
Versions
[email protected]
[email protected]
[email protected]
Issue
According to Misc | Node Crypto, the
timingSafeEqual
function should be supported bynodejs_compat
.However, when logging
import crypto from "node:crypto";
, you seewhere it appears that
timingSafeEqual
is defined asundefined
...The text was updated successfully, but these errors were encountered: