From f035ac5470c7fbcf791e361cb2d611de7edafb0f Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 2 May 2020 18:45:50 -0400 Subject: check protocol version before agent communication --- src/protocol.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/protocol.rs') diff --git a/src/protocol.rs b/src/protocol.rs index de8833c..2ef99cd 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -1,3 +1,5 @@ +pub const VERSION: u32 = 1; + #[derive(serde::Serialize, serde::Deserialize, Debug)] pub struct Request { pub tty: Option, @@ -14,6 +16,7 @@ pub enum Action { Decrypt { cipherstring: String }, Encrypt { plaintext: String }, Quit, + Version, } #[derive(serde::Serialize, serde::Deserialize, Debug)] @@ -23,4 +26,5 @@ pub enum Response { Error { error: String }, Decrypt { plaintext: String }, Encrypt { cipherstring: String }, + Version { version: u32 }, } -- cgit v1.2.3-54-g00ecf