From 9e56615b4387bd6669857138070a1f8ebd0b57bc Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Mon, 26 Apr 2021 18:46:59 -0700 Subject: [PATCH] minor spelling fixes, and explain the command protocol.. --- PROTOCOL.md | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/PROTOCOL.md b/PROTOCOL.md index 7bde402..6094ab3 100644 --- a/PROTOCOL.md +++ b/PROTOCOL.md @@ -1,7 +1,7 @@ Protocol ======== -The responder will be the node under control (irrigation controler), and +The responder will be the node under control (irrigation controller), and the initiator will be the server. The responder will always respond with one and only one packet. That @@ -25,7 +25,7 @@ initiator: send_enc(<16 bytes random data> + 'reqreset') # nonce injection send_mac(8) -respondant: +respondent: send_enc(<16 bytes random data>) # nonce injection send_mac(8) @@ -33,7 +33,7 @@ initiator: send_enc('confirm') send_mac(8) -respondant: +respondent: send_enc('confirmed') send_mac(8) @@ -45,7 +45,7 @@ The new key/session does not become active till this point. In order to handle a reset and prevent a replay attack, the existing session, if any is maintained till the completion of a reset request. -Only after that, does the old conenction key get removed. This does +Only after that, does the old connection key get removed. This does mean that after a reset request, it is required that both sides attempt to decode each packet w/ both keys. @@ -54,4 +54,19 @@ Where type is to be: ecdh - Results of an ECDH exchange, key = K || K_A || K_B ecdhe - Results of an ECDHE exchange, key = TBD +Once the session has been established, the initiator will send commands of the +following format: + + +Currently the only defined type for args, is a 4 byte integer in little endian +format. Additional types may be added later. + +The following commands are defined: +TERMINATE: 1 -- no args: terminate the session, reply confirms +WAITFOR: 2 -- args: (length): waits for length seconds +RUNFOR: 3 -- args: (chan, length): turns on chan for length seconds + +When the responder receives a command, it will process it, and send back +a response w/ the same command byte as an acknowledgment. + Note: look at: https://monocypher.org/manual/advanced/elligator when doing ECDHE