Skip to content

Commit

Permalink
Merge pull request #2465 from ljedrz/pk_further_tweaks
Browse files Browse the repository at this point in the history
Forbid empty private-key args
  • Loading branch information
ljedrz authored Aug 17, 2023
2 parents da84380 + 28f1c5e commit ede1870
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cli/src/commands/start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,13 @@ impl Start {
bail!("Both the private key string and file path flags were specified, please pick only one");
}

// If the private key is provided directly, don't do anything else.
if self.private_key.is_some() {
return Ok(());
// If the private key is provided directly, don't do anything else; make sure it's non-empty too.
if let Some(private_key) = &self.private_key {
if private_key.is_empty() {
bail!("The private-key argument can't be empty");
} else {
return Ok(());
}
}

// If a filesystem path to the private key is provided, attempt to
Expand Down

0 comments on commit ede1870

Please sign in to comment.