From c3bde086bb780eb630775c0a7df90a01aa47c35e Mon Sep 17 00:00:00 2001 From: Aaron France Date: Tue, 5 Dec 2023 15:05:46 +0100 Subject: [PATCH] feat: output private key for get command --- boringtun/src/device/api.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boringtun/src/device/api.rs b/boringtun/src/device/api.rs index 0486de68b..22cf63f7f 100644 --- a/boringtun/src/device/api.rs +++ b/boringtun/src/device/api.rs @@ -157,6 +157,8 @@ impl Device { fn api_get(writer: &mut BufWriter<&UnixStream>, d: &Device) -> i32 { // get command requires an empty line, but there is no reason to be religious about it if let Some(ref k) = d.key_pair { + writeln!(writer, "private_key={}", encode_hex(k.0.as_bytes())); + // Is this even needed? This seems like a custom extension in boringtun writeln!(writer, "own_public_key={}", encode_hex(k.1.as_bytes())); }