Reapply "Add missing admin action files and navigation links"

This reverts commit 4d515bc400.
This commit is contained in:
Simo committed 2026-07-11 20:52:56 +02:00
1 parent 96ed768f14
commit 5b4228261a
338 files changed
+28143 -5948

No files matched your search

+5 -3
View File
@@ -29,7 +29,9 @@ function decryptCbc(payload: string, key: Buffer, serialize = true): string {
value: string;
mac: string;
};
const expected = createHmac("sha256", key).update(json.iv + json.value).digest("hex");
const expected = createHmac("sha256", key)
.update(json.iv + json.value)
.digest("hex");
const a = Buffer.from(expected, "hex");
const b = Buffer.from(json.mac, "hex");
if (a.length !== b.length || !timingSafeEqual(a, b)) {
@@ -59,8 +61,8 @@ function isAlreadyGcm(payload: string, key: Buffer): boolean {
try {
const json = JSON.parse(Buffer.from(payload, "base64").toString("utf8"));
if (!json.tag && !json.mac) return false; // can't determine format
if (json.tag) return true; // has authTag => GCM
return false; // has mac => CBC
if (json.tag) return true; // has authTag => GCM
return false; // has mac => CBC
} catch {
return false;
}