aboutsummaryrefslogtreecommitdiff
path: root/Assistant/Pairing.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-08 00:26:47 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-08 00:27:27 -0400
commit3bee6b3c74cede7c9099e6bf298ffa585ebf3b80 (patch)
treec03eb6201f8967cb28d383dde805e19df9aa9c8c /Assistant/Pairing.hs
parent92df8250fa7c6d8c36ca214e45c7b5a6c9d307a9 (diff)
yesod skelton and routes for pairing
yet more changes to pairing message data types
Diffstat (limited to 'Assistant/Pairing.hs')
-rw-r--r--Assistant/Pairing.hs30
1 files changed, 14 insertions, 16 deletions
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)