diff options
author | Paolo Asperti <[email protected]> | 2024-01-31 04:21:00 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-01-31 11:21:00 +0800 |
commit | 94ae51458c310aca43e79325e324a3b98a02ab26 (patch) | |
tree | 64e9e0939c91d089cb2e990823a33a7c558f4f10 /src/common.rs | |
parent | 778c89efb10f687afe803c2afaed26be6f7e781d (diff) | |
download | rustdesk-server-94ae51458c310aca43e79325e324a3b98a02ab26.tar.gz rustdesk-server-94ae51458c310aca43e79325e324a3b98a02ab26.zip |
fix Pk size check (#361)
* more descriptive error
* fix key size check
Diffstat (limited to 'src/common.rs')
-rw-r--r-- | src/common.rs | 3 |
1 files changed, 3 insertions, 0 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 { |