dev(rosenpass): add support for the shake256 hash function in the rosenpass crate

This commit is contained in:
David Niehues
2025-02-14 16:29:56 +01:00
parent 30e158f594
commit 2d2d109246
14 changed files with 435 additions and 184 deletions

View File

@@ -26,7 +26,7 @@ use rosenpass_util::{
use std::os::fd::{AsFd, AsRawFd};
use tempfile::TempDir;
use zerocopy::AsBytes;
use rosenpass::config::ProtocolVersion;
use rosenpass::protocol::SymKey;
struct KillChild(std::process::Child);
@@ -48,7 +48,16 @@ impl Drop for KillChild {
}
#[test]
fn api_integration_api_setup() -> anyhow::Result<()> {
fn api_integration_api_setup_v02() -> anyhow::Result<()> {
api_integration_api_setup(ProtocolVersion::V02)
}
#[test]
fn api_integration_api_setup_v03() -> anyhow::Result<()> {
api_integration_api_setup(ProtocolVersion::V03)
}
fn api_integration_api_setup(protocol_version: ProtocolVersion) -> anyhow::Result<()> {
rosenpass_secret_memory::policy::secret_policy_use_only_malloc_secrets();
let dir = TempDir::with_prefix("rosenpass-api-integration-test")?;
@@ -96,6 +105,7 @@ fn api_integration_api_setup() -> anyhow::Result<()> {
peer: format!("{}", peer_b_wg_peer_id.fmt_b64::<8129>()),
extra_params: vec![],
}),
protocol_version: protocol_version.clone(),
}],
};
@@ -116,6 +126,7 @@ fn api_integration_api_setup() -> anyhow::Result<()> {
endpoint: Some(peer_a_endpoint.to_owned()),
pre_shared_key: None,
wg: None,
protocol_version: protocol_version.clone(),
}],
};