mirror of
https://github.com/gchq/CyberChef
synced 2025-12-05 23:53:27 +00:00
Add extraction of actual key from public key file
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user