diff options
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; } |
