Skip to content

Commit 026d3a6

Browse files
authored
Get wireguard keypair as arg instead of reading it from disk (#6078)
* Get wireguard keypair as arg instead of reading it from disk * Move keypair out of NymNode * Remove legacy auth client
1 parent 53c4fde commit 026d3a6

File tree

11 files changed

+137
-363
lines changed

11 files changed

+137
-363
lines changed

Cargo.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/registration/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ use nym_crypto::asymmetric::x25519::PublicKey;
88
use nym_ip_packet_requests::IpPair;
99
use nym_sphinx::addressing::{NodeIdentity, Recipient};
1010

11-
pub const DEFAULT_PRIVATE_ENTRY_WIREGUARD_KEY_FILENAME: &str = "free_private_entry_wireguard.pem";
12-
pub const DEFAULT_PUBLIC_ENTRY_WIREGUARD_KEY_FILENAME: &str = "free_public_entry_wireguard.pem";
13-
pub const DEFAULT_PRIVATE_EXIT_WIREGUARD_KEY_FILENAME: &str = "free_private_exit_wireguard.pem";
14-
pub const DEFAULT_PUBLIC_EXIT_WIREGUARD_KEY_FILENAME: &str = "free_public_exit_wireguard.pem";
15-
1611
#[derive(Debug, Clone, Copy, PartialEq)]
1712
pub struct NymNode {
1813
pub identity: NodeIdentity,

nym-authenticator-client/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ workspace = true
1414
[dependencies]
1515
bincode.workspace = true
1616
futures.workspace = true
17-
rand.workspace = true
1817
semver.workspace = true
1918
thiserror.workspace = true
2019
tokio-util.workspace = true
@@ -25,7 +24,6 @@ nym-authenticator-requests = { path = "../common/authenticator-requests" }
2524
nym-bandwidth-controller = { path = "../common/bandwidth-controller" }
2625
nym-credentials-interface = { path = "../common/credentials-interface" }
2726
nym-crypto = { path = "../common/crypto" }
28-
nym-pemstore = { path = "../common/pemstore" }
2927
nym-registration-common = { path = "../common/registration" }
3028
nym-sdk = { path = "../sdk/rust/nym-sdk" }
3129
nym-service-provider-requests-common = { path = "../common/service-provider-requests-common" }
Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
// Copyright 2025 - Nym Technologies SA <[email protected]>
22
// SPDX-License-Identifier: Apache-2.0
33

4-
use nym_crypto::asymmetric::x25519::KeyPair;
5-
use nym_pemstore::KeyPairPath;
64
use nym_sdk::mixnet::{IncludedSurbs, Recipient, TransmissionLane};
7-
use rand::{CryptoRng, RngCore};
85

96
pub(crate) fn create_input_message(
107
recipient: Recipient,
@@ -27,23 +24,3 @@ pub(crate) fn create_input_message(
2724
),
2825
}
2926
}
30-
31-
pub(crate) fn load_or_generate_keypair<R: RngCore + CryptoRng>(
32-
rng: &mut R,
33-
paths: KeyPairPath,
34-
) -> KeyPair {
35-
match nym_pemstore::load_keypair(&paths) {
36-
Ok(keypair) => keypair,
37-
Err(_) => {
38-
let keypair = KeyPair::new(rng);
39-
if let Err(e) = nym_pemstore::store_keypair(&keypair, &paths) {
40-
tracing::error!(
41-
"could not store generated keypair at {:?} - {:?}; will use ephemeral keys",
42-
paths,
43-
e
44-
);
45-
}
46-
keypair
47-
}
48-
}
49-
}

nym-authenticator-client/src/legacy.rs

Lines changed: 0 additions & 224 deletions
This file was deleted.

0 commit comments

Comments
 (0)