From f0d719416ec9ca041ea88b8a983b5d899a6aa107 Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Thu, 5 Dec 2019 10:33:59 +0100 Subject: [PATCH] fix: allow PBES2 for the correct JWK `use` values --- lib/jwa/pbes2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jwa/pbes2.js b/lib/jwa/pbes2.js index bd1700fa12..b0c7d40dfa 100644 --- a/lib/jwa/pbes2.js +++ b/lib/jwa/pbes2.js @@ -54,7 +54,7 @@ module.exports = (JWA, JWK) => { if (kwWrap && kwUnwrap) { JWA.keyManagementEncrypt.set(jwaAlg, wrapKey.bind(undefined, keylen, sha, concatSalt.bind(undefined, jwaAlg), kwWrap)) JWA.keyManagementDecrypt.set(jwaAlg, unwrapKey.bind(undefined, keylen, sha, concatSalt.bind(undefined, jwaAlg), kwUnwrap)) - JWK.oct.deriveKey[jwaAlg] = key => key.use === 'sig' || key.use === undefined + JWK.oct.deriveKey[jwaAlg] = key => key.use === 'enc' || key.use === undefined } }) }