summaryrefslogtreecommitdiff
path: root/Assistant/Ssh.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-06-11 23:12:01 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-06-11 23:12:01 -0400
commit48955ac0dc17309f4f0b37295720a2989ed81ea0 (patch)
tree0c6be2843b2996606906b8af752e2e5997793320 /Assistant/Ssh.hs
parentf5e2a7f5a332054fd2c4c8c46d5afe3af3806f8e (diff)
sanity check
Diffstat (limited to 'Assistant/Ssh.hs')
-rw-r--r--Assistant/Ssh.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Assistant/Ssh.hs b/Assistant/Ssh.hs
index 182e85377..87347571e 100644
--- a/Assistant/Ssh.hs
+++ b/Assistant/Ssh.hs
@@ -64,7 +64,10 @@ sshTranscript opts input = processTranscript "ssh" opts input
{- Ensure that the ssh public key doesn't include any ssh options, like
- command=foo, or other weirdness -}
validateSshPubKey :: SshPubKey -> IO ()
-validateSshPubKey pubkey = either error return $ check $ words pubkey
+validateSshPubKey pubkey
+ | length (lines pubkey) == 1 =
+ either error return $ check $ words pubkey
+ | otherwise = error "too many lines in ssh public key"
where
check [prefix, _key, comment] = do
checkprefix prefix