conductor-oss 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@conductor-oss/plugin-agent-amp/package.json +1 -1
- package/node_modules/@conductor-oss/plugin-agent-ccr/package.json +1 -1
- package/node_modules/@conductor-oss/plugin-agent-claude-code/package.json +1 -1
- package/node_modules/@conductor-oss/plugin-agent-codex/package.json +1 -1
- package/node_modules/@conductor-oss/plugin-agent-cursor-cli/package.json +1 -1
- package/node_modules/@conductor-oss/plugin-agent-droid/package.json +1 -1
- package/node_modules/@conductor-oss/plugin-agent-gemini/package.json +1 -1
- package/node_modules/@conductor-oss/plugin-agent-github-copilot/package.json +1 -1
- package/node_modules/@conductor-oss/plugin-agent-opencode/package.json +1 -1
- package/node_modules/@conductor-oss/plugin-agent-qwen-code/package.json +1 -1
- package/node_modules/@conductor-oss/plugin-mcp-server/package.json +1 -1
- package/node_modules/@conductor-oss/plugin-notifier-desktop/package.json +1 -1
- package/node_modules/@conductor-oss/plugin-notifier-discord/package.json +1 -1
- package/node_modules/@conductor-oss/plugin-runtime-tmux/package.json +1 -1
- package/node_modules/@conductor-oss/plugin-scm-github/package.json +1 -1
- package/node_modules/@conductor-oss/plugin-terminal-web/package.json +1 -1
- package/node_modules/@conductor-oss/plugin-tracker-github/package.json +1 -1
- package/node_modules/@conductor-oss/plugin-workspace-worktree/package.json +1 -1
- package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +11 -36
- package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +10 -22
- package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +1 -1
- package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +8 -16
- package/node_modules/jose/dist/webapi/jwk/embedded.js +1 -1
- package/node_modules/jose/dist/webapi/jwk/thumbprint.js +2 -2
- package/node_modules/jose/dist/webapi/jwks/local.js +1 -1
- package/node_modules/jose/dist/webapi/jwks/remote.js +2 -2
- package/node_modules/jose/dist/webapi/jws/flattened/sign.js +5 -8
- package/node_modules/jose/dist/webapi/jws/flattened/verify.js +6 -16
- package/node_modules/jose/dist/webapi/jws/general/sign.js +3 -6
- package/node_modules/jose/dist/webapi/jws/general/verify.js +1 -1
- package/node_modules/jose/dist/webapi/jwt/encrypt.js +5 -12
- package/node_modules/jose/dist/webapi/key/import.js +1 -1
- package/node_modules/jose/dist/webapi/lib/aesgcmkw.js +1 -2
- package/node_modules/jose/dist/webapi/lib/check_key_type.js +1 -1
- package/node_modules/jose/dist/webapi/lib/content_encryption.js +217 -0
- package/node_modules/jose/dist/webapi/lib/crypto_key.js +9 -16
- package/node_modules/jose/dist/webapi/lib/ecdhes.js +1 -1
- package/node_modules/jose/dist/webapi/lib/helpers.js +19 -0
- package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +9 -11
- package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +1 -1
- package/node_modules/jose/dist/webapi/lib/key_management.js +186 -0
- package/node_modules/jose/dist/webapi/lib/normalize_key.js +10 -20
- package/node_modules/jose/dist/webapi/lib/rsaes.js +1 -1
- package/node_modules/jose/dist/webapi/lib/signing.js +68 -0
- package/node_modules/jose/dist/webapi/lib/type_checks.js +40 -0
- package/node_modules/jose/dist/webapi/util/decode_jwt.js +1 -1
- package/node_modules/jose/dist/webapi/util/decode_protected_header.js +1 -1
- package/node_modules/jose/package.json +1 -1
- package/package.json +23 -23
- package/web/.next/standalone/packages/web/.next/BUILD_ID +1 -1
- package/web/.next/standalone/packages/web/.next/build-manifest.json +2 -2
- package/web/.next/standalone/packages/web/.next/prerender-manifest.json +3 -3
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found/page/server-reference-manifest.json +7 -7
- package/web/.next/standalone/packages/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.html +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.rsc +3 -3
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/page/server-reference-manifest.json +7 -7
- package/web/.next/standalone/packages/web/.next/server/app/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page/server-reference-manifest.json +7 -7
- package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page/server-reference-manifest.json +7 -7
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/unlock/page/server-reference-manifest.json +7 -7
- package/web/.next/standalone/packages/web/.next/server/app/unlock/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/unlock/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/[root-of-the-server]__000b8c99._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/[root-of-the-server]__29d8d063._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/{[root-of-the-server]__4168e031._.js → [root-of-the-server]__a004344a._.js} +2 -2
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_0e1412de._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/{_1f2460d5._.js → _23584339._.js} +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_69e05fca._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_80efe193._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_b6d31783._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_c0f0e227._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_f36ddaa9._.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/node_modules_@clerk_nextjs_dist_esm_app-router_2d57befe._.js +3 -0
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/{node_modules_@clerk_nextjs_dist_esm_app-router_0a811c5a._.js → node_modules_@clerk_nextjs_dist_esm_app-router_c4893a23._.js} +2 -2
- package/web/.next/standalone/packages/web/.next/server/pages/404.html +1 -1
- package/web/.next/standalone/packages/web/.next/server/pages/500.html +2 -2
- package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.json +8 -8
- package/web/.next/standalone/packages/web/.next/static/chunks/{2e2e8fd2ceca47dc.js → 5887c6e7b41bfd4b.js} +2 -2
- package/web/.next/standalone/packages/web/.next/static/chunks/d60c73bb353f26d3.js +1 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/e6e3c4fe9248dbee.js +1 -0
- package/web/.next/static/chunks/{2e2e8fd2ceca47dc.js → 5887c6e7b41bfd4b.js} +2 -2
- package/web/.next/static/chunks/d60c73bb353f26d3.js +1 -0
- package/web/.next/static/chunks/e6e3c4fe9248dbee.js +1 -0
- package/node_modules/jose/dist/webapi/lib/cek.js +0 -19
- package/node_modules/jose/dist/webapi/lib/check_cek_length.js +0 -7
- package/node_modules/jose/dist/webapi/lib/check_iv_length.js +0 -7
- package/node_modules/jose/dist/webapi/lib/check_key_length.js +0 -8
- package/node_modules/jose/dist/webapi/lib/decrypt.js +0 -106
- package/node_modules/jose/dist/webapi/lib/decrypt_key_management.js +0 -127
- package/node_modules/jose/dist/webapi/lib/digest.js +0 -4
- package/node_modules/jose/dist/webapi/lib/encrypt.js +0 -74
- package/node_modules/jose/dist/webapi/lib/encrypt_key_management.js +0 -92
- package/node_modules/jose/dist/webapi/lib/get_sign_verify_key.js +0 -12
- package/node_modules/jose/dist/webapi/lib/is_disjoint.js +0 -21
- package/node_modules/jose/dist/webapi/lib/is_jwk.js +0 -6
- package/node_modules/jose/dist/webapi/lib/is_object.js +0 -14
- package/node_modules/jose/dist/webapi/lib/iv.js +0 -19
- package/node_modules/jose/dist/webapi/lib/private_symbols.js +0 -1
- package/node_modules/jose/dist/webapi/lib/sign.js +0 -9
- package/node_modules/jose/dist/webapi/lib/subtle_dsa.js +0 -31
- package/node_modules/jose/dist/webapi/lib/verify.js +0 -14
- package/web/.next/standalone/packages/web/.next/server/chunks/ssr/node_modules_@clerk_nextjs_dist_esm_app-router_2c78c2f3._.js +0 -3
- package/web/.next/standalone/packages/web/.next/static/chunks/7fd2a83e9e74f215.js +0 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/91e9e111a2536f92.js +0 -1
- package/web/.next/static/chunks/7fd2a83e9e74f215.js +0 -1
- package/web/.next/static/chunks/91e9e111a2536f92.js +0 -1
- /package/web/.next/standalone/packages/web/.next/static/{E4-NvSai1Ps20r9dtdpps → s8P8PtiSDD1N4unj4vBuY}/_buildManifest.js +0 -0
- /package/web/.next/standalone/packages/web/.next/static/{E4-NvSai1Ps20r9dtdpps → s8P8PtiSDD1N4unj4vBuY}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/packages/web/.next/static/{E4-NvSai1Ps20r9dtdpps → s8P8PtiSDD1N4unj4vBuY}/_ssgManifest.js +0 -0
- /package/web/.next/static/{E4-NvSai1Ps20r9dtdpps → s8P8PtiSDD1N4unj4vBuY}/_buildManifest.js +0 -0
- /package/web/.next/static/{E4-NvSai1Ps20r9dtdpps → s8P8PtiSDD1N4unj4vBuY}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{E4-NvSai1Ps20r9dtdpps → s8P8PtiSDD1N4unj4vBuY}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,54287,e=>{"use strict";var l=e.i(95187);let t=(0,l.createServerReference)("005fe7872401f9ccffa59c79b69e104f509eb27aed",l.callServer,void 0,l.findSourceMapURL,"createOrReadKeylessAction");e.s(["createOrReadKeylessAction",()=>t])},37572,e=>{"use strict";var l=e.i(18566),t=e.i(71645),s=e.i(54287);let a=e=>{var a;let{children:i}=e,r=(null==(a=(0,l.useSelectedLayoutSegments)()[0])?void 0:a.startsWith("/_not-found"))||!1,[n,c]=t.default.useActionState(s.createOrReadKeylessAction,null);return((0,t.useEffect)(()=>{r||t.default.startTransition(()=>{c()})},[r]),t.default.isValidElement(i))?t.default.cloneElement(i,{key:null==n?void 0:n.publishableKey,publishableKey:null==n?void 0:n.publishableKey,__internal_keyless_claimKeylessApplicationUrl:null==n?void 0:n.claimUrl,__internal_keyless_copyInstanceKeysUrl:null==n?void 0:n.apiKeysUrl,__internal_bypassMissingPublishableKey:!0}):i};e.s(["KeylessCreatorOrReader",()=>a])}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,54287,e=>{"use strict";var c=e.i(95187);let r=(0,c.createServerReference)("005fe7872401f9ccffa59c79b69e104f509eb27aed",c.callServer,void 0,c.findSourceMapURL,"createOrReadKeylessAction");e.s(["createOrReadKeylessAction",()=>r])},23151,e=>{"use strict";e.s([],29135),e.i(29135);var c=e.i(95187);let r=(0,c.createServerReference)("401c807e247b16b70c92a3985ae8b9048ecd4baf01",c.callServer,void 0,c.findSourceMapURL,"syncKeylessConfigAction");var t=e.i(54287);let s=(0,c.createServerReference)("0064298eb05a747140b485b42151c5a190017d57ce",c.callServer,void 0,c.findSourceMapURL,"deleteKeylessAction");var i=e.i(93166);e.s(["createOrReadKeylessAction",()=>t.createOrReadKeylessAction,"deleteKeylessAction",()=>s,"detectKeylessEnvDriftAction",()=>i.detectKeylessEnvDriftAction,"syncKeylessConfigAction",()=>r],23151)}]);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { JOSENotSupported } from '../util/errors.js';
|
|
2
|
-
export function cekLength(alg) {
|
|
3
|
-
switch (alg) {
|
|
4
|
-
case 'A128GCM':
|
|
5
|
-
return 128;
|
|
6
|
-
case 'A192GCM':
|
|
7
|
-
return 192;
|
|
8
|
-
case 'A256GCM':
|
|
9
|
-
case 'A128CBC-HS256':
|
|
10
|
-
return 256;
|
|
11
|
-
case 'A192CBC-HS384':
|
|
12
|
-
return 384;
|
|
13
|
-
case 'A256CBC-HS512':
|
|
14
|
-
return 512;
|
|
15
|
-
default:
|
|
16
|
-
throw new JOSENotSupported(`Unsupported JWE Algorithm: ${alg}`);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
export const generateCek = (alg) => crypto.getRandomValues(new Uint8Array(cekLength(alg) >> 3));
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { JWEInvalid } from '../util/errors.js';
|
|
2
|
-
export function checkCekLength(cek, expected) {
|
|
3
|
-
const actual = cek.byteLength << 3;
|
|
4
|
-
if (actual !== expected) {
|
|
5
|
-
throw new JWEInvalid(`Invalid Content Encryption Key length. Expected ${expected} bits, got ${actual} bits`);
|
|
6
|
-
}
|
|
7
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export function checkKeyLength(alg, key) {
|
|
2
|
-
if (alg.startsWith('RS') || alg.startsWith('PS')) {
|
|
3
|
-
const { modulusLength } = key.algorithm;
|
|
4
|
-
if (typeof modulusLength !== 'number' || modulusLength < 2048) {
|
|
5
|
-
throw new TypeError(`${alg} requires key modulusLength to be 2048 bits or larger`);
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { concat, uint64be } from './buffer_utils.js';
|
|
2
|
-
import { checkIvLength } from './check_iv_length.js';
|
|
3
|
-
import { checkCekLength } from './check_cek_length.js';
|
|
4
|
-
import { JOSENotSupported, JWEDecryptionFailed, JWEInvalid } from '../util/errors.js';
|
|
5
|
-
import { checkEncCryptoKey } from './crypto_key.js';
|
|
6
|
-
import { invalidKeyInput } from './invalid_key_input.js';
|
|
7
|
-
import { isCryptoKey } from './is_key_like.js';
|
|
8
|
-
async function timingSafeEqual(a, b) {
|
|
9
|
-
if (!(a instanceof Uint8Array)) {
|
|
10
|
-
throw new TypeError('First argument must be a buffer');
|
|
11
|
-
}
|
|
12
|
-
if (!(b instanceof Uint8Array)) {
|
|
13
|
-
throw new TypeError('Second argument must be a buffer');
|
|
14
|
-
}
|
|
15
|
-
const algorithm = { name: 'HMAC', hash: 'SHA-256' };
|
|
16
|
-
const key = (await crypto.subtle.generateKey(algorithm, false, ['sign']));
|
|
17
|
-
const aHmac = new Uint8Array(await crypto.subtle.sign(algorithm, key, a));
|
|
18
|
-
const bHmac = new Uint8Array(await crypto.subtle.sign(algorithm, key, b));
|
|
19
|
-
let out = 0;
|
|
20
|
-
let i = -1;
|
|
21
|
-
while (++i < 32) {
|
|
22
|
-
out |= aHmac[i] ^ bHmac[i];
|
|
23
|
-
}
|
|
24
|
-
return out === 0;
|
|
25
|
-
}
|
|
26
|
-
async function cbcDecrypt(enc, cek, ciphertext, iv, tag, aad) {
|
|
27
|
-
if (!(cek instanceof Uint8Array)) {
|
|
28
|
-
throw new TypeError(invalidKeyInput(cek, 'Uint8Array'));
|
|
29
|
-
}
|
|
30
|
-
const keySize = parseInt(enc.slice(1, 4), 10);
|
|
31
|
-
const encKey = await crypto.subtle.importKey('raw', cek.subarray(keySize >> 3), 'AES-CBC', false, ['decrypt']);
|
|
32
|
-
const macKey = await crypto.subtle.importKey('raw', cek.subarray(0, keySize >> 3), {
|
|
33
|
-
hash: `SHA-${keySize << 1}`,
|
|
34
|
-
name: 'HMAC',
|
|
35
|
-
}, false, ['sign']);
|
|
36
|
-
const macData = concat(aad, iv, ciphertext, uint64be(aad.length << 3));
|
|
37
|
-
const expectedTag = new Uint8Array((await crypto.subtle.sign('HMAC', macKey, macData)).slice(0, keySize >> 3));
|
|
38
|
-
let macCheckPassed;
|
|
39
|
-
try {
|
|
40
|
-
macCheckPassed = await timingSafeEqual(tag, expectedTag);
|
|
41
|
-
}
|
|
42
|
-
catch {
|
|
43
|
-
}
|
|
44
|
-
if (!macCheckPassed) {
|
|
45
|
-
throw new JWEDecryptionFailed();
|
|
46
|
-
}
|
|
47
|
-
let plaintext;
|
|
48
|
-
try {
|
|
49
|
-
plaintext = new Uint8Array(await crypto.subtle.decrypt({ iv: iv, name: 'AES-CBC' }, encKey, ciphertext));
|
|
50
|
-
}
|
|
51
|
-
catch {
|
|
52
|
-
}
|
|
53
|
-
if (!plaintext) {
|
|
54
|
-
throw new JWEDecryptionFailed();
|
|
55
|
-
}
|
|
56
|
-
return plaintext;
|
|
57
|
-
}
|
|
58
|
-
async function gcmDecrypt(enc, cek, ciphertext, iv, tag, aad) {
|
|
59
|
-
let encKey;
|
|
60
|
-
if (cek instanceof Uint8Array) {
|
|
61
|
-
encKey = await crypto.subtle.importKey('raw', cek, 'AES-GCM', false, ['decrypt']);
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
checkEncCryptoKey(cek, enc, 'decrypt');
|
|
65
|
-
encKey = cek;
|
|
66
|
-
}
|
|
67
|
-
try {
|
|
68
|
-
return new Uint8Array(await crypto.subtle.decrypt({
|
|
69
|
-
additionalData: aad,
|
|
70
|
-
iv: iv,
|
|
71
|
-
name: 'AES-GCM',
|
|
72
|
-
tagLength: 128,
|
|
73
|
-
}, encKey, concat(ciphertext, tag)));
|
|
74
|
-
}
|
|
75
|
-
catch {
|
|
76
|
-
throw new JWEDecryptionFailed();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
export async function decrypt(enc, cek, ciphertext, iv, tag, aad) {
|
|
80
|
-
if (!isCryptoKey(cek) && !(cek instanceof Uint8Array)) {
|
|
81
|
-
throw new TypeError(invalidKeyInput(cek, 'CryptoKey', 'KeyObject', 'Uint8Array', 'JSON Web Key'));
|
|
82
|
-
}
|
|
83
|
-
if (!iv) {
|
|
84
|
-
throw new JWEInvalid('JWE Initialization Vector missing');
|
|
85
|
-
}
|
|
86
|
-
if (!tag) {
|
|
87
|
-
throw new JWEInvalid('JWE Authentication Tag missing');
|
|
88
|
-
}
|
|
89
|
-
checkIvLength(enc, iv);
|
|
90
|
-
switch (enc) {
|
|
91
|
-
case 'A128CBC-HS256':
|
|
92
|
-
case 'A192CBC-HS384':
|
|
93
|
-
case 'A256CBC-HS512':
|
|
94
|
-
if (cek instanceof Uint8Array)
|
|
95
|
-
checkCekLength(cek, parseInt(enc.slice(-3), 10));
|
|
96
|
-
return cbcDecrypt(enc, cek, ciphertext, iv, tag, aad);
|
|
97
|
-
case 'A128GCM':
|
|
98
|
-
case 'A192GCM':
|
|
99
|
-
case 'A256GCM':
|
|
100
|
-
if (cek instanceof Uint8Array)
|
|
101
|
-
checkCekLength(cek, parseInt(enc.slice(1, 4), 10));
|
|
102
|
-
return gcmDecrypt(enc, cek, ciphertext, iv, tag, aad);
|
|
103
|
-
default:
|
|
104
|
-
throw new JOSENotSupported('Unsupported JWE Content Encryption Algorithm');
|
|
105
|
-
}
|
|
106
|
-
}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import * as aeskw from './aeskw.js';
|
|
2
|
-
import * as ecdhes from './ecdhes.js';
|
|
3
|
-
import * as pbes2kw from './pbes2kw.js';
|
|
4
|
-
import * as rsaes from './rsaes.js';
|
|
5
|
-
import { decode as b64u } from '../util/base64url.js';
|
|
6
|
-
import { JOSENotSupported, JWEInvalid } from '../util/errors.js';
|
|
7
|
-
import { cekLength } from '../lib/cek.js';
|
|
8
|
-
import { importJWK } from '../key/import.js';
|
|
9
|
-
import { isObject } from './is_object.js';
|
|
10
|
-
import { unwrap as aesGcmKw } from './aesgcmkw.js';
|
|
11
|
-
import { assertCryptoKey } from './is_key_like.js';
|
|
12
|
-
export async function decryptKeyManagement(alg, key, encryptedKey, joseHeader, options) {
|
|
13
|
-
switch (alg) {
|
|
14
|
-
case 'dir': {
|
|
15
|
-
if (encryptedKey !== undefined)
|
|
16
|
-
throw new JWEInvalid('Encountered unexpected JWE Encrypted Key');
|
|
17
|
-
return key;
|
|
18
|
-
}
|
|
19
|
-
case 'ECDH-ES':
|
|
20
|
-
if (encryptedKey !== undefined)
|
|
21
|
-
throw new JWEInvalid('Encountered unexpected JWE Encrypted Key');
|
|
22
|
-
case 'ECDH-ES+A128KW':
|
|
23
|
-
case 'ECDH-ES+A192KW':
|
|
24
|
-
case 'ECDH-ES+A256KW': {
|
|
25
|
-
if (!isObject(joseHeader.epk))
|
|
26
|
-
throw new JWEInvalid(`JOSE Header "epk" (Ephemeral Public Key) missing or invalid`);
|
|
27
|
-
assertCryptoKey(key);
|
|
28
|
-
if (!ecdhes.allowed(key))
|
|
29
|
-
throw new JOSENotSupported('ECDH with the provided key is not allowed or not supported by your javascript runtime');
|
|
30
|
-
const epk = await importJWK(joseHeader.epk, alg);
|
|
31
|
-
assertCryptoKey(epk);
|
|
32
|
-
let partyUInfo;
|
|
33
|
-
let partyVInfo;
|
|
34
|
-
if (joseHeader.apu !== undefined) {
|
|
35
|
-
if (typeof joseHeader.apu !== 'string')
|
|
36
|
-
throw new JWEInvalid(`JOSE Header "apu" (Agreement PartyUInfo) invalid`);
|
|
37
|
-
try {
|
|
38
|
-
partyUInfo = b64u(joseHeader.apu);
|
|
39
|
-
}
|
|
40
|
-
catch {
|
|
41
|
-
throw new JWEInvalid('Failed to base64url decode the apu');
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
if (joseHeader.apv !== undefined) {
|
|
45
|
-
if (typeof joseHeader.apv !== 'string')
|
|
46
|
-
throw new JWEInvalid(`JOSE Header "apv" (Agreement PartyVInfo) invalid`);
|
|
47
|
-
try {
|
|
48
|
-
partyVInfo = b64u(joseHeader.apv);
|
|
49
|
-
}
|
|
50
|
-
catch {
|
|
51
|
-
throw new JWEInvalid('Failed to base64url decode the apv');
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
const sharedSecret = await ecdhes.deriveKey(epk, key, alg === 'ECDH-ES' ? joseHeader.enc : alg, alg === 'ECDH-ES' ? cekLength(joseHeader.enc) : parseInt(alg.slice(-5, -2), 10), partyUInfo, partyVInfo);
|
|
55
|
-
if (alg === 'ECDH-ES')
|
|
56
|
-
return sharedSecret;
|
|
57
|
-
if (encryptedKey === undefined)
|
|
58
|
-
throw new JWEInvalid('JWE Encrypted Key missing');
|
|
59
|
-
return aeskw.unwrap(alg.slice(-6), sharedSecret, encryptedKey);
|
|
60
|
-
}
|
|
61
|
-
case 'RSA-OAEP':
|
|
62
|
-
case 'RSA-OAEP-256':
|
|
63
|
-
case 'RSA-OAEP-384':
|
|
64
|
-
case 'RSA-OAEP-512': {
|
|
65
|
-
if (encryptedKey === undefined)
|
|
66
|
-
throw new JWEInvalid('JWE Encrypted Key missing');
|
|
67
|
-
assertCryptoKey(key);
|
|
68
|
-
return rsaes.decrypt(alg, key, encryptedKey);
|
|
69
|
-
}
|
|
70
|
-
case 'PBES2-HS256+A128KW':
|
|
71
|
-
case 'PBES2-HS384+A192KW':
|
|
72
|
-
case 'PBES2-HS512+A256KW': {
|
|
73
|
-
if (encryptedKey === undefined)
|
|
74
|
-
throw new JWEInvalid('JWE Encrypted Key missing');
|
|
75
|
-
if (typeof joseHeader.p2c !== 'number')
|
|
76
|
-
throw new JWEInvalid(`JOSE Header "p2c" (PBES2 Count) missing or invalid`);
|
|
77
|
-
const p2cLimit = options?.maxPBES2Count || 10_000;
|
|
78
|
-
if (joseHeader.p2c > p2cLimit)
|
|
79
|
-
throw new JWEInvalid(`JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds`);
|
|
80
|
-
if (typeof joseHeader.p2s !== 'string')
|
|
81
|
-
throw new JWEInvalid(`JOSE Header "p2s" (PBES2 Salt) missing or invalid`);
|
|
82
|
-
let p2s;
|
|
83
|
-
try {
|
|
84
|
-
p2s = b64u(joseHeader.p2s);
|
|
85
|
-
}
|
|
86
|
-
catch {
|
|
87
|
-
throw new JWEInvalid('Failed to base64url decode the p2s');
|
|
88
|
-
}
|
|
89
|
-
return pbes2kw.unwrap(alg, key, encryptedKey, joseHeader.p2c, p2s);
|
|
90
|
-
}
|
|
91
|
-
case 'A128KW':
|
|
92
|
-
case 'A192KW':
|
|
93
|
-
case 'A256KW': {
|
|
94
|
-
if (encryptedKey === undefined)
|
|
95
|
-
throw new JWEInvalid('JWE Encrypted Key missing');
|
|
96
|
-
return aeskw.unwrap(alg, key, encryptedKey);
|
|
97
|
-
}
|
|
98
|
-
case 'A128GCMKW':
|
|
99
|
-
case 'A192GCMKW':
|
|
100
|
-
case 'A256GCMKW': {
|
|
101
|
-
if (encryptedKey === undefined)
|
|
102
|
-
throw new JWEInvalid('JWE Encrypted Key missing');
|
|
103
|
-
if (typeof joseHeader.iv !== 'string')
|
|
104
|
-
throw new JWEInvalid(`JOSE Header "iv" (Initialization Vector) missing or invalid`);
|
|
105
|
-
if (typeof joseHeader.tag !== 'string')
|
|
106
|
-
throw new JWEInvalid(`JOSE Header "tag" (Authentication Tag) missing or invalid`);
|
|
107
|
-
let iv;
|
|
108
|
-
try {
|
|
109
|
-
iv = b64u(joseHeader.iv);
|
|
110
|
-
}
|
|
111
|
-
catch {
|
|
112
|
-
throw new JWEInvalid('Failed to base64url decode the iv');
|
|
113
|
-
}
|
|
114
|
-
let tag;
|
|
115
|
-
try {
|
|
116
|
-
tag = b64u(joseHeader.tag);
|
|
117
|
-
}
|
|
118
|
-
catch {
|
|
119
|
-
throw new JWEInvalid('Failed to base64url decode the tag');
|
|
120
|
-
}
|
|
121
|
-
return aesGcmKw(alg, key, encryptedKey, iv, tag);
|
|
122
|
-
}
|
|
123
|
-
default: {
|
|
124
|
-
throw new JOSENotSupported('Invalid or unsupported "alg" (JWE Algorithm) header value');
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { concat, uint64be } from './buffer_utils.js';
|
|
2
|
-
import { checkIvLength } from './check_iv_length.js';
|
|
3
|
-
import { checkCekLength } from './check_cek_length.js';
|
|
4
|
-
import { checkEncCryptoKey } from './crypto_key.js';
|
|
5
|
-
import { invalidKeyInput } from './invalid_key_input.js';
|
|
6
|
-
import { generateIv } from './iv.js';
|
|
7
|
-
import { JOSENotSupported } from '../util/errors.js';
|
|
8
|
-
import { isCryptoKey } from './is_key_like.js';
|
|
9
|
-
async function cbcEncrypt(enc, plaintext, cek, iv, aad) {
|
|
10
|
-
if (!(cek instanceof Uint8Array)) {
|
|
11
|
-
throw new TypeError(invalidKeyInput(cek, 'Uint8Array'));
|
|
12
|
-
}
|
|
13
|
-
const keySize = parseInt(enc.slice(1, 4), 10);
|
|
14
|
-
const encKey = await crypto.subtle.importKey('raw', cek.subarray(keySize >> 3), 'AES-CBC', false, ['encrypt']);
|
|
15
|
-
const macKey = await crypto.subtle.importKey('raw', cek.subarray(0, keySize >> 3), {
|
|
16
|
-
hash: `SHA-${keySize << 1}`,
|
|
17
|
-
name: 'HMAC',
|
|
18
|
-
}, false, ['sign']);
|
|
19
|
-
const ciphertext = new Uint8Array(await crypto.subtle.encrypt({
|
|
20
|
-
iv: iv,
|
|
21
|
-
name: 'AES-CBC',
|
|
22
|
-
}, encKey, plaintext));
|
|
23
|
-
const macData = concat(aad, iv, ciphertext, uint64be(aad.length << 3));
|
|
24
|
-
const tag = new Uint8Array((await crypto.subtle.sign('HMAC', macKey, macData)).slice(0, keySize >> 3));
|
|
25
|
-
return { ciphertext, tag, iv };
|
|
26
|
-
}
|
|
27
|
-
async function gcmEncrypt(enc, plaintext, cek, iv, aad) {
|
|
28
|
-
let encKey;
|
|
29
|
-
if (cek instanceof Uint8Array) {
|
|
30
|
-
encKey = await crypto.subtle.importKey('raw', cek, 'AES-GCM', false, ['encrypt']);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
checkEncCryptoKey(cek, enc, 'encrypt');
|
|
34
|
-
encKey = cek;
|
|
35
|
-
}
|
|
36
|
-
const encrypted = new Uint8Array(await crypto.subtle.encrypt({
|
|
37
|
-
additionalData: aad,
|
|
38
|
-
iv: iv,
|
|
39
|
-
name: 'AES-GCM',
|
|
40
|
-
tagLength: 128,
|
|
41
|
-
}, encKey, plaintext));
|
|
42
|
-
const tag = encrypted.slice(-16);
|
|
43
|
-
const ciphertext = encrypted.slice(0, -16);
|
|
44
|
-
return { ciphertext, tag, iv };
|
|
45
|
-
}
|
|
46
|
-
export async function encrypt(enc, plaintext, cek, iv, aad) {
|
|
47
|
-
if (!isCryptoKey(cek) && !(cek instanceof Uint8Array)) {
|
|
48
|
-
throw new TypeError(invalidKeyInput(cek, 'CryptoKey', 'KeyObject', 'Uint8Array', 'JSON Web Key'));
|
|
49
|
-
}
|
|
50
|
-
if (iv) {
|
|
51
|
-
checkIvLength(enc, iv);
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
iv = generateIv(enc);
|
|
55
|
-
}
|
|
56
|
-
switch (enc) {
|
|
57
|
-
case 'A128CBC-HS256':
|
|
58
|
-
case 'A192CBC-HS384':
|
|
59
|
-
case 'A256CBC-HS512':
|
|
60
|
-
if (cek instanceof Uint8Array) {
|
|
61
|
-
checkCekLength(cek, parseInt(enc.slice(-3), 10));
|
|
62
|
-
}
|
|
63
|
-
return cbcEncrypt(enc, plaintext, cek, iv, aad);
|
|
64
|
-
case 'A128GCM':
|
|
65
|
-
case 'A192GCM':
|
|
66
|
-
case 'A256GCM':
|
|
67
|
-
if (cek instanceof Uint8Array) {
|
|
68
|
-
checkCekLength(cek, parseInt(enc.slice(1, 4), 10));
|
|
69
|
-
}
|
|
70
|
-
return gcmEncrypt(enc, plaintext, cek, iv, aad);
|
|
71
|
-
default:
|
|
72
|
-
throw new JOSENotSupported('Unsupported JWE Content Encryption Algorithm');
|
|
73
|
-
}
|
|
74
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import * as aeskw from './aeskw.js';
|
|
2
|
-
import * as ecdhes from './ecdhes.js';
|
|
3
|
-
import * as pbes2kw from './pbes2kw.js';
|
|
4
|
-
import * as rsaes from './rsaes.js';
|
|
5
|
-
import { encode as b64u } from '../util/base64url.js';
|
|
6
|
-
import { normalizeKey } from './normalize_key.js';
|
|
7
|
-
import { generateCek, cekLength } from '../lib/cek.js';
|
|
8
|
-
import { JOSENotSupported } from '../util/errors.js';
|
|
9
|
-
import { exportJWK } from '../key/export.js';
|
|
10
|
-
import { wrap as aesGcmKw } from './aesgcmkw.js';
|
|
11
|
-
import { assertCryptoKey } from './is_key_like.js';
|
|
12
|
-
export async function encryptKeyManagement(alg, enc, key, providedCek, providedParameters = {}) {
|
|
13
|
-
let encryptedKey;
|
|
14
|
-
let parameters;
|
|
15
|
-
let cek;
|
|
16
|
-
switch (alg) {
|
|
17
|
-
case 'dir': {
|
|
18
|
-
cek = key;
|
|
19
|
-
break;
|
|
20
|
-
}
|
|
21
|
-
case 'ECDH-ES':
|
|
22
|
-
case 'ECDH-ES+A128KW':
|
|
23
|
-
case 'ECDH-ES+A192KW':
|
|
24
|
-
case 'ECDH-ES+A256KW': {
|
|
25
|
-
assertCryptoKey(key);
|
|
26
|
-
if (!ecdhes.allowed(key)) {
|
|
27
|
-
throw new JOSENotSupported('ECDH with the provided key is not allowed or not supported by your javascript runtime');
|
|
28
|
-
}
|
|
29
|
-
const { apu, apv } = providedParameters;
|
|
30
|
-
let ephemeralKey;
|
|
31
|
-
if (providedParameters.epk) {
|
|
32
|
-
ephemeralKey = (await normalizeKey(providedParameters.epk, alg));
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
ephemeralKey = (await crypto.subtle.generateKey(key.algorithm, true, ['deriveBits'])).privateKey;
|
|
36
|
-
}
|
|
37
|
-
const { x, y, crv, kty } = await exportJWK(ephemeralKey);
|
|
38
|
-
const sharedSecret = await ecdhes.deriveKey(key, ephemeralKey, alg === 'ECDH-ES' ? enc : alg, alg === 'ECDH-ES' ? cekLength(enc) : parseInt(alg.slice(-5, -2), 10), apu, apv);
|
|
39
|
-
parameters = { epk: { x, crv, kty } };
|
|
40
|
-
if (kty === 'EC')
|
|
41
|
-
parameters.epk.y = y;
|
|
42
|
-
if (apu)
|
|
43
|
-
parameters.apu = b64u(apu);
|
|
44
|
-
if (apv)
|
|
45
|
-
parameters.apv = b64u(apv);
|
|
46
|
-
if (alg === 'ECDH-ES') {
|
|
47
|
-
cek = sharedSecret;
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
cek = providedCek || generateCek(enc);
|
|
51
|
-
const kwAlg = alg.slice(-6);
|
|
52
|
-
encryptedKey = await aeskw.wrap(kwAlg, sharedSecret, cek);
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
case 'RSA-OAEP':
|
|
56
|
-
case 'RSA-OAEP-256':
|
|
57
|
-
case 'RSA-OAEP-384':
|
|
58
|
-
case 'RSA-OAEP-512': {
|
|
59
|
-
cek = providedCek || generateCek(enc);
|
|
60
|
-
assertCryptoKey(key);
|
|
61
|
-
encryptedKey = await rsaes.encrypt(alg, key, cek);
|
|
62
|
-
break;
|
|
63
|
-
}
|
|
64
|
-
case 'PBES2-HS256+A128KW':
|
|
65
|
-
case 'PBES2-HS384+A192KW':
|
|
66
|
-
case 'PBES2-HS512+A256KW': {
|
|
67
|
-
cek = providedCek || generateCek(enc);
|
|
68
|
-
const { p2c, p2s } = providedParameters;
|
|
69
|
-
({ encryptedKey, ...parameters } = await pbes2kw.wrap(alg, key, cek, p2c, p2s));
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
case 'A128KW':
|
|
73
|
-
case 'A192KW':
|
|
74
|
-
case 'A256KW': {
|
|
75
|
-
cek = providedCek || generateCek(enc);
|
|
76
|
-
encryptedKey = await aeskw.wrap(alg, key, cek);
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
case 'A128GCMKW':
|
|
80
|
-
case 'A192GCMKW':
|
|
81
|
-
case 'A256GCMKW': {
|
|
82
|
-
cek = providedCek || generateCek(enc);
|
|
83
|
-
const { iv } = providedParameters;
|
|
84
|
-
({ encryptedKey, ...parameters } = await aesGcmKw(alg, key, cek, iv));
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
|
-
default: {
|
|
88
|
-
throw new JOSENotSupported('Invalid or unsupported "alg" (JWE Algorithm) header value');
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
return { cek, encryptedKey, parameters };
|
|
92
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { checkSigCryptoKey } from './crypto_key.js';
|
|
2
|
-
import { invalidKeyInput } from './invalid_key_input.js';
|
|
3
|
-
export async function getSigKey(alg, key, usage) {
|
|
4
|
-
if (key instanceof Uint8Array) {
|
|
5
|
-
if (!alg.startsWith('HS')) {
|
|
6
|
-
throw new TypeError(invalidKeyInput(key, 'CryptoKey', 'KeyObject', 'JSON Web Key'));
|
|
7
|
-
}
|
|
8
|
-
return crypto.subtle.importKey('raw', key, { hash: `SHA-${alg.slice(-3)}`, name: 'HMAC' }, false, [usage]);
|
|
9
|
-
}
|
|
10
|
-
checkSigCryptoKey(key, alg, usage);
|
|
11
|
-
return key;
|
|
12
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export function isDisjoint(...headers) {
|
|
2
|
-
const sources = headers.filter(Boolean);
|
|
3
|
-
if (sources.length === 0 || sources.length === 1) {
|
|
4
|
-
return true;
|
|
5
|
-
}
|
|
6
|
-
let acc;
|
|
7
|
-
for (const header of sources) {
|
|
8
|
-
const parameters = Object.keys(header);
|
|
9
|
-
if (!acc || acc.size === 0) {
|
|
10
|
-
acc = new Set(parameters);
|
|
11
|
-
continue;
|
|
12
|
-
}
|
|
13
|
-
for (const parameter of parameters) {
|
|
14
|
-
if (acc.has(parameter)) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
acc.add(parameter);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return true;
|
|
21
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { isObject } from './is_object.js';
|
|
2
|
-
export const isJWK = (key) => isObject(key) && typeof key.kty === 'string';
|
|
3
|
-
export const isPrivateJWK = (key) => key.kty !== 'oct' &&
|
|
4
|
-
((key.kty === 'AKP' && typeof key.priv === 'string') || typeof key.d === 'string');
|
|
5
|
-
export const isPublicJWK = (key) => key.kty !== 'oct' && key.d === undefined && key.priv === undefined;
|
|
6
|
-
export const isSecretJWK = (key) => key.kty === 'oct' && typeof key.k === 'string';
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const isObjectLike = (value) => typeof value === 'object' && value !== null;
|
|
2
|
-
export function isObject(input) {
|
|
3
|
-
if (!isObjectLike(input) || Object.prototype.toString.call(input) !== '[object Object]') {
|
|
4
|
-
return false;
|
|
5
|
-
}
|
|
6
|
-
if (Object.getPrototypeOf(input) === null) {
|
|
7
|
-
return true;
|
|
8
|
-
}
|
|
9
|
-
let proto = input;
|
|
10
|
-
while (Object.getPrototypeOf(proto) !== null) {
|
|
11
|
-
proto = Object.getPrototypeOf(proto);
|
|
12
|
-
}
|
|
13
|
-
return Object.getPrototypeOf(input) === proto;
|
|
14
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { JOSENotSupported } from '../util/errors.js';
|
|
2
|
-
export function bitLength(alg) {
|
|
3
|
-
switch (alg) {
|
|
4
|
-
case 'A128GCM':
|
|
5
|
-
case 'A128GCMKW':
|
|
6
|
-
case 'A192GCM':
|
|
7
|
-
case 'A192GCMKW':
|
|
8
|
-
case 'A256GCM':
|
|
9
|
-
case 'A256GCMKW':
|
|
10
|
-
return 96;
|
|
11
|
-
case 'A128CBC-HS256':
|
|
12
|
-
case 'A192CBC-HS384':
|
|
13
|
-
case 'A256CBC-HS512':
|
|
14
|
-
return 128;
|
|
15
|
-
default:
|
|
16
|
-
throw new JOSENotSupported(`Unsupported JWE Algorithm: ${alg}`);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
export const generateIv = (alg) => crypto.getRandomValues(new Uint8Array(bitLength(alg) >> 3));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const unprotected = Symbol();
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { subtleAlgorithm } from './subtle_dsa.js';
|
|
2
|
-
import { checkKeyLength } from './check_key_length.js';
|
|
3
|
-
import { getSigKey } from './get_sign_verify_key.js';
|
|
4
|
-
export async function sign(alg, key, data) {
|
|
5
|
-
const cryptoKey = await getSigKey(alg, key, 'sign');
|
|
6
|
-
checkKeyLength(alg, cryptoKey);
|
|
7
|
-
const signature = await crypto.subtle.sign(subtleAlgorithm(alg, cryptoKey.algorithm), cryptoKey, data);
|
|
8
|
-
return new Uint8Array(signature);
|
|
9
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { JOSENotSupported } from '../util/errors.js';
|
|
2
|
-
export function subtleAlgorithm(alg, algorithm) {
|
|
3
|
-
const hash = `SHA-${alg.slice(-3)}`;
|
|
4
|
-
switch (alg) {
|
|
5
|
-
case 'HS256':
|
|
6
|
-
case 'HS384':
|
|
7
|
-
case 'HS512':
|
|
8
|
-
return { hash, name: 'HMAC' };
|
|
9
|
-
case 'PS256':
|
|
10
|
-
case 'PS384':
|
|
11
|
-
case 'PS512':
|
|
12
|
-
return { hash, name: 'RSA-PSS', saltLength: parseInt(alg.slice(-3), 10) >> 3 };
|
|
13
|
-
case 'RS256':
|
|
14
|
-
case 'RS384':
|
|
15
|
-
case 'RS512':
|
|
16
|
-
return { hash, name: 'RSASSA-PKCS1-v1_5' };
|
|
17
|
-
case 'ES256':
|
|
18
|
-
case 'ES384':
|
|
19
|
-
case 'ES512':
|
|
20
|
-
return { hash, name: 'ECDSA', namedCurve: algorithm.namedCurve };
|
|
21
|
-
case 'Ed25519':
|
|
22
|
-
case 'EdDSA':
|
|
23
|
-
return { name: 'Ed25519' };
|
|
24
|
-
case 'ML-DSA-44':
|
|
25
|
-
case 'ML-DSA-65':
|
|
26
|
-
case 'ML-DSA-87':
|
|
27
|
-
return { name: alg };
|
|
28
|
-
default:
|
|
29
|
-
throw new JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { subtleAlgorithm } from './subtle_dsa.js';
|
|
2
|
-
import { checkKeyLength } from './check_key_length.js';
|
|
3
|
-
import { getSigKey } from './get_sign_verify_key.js';
|
|
4
|
-
export async function verify(alg, key, signature, data) {
|
|
5
|
-
const cryptoKey = await getSigKey(alg, key, 'verify');
|
|
6
|
-
checkKeyLength(alg, cryptoKey);
|
|
7
|
-
const algorithm = subtleAlgorithm(alg, cryptoKey.algorithm);
|
|
8
|
-
try {
|
|
9
|
-
return await crypto.subtle.verify(algorithm, cryptoKey, signature, data);
|
|
10
|
-
}
|
|
11
|
-
catch {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[23196,a=>{"use strict";var b=a.i(5050);let c=(0,b.createServerReference)("001d1c527b43c036fe6e65dc233998e2767c372c93",b.callServer,void 0,b.findSourceMapURL,"createOrReadKeylessAction");a.s(["createOrReadKeylessAction",()=>c])},37247,a=>{"use strict";a.s([],67203),a.i(67203);var b=a.i(5050);let c=(0,b.createServerReference)("40a74aa32c96f32d69487b5eccbd524ecba417b6ff",b.callServer,void 0,b.findSourceMapURL,"syncKeylessConfigAction");var d=a.i(23196);let e=(0,b.createServerReference)("000d70dd7b4fc3c5afeb2476673775a81aa7b4234c",b.callServer,void 0,b.findSourceMapURL,"deleteKeylessAction");var f=a.i(18825);a.s(["createOrReadKeylessAction",()=>d.createOrReadKeylessAction,"deleteKeylessAction",()=>e,"detectKeylessEnvDriftAction",()=>f.detectKeylessEnvDriftAction,"syncKeylessConfigAction",()=>c],37247)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=node_modules_%40clerk_nextjs_dist_esm_app-router_2c78c2f3._.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,60589,e=>{"use strict";var c=e.i(95187);let r=(0,c.createServerReference)("001d1c527b43c036fe6e65dc233998e2767c372c93",c.callServer,void 0,c.findSourceMapURL,"createOrReadKeylessAction");e.s(["createOrReadKeylessAction",()=>r])},23151,e=>{"use strict";e.s([],29135),e.i(29135);var c=e.i(95187);let r=(0,c.createServerReference)("40a74aa32c96f32d69487b5eccbd524ecba417b6ff",c.callServer,void 0,c.findSourceMapURL,"syncKeylessConfigAction");var t=e.i(60589);let s=(0,c.createServerReference)("000d70dd7b4fc3c5afeb2476673775a81aa7b4234c",c.callServer,void 0,c.findSourceMapURL,"deleteKeylessAction");var a=e.i(65509);e.s(["createOrReadKeylessAction",()=>t.createOrReadKeylessAction,"deleteKeylessAction",()=>s,"detectKeylessEnvDriftAction",()=>a.detectKeylessEnvDriftAction,"syncKeylessConfigAction",()=>r],23151)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,60589,e=>{"use strict";var l=e.i(95187);let t=(0,l.createServerReference)("001d1c527b43c036fe6e65dc233998e2767c372c93",l.callServer,void 0,l.findSourceMapURL,"createOrReadKeylessAction");e.s(["createOrReadKeylessAction",()=>t])},37572,e=>{"use strict";var l=e.i(18566),t=e.i(71645),s=e.i(60589);let i=e=>{var i;let{children:a}=e,r=(null==(i=(0,l.useSelectedLayoutSegments)()[0])?void 0:i.startsWith("/_not-found"))||!1,[n,c]=t.default.useActionState(s.createOrReadKeylessAction,null);return((0,t.useEffect)(()=>{r||t.default.startTransition(()=>{c()})},[r]),t.default.isValidElement(a))?t.default.cloneElement(a,{key:null==n?void 0:n.publishableKey,publishableKey:null==n?void 0:n.publishableKey,__internal_keyless_claimKeylessApplicationUrl:null==n?void 0:n.claimUrl,__internal_keyless_copyInstanceKeysUrl:null==n?void 0:n.apiKeysUrl,__internal_bypassMissingPublishableKey:!0}):a};e.s(["KeylessCreatorOrReader",()=>i])}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,60589,e=>{"use strict";var c=e.i(95187);let r=(0,c.createServerReference)("001d1c527b43c036fe6e65dc233998e2767c372c93",c.callServer,void 0,c.findSourceMapURL,"createOrReadKeylessAction");e.s(["createOrReadKeylessAction",()=>r])},23151,e=>{"use strict";e.s([],29135),e.i(29135);var c=e.i(95187);let r=(0,c.createServerReference)("40a74aa32c96f32d69487b5eccbd524ecba417b6ff",c.callServer,void 0,c.findSourceMapURL,"syncKeylessConfigAction");var t=e.i(60589);let s=(0,c.createServerReference)("000d70dd7b4fc3c5afeb2476673775a81aa7b4234c",c.callServer,void 0,c.findSourceMapURL,"deleteKeylessAction");var a=e.i(65509);e.s(["createOrReadKeylessAction",()=>t.createOrReadKeylessAction,"deleteKeylessAction",()=>s,"detectKeylessEnvDriftAction",()=>a.detectKeylessEnvDriftAction,"syncKeylessConfigAction",()=>r],23151)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,60589,e=>{"use strict";var l=e.i(95187);let t=(0,l.createServerReference)("001d1c527b43c036fe6e65dc233998e2767c372c93",l.callServer,void 0,l.findSourceMapURL,"createOrReadKeylessAction");e.s(["createOrReadKeylessAction",()=>t])},37572,e=>{"use strict";var l=e.i(18566),t=e.i(71645),s=e.i(60589);let i=e=>{var i;let{children:a}=e,r=(null==(i=(0,l.useSelectedLayoutSegments)()[0])?void 0:i.startsWith("/_not-found"))||!1,[n,c]=t.default.useActionState(s.createOrReadKeylessAction,null);return((0,t.useEffect)(()=>{r||t.default.startTransition(()=>{c()})},[r]),t.default.isValidElement(a))?t.default.cloneElement(a,{key:null==n?void 0:n.publishableKey,publishableKey:null==n?void 0:n.publishableKey,__internal_keyless_claimKeylessApplicationUrl:null==n?void 0:n.claimUrl,__internal_keyless_copyInstanceKeysUrl:null==n?void 0:n.apiKeysUrl,__internal_bypassMissingPublishableKey:!0}):a};e.s(["KeylessCreatorOrReader",()=>i])}]);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|