From ca18776932303924d53b09c5a3c0f5b15ed11746 Mon Sep 17 00:00:00 2001 From: Daniel Hougaard Date: Mon, 7 Jul 2025 22:03:51 +0400 Subject: [PATCH] Update cryptography.ts --- backend/src/lib/crypto/cryptography.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/src/lib/crypto/cryptography.ts b/backend/src/lib/crypto/cryptography.ts index 7e6fe2a80..2bbb9eadd 100644 --- a/backend/src/lib/crypto/cryptography.ts +++ b/backend/src/lib/crypto/cryptography.ts @@ -360,13 +360,15 @@ const cryptographyFactory = () => { } }; - const isFipsModeEnabled = () => { - $checkIsInitialized(); + const isFipsModeEnabled = (options: { skipInitializationCheck?: boolean } = {}) => { + if (!options?.skipInitializationCheck) { + $checkIsInitialized(); + } return $fipsEnabled; }; const verifyFipsLicense = (licenseService: Pick) => { - if (isFipsModeEnabled() && !licenseService.onPremFeatures?.fips) { + if (isFipsModeEnabled({ skipInitializationCheck: true }) && !licenseService.onPremFeatures?.fips) { throw new CryptographyError({ message: "FIPS mode is enabled but your license does not include FIPS support. Please contact support." });