the the
parent
f36fb55727
commit
f76cb1d123
|
@ -197,7 +197,7 @@ impl<'a, R: Read + 'a> AttachmentEncryptor<'a, R> {
|
||||||
let mut iv = Zeroizing::new([0u8; IV_SIZE]);
|
let mut iv = Zeroizing::new([0u8; IV_SIZE]);
|
||||||
|
|
||||||
getrandom(&mut *key).expect("Can't generate randomness");
|
getrandom(&mut *key).expect("Can't generate randomness");
|
||||||
// Only populate the the first 8 bits with randomness, the rest is 0
|
// Only populate the first 8 bits with randomness, the rest is 0
|
||||||
// initialized.
|
// initialized.
|
||||||
getrandom(&mut iv[0..8]).expect("Can't generate randomness");
|
getrandom(&mut iv[0..8]).expect("Can't generate randomness");
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ where
|
||||||
let now = Instant::now();
|
let now = Instant::now();
|
||||||
let instant = now
|
let instant = now
|
||||||
.checked_sub(duration)
|
.checked_sub(duration)
|
||||||
.ok_or_else(|| serde::de::Error::custom("Can't subtract the the current instant"))?;
|
.ok_or_else(|| serde::de::Error::custom("Can't subtract the current instant"))?;
|
||||||
Ok(instant)
|
Ok(instant)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ impl SessionStore {
|
||||||
|
|
||||||
/// Add a session to the store.
|
/// Add a session to the store.
|
||||||
///
|
///
|
||||||
/// Returns true if the the session was added, false if the session was
|
/// Returns true if the session was added, false if the session was
|
||||||
/// already in the store.
|
/// already in the store.
|
||||||
pub async fn add(&self, session: Session) -> bool {
|
pub async fn add(&self, session: Session) -> bool {
|
||||||
let sessions_lock = self
|
let sessions_lock = self
|
||||||
|
@ -89,7 +89,7 @@ impl GroupSessionStore {
|
||||||
|
|
||||||
/// Add an inbound group session to the store.
|
/// Add an inbound group session to the store.
|
||||||
///
|
///
|
||||||
/// Returns true if the the session was added, false if the session was
|
/// Returns true if the session was added, false if the session was
|
||||||
/// already in the store.
|
/// already in the store.
|
||||||
pub fn add(&self, session: InboundGroupSession) -> bool {
|
pub fn add(&self, session: InboundGroupSession) -> bool {
|
||||||
self.entries
|
self.entries
|
||||||
|
|
Loading…
Reference in New Issue