feat: fips inside support (checkpoint)

This commit is contained in:
Daniel Hougaard
2025-07-06 15:44:07 +04:00
parent 83f0a500bd
commit 9aa3c14bf2
121 changed files with 1766 additions and 1277 deletions
+2 -2
View File
@@ -1,11 +1,11 @@
import crypto from "node:crypto";
import { crypto } from "@app/lib/crypto/cryptography";
const TURN_TOKEN_TTL = 24 * 60 * 60 * 1000; // 24 hours in milliseconds
export const getTurnCredentials = (id: string, authSecret: string, ttl = TURN_TOKEN_TTL) => {
const timestamp = Math.floor((Date.now() + ttl) / 1000);
const username = `${timestamp}:${id}`;
const hmac = crypto.createHmac("sha1", authSecret);
const hmac = crypto.rawCrypto.createHmac("sha1", authSecret);
hmac.update(username);
const password = hmac.digest("base64");