Skip to content

Commit

Permalink
fix key size check
Browse files Browse the repository at this point in the history
  • Loading branch information
paspo committed Jan 30, 2024
1 parent d332376 commit d96ea09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 0 additions & 3 deletions src/rendezvous_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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. You probably have a trailing newline in the secret key file.");
std::process::exit(1);
}
}

Expand Down

0 comments on commit d96ea09

Please sign in to comment.