mod/ssh-keys-import: drop the version check for ed25519 keys...

... now that we require RouterOS 7.12beta1 anyway.
This commit is contained in:
Christian Hesse 2023-08-18 15:26:18 +02:00
parent 1265caca60
commit 042ff1cfda

View file

@ -20,7 +20,6 @@
:global GetRandom20CharAlNum; :global GetRandom20CharAlNum;
:global LogPrintExit2; :global LogPrintExit2;
:global MkDir; :global MkDir;
:global RequiredRouterOS;
:global WaitForFile; :global WaitForFile;
:if ([ :len $Key ] = 0 || [ :len $User ] = 0) do={ :if ([ :len $Key ] = 0 || [ :len $User ] = 0) do={
@ -32,7 +31,7 @@
} }
:local KeyVal [ :toarray [ $CharacterReplace $Key " " "," ] ]; :local KeyVal [ :toarray [ $CharacterReplace $Key " " "," ] ];
:if (!(([ $RequiredRouterOS $0 "7.12beta1" ] = true && $KeyVal->0 = "ssh-ed25519") || $KeyVal->0 = "ssh-rsa")) do={ :if (!($KeyVal->0 = "ssh-ed25519" || $KeyVal->0 = "ssh-rsa")) do={
$LogPrintExit2 warning $0 ("SSH key of type '" . $KeyVal->0 . "' is not supported.") true; $LogPrintExit2 warning $0 ("SSH key of type '" . $KeyVal->0 . "' is not supported.") true;
} }
@ -63,7 +62,6 @@
:global EitherOr; :global EitherOr;
:global LogPrintExit2; :global LogPrintExit2;
:global ParseKeyValueStore; :global ParseKeyValueStore;
:global RequiredRouterOS;
:global SSHKeysImport; :global SSHKeysImport;
:if ([ :len $FileName ] = 0 || [ :len $User ] = 0) do={ :if ([ :len $FileName ] = 0 || [ :len $User ] = 0) do={
@ -81,7 +79,7 @@
:local Line [ :pick $Keys 0 [ :find $Keys "\n" ] ]; :local Line [ :pick $Keys 0 [ :find $Keys "\n" ] ];
:set Keys [ :pick $Keys ([ :find $Keys "\n" ] + 1) [ :len $Keys ] ]; :set Keys [ :pick $Keys ([ :find $Keys "\n" ] + 1) [ :len $Keys ] ];
:local KeyVal [ :toarray [ $CharacterReplace $Key " " "," ] ]; :local KeyVal [ :toarray [ $CharacterReplace $Key " " "," ] ];
:if (([ $RequiredRouterOS $0 "7.12beta1" ] = true && $KeyVal->0 = "ssh-ed25519") || $KeyVal->0 = "ssh-rsa") do={ :if ($KeyVal->0 = "ssh-ed25519" || $KeyVal->0 = "ssh-rsa") do={
$SSHKeysImport $Line $User; $SSHKeysImport $Line $User;
:set Continue true; :set Continue true;
} }