summaryrefslogtreecommitdiffhomepage
path: root/Role/User.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-05-05 11:02:58 -0400
committerJoey Hess <joeyh@joeyh.name>2017-05-05 11:03:48 -0400
commitbe53d40694e59f9ef48d8a8106004623bddc703b (patch)
tree9699d7385da6c9276272812d91cb1f913884bb49 /Role/User.hs
parentb8a8b10ab8f2e593d55b7b1ab0d57817939decc0 (diff)
downloaddebug-me-be53d40694e59f9ef48d8a8106004623bddc703b.tar.gz
add protocol version
This is distinct from the wire protocol version used in the websocket framing of messages. Versioning the high level protocol will let later features be added. The user controls the protocol version, since they send the first several messages. Developers that connect need to avoid using features from newer protocol versions. So, developers and servers will need to support the most recent version, while the user can have an old version of debug-me and it will continue to work. This commit changes the protocol buffer encoding, and is the last such free change. All changes past this point will need to be versioned. This commit was sponsored by Jochen Bartl on Patreon.
Diffstat (limited to 'Role/User.hs')
-rw-r--r--Role/User.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Role/User.hs b/Role/User.hs
index 6c6fb39..6ee1a42 100644
--- a/Role/User.hs
+++ b/Role/User.hs
@@ -118,7 +118,7 @@ startProtocol starttxt ochan logger = do
logger $ User msg
sk <- genMySessionKey
pk <- myPublicKey sk (GpgSign False)
- let c = mkSigned sk $ Control (SessionKey pk)
+ let c = mkSigned sk $ Control (SessionKey pk currentProtocolVersion)
initialmessage $ ControlMessage c
let starttxt' = rawLine starttxt
let act = mkSigned sk $ Activity
@@ -248,7 +248,7 @@ getDeveloperMessage' (MissingHashes wiremsg) ochan us now = do
st <- readTVar us
Developer msg <- restoreHashes (userStateRecentActivity us) (MissingHashes (Developer wiremsg))
case msg of
- ControlMessage (Control (SessionKey spk) _) -> do
+ ControlMessage (Control (SessionKey spk _) _) -> do
let sigverifier = mkSigVerifier $ case spk of
GpgSigned pk _ _ -> pk
UnSigned pk -> pk