From bb80cdf5a6157ca1f3a276e12e9faae9a4739cb7 Mon Sep 17 00:00:00 2001
From: dh_ackergaul <dh_ackergaul@dh-software.de>
Date: Di, 23 Jun 2026 11:16:18 +0200
Subject: [PATCH] Update emvheya - 23.6.2026, 11:16:10 [JD]

---
 manufacturer/_furnview/furnplan-web/node_modules/jose/dist/webapi/lib/pbes2kw.js |   42 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/manufacturer/_furnview/furnplan-web/node_modules/jose/dist/webapi/lib/pbes2kw.js b/manufacturer/_furnview/furnplan-web/node_modules/jose/dist/webapi/lib/pbes2kw.js
new file mode 100644
index 0000000..b2cf2f3
--- /dev/null
+++ b/manufacturer/_furnview/furnplan-web/node_modules/jose/dist/webapi/lib/pbes2kw.js
@@ -0,0 +1,42 @@
+import { encode as b64u } from '../util/base64url.js';
+import * as aeskw from './aeskw.js';
+import { checkEncCryptoKey } from './crypto_key.js';
+import { concat, encode } from './buffer_utils.js';
+import { JWEInvalid } from '../util/errors.js';
+function getCryptoKey(key, alg) {
+    if (key instanceof Uint8Array) {
+        return crypto.subtle.importKey('raw', key, 'PBKDF2', false, [
+            'deriveBits',
+        ]);
+    }
+    checkEncCryptoKey(key, alg, 'deriveBits');
+    return key;
+}
+const concatSalt = (alg, p2sInput) => concat(encode(alg), Uint8Array.of(0x00), p2sInput);
+async function deriveKey(p2s, alg, p2c, key) {
+    if (!(p2s instanceof Uint8Array) || p2s.length < 8) {
+        throw new JWEInvalid('PBES2 Salt Input must be 8 or more octets');
+    }
+    if (!Number.isSafeInteger(p2c) || Math.sign(p2c) !== 1) {
+        throw new JWEInvalid('PBES2 Count Input must be a positive integer');
+    }
+    const salt = concatSalt(alg, p2s);
+    const keylen = parseInt(alg.slice(13, 16), 10);
+    const subtleAlg = {
+        hash: `SHA-${alg.slice(8, 11)}`,
+        iterations: p2c,
+        name: 'PBKDF2',
+        salt,
+    };
+    const cryptoKey = await getCryptoKey(key, alg);
+    return new Uint8Array(await crypto.subtle.deriveBits(subtleAlg, cryptoKey, keylen));
+}
+export async function wrap(alg, key, cek, p2c = 2048, p2s = crypto.getRandomValues(new Uint8Array(16))) {
+    const derived = await deriveKey(p2s, alg, p2c, key);
+    const encryptedKey = await aeskw.wrap(alg.slice(-6), derived, cek);
+    return { encryptedKey, p2c, p2s: b64u(p2s) };
+}
+export async function unwrap(alg, key, encryptedKey, p2c, p2s) {
+    const derived = await deriveKey(p2s, alg, p2c, key);
+    return aeskw.unwrap(alg.slice(-6), derived, encryptedKey);
+}

--
Gitblit v1.9.3