fix Pk size check (#361)

* more descriptive error

* fix key size check
This commit is contained in:
Paolo Asperti authored and GitHub committed 2024-01-31 11:21:00 +08:00
1 parent 778c89efb1
commit 94ae51458c
2 files changed
+3 -3

No files matched your search

+3
View File
@@ -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 {