diff options
author | Joey Hess <joey@kitenet.net> | 2012-09-10 21:55:59 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-09-10 21:55:59 -0400 |
commit | d19bbd29d8f473eae1aa1fa76c22e5374922c108 (patch) | |
tree | ffb8391884b271a822f1e031d1051219093b267a /Assistant/Pairing.hs | |
parent | a41255723c55d0046e8a9953a7ebaef9d2196bb5 (diff) |
pairing probably works now (untested)
Diffstat (limited to 'Assistant/Pairing.hs')
-rw-r--r-- | Assistant/Pairing.hs | 16 |
1 files changed, 9 insertions, 7 deletions
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 |