changes due to crate moving

This commit is contained in:
Simon Wicky
2025-09-05 15:03:47 +02:00
parent 1596277c85
commit bda262810b
8 changed files with 27 additions and 24 deletions
Generated
+1
View File
@@ -5571,6 +5571,7 @@ dependencies = [
"aead",
"aes",
"aes-gcm-siv",
"base64 0.22.1",
"blake3",
"bs58",
"cipher",
+1
View File
@@ -11,6 +11,7 @@ repository = { workspace = true }
aes-gcm-siv = { workspace = true, optional = true }
aes = { workspace = true, optional = true }
aead = { workspace = true, optional = true }
base64.workspace = true
bs58 = { workspace = true }
blake3 = { workspace = true, features = ["traits-preview"], optional = true }
ctr = { workspace = true, optional = true }
@@ -1,6 +1,7 @@
// Copyright 2021-2023 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use base64::Engine;
use nym_pemstore::traits::{PemStorableKey, PemStorableKeyPair};
use std::fmt::{self, Debug, Display, Formatter};
use std::str::FromStr;
@@ -158,6 +159,15 @@ impl PublicKey {
.map_err(|source| KeyRecoveryError::MalformedPublicKeyString { source })?;
Self::from_bytes(&bytes)
}
pub fn from_base64(s: &str) -> Option<Self> {
let bytes = base64::engine::general_purpose::STANDARD.decode(s).ok()?;
Self::from_bytes(&bytes).ok()
}
pub fn to_base64(&self) -> String {
base64::engine::general_purpose::STANDARD.encode(self.as_bytes())
}
}
impl FromStr for PublicKey {
@@ -1,6 +1,9 @@
// Copyright 2025 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: GPL-3.0-only
// To remove with the Registration Client PR
#![allow(clippy::unwrap_used)]
use std::sync::Arc;
use futures::StreamExt;
+7 -14
View File
@@ -1,9 +1,11 @@
// Copyright 2023-2024 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: GPL-3.0-only
// To remove with the Registration Client PR
#![allow(clippy::unwrap_used)]
use std::{sync::Arc, time::Duration};
use nym_gateway_directory::IpPacketRouterAddress;
use nym_ip_packet_requests::IpPair;
use nym_sdk::mixnet::{
InputMessage, MixnetClient, MixnetClientSender, MixnetMessageSender, Recipient,
@@ -59,10 +61,7 @@ impl IprClientConnect {
}
}
pub async fn connect(
&mut self,
ip_packet_router_address: IpPacketRouterAddress,
) -> Result<IpPair> {
pub async fn connect(&mut self, ip_packet_router_address: Recipient) -> Result<IpPair> {
if self.connected != ConnectionState::Disconnected {
return Err(Error::AlreadyConnected);
}
@@ -83,20 +82,14 @@ impl IprClientConnect {
}
}
async fn connect_inner(
&mut self,
ip_packet_router_address: IpPacketRouterAddress,
) -> Result<IpPair> {
async fn connect_inner(&mut self, ip_packet_router_address: Recipient) -> Result<IpPair> {
let request_id = self.send_connect_request(ip_packet_router_address).await?;
debug!("Waiting for reply...");
self.listen_for_connect_response(request_id).await
}
async fn send_connect_request(
&self,
ip_packet_router_address: IpPacketRouterAddress,
) -> Result<u64> {
async fn send_connect_request(&self, ip_packet_router_address: Recipient) -> Result<u64> {
let (request, request_id) = IpPacketRequest::new_connect_request(None);
// We use 20 surbs for the connect request because typically the IPR is configured to have
@@ -104,7 +97,7 @@ impl IprClientConnect {
let surbs = 20;
self.mixnet_sender
.send(create_input_message(
Recipient::from(ip_packet_router_address),
ip_packet_router_address,
request,
surbs,
))
+1 -1
View File
@@ -7,8 +7,8 @@ use nym_authenticator_client::{
use nym_authenticator_requests::{v3, v4, v5};
use nym_credentials_interface::CredentialSpendingData;
use nym_crypto::asymmetric::encryption;
use nym_gateway_directory::Recipient;
use nym_node_requests::api::v1::gateway::client_interfaces::wireguard::models::PeerPublicKey;
use nym_sdk::mixnet::Recipient;
use crate::error::{Error, Result};
+1 -4
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-only
use nym_credentials_interface::TicketType;
use nym_gateway_directory::NodeIdentity;
use nym_sdk::mixnet::NodeIdentity;
#[derive(Debug, thiserror::Error)]
pub enum Error {
@@ -15,9 +15,6 @@ pub enum Error {
#[error(transparent)]
AuthenticatorClientError(#[from] nym_authenticator_client::Error),
#[error(transparent)]
MetadataClientError(#[from] nym_wg_metadata_client::error::MetadataClientError),
#[error("error that should stop auto retrying")]
NoRetry {
#[source]
+3 -5
View File
@@ -18,13 +18,11 @@ use nym_authenticator_client::{
use nym_authenticator_requests::{v2, v3, v4, v5};
use nym_bandwidth_controller::PreparedCredential;
use nym_credentials_interface::TicketType;
use nym_crypto::asymmetric::{encryption, x25519::KeyPair};
use nym_gateway_directory::{NodeIdentity, Recipient};
use nym_crypto::asymmetric::{encryption, x25519::KeyPair, x25519::PublicKey};
use nym_node_requests::api::v1::gateway::client_interfaces::wireguard::models::PeerPublicKey;
use nym_pemstore::KeyPairPath;
use nym_sdk::mixnet::CredentialStorage;
use nym_sdk::mixnet::{CredentialStorage, NodeIdentity, Recipient};
use nym_validator_client::QueryHttpRpcNyxdClient;
use nym_wg_go::PublicKey;
use rand::{rngs::OsRng, CryptoRng, RngCore};
use tracing::{debug, error, trace};
@@ -272,7 +270,7 @@ impl WgGatewayClient {
);
let gateway_data = GatewayData {
public_key: PublicKey::from(registered_data.pub_key().to_bytes()),
public_key: registered_data.pub_key().inner().into(),
endpoint: SocketAddr::from_str(&format!(
"{}:{}",
gateway_host,