crypto: Zeroize the GroupSessionKey struct.

This commit is contained in:
Damir Jelić 2020-04-10 17:02:51 +02:00
parent 8210c2377d
commit cb8f1c1a5b
2 changed files with 5 additions and 3 deletions

View file

@ -12,7 +12,7 @@ version = "0.1.0"
[features]
default = []
encryption = ["olm-rs", "serde/derive", "serde_json", "cjson"]
encryption = ["olm-rs", "serde/derive", "serde_json", "cjson", "zeroize"]
sqlite-cryptostore = ["sqlx", "zeroize"]
[dependencies]
@ -35,7 +35,7 @@ olm-rs = { git = "https://gitlab.gnome.org/poljar/olm-rs", optional = true, feat
serde = { version = "1.0.106", optional = true, features = ["derive"] }
serde_json = { version = "1.0.51", optional = true }
cjson = { version = "0.1.0", optional = true }
zeroize = { version = "1.1.0", optional = true }
zeroize = { version = "1.1.0", optional = true, features = ["zeroize_derive"] }
# Misc dependencies
thiserror = "1.0.14"

View file

@ -19,6 +19,7 @@ use std::time::Instant;
use serde::Serialize;
use tokio::sync::Mutex;
use zeroize::Zeroize;
use olm_rs::account::{IdentityKeys, OlmAccount, OneTimeKeys};
use olm_rs::errors::{OlmAccountError, OlmGroupSessionError, OlmSessionError};
@ -344,7 +345,8 @@ impl PartialEq for Session {
/// The private session key of a group session.
/// Can be used to create a new inbound group session.
#[derive(Clone, Serialize)]
#[derive(Clone, Serialize, Zeroize)]
#[zeroize(drop)]
pub struct GroupSessionKey(pub String);
/// Inbound group session.