Skip to content

Commit 9700e26

Browse files
switch to printing a warning instead of failing
1 parent 4543ffa commit 9700e26

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/dist/download.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ impl<'a> DownloadCfg<'a> {
151151
/// Downloads a file, sourcing its hash from the same url with a `.sha256` suffix.
152152
/// If `update_hash` is present, then that will be compared to the downloaded hash,
153153
/// and if they match, the download is skipped.
154+
/// Verifies the signature found at the same url with a `.asc` suffix, and prints a
155+
/// warning when the signature does not verify, or is not found.
154156
pub fn download_and_check(
155157
&self,
156158
url_str: &str,
@@ -198,7 +200,11 @@ impl<'a> DownloadCfg<'a> {
198200

199201
// No signatures for tarballs for now.
200202
if !url_str.ends_with(".tar.gz") && !url_str.ends_with(".tar.xz") {
201-
self.check_signature(&url_str, &file)?;
203+
if let Err(err) = self.check_signature(&url_str, &file) {
204+
// TODO: this should probably be warn!, but log is not used in this part of the code
205+
// at the moment.
206+
println!("Invalid signature detected: {}", err);
207+
}
202208
}
203209

204210
Ok(Some((file, partial_hash)))

0 commit comments

Comments
 (0)