Print key validation results in verbose mode

This commit is contained in:
Alex Page 2023-06-22 03:39:24 -04:00
parent e001afdaed
commit b95d46293c
3 changed files with 53 additions and 7 deletions

View file

@ -239,7 +239,13 @@ impl Cli {
)?;
Cli::print_key(&p_key);
if bink1998::verify(&self.e_curve, &self.gen_point, &self.pub_point, &p_key)? {
if bink1998::verify(
&self.e_curve,
&self.gen_point,
&self.pub_point,
&p_key,
self.options.verbose,
)? {
self.count += 1;
}
}
@ -276,7 +282,13 @@ impl Cli {
Cli::print_key(&p_key);
println!("\n");
if bink2002::verify(&self.e_curve, &self.gen_point, &self.pub_point, &p_key)? {
if bink2002::verify(
&self.e_curve,
&self.gen_point,
&self.pub_point,
&p_key,
self.options.verbose,
)? {
self.count += 1;
}
}
@ -291,7 +303,13 @@ impl Cli {
};
Self::print_key(&key);
if !bink1998::verify(&self.e_curve, &self.gen_point, &self.pub_point, &key)? {
if !bink1998::verify(
&self.e_curve,
&self.gen_point,
&self.pub_point,
&key,
self.options.verbose,
)? {
return Err(anyhow!("Product key is invalid! Wrong BINK ID?"));
}
@ -305,7 +323,13 @@ impl Cli {
};
Self::print_key(&key);
if !bink2002::verify(&self.e_curve, &self.gen_point, &self.pub_point, &key)? {
if !bink2002::verify(
&self.e_curve,
&self.gen_point,
&self.pub_point,
&key,
self.options.verbose,
)? {
return Err(anyhow!("Product key is invalid! Wrong BINK ID?"));
}