diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/common.rs | 3 | ||||
-rw-r--r-- | src/rendezvous_server.rs | 3 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/common.rs b/src/common.rs index 977f8ed..c2c63ba 100644 --- a/src/common.rs +++ b/src/common.rs @@ -120,6 +120,9 @@ pub fn gen_sk(wait: u64) -> (String, Option<sign::SecretKey>) { let pk = base64::encode(&tmp[sign::SECRETKEYBYTES / 2..]); log::info!("Private key comes from {}", sk_file); return (pk, Some(sign::SecretKey(tmp))); + } else { + log::error!("Malformed private key. You probably have a trailing newline in the secret key file."); + std::process::exit(1); } } } else { diff --git a/src/rendezvous_server.rs b/src/rendezvous_server.rs index ede0ede..0c0d107 100644 --- a/src/rendezvous_server.rs +++ b/src/rendezvous_server.rs @@ -1174,9 +1174,6 @@ impl RendezvousServer { let mut tmp = [0u8; sign::SECRETKEYBYTES]; tmp[..].copy_from_slice(&sk); out_sk = Some(sign::SecretKey(tmp)); - } else { - log::error!("Malformed private key"); - std::process::exit(1); } } |