LP: include signing key digests to LP responses (#6373)

* include signing key digests to LP responses

* mock
This commit is contained in:
Jędrzej Stuczyński
2026-01-27 12:23:52 +00:00
committed by GitHub
parent 3597682b33
commit 8af759fb1d
14 changed files with 274 additions and 86 deletions
+6 -2
View File
@@ -64,7 +64,7 @@ use crate::bandwidth_helpers::{acquire_bandwidth, import_bandwidth};
use crate::nodes::{DirectoryNode, NymApiDirectory};
pub use mode::TestMode;
use nym_crypto::asymmetric::{ed25519, x25519};
use nym_kkt_ciphersuite::{KEM, KEMKeyDigests};
use nym_kkt_ciphersuite::{KEM, KEMKeyDigests, SignatureScheme};
use nym_lp::peer::LpRemotePeer;
use nym_node_status_client::models::AttachedTicketMaterials;
use nym_registration_client::{LpRegistrationClient, NestedLpSession};
@@ -167,6 +167,7 @@ pub struct TestedNodeDetails {
pub struct TestedNodeLpDetails {
pub address: SocketAddr,
pub expected_kem_key_hashes: HashMap<KEM, KEMKeyDigests>,
pub expected_signing_key_hashes: HashMap<SignatureScheme, KEMKeyDigests>,
pub x25519: x25519::PublicKey,
}
@@ -1077,7 +1078,10 @@ async fn wg_probe(
}
fn to_lp_remote_peer(identity: ed25519::PublicKey, data: TestedNodeLpDetails) -> LpRemotePeer {
LpRemotePeer::new(identity, data.x25519).with_kem_key_digests(data.expected_kem_key_hashes)
LpRemotePeer::new(identity, data.x25519).with_key_digests(
data.expected_kem_key_hashes,
data.expected_signing_key_hashes,
)
}
async fn lp_registration_probe<St>(
+13
View File
@@ -141,6 +141,19 @@ impl DirectoryNode {
)
})
.collect(),
expected_signing_key_hashes: lp_data
.signing_keys
.into_iter()
.map(|(scheme, digests)| {
(
scheme.into(),
digests
.into_iter()
.map(|(hash_fn, digest)| (hash_fn.into(), digest))
.collect(),
)
})
.collect(),
x25519: noise_key.x25519_pubkey,
}),
_ => None,
+5
View File
@@ -244,6 +244,9 @@ fn mode_to_flags(mode: TestMode) -> (bool, bool, bool) {
}
}
#[allow(clippy::todo)]
#[allow(unreachable_code, unused)]
// ^^^^ // NOTE: to be changed by @SW
#[allow(clippy::unwrap_used)]
pub(crate) async fn run() -> anyhow::Result<ProbeResult> {
let args = CliArgs::parse();
@@ -306,6 +309,7 @@ pub(crate) async fn run() -> anyhow::Result<ProbeResult> {
let entry_lp_node = TestedNodeLpDetails {
address: entry_lp_addr,
expected_kem_key_hashes,
expected_signing_key_hashes: todo!(),
x25519: x25519_key,
};
let entry_details = TestedNodeDetails::from_cli(identity, entry_lp_node);
@@ -338,6 +342,7 @@ pub(crate) async fn run() -> anyhow::Result<ProbeResult> {
let exit_lp_node = TestedNodeLpDetails {
address: exit_lp_addr,
expected_kem_key_hashes,
expected_signing_key_hashes: Default::default(),
x25519: x25519_key,
};