From 81d6f96cd9e7df41e685a88c62d84d5926b8f793 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 11 Jun 2013 23:12:01 -0400 Subject: [PATCH] sanity check --- Assistant/Ssh.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Assistant/Ssh.hs b/Assistant/Ssh.hs index 182e853772..87347571ec 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