aboutsummaryrefslogtreecommitdiffstats
path: root/atuin-client/src/api_client.rs
diff options
context:
space:
mode:
authorConrad Ludgate <conradludgate@gmail.com>2023-04-17 21:12:02 +0100
committerGitHub <noreply@github.com>2023-04-17 21:12:02 +0100
commitc7d89c1703c6dc580b2ef2cbb66b0df0b1e72b50 (patch)
treeb9d7a653f3460a9f9d3a96106c273b9cbd382710 /atuin-client/src/api_client.rs
parentAdd workflow dispatch for release (#888) (diff)
downloadatuin-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.rs6
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());