From d19bbd29d8f473eae1aa1fa76c22e5374922c108 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 10 Sep 2012 21:55:59 -0400 Subject: pairing probably works now (untested) --- Assistant/Pairing.hs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'Assistant/Pairing.hs') diff --git a/Assistant/Pairing.hs b/Assistant/Pairing.hs index b957e0835..4aade5465 100644 --- a/Assistant/Pairing.hs +++ b/Assistant/Pairing.hs @@ -25,23 +25,24 @@ data PairStage | PairDone deriving (Eq, Read, Show) -newtype PairMsg = PairMsg (Verifiable (PairStage, PairData)) +newtype PairMsg = PairMsg (Verifiable (PairStage, PairData, SomeAddr)) deriving (Eq, Read, Show) -fromPairMsg :: PairMsg -> (Verifiable (PairStage, PairData)) +fromPairMsg :: PairMsg -> (Verifiable (PairStage, PairData, SomeAddr)) fromPairMsg (PairMsg m) = m pairMsgStage :: PairMsg -> PairStage -pairMsgStage (PairMsg (Verifiable (s, _) _)) = s +pairMsgStage (PairMsg (Verifiable (s, _, _) _)) = s pairMsgData :: PairMsg -> PairData -pairMsgData (PairMsg (Verifiable (_, d) _)) = d +pairMsgData (PairMsg (Verifiable (_, d, _) _)) = d + +pairMsgAddr :: PairMsg -> SomeAddr +pairMsgAddr (PairMsg (Verifiable (_, _, a) _)) = a data PairData = PairData -- uname -n output, not a full domain name { remoteHostName :: Maybe HostName - -- the address is included so that it can be verified, avoiding spoofing - , remoteAddress :: SomeAddr , remoteUserName :: UserName , remoteDirectory :: FilePath , remoteSshPubKey :: SshPubKey @@ -55,8 +56,9 @@ type UserName = String - set up on disk. -} data PairingInProgress = PairingInProgress { inProgressSecret :: Secret - , inProgressThreadId :: ThreadId + , inProgressThreadId :: Maybe ThreadId , inProgressSshKeyPair :: SshKeyPair + , inProgressPairData :: PairData } data SomeAddr = IPv4Addr HostAddress | IPv6Addr HostAddress6 -- cgit v1.2.3