aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-11-08 08:50:12 +0100
committerGravatar Christian Hesse <mail@eworm.de>2024-11-08 09:16:25 +0100
commit1f526b356121749991fee69cee5a6c728855c8f2 (patch)
treed86c358448c3d4bd04a6863c85200f6cca3c3d9b
parent0837391c38987462c3a1787143d631b92e0a0551 (diff)
mod/ssh-keys-import: $SSHKeysImport: split with `:deserialize`
-rw-r--r--mod/ssh-keys-import.rsc3
1 files changed, 1 insertions, 2 deletions
diff --git a/mod/ssh-keys-import.rsc b/mod/ssh-keys-import.rsc
index f67c0fc..d6b3b3f 100644
--- a/mod/ssh-keys-import.rsc
+++ b/mod/ssh-keys-import.rsc
@@ -16,7 +16,6 @@
:local Key [ :tostr $1 ];
:local User [ :tostr $2 ];
- :global CharacterReplace;
:global GetRandom20CharAlNum;
:global LogPrint;
:global MkDir;
@@ -32,7 +31,7 @@
:return false;
}
- :local KeyVal [ :toarray [ $CharacterReplace $Key " " "," ] ];
+ :local KeyVal ([ :deserialize $Key delimiter=" " from=dsv options=dsv.plain ]->0);
:if (!($KeyVal->0 = "ssh-ed25519" || $KeyVal->0 = "ssh-rsa")) do={
$LogPrint warning $0 ("SSH key of type '" . $KeyVal->0 . "' is not supported.");
:return false;