fix(ext/node): stub getFipsCrypto to false (#29485)

This makes Deno act as a non-FIPS compliant build of Node.js to node
modules.
This commit is contained in:
Divy Srivastava 2025-05-29 23:15:03 -07:00 committed by GitHub
parent b2f668550d
commit 342ea09135
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,14 +1,15 @@
// Copyright 2018-2025 the Deno authors. MIT license.
// Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license.
import { notImplemented } from "ext:deno_node/_utils.ts";
export { timingSafeEqual } from "ext:deno_node/internal_binding/_timingSafeEqual.ts";
import { primordials } from "ext:core/mod.js";
const { Error } = primordials;
export function getFipsCrypto(): boolean {
notImplemented("crypto.getFipsCrypto");
return false;
}
export function setFipsCrypto(_fips: boolean) {
notImplemented("crypto.setFipsCrypto");
throw new Error("FIPS mode is not supported in Deno.");
}