From 349f4236b361a31329a17507ed43e57178b4fb54 Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Tue, 28 May 2024 11:14:31 -0400 Subject: [PATCH] chore: add error log when patch signature is invalid --- library/src/cache/signing.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/src/cache/signing.rs b/library/src/cache/signing.rs index 706ccce..d812737 100644 --- a/library/src/cache/signing.rs +++ b/library/src/cache/signing.rs @@ -3,7 +3,7 @@ use base64::Engine; use std::path::Path; // https://stackoverflow.com/questions/67087597/is-it-possible-to-use-rusts-log-info-for-tests #[cfg(test)] -use std::{println as info, println as debug}; // Workaround to use println! for logs. +use std::{println as info, println as debug, println as error}; // Workaround to use println! for logs. /// Reads the file at `path` and returns the SHA-256 hash of its contents as a String. pub fn hash_file>(path: P) -> Result { @@ -53,6 +53,7 @@ pub fn check_signature(message: &str, signature: &str, public_key: &str) -> Resu Err(_) => { // The error provided by `verify` is (by design) not helpful, so we ignore it. // See https://docs.rs/ring/latest/ring/error/struct.Unspecified.html + error!("Patch signature is invalid"); bail!("Patch signature is invalid") } }