sanity check
This commit is contained in:
parent
848998f258
commit
81d6f96cd9
1 changed files with 4 additions and 1 deletions
|
@ -64,7 +64,10 @@ sshTranscript opts input = processTranscript "ssh" opts input
|
||||||
{- Ensure that the ssh public key doesn't include any ssh options, like
|
{- Ensure that the ssh public key doesn't include any ssh options, like
|
||||||
- command=foo, or other weirdness -}
|
- command=foo, or other weirdness -}
|
||||||
validateSshPubKey :: SshPubKey -> IO ()
|
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
|
where
|
||||||
check [prefix, _key, comment] = do
|
check [prefix, _key, comment] = do
|
||||||
checkprefix prefix
|
checkprefix prefix
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue