Skip to content

Commit

Permalink
feat: relax zeroize dependencies (#4971)
Browse files Browse the repository at this point in the history
Description
---
Relaxed `zeroize` dependencies to enable cargo selection of `zeroize v1.5.7`

Motivation and Context
---
The latest version of `zeroize` could not be auto-selected due to old dependency pins.
  • Loading branch information
hansieodendaal authored Nov 29, 2022
1 parent 2962028 commit 10a19d5
Show file tree
Hide file tree
Showing 14 changed files with 254 additions and 217 deletions.
440 changes: 240 additions & 200 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion base_layer/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ bitflags = "1.0.4"
blake2 = "^0.9.0"
borsh = "0.9.3"
bytes = "0.5"
chacha20poly1305 = "0.9.0"
chacha20poly1305 = "0.10.1"
chrono = { version = "0.4.19", default-features = false, features = ["serde"] }
criterion = { version = "0.4.0", optional = true }
croaring = { version = "0.5.2", optional = true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@

use borsh::{BorshDeserialize, BorshSerialize};
use chacha20poly1305::{
aead::{Aead, Error, NewAead, Payload},
aead::{Aead, Error, Payload},
ChaCha20Poly1305,
Key,
KeyInit,
Nonce,
};
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion base_layer/p2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fs2 = "0.4.0"
futures = { version = "^0.3.1" }
lmdb-zero = "0.4.4"
log = "0.4.6"
pgp = { version = "0.7.2", optional = true }
pgp = { version = "0.8.0", optional = true }
prost = "=0.9.0"
rand = "0.7.3"
reqwest = { version = "0.11", optional = true, default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion base_layer/wallet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ thiserror = "1.0.26"
tower = "0.4"
prost = "0.9"
itertools = "0.10.3"
chacha20poly1305 = "0.9.1"
chacha20poly1305 = "0.10.1"
zeroize = "1"

[dev-dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,7 @@ impl Encryptable<XChaCha20Poly1305> for KnownOneSidedPaymentScriptSql {
mod test {
use std::mem::size_of;

use chacha20poly1305::{aead::NewAead, Key, XChaCha20Poly1305};
use chacha20poly1305::{Key, KeyInit, XChaCha20Poly1305};
use diesel::{Connection, SqliteConnection};
use rand::{rngs::OsRng, RngCore};
use tari_common_types::types::CommitmentFactory;
Expand Down
2 changes: 1 addition & 1 deletion base_layer/wallet/src/storage/sqlite_db/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use argon2::{
password_hash::{rand_core::OsRng, Decimal, PasswordHash, PasswordHasher, PasswordVerifier, SaltString},
Argon2,
};
use chacha20poly1305::{aead::NewAead, Key, Tag, XChaCha20Poly1305, XNonce};
use chacha20poly1305::{Key, KeyInit, Tag, XChaCha20Poly1305, XNonce};
use diesel::{prelude::*, SqliteConnection};
use log::*;
use tari_common_types::chain_metadata::ChainMetadata;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2410,7 +2410,7 @@ impl UnconfirmedTransactionInfoSql {
mod test {
use std::{convert::TryFrom, mem::size_of, time::Duration};

use chacha20poly1305::{aead::NewAead, Key, XChaCha20Poly1305};
use chacha20poly1305::{Key, KeyInit, XChaCha20Poly1305};
use chrono::Utc;
use diesel::{Connection, SqliteConnection};
use rand::{rngs::OsRng, RngCore};
Expand Down
2 changes: 1 addition & 1 deletion base_layer/wallet/src/util/encryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pub fn encrypt_bytes_integral_nonce(
mod test {
use std::mem::size_of;

use chacha20poly1305::{aead::NewAead, Key, Tag, XChaCha20Poly1305, XNonce};
use chacha20poly1305::{Key, KeyInit, Tag, XChaCha20Poly1305, XNonce};
use rand::{rngs::OsRng, RngCore};
use tari_utilities::{ByteArray, Hidden};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

use std::mem::size_of;

use chacha20poly1305::{aead::NewAead, Key, XChaCha20Poly1305};
use chacha20poly1305::{Key, KeyInit, XChaCha20Poly1305};
use rand::{rngs::OsRng, RngCore};
use tari_key_manager::cipher_seed::CipherSeed;
use tari_wallet::key_manager_service::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

use std::mem::size_of;

use chacha20poly1305::{aead::NewAead, Key, XChaCha20Poly1305};
use chacha20poly1305::{Key, KeyInit, XChaCha20Poly1305};
use rand::{rngs::OsRng, RngCore};
use tari_common_types::{transaction::TxId, types::FixedHash};
use tari_core::transactions::{tari_amount::MicroTari, CryptoFactories};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

use std::mem::size_of;

use chacha20poly1305::{aead::NewAead, Key, XChaCha20Poly1305};
use chacha20poly1305::{Key, KeyInit, XChaCha20Poly1305};
use chrono::{NaiveDateTime, Utc};
use rand::{rngs::OsRng, RngCore};
use tari_common::configuration::Network;
Expand Down
2 changes: 1 addition & 1 deletion comms/dht/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tari_common_sqlite = { path = "../../common_sqlite" }
anyhow = "1.0.53"
bitflags = "1.2.0"
chacha20 = "0.7.1"
chacha20poly1305 = "0.9.1"
chacha20poly1305 = "0.10.1"
chrono = { version = "0.4.19", default-features = false }
diesel = { version = "1.4.7", features = ["sqlite", "serde_json", "chrono", "numeric"] }
diesel_migrations = "1.4.0"
Expand Down
6 changes: 1 addition & 5 deletions comms/dht/src/crypt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ use chacha20::{
Key,
Nonce,
};
use chacha20poly1305::{
self,
aead::{Aead, NewAead},
ChaCha20Poly1305,
};
use chacha20poly1305::{self, aead::Aead, ChaCha20Poly1305, KeyInit};
use digest::Digest;
use prost::bytes::BytesMut;
use rand::{rngs::OsRng, RngCore};
Expand Down

0 comments on commit 10a19d5

Please sign in to comment.