summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhillip Smyth <phillip.smyth@codethink.co.uk>2017-10-10 17:18:29 +0100
committerPhillip Smyth <phillip.smyth@codethink.co.uk>2017-10-13 09:32:43 +0100
commitaae625c318033fa199c1a2a3af509c357a8c0b91 (patch)
tree46837e60700eab5e219991ce4af50ef5483e11bd
parent1228c8dc2b1624c8e8c866107c3768d8a47fad29 (diff)
downloadgitano-aae625c318033fa199c1a2a3af509c357a8c0b91.tar.gz
Added ssh_type_is_invalid function
-rw-r--r--lib/gitano/util.lua13
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,
}