aboutsummaryrefslogtreecommitdiffstats
path: root/mod/ssh-keys-import.rsc
diff options
context:
space:
mode:
Diffstat (limited to 'mod/ssh-keys-import.rsc')
-rw-r--r--mod/ssh-keys-import.rsc6
1 files changed, 6 insertions, 0 deletions
diff --git a/mod/ssh-keys-import.rsc b/mod/ssh-keys-import.rsc
index 170139d..31bb3e6 100644
--- a/mod/ssh-keys-import.rsc
+++ b/mod/ssh-keys-import.rsc
@@ -17,6 +17,7 @@
:global GetRandom20CharAlNum;
:global LogPrintExit2;
:global MkDir;
+ :global RequiredRouterOS;
:global WaitForFile;
:if ([ :len $Key ] = 0 || [ :len $User ] = 0) do={
@@ -27,6 +28,11 @@
$LogPrintExit2 warning $0 ("User '" . $User . "' does not exist.") true;
}
+ :local Type [ :pick $Key 0 [ :find $Key " " ] ];
+ :if (!(([ $RequiredRouterOS $0 "7.12beta1" ] = true && $Type = "ssh-ed25519") || $Type = "ssh-rsa")) do={
+ $LogPrintExit2 warning $0 ("SSH key of type '" . $Type . "' is not supported.") true;
+ }
+
:if ([ $MkDir "tmpfs/ssh-keys-import" ] = false) do={
$LogPrintExit2 warning $0 ("Creating directory 'tmpfs/ssh-keys-import' failed!") true;
}