From a32b9428615b5c95448d5ca31669a3fd8f7350fe Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 6 May 2019 03:06:49 -0600 Subject: [PATCH] typo fix: ecdsaAsn1SigToJwtSig => ecdsaJoseSigToAsn1Sig --- keyfetch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyfetch.js b/keyfetch.js index 44c5286..94dce86 100644 --- a/keyfetch.js +++ b/keyfetch.js @@ -327,7 +327,7 @@ keyfetch.jwt.verify = function (jwt, opts) { keyfetch.jws = {}; keyfetch.jws.verify = function (jws, pub) { var alg = 'SHA' + jws.header.alg.replace(/[^\d]+/i, ''); - var sig = ecdsaAsn1SigToJwtSig(jws.header, jws.signature); + var sig = ecdsaJoseSigToAsn1Sig(jws.header, jws.signature); return require('crypto') .createVerify(alg) .update(jws.protected + '.' + jws.payload) @@ -347,7 +347,7 @@ keyfetch.verify = function (opts) { }); }; -function ecdsaAsn1SigToJwtSig(header, b64sig) { +function ecdsaJoseSigToAsn1Sig(header, b64sig) { // ECDSA JWT signatures differ from "normal" ECDSA signatures // https://tools.ietf.org/html/rfc7518#section-3.4 if (!/^ES/i.test(header.alg)) { return b64sig; }