mirror of
https://github.com/rosenpass/rosenpass.git
synced 2026-02-27 22:13:12 -08:00
chore(test): Move the wireguard key generation in the integration tests to the test script to make the derivations deterministc while keeping random keys
This commit is contained in:
@@ -32,8 +32,8 @@ let
|
||||
description = "network address of the host that runs rosenpass";
|
||||
};
|
||||
|
||||
peerPubkey = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
peerPubkeyFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
description = "Public key of wireguard peer";
|
||||
};
|
||||
|
||||
@@ -73,10 +73,11 @@ in
|
||||
# The script downloads the key generated by rosenpass from the key exchange node and sets it as the preshared key for the specified wireguard peer.
|
||||
script = ''
|
||||
set -euo pipefail
|
||||
PEER_PUB_KEY=$(cat ${instanceCfg.peerPubkeyFile})
|
||||
${pkgs.openssh}/bin/ssh ${instanceCfg.rpHost} "cat ${instanceCfg.remoteKeyPath}" \
|
||||
| ${pkgs.wireguard-tools}/bin/wg \
|
||||
set ${instanceCfg.wgInterface} \
|
||||
peer ${instanceCfg.peerPubkey} \
|
||||
peer $PEER_PUB_KEY \
|
||||
endpoint ${instanceCfg.endpoint} \
|
||||
allowed-ips ${instanceCfg.allowedIps} \
|
||||
preshared-key /dev/stdin
|
||||
|
||||
Reference in New Issue
Block a user