From b22f957124c5c5e55b1b386610a1d064c4731cbf Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 6 May 2019 03:07:30 -0600 Subject: [PATCH] update name: convertIfEcdsa => ecdsaAsn1SigToJoseSig --- keypairs.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keypairs.js b/keypairs.js index 1bbebb4..2ec87ba 100644 --- a/keypairs.js +++ b/keypairs.js @@ -240,7 +240,7 @@ Keypairs.signJws = function (opts) { if ('EC' === opts.jwk.kty) { // ECDSA JWT signatures differ from "normal" ECDSA signatures // https://tools.ietf.org/html/rfc7518#section-3.4 - binsig = convertIfEcdsa(binsig); + binsig = ecdsaAsn1SigToJoseSig(binsig); } var sig = binsig.toString('base64') @@ -257,7 +257,7 @@ Keypairs.signJws = function (opts) { }; } - function convertIfEcdsa(binsig) { + function ecdsaAsn1SigToJoseSig(binsig) { // should have asn1 sequence header of 0x30 if (0x30 !== binsig[0]) { throw new Error("Impossible EC SHA head marker"); } var index = 2; // first ecdsa "R" header byte