v1.0.2: handle multiple 0x00 pads
This commit is contained in:
parent
b1f3c7ee90
commit
88f688184a
|
@ -39,8 +39,8 @@ SSH.parse = function (ssh) {
|
|||
var y = els[2].slice(1 + len, 1 + len + len);
|
||||
|
||||
// I don't think EC keys use 0x00 padding, but just in case
|
||||
if (0x00 === x[0]) { x = x.slice(1); }
|
||||
if (0x00 === y[0]) { y = y.slice(1); }
|
||||
while (0x00 === x[0]) { x = x.slice(1); }
|
||||
while (0x00 === y[0]) { y = y.slice(1); }
|
||||
|
||||
result.jwk.x = Enc.bufToUrlBase64(x);
|
||||
result.jwk.y = Enc.bufToUrlBase64(y);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "ssh-to-jwk",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"description": "💯 SSH to JWK in a lightweight, zero-dependency library.",
|
||||
"homepage": "https://git.coolaj86.com/coolaj86/ssh-to-jwk.js",
|
||||
"main": "index.js",
|
||||
|
|
Loading…
Reference in New Issue