Update On Sat Nov 2 19:33:11 CET 2024

This commit is contained in:
github-action[bot]
2024-11-02 19:33:11 +01:00
parent 453bb0e96c
commit d668647e75
106 changed files with 8650 additions and 1037 deletions

View File

@@ -7,7 +7,7 @@ use log::warn;
use crate::{
config::{ReplayAttackPolicy, ServerType},
crypto::{v1::random_iv_or_salt, CipherKind},
crypto::CipherKind,
dns_resolver::DnsResolver,
security::replay::ReplayProtector,
};
@@ -50,6 +50,7 @@ impl Context {
/// Check if nonce exist or not
///
/// If not, set into the current bloom filter
#[cfg(any(feature = "stream-cipher", feature = "aead-cipher", feature = "aead-cipher-2022"))]
#[inline(always)]
fn check_nonce_and_set(&self, method: CipherKind, nonce: &[u8]) -> bool {
match self.replay_policy {
@@ -64,7 +65,10 @@ impl Context {
return;
}
#[cfg(any(feature = "stream-cipher", feature = "aead-cipher", feature = "aead-cipher-2022"))]
loop {
use crate::crypto::utils::random_iv_or_salt;
random_iv_or_salt(nonce);
// Salt already exists, generate a new one.
@@ -74,6 +78,12 @@ impl Context {
break;
}
#[cfg(not(any(feature = "stream-cipher", feature = "aead-cipher", feature = "aead-cipher-2022")))]
if !nonce.is_empty() {
let _ = unique;
panic!("{method} don't know how to generate nonce");
}
}
/// Check nonce replay