From c16fa1c1e05f2586e2deca8faf32e519a9b50670 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 2 May 2020 19:35:39 -0400 Subject: expand the protocol to allow decrypting with organization keys not implemented yet, just changing the interface --- src/bin/rbw-agent/actions.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/bin/rbw-agent/actions.rs') diff --git a/src/bin/rbw-agent/actions.rs b/src/bin/rbw-agent/actions.rs index 52c34fa..afe76c8 100644 --- a/src/bin/rbw-agent/actions.rs +++ b/src/bin/rbw-agent/actions.rs @@ -211,9 +211,10 @@ pub async fn decrypt( sock: &mut crate::sock::Sock, state: std::sync::Arc>, cipherstring: &str, + org_id: Option<&str>, ) -> anyhow::Result<()> { let state = state.read().await; - let keys = if let Some(keys) = &state.priv_key { + let keys = if let Some(keys) = state.key(org_id) { keys } else { return Err(anyhow::anyhow!( @@ -238,9 +239,10 @@ pub async fn encrypt( sock: &mut crate::sock::Sock, state: std::sync::Arc>, plaintext: &str, + org_id: Option<&str>, ) -> anyhow::Result<()> { let state = state.read().await; - let keys = if let Some(keys) = &state.priv_key { + let keys = if let Some(keys) = state.key(org_id) { keys } else { return Err(anyhow::anyhow!( -- cgit v1.2.3-54-g00ecf