From 3b4f3014683a439dd7f0d1e663743cf0641a05c1 Mon Sep 17 00:00:00 2001 From: forever2k38 Date: Mon, 7 Sep 2026 15:53:21 +0200 Subject: hash verification --- src/download.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/download.c') diff --git a/src/download.c b/src/download.c index a833932..fb5746d 100644 --- a/src/download.c +++ b/src/download.c @@ -1,3 +1,4 @@ +#include "hash.h" #include "package.h" #include "curl/curl.h" @@ -63,5 +64,14 @@ int pow_download_source(pow_package_source *src, const char *prefix) { return 1; } + if (pow_check_blake2b_hash(full_path, src->hash)) { + printf("hash mismatch. something is going wrong with downloading the file " + "or it may be tampered with.\n"); + + return 1; + } + + printf("hash verification succeeded, going through."); + return 0; } -- cgit v1.3