diff options
| author | forever2k38 <forever2k38@noreply.codeberg.org> | 2026-09-07 15:53:21 +0200 |
|---|---|---|
| committer | forever2k38 <forever2k38@noreply.codeberg.org> | 2026-09-07 15:53:21 +0200 |
| commit | 3b4f3014683a439dd7f0d1e663743cf0641a05c1 (patch) | |
| tree | e5c8cdbdcfaa32409eae3dccfc782414c942cade /src/download.c | |
| parent | 119d56047e5bd49c42ca7378a332707c021a81cc (diff) | |
hash verification
Diffstat (limited to 'src/download.c')
| -rw-r--r-- | src/download.c | 10 |
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; } |
