Add extraction of actual key from public key file
This commit is contained in:
1 parent
59cdd259ac
commit
d56ff0825a
1 file changed
+7
@@ -80,6 +80,13 @@ class ParseSSHHostKey extends Operation {
|
|||||||
* @returns {byteArray}
|
* @returns {byteArray}
|
||||||
*/
|
*/
|
||||||
convertKeyToBinary(inputKey, inputFormat) {
|
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") {
|
if (inputFormat === "Auto") {
|
||||||
inputFormat = this.detectKeyFormat(inputKey);
|
inputFormat = this.detectKeyFormat(inputKey);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user