Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: relax zeroize dependencies #4971

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
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
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
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
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 Expand Up @@ -1512,7 +1512,7 @@ mod test {
let cipher = XChaCha20Poly1305::new(key_ga);

let (_, uo) = make_input(MicroTari::from(100 + OsRng.next_u64() % 1000));
let decrypted_spending_key = uo.spending_key.clone().to_vec();
let decrypted_spending_key = uo.spending_key.to_vec();

let uo = DbUnblindedOutput::from_unblinded_output(uo, &factories, None, OutputSource::Unknown).unwrap();

Expand Down
2 changes: 1 addition & 1 deletion base_layer/wallet/src/storage/sqlite_db/wallet.rs
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
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
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
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
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
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
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
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