diff options
author | Phillip Smyth <phillip.smyth@codethink.co.uk> | 2017-10-10 17:18:29 +0100 |
---|---|---|
committer | Phillip Smyth <phillip.smyth@codethink.co.uk> | 2017-10-13 09:32:43 +0100 |
commit | aae625c318033fa199c1a2a3af509c357a8c0b91 (patch) | |
tree | 46837e60700eab5e219991ce4af50ef5483e11bd | |
parent | 1228c8dc2b1624c8e8c866107c3768d8a47fad29 (diff) | |
download | gitano-aae625c318033fa199c1a2a3af509c357a8c0b91.tar.gz |
Added ssh_type_is_invalid function
-rw-r--r-- | lib/gitano/util.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/gitano/util.lua b/lib/gitano/util.lua index 76183e3..3f1f4f0 100644 --- a/lib/gitano/util.lua +++ b/lib/gitano/util.lua @@ -584,6 +584,18 @@ local function unlockfile(fh) fh:close() end +local function ssh_type_is_invalid(keytype) + if (keytype ~= "ssh-rsa") and + (keytype ~= "ssh-dss") and + (keytype ~= "ecdsa-sha2-nistp256") and + (keytype ~= "ecdsa-sha2-nistp384") and + (keytype ~= "ecdsa-sha2-nistp521") and + (keytype ~= "ssh-ed25519") then + return true + end + return false +end + return { parse_cmdline = _parse_cmdline, @@ -623,4 +635,5 @@ return { lockfile = lockfile, unlockfile = unlockfile, + ssh_type_is_invalid = ssh_type_is_invalid, } |