From 3bee6b3c74cede7c9099e6bf298ffa585ebf3b80 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 8 Sep 2012 00:26:47 -0400 Subject: yesod skelton and routes for pairing yet more changes to pairing message data types --- Assistant/Pairing.hs | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'Assistant/Pairing.hs') diff --git a/Assistant/Pairing.hs b/Assistant/Pairing.hs index ef7b66d5c..f384895bd 100644 --- a/Assistant/Pairing.hs +++ b/Assistant/Pairing.hs @@ -12,26 +12,24 @@ import Utility.Verifiable import Network.Socket (HostName) -{- Messages sent in pairing are all verifiable using a secret that - - should be shared between the systems being paired. -} -type PairMsg = Verifiable (PairStage, HostInfo, SshPubKey) - -mkPairMsg :: Secret -> PairStage -> HostInfo -> SshPubKey -> PairMsg -mkPairMsg secret pairstage hostinfo sshkey = mkVerifiable - (pairstage, hostinfo, sshkey) secret - -data PairStage - {- "I'd like to pair with somebody who knows a secret. - - Here's my ssh key, and hostinfo." -} - = PairRequest - {- "I've checked your PairRequest, and like it; I set up - - your ssh key already. Here's mine." -} - | PairAck +{- "I'd like to pair with somebody who knows a secret." -} +data PairReq = PairReq (Verifiable PairData) deriving (Eq, Read, Show) -data HostInfo = HostInfo +{- "I've checked your PairReq, and like it. + - I set up your ssh key already. Here's mine for you to set up." -} +data PairAck = PairAck (Verifiable PairData) + deriving (Eq, Read, Show) + +data PairMsg + = PairReqM PairReq + | PairAckM PairAck + deriving (Eq, Read, Show) + +data PairData = PairData { hostName :: HostName , userName :: UserName + , sshPubKey :: Maybe SshPubKey } deriving (Eq, Read, Show) -- cgit v1.2.3