aboutsummaryrefslogtreecommitdiff
path: root/src/download.c
diff options
context:
space:
mode:
authorforever2k38 <forever2k38@noreply.codeberg.org>2026-09-07 15:53:21 +0200
committerforever2k38 <forever2k38@noreply.codeberg.org>2026-09-07 15:53:21 +0200
commit3b4f3014683a439dd7f0d1e663743cf0641a05c1 (patch)
treee5c8cdbdcfaa32409eae3dccfc782414c942cade /src/download.c
parent119d56047e5bd49c42ca7378a332707c021a81cc (diff)
hash verification
Diffstat (limited to 'src/download.c')
-rw-r--r--src/download.c10
1 files changed, 10 insertions, 0 deletions
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;
}