assistant: Fix local pairing to not include newline in ssh pubkey, which is rejected on the other end for security reasons.

This commit is contained in:
Joey Hess 2015-07-02 14:50:20 -04:00
parent a8fcd68144
commit 20edbf850c
3 changed files with 21 additions and 1 deletions

View file

@ -223,11 +223,12 @@ startLocalPairing stage oncancel alert muuid displaysecret secret = do
- background. -}
thread <- liftAssistant $ asIO $ do
keypair <- liftIO $ genSshKeyPair
let pubkey = either error id $ validateSshPubKey $ sshPubKey keypair
pairdata <- liftIO $ PairData
<$> getHostname
<*> myUserName
<*> pure reldir
<*> pure (sshPubKey keypair)
<*> pure pubkey
<*> (maybe genUUID return muuid)
let sender = multicastPairMsg Nothing secret pairdata
let pip = PairingInProgress secret Nothing keypair pairdata stage