Skip to content

🐛 [bug] crypto.timingSafeEqual === undefined #2172

Closed
@helloimalastair

Description

@helloimalastair

Versions

[email protected]
[email protected]
[email protected]

Issue

According to Misc | Node Crypto, the timingSafeEqual function should be supported by nodejs_compat.

However, when logging import crypto from "node:crypto";, you see

{
	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...

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions