feat: update deno-sshsig-mod.ts
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
*.sshsig
|
||||
.idea/
|
||||
# ---> macOS
|
||||
# General
|
||||
|
||||
@@ -285,12 +285,18 @@ export class SshSignatureValue {
|
||||
// crypto.subtle.sign's signature is R and S
|
||||
toRs(): Uint8Array {
|
||||
const writer = new BinaryWriter();
|
||||
if (this.ecSignatureR.byteLength === 0x21) {
|
||||
if (
|
||||
this.ecSignatureR.byteLength === 0x21 ||
|
||||
this.ecSignatureR.byteLength === 0x31
|
||||
) {
|
||||
writer.writeBytes(this.ecSignatureR.slice(1));
|
||||
} else {
|
||||
writer.writeBytes(this.ecSignatureR);
|
||||
}
|
||||
if (this.ecSignatureS.byteLength === 0x21) {
|
||||
if (
|
||||
this.ecSignatureS.byteLength === 0x21 ||
|
||||
this.ecSignatureS.byteLength === 0x31
|
||||
) {
|
||||
writer.writeBytes(this.ecSignatureS.slice(1));
|
||||
} else {
|
||||
writer.writeBytes(this.ecSignatureS);
|
||||
|
||||
Reference in New Issue
Block a user