diff options
| author | Conrad Ludgate <conradludgate@gmail.com> | 2023-04-17 21:12:02 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-17 21:12:02 +0100 |
| commit | c7d89c1703c6dc580b2ef2cbb66b0df0b1e72b50 (patch) | |
| tree | b9d7a653f3460a9f9d3a96106c273b9cbd382710 /atuin-client/src/api_client.rs | |
| parent | Add workflow dispatch for release (#888) (diff) | |
| download | atuin-c7d89c1703c6dc580b2ef2cbb66b0df0b1e72b50.zip | |
chore: uuhhhhhh crypto lol (#805)
* chore: uuhhhhhh crypto lol
* remove dead code
* fix key decoding
* use inplace encryption
Diffstat (limited to '')
| -rw-r--r-- | atuin-client/src/api_client.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/atuin-client/src/api_client.rs b/atuin-client/src/api_client.rs index dee98613..80051ba6 100644 --- a/atuin-client/src/api_client.rs +++ b/atuin-client/src/api_client.rs @@ -7,13 +7,13 @@ use reqwest::{ header::{HeaderMap, AUTHORIZATION, USER_AGENT}, StatusCode, Url, }; -use sodiumoxide::crypto::secretbox; use atuin_common::api::{ AddHistoryRequest, CountResponse, DeleteHistoryRequest, ErrorResponse, IndexResponse, LoginRequest, LoginResponse, RegisterResponse, StatusResponse, SyncHistoryResponse, }; use semver::Version; +use xsalsa20poly1305::Key; use crate::{ encryption::{decode_key, decrypt}, @@ -28,7 +28,7 @@ static APP_USER_AGENT: &str = concat!("atuin/", env!("CARGO_PKG_VERSION"),); pub struct Client<'a> { sync_addr: &'a str, - key: secretbox::Key, + key: Key, client: reqwest::Client, } @@ -182,7 +182,7 @@ impl<'a> Client<'a> { .iter() // TODO: handle deletion earlier in this chain .map(|h| serde_json::from_str(h).expect("invalid base64")) - .map(|h| decrypt(&h, &self.key).expect("failed to decrypt history! check your key")) + .map(|h| decrypt(h, &self.key).expect("failed to decrypt history! check your key")) .map(|mut h| { if deleted.contains(&h.id) { h.deleted_at = Some(chrono::Utc::now()); |
