jose 4.3.2 → 4.3.6
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/dist/browser/jws/compact/verify.js +1 -5
- package/dist/node/cjs/jws/compact/verify.js +1 -5
- package/dist/node/cjs/runtime/node_key.js +2 -1
- package/dist/node/esm/jws/compact/verify.js +1 -5
- package/dist/node/esm/runtime/node_key.js +2 -1
- package/dist/types/types.d.ts +5 -5
- package/package.json +1 -1
|
@@ -12,11 +12,7 @@ export async function compactVerify(jws, key, options) {
|
|
|
12
12
|
if (length !== 3) {
|
|
13
13
|
throw new JWSInvalid('Invalid Compact JWS');
|
|
14
14
|
}
|
|
15
|
-
const verified = await flattenedVerify({
|
|
16
|
-
payload: (payload || undefined),
|
|
17
|
-
protected: protectedHeader || undefined,
|
|
18
|
-
signature: (signature || undefined),
|
|
19
|
-
}, key, options);
|
|
15
|
+
const verified = await flattenedVerify({ payload, protected: protectedHeader, signature }, key, options);
|
|
20
16
|
const result = { payload: verified.payload, protectedHeader: verified.protectedHeader };
|
|
21
17
|
if (typeof key === 'function') {
|
|
22
18
|
return { ...result, key: verified.key };
|
|
@@ -15,11 +15,7 @@ async function compactVerify(jws, key, options) {
|
|
|
15
15
|
if (length !== 3) {
|
|
16
16
|
throw new errors_js_1.JWSInvalid('Invalid Compact JWS');
|
|
17
17
|
}
|
|
18
|
-
const verified = await (0, verify_js_1.flattenedVerify)({
|
|
19
|
-
payload: (payload || undefined),
|
|
20
|
-
protected: protectedHeader || undefined,
|
|
21
|
-
signature: (signature || undefined),
|
|
22
|
-
}, key, options);
|
|
18
|
+
const verified = await (0, verify_js_1.flattenedVerify)({ payload, protected: protectedHeader, signature }, key, options);
|
|
23
19
|
const result = { payload: verified.payload, protectedHeader: verified.protectedHeader };
|
|
24
20
|
if (typeof key === 'function') {
|
|
25
21
|
return { ...result, key: verified.key };
|
|
@@ -8,7 +8,8 @@ const [major, minor] = process.version
|
|
|
8
8
|
.substr(1)
|
|
9
9
|
.split('.')
|
|
10
10
|
.map((str) => parseInt(str, 10));
|
|
11
|
-
const
|
|
11
|
+
const electron = 'electron' in process.versions;
|
|
12
|
+
const rsaPssParams = !electron && (major >= 17 || (major === 16 && minor >= 9));
|
|
12
13
|
const PSS = {
|
|
13
14
|
padding: crypto_1.constants.RSA_PKCS1_PSS_PADDING,
|
|
14
15
|
saltLength: crypto_1.constants.RSA_PSS_SALTLEN_DIGEST,
|
|
@@ -12,11 +12,7 @@ export async function compactVerify(jws, key, options) {
|
|
|
12
12
|
if (length !== 3) {
|
|
13
13
|
throw new JWSInvalid('Invalid Compact JWS');
|
|
14
14
|
}
|
|
15
|
-
const verified = await flattenedVerify({
|
|
16
|
-
payload: (payload || undefined),
|
|
17
|
-
protected: protectedHeader || undefined,
|
|
18
|
-
signature: (signature || undefined),
|
|
19
|
-
}, key, options);
|
|
15
|
+
const verified = await flattenedVerify({ payload, protected: protectedHeader, signature }, key, options);
|
|
20
16
|
const result = { payload: verified.payload, protectedHeader: verified.protectedHeader };
|
|
21
17
|
if (typeof key === 'function') {
|
|
22
18
|
return { ...result, key: verified.key };
|
|
@@ -6,7 +6,8 @@ const [major, minor] = process.version
|
|
|
6
6
|
.substr(1)
|
|
7
7
|
.split('.')
|
|
8
8
|
.map((str) => parseInt(str, 10));
|
|
9
|
-
const
|
|
9
|
+
const electron = 'electron' in process.versions;
|
|
10
|
+
const rsaPssParams = !electron && (major >= 17 || (major === 16 && minor >= 9));
|
|
10
11
|
const PSS = {
|
|
11
12
|
padding: constants.RSA_PKCS1_PSS_PADDING,
|
|
12
13
|
saltLength: constants.RSA_PSS_SALTLEN_DIGEST,
|
package/dist/types/types.d.ts
CHANGED
|
@@ -235,7 +235,7 @@ export interface FlattenedDecryptResult {
|
|
|
235
235
|
export interface GeneralDecryptResult extends FlattenedDecryptResult {}
|
|
236
236
|
export interface CompactDecryptResult {
|
|
237
237
|
plaintext: Uint8Array
|
|
238
|
-
protectedHeader:
|
|
238
|
+
protectedHeader: CompactJWEHeaderParameters
|
|
239
239
|
}
|
|
240
240
|
export interface FlattenedVerifyResult {
|
|
241
241
|
payload: Uint8Array
|
|
@@ -245,15 +245,15 @@ export interface FlattenedVerifyResult {
|
|
|
245
245
|
export interface GeneralVerifyResult extends FlattenedVerifyResult {}
|
|
246
246
|
export interface CompactVerifyResult {
|
|
247
247
|
payload: Uint8Array
|
|
248
|
-
protectedHeader:
|
|
248
|
+
protectedHeader: CompactJWSHeaderParameters
|
|
249
249
|
}
|
|
250
250
|
export interface JWTVerifyResult {
|
|
251
251
|
payload: JWTPayload
|
|
252
|
-
protectedHeader:
|
|
252
|
+
protectedHeader: JWTHeaderParameters
|
|
253
253
|
}
|
|
254
254
|
export interface JWTDecryptResult {
|
|
255
255
|
payload: JWTPayload
|
|
256
|
-
protectedHeader:
|
|
256
|
+
protectedHeader: CompactJWEHeaderParameters
|
|
257
257
|
}
|
|
258
258
|
export interface ResolvedKey {
|
|
259
259
|
key: KeyLike | Uint8Array
|
|
@@ -262,7 +262,7 @@ export interface CompactJWSHeaderParameters extends JWSHeaderParameters {
|
|
|
262
262
|
alg: string
|
|
263
263
|
}
|
|
264
264
|
export interface JWTHeaderParameters extends CompactJWSHeaderParameters {
|
|
265
|
-
b64
|
|
265
|
+
b64?: never
|
|
266
266
|
}
|
|
267
267
|
export interface CompactJWEHeaderParameters extends JWEHeaderParameters {
|
|
268
268
|
alg: string
|