From 85dbc7675589435d9a5369f56508115a30b9caf0 Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Sat, 11 Jan 2025 16:59:59 +0800 Subject: [PATCH] feat: update deno-sshsig-mod.ts --- libraries/deno-sshsig-mod.ts | 37 ++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/libraries/deno-sshsig-mod.ts b/libraries/deno-sshsig-mod.ts index 35e50a9..44527f9 100644 --- a/libraries/deno-sshsig-mod.ts +++ b/libraries/deno-sshsig-mod.ts @@ -1,7 +1,7 @@ import {crypto} from "jsr:@std/crypto"; import {decodeBase64} from "jsr:@std/encoding/base64"; import {encodeBase64Url} from "jsr:@std/encoding/base64url"; -import {decodeHex, encodeHex} from "jsr:@std/encoding/hex"; +import {encodeHex} from "jsr:@std/encoding/hex"; // Reference: // * https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.sshsig @@ -284,7 +284,7 @@ class SshPublicKey { } else if (this.algorithm === "nistp384") { coordinateLength = 384 / 8; } else { - throw `Not supported alrogithm: ${this.algorithm}`; + throw `Not supported algorithm: ${this.algorithm}`; } const x = this.publicKeyPoint.slice(1, coordinateLength + 1); const y = this.publicKeyPoint.slice(coordinateLength + 1, coordinateLength + coordinateLength + 1); @@ -343,6 +343,7 @@ async function digestFile(filename: string, algorithm: string): Promise