diff --git a/src/core/operations/ParseSSHHostKey.mjs b/src/core/operations/ParseSSHHostKey.mjs index 811f33c8..fe055496 100644 --- a/src/core/operations/ParseSSHHostKey.mjs +++ b/src/core/operations/ParseSSHHostKey.mjs @@ -80,6 +80,13 @@ class ParseSSHHostKey extends Operation { * @returns {byteArray} */ convertKeyToBinary(inputKey, inputFormat) { + const keyPattern = new RegExp(/^(?:[ssh]|[ecdsa-sha2])\S+\s+(\S*)/), + keyMatch = inputKey.match(keyPattern); + + if (keyMatch) { + inputKey = keyMatch[1]; + } + if (inputFormat === "Auto") { inputFormat = this.detectKeyFormat(inputKey); }