From 66152940fd0a91eebf203297a605a70e06382889 Mon Sep 17 00:00:00 2001 From: Floris Bruynooghe Date: Sat, 25 Oct 2025 12:30:45 +0200 Subject: [PATCH] feat: Do not print the secret key It is scary when folks have to worry about secrets being printed. #84 will solve the key persistence in a much better way anyway. --- src/main.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 53956ef..80cec6d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,7 @@ //! Command line arguments. use clap::{Parser, Subcommand}; use dumbpipe::EndpointTicket; -use iroh::{endpoint::Connecting, Endpoint, EndpointAddr, SecretKey}; +use iroh::{Endpoint, EndpointAddr, SecretKey, endpoint::Connecting}; use n0_snafu::{Result, ResultExt}; use std::{ io, @@ -282,16 +282,14 @@ async fn copy_from_quinn( } /// Get the secret key or generate a new one. -/// -/// Print the secret key to stderr if it was generated, so the user can save it. fn get_or_create_secret() -> Result { match std::env::var("IROH_SECRET") { Ok(secret) => SecretKey::from_str(&secret).context("invalid secret"), Err(_) => { let key = SecretKey::generate(&mut rand::rng()); eprintln!( - "using secret key {}", - data_encoding::HEXLOWER.encode(&key.to_bytes()) + "generated new endpoint ID: {}", + data_encoding::HEXLOWER.encode(&*key.public()) ); Ok(key) }