aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2020-05-03 01:19:49 -0400
committerJesse Luehrs <doy@tozt.net>2020-05-03 01:54:08 -0400
commite89ecaf0792dea1d36b6f071cb32bf79665c8e37 (patch)
tree773f85d0c08691a795cb512986ce6650054de66b /src/bin
parente28b23f713fda315d28aaf6a375a720aae166f78 (diff)
downloadrbw-e89ecaf0792dea1d36b6f071cb32bf79665c8e37.tar.gz
rbw-e89ecaf0792dea1d36b6f071cb32bf79665c8e37.zip
refactor encrypt/decrypt methods to indicate symmetric encryption
since we're going to have to also implement asymmetric encryption
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/rbw-agent/actions.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/bin/rbw-agent/actions.rs b/src/bin/rbw-agent/actions.rs
index d17f5f1..5b3444d 100644
--- a/src/bin/rbw-agent/actions.rs
+++ b/src/bin/rbw-agent/actions.rs
@@ -226,7 +226,7 @@ pub async fn decrypt(
.context("failed to parse encrypted secret")?;
let plaintext = String::from_utf8(
cipherstring
- .decrypt(&keys)
+ .decrypt_symmetric(&keys)
.context("failed to decrypt encrypted secret")?,
)
.context("failed to parse decrypted secret")?;
@@ -250,9 +250,11 @@ pub async fn encrypt(
"failed to find encryption keys in in-memory state"
));
};
- let cipherstring =
- rbw::cipherstring::CipherString::encrypt(keys, plaintext.as_bytes())
- .context("failed to encrypt plaintext secret")?;
+ let cipherstring = rbw::cipherstring::CipherString::encrypt_symmetric(
+ keys,
+ plaintext.as_bytes(),
+ )
+ .context("failed to encrypt plaintext secret")?;
respond_encrypt(sock, cipherstring.to_string()).await?;