typo fix: ecdsaAsn1SigToJwtSig => ecdsaJoseSigToAsn1Sig

This commit is contained in:
AJ ONeal 2019-05-06 03:06:49 -06:00
parent e274e5368a
commit a32b942861
1 changed files with 2 additions and 2 deletions

View File

@ -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; }