]> git.ipfire.org Git - pakfire.git/commitdiff
file: Refactor how we store digests
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 19 Aug 2022 12:27:03 +0000 (12:27 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 19 Aug 2022 12:27:03 +0000 (12:27 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
15 files changed:
src/_pakfire/file.c
src/_pakfire/package.c
src/libpakfire/db.c
src/libpakfire/dist.c
src/libpakfire/downloader.c
src/libpakfire/file.c
src/libpakfire/include/pakfire/file.h
src/libpakfire/include/pakfire/pakfire.h
src/libpakfire/libpakfire.sym
src/libpakfire/package.c
src/libpakfire/repo.c
src/libpakfire/request.c
src/libpakfire/transaction.c
src/libpakfire/util.c
tests/libpakfire/downloader.c

index b1a05ffeaf12f2b1b0cb68cf361a5c3c966eb59c..339cdeed3736145fb52c00635126e699227a912a 100644 (file)
@@ -248,11 +248,14 @@ static PyObject* File_digest(FileObject* self, PyObject* args) {
 }
 
 static PyObject* _File_hexdigest(FileObject* self, enum pakfire_digests type) {
-       const char* hexdigest = pakfire_file_get_hexdigest(self->file, type);
+       char* hexdigest = pakfire_file_get_hexdigest(self->file, type);
        if (!hexdigest)
                Py_RETURN_NONE;
 
-       return PyUnicode_FromString(hexdigest);
+       PyObject* obj = PyUnicode_FromString(hexdigest);
+       free(hexdigest);
+
+       return obj;
 }
 
 static PyObject* File_hexdigest(FileObject* self, PyObject* args) {
index 783e813f8635535114e41888949d6b6b8da844ef..dcb039dbd145c86ed7690938ffc38d102dc594da 100644 (file)
@@ -194,7 +194,7 @@ static void Package_set_uuid(PackageObject* self, PyObject* value) {
 }
 
 static PyObject* Package_get_hexdigest(PackageObject* self, enum pakfire_digests type) {
-       enum pakfire_digests digest = PAKFIRE_DIGEST_NONE;
+       enum pakfire_digests digest = 0;
 
        const char* hexdigest = pakfire_package_get_hexdigest(self->package, &digest);
        if (!hexdigest)
index 9cd02e73600e25be3d3ea645b1ccbad329ae9ff3..5ba760e58d7762c65c12e48aebc760c27c17e8ab 100644 (file)
@@ -851,7 +851,7 @@ static const struct pakfire_digest {
 } pakfire_digests[] = {
        { PAKFIRE_DIGEST_SHA512, "sha512:" },
        { PAKFIRE_DIGEST_SHA256, "sha256:" },
-       { PAKFIRE_DIGEST_NONE, NULL },
+       { 0, NULL },
 };
 
 static char* pakfire_db_pack_digest(enum pakfire_digests type, const char* hexdigest) {
@@ -872,7 +872,7 @@ static char* pakfire_db_pack_digest(enum pakfire_digests type, const char* hexdi
 }
 
 static const char* pakfire_db_unpack_digest(const char* hexdigest, enum pakfire_digests* type) {
-       *type = PAKFIRE_DIGEST_NONE;
+       *type = 0;
 
        // Don't do anything for empty input
        if (!hexdigest || !*hexdigest)
@@ -988,7 +988,7 @@ static int pakfire_db_file_add_digests(struct pakfire_db* db, unsigned long id,
                PAKFIRE_DIGEST_SHA256,
 
                // Sentinel
-               PAKFIRE_DIGEST_NONE,
+               0,
        };
 
        const char* sql = "INSERT INTO file_digests(file, type, digest) VALUES(?, ?, ?)";
@@ -1449,7 +1449,7 @@ int pakfire_db_add_package(struct pakfire_db* db,
                goto ERROR;
        }
 
-       enum pakfire_digests digest_type = PAKFIRE_DIGEST_NONE;
+       enum pakfire_digests digest_type = 0;
 
        const char* hexdigest = pakfire_package_get_hexdigest(pkg, &digest_type);
        if (hexdigest) {
@@ -1830,7 +1830,7 @@ static int pakfire_db_load_package(struct pakfire_db* db, struct pakfire_repo* r
        // Digest
        const char* digest = (const char*)sqlite3_column_text(stmt, 8);
        if (digest) {
-               enum pakfire_digests digest_type = PAKFIRE_DIGEST_NONE;
+               enum pakfire_digests digest_type = 0;
 
                // Unpack digest
                const char* hexdigest = pakfire_db_unpack_digest(digest, &digest_type);
index dc8120b4405a5e2097875bf060b5b93b9c4a62f4..9f06ffedf2f5819aa02bcdf860e4864f74e67be1 100644 (file)
@@ -260,7 +260,7 @@ static int pakfire_dist_add_source(struct pakfire* pakfire, struct pakfire_packa
        // Download the file if it does not exist in the cache
        if (access(cache_path, R_OK) != 0) {
                r = pakfire_downloader_retrieve(downloader, BASEURL, mirrorlist,
-                       NULL, filename, cache_path, PAKFIRE_DIGEST_NONE, NULL, 0, 0);
+                       NULL, filename, cache_path, 0, NULL, 0, 0);
                if (r)
                        return r;
        }
index 8349d513e32826e74473929a48835c10af73185e..626a66c0b31cf83e942cacf3e3cebe422a131cfa 100644 (file)
@@ -285,17 +285,12 @@ static struct pakfire_transfer* pakfire_downloader_create_transfer(
        }
 
        // Check if expected digest is set
-       switch (md) {
-               case PAKFIRE_DIGEST_NONE:
-                       break;
-
-               default:
-                       if (!expected_digest || !expected_digest_length) {
-                               ERROR(downloader->pakfire, "Expected message digest or size is not set\n");
-                               errno = EINVAL;
-                               return NULL;
-                       }
-                       break;
+       if (md) {
+               if (!expected_digest || !expected_digest_length) {
+                       ERROR(downloader->pakfire, "Expected message digest or size is not set\n");
+                       errno = EINVAL;
+                       return NULL;
+               }
        }
 
        // Expected digest length cannot be too long
@@ -357,9 +352,6 @@ static struct pakfire_transfer* pakfire_downloader_create_transfer(
                case PAKFIRE_DIGEST_SHA256:
                        transfer->md = EVP_sha256();
                        break;
-
-               case PAKFIRE_DIGEST_NONE:
-                       break;
        }
 
        // Copy the expected digest
index 6d28da9efb1440a26fd6af503dba36c9818c2f77..0dc6e167b3834b56b68ff894298ce40747f82182 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <archive_entry.h>
 #include <openssl/evp.h>
+#include <openssl/sha.h>
 
 #include <pakfire/constants.h>
 #include <pakfire/file.h>
 #include <pakfire/string.h>
 #include <pakfire/util.h>
 
-#define MAX_DIGESTS 4
-
-struct pakfire_file_digest {
-       enum pakfire_digests type;
-       unsigned char digest[EVP_MAX_MD_SIZE];
-       size_t length;
-
-       // Add a buffer to store the hex representation
-       char* hexdigest;
-};
-
 struct pakfire_file {
        struct pakfire* pakfire;
        int nrefs;
@@ -80,7 +70,13 @@ struct pakfire_file {
        char symlink[PATH_MAX];
 
        // Digests
-       struct pakfire_file_digest digests[MAX_DIGESTS];
+       struct pakfire_file_digests {
+               // SHA-512
+               unsigned char sha512[SHA512_DIGEST_LENGTH];
+
+               // SHA-256
+               unsigned char sha256[SHA256_DIGEST_LENGTH];
+       } digests;
 
        #warning TODO capabilities, config, data
        // capabilities
@@ -129,7 +125,7 @@ static const struct pakfire_libarchive_digest {
 } pakfire_libarchive_digests[] = {
        { PAKFIRE_DIGEST_SHA512, ARCHIVE_ENTRY_DIGEST_SHA512 },
        { PAKFIRE_DIGEST_SHA256, ARCHIVE_ENTRY_DIGEST_SHA256 },
-       { PAKFIRE_DIGEST_NONE, 0 },
+       { 0, 0 },
 };
 
 int pakfire_file_copy_archive_entry(struct pakfire_file* file, struct archive_entry* entry) {
@@ -177,9 +173,7 @@ int pakfire_file_copy_archive_entry(struct pakfire_file* file, struct archive_en
                        type->pakfire; type++) {
                const unsigned char* digest = archive_entry_digest(entry, type->libarchive);
                if (digest) {
-                       size_t length = pakfire_digest_length(type->pakfire);
-
-                       r = pakfire_file_set_digest(file, type->pakfire, digest, length);
+                       r = pakfire_file_set_digest(file, type->pakfire, digest);
                        if (r)
                                return r;
                }
@@ -229,18 +223,6 @@ struct archive_entry* pakfire_file_archive_entry(struct pakfire_file* file) {
 }
 
 static void pakfire_file_free(struct pakfire_file* file) {
-       struct pakfire_file_digest* digest = NULL;
-
-       // Free any generated hexdigests
-       for (unsigned int i = 0; i < MAX_DIGESTS; i++) {
-               digest = &file->digests[i];
-
-               if (digest->hexdigest) {
-                       free(digest->hexdigest);
-                       digest->hexdigest = NULL;
-               }
-       }
-
        pakfire_unref(file->pakfire);
        free(file);
 }
@@ -382,105 +364,75 @@ PAKFIRE_EXPORT void pakfire_file_set_mtime(struct pakfire_file* file, time_t tim
        file->mtime = time;
 }
 
-static struct pakfire_file_digest* pakfire_file_find_digest(
-               struct pakfire_file* file, enum pakfire_digests type) {
-       struct pakfire_file_digest* digest = NULL;
-
-       for (unsigned int i = 0; i < MAX_DIGESTS; i++) {
-               digest = &file->digests[i];
-
-               if (digest->type == type)
-                       return digest;
+/*
+       Returns one if the digest is not all zeros.
+*/
+static int pakfire_file_has_digest(const unsigned char* digest, const size_t length) {
+       for (unsigned int i = 0; i < length; i++) {
+               if (digest[i])
+                       return 1;
        }
 
-       // No match
-       return NULL;
+       return 0;
 }
 
 PAKFIRE_EXPORT const unsigned char* pakfire_file_get_digest(
-               struct pakfire_file* file, enum pakfire_digests type, size_t* length) {
-       const struct pakfire_file_digest* digest = pakfire_file_find_digest(file, type);
-       if (!digest)
-               return NULL;
+               struct pakfire_file* file, const enum pakfire_digests type, size_t* length) {
 
-       // Export length
-       if (length)
-               *length = digest->length;
+       switch (type) {
+               case PAKFIRE_DIGEST_SHA512:
+                       if (!pakfire_file_has_digest(file->digests.sha512, sizeof(file->digests.sha512)))
+                               return NULL;
 
-       return digest->digest;
-}
+                       if (length)
+                               *length = sizeof(file->digests.sha512);
 
-PAKFIRE_EXPORT const char* pakfire_file_get_hexdigest(
-               struct pakfire_file* file, enum pakfire_digests type) {
-       struct pakfire_file_digest* digest = pakfire_file_find_digest(file, type);
-       if (!digest)
-               return NULL;
+                       return file->digests.sha512;
+
+               case PAKFIRE_DIGEST_SHA256:
+                       if (!pakfire_file_has_digest(file->digests.sha256, sizeof(file->digests.sha256)))
+                               return NULL;
 
-       // Generate the hexdigest if non exists
-       if (!digest->hexdigest) {
-               const size_t length = pakfire_digest_length(digest->type);
-               if (!length)
-                       return NULL;
+                       if (length)
+                               *length = sizeof(file->digests.sha256);
 
-               digest->hexdigest = __pakfire_hexlify(digest->digest, length);
+                       return file->digests.sha256;
        }
 
-       return digest->hexdigest;
+       return NULL;
 }
 
 PAKFIRE_EXPORT int pakfire_file_set_digest(struct pakfire_file* file,
-               enum pakfire_digests type, const unsigned char* digest, size_t length) {
-       if (!digest || !length) {
+               const enum pakfire_digests type, const unsigned char* digest) {
+       if (!digest) {
                errno = EINVAL;
                return 1;
        }
 
-       // Find any existing digests of this type
-       struct pakfire_file_digest* d = pakfire_file_find_digest(file, type);
-
-       // If there is no digest, we will try finding a new one
-       if (!d)
-               d = pakfire_file_find_digest(file, PAKFIRE_DIGEST_NONE);
-
-       // If we could not find a free spot, we probably run out of space
-       if (!d) {
-               errno = ENOBUFS;
-               return 1;
-       }
+       switch (type) {
+               case PAKFIRE_DIGEST_SHA512:
+                       memcpy(file->digests.sha512, digest, sizeof(file->digests.sha512));
+                       break;
 
-       // Check if the digest fits into our pre-allocated buffer space
-       if (length > sizeof(d->digest)) {
-               errno = ENOBUFS;
-               return 1;
+               case PAKFIRE_DIGEST_SHA256:
+                       memcpy(file->digests.sha256, digest, sizeof(file->digests.sha256));
+                       break;
        }
 
-       // Store type & length
-       d->type = type;
-       d->length = length;
-
-       // Store digest
-       memcpy(d->digest, digest, d->length);
-
        return 0;
 }
 
-PAKFIRE_EXPORT int pakfire_file_set_hexdigest(struct pakfire_file* file,
-               enum pakfire_digests type, const char* hexdigest) {
-       const size_t digest_length = pakfire_digest_length(type);
-       if (!digest_length) {
-               errno = EINVAL;
-               return 1;
-       }
+PAKFIRE_EXPORT char* pakfire_file_get_hexdigest(
+               struct pakfire_file* file, const enum pakfire_digests type) {
+       const unsigned char* digest = NULL;
+       size_t length = 0;
 
-       // Allocate a buffer for the binary representation of the digest
-       unsigned char* digest = alloca(digest_length);
+       // Fetch the digest
+       digest = pakfire_file_get_digest(file, type, &length);
        if (!digest)
-               return 1;
-
-       // Convert from hex to binary
-       __pakfire_unhexlify(digest, digest_length, hexdigest);
+               return NULL;
 
-       return pakfire_file_set_digest(file, type, digest, digest_length);
+       return __pakfire_hexlify(digest, length);
 }
 
 static int pakfire_file_levels(struct pakfire_file* file) {
index 276fb9a4572813477e013c953913daba0e318c4c..7429c8ca7bd3c02b5e161cf9292c03bd848e8733 100644 (file)
@@ -66,14 +66,12 @@ void pakfire_file_set_ctime(struct pakfire_file* file, time_t time);
 time_t pakfire_file_get_mtime(struct pakfire_file* file);
 void pakfire_file_set_mtime(struct pakfire_file* file, time_t time);
 
-const unsigned char* pakfire_file_get_digest(
-       struct pakfire_file* file, enum pakfire_digests type, size_t* length);
-const char* pakfire_file_get_hexdigest(
-       struct pakfire_file* file, enum pakfire_digests type);
+const unsigned char* pakfire_file_get_digest(struct pakfire_file* file,
+       const enum pakfire_digests type, size_t* length);
+char* pakfire_file_get_hexdigest(struct pakfire_file* file,
+       const enum pakfire_digests type);
 int pakfire_file_set_digest(struct pakfire_file* file,
-       enum pakfire_digests type, const unsigned char* digest, size_t length);
-int pakfire_file_set_hexdigest(struct pakfire_file* file,
-       enum pakfire_digests type, const char* hexdigest);
+       const enum pakfire_digests type, const unsigned char* digest);
 
 struct pakfire_file* pakfire_file_parse_from_file(const char* list, unsigned int format);
 
index 6f972f6704fb47f42b9562bfd82102077c75e1d9..4b1d06c51af17a6de8b9508fe8223bce1c9738be 100644 (file)
@@ -30,7 +30,6 @@
 struct pakfire;
 
 enum pakfire_digests {
-       PAKFIRE_DIGEST_NONE   = 0,
        PAKFIRE_DIGEST_SHA256 = 1,
        PAKFIRE_DIGEST_SHA512 = 2,
 };
index 37378e8c9a211c2fbb5b77e8a1692d268b9e82f1..305db59275c1afcd39ada8a41290caa3549fb0b1 100644 (file)
@@ -96,7 +96,6 @@ global:
        pakfire_file_set_ctime;
        pakfire_file_set_digest;
        pakfire_file_set_group;
-       pakfire_file_set_hexdigest;
        pakfire_file_set_mode;
        pakfire_file_set_mtime;
        pakfire_file_set_path;
index 6d358183ed06c554698eaa676c8783f8985ccddc..735ca0f9f47c6b6bdaf2f4b185af5f12a7656a50 100644 (file)
@@ -404,7 +404,7 @@ static enum pakfire_digests pakfire_package_id2digest(Id id) {
                        return PAKFIRE_DIGEST_SHA256;
        }
 
-       return PAKFIRE_DIGEST_NONE;
+       return 0;
 }
 
 PAKFIRE_EXPORT const unsigned char* pakfire_package_get_digest(
@@ -586,7 +586,7 @@ PAKFIRE_EXPORT void pakfire_package_set_maintainer(struct pakfire_package* pkg,
 static int pakfire_package_make_cache_path(struct pakfire_package* pkg) {
        const char* filename = pakfire_package_get_filename(pkg);
 
-       enum pakfire_digests digest = PAKFIRE_DIGEST_NONE;
+       enum pakfire_digests digest;
        const char* hexdigest = pakfire_package_get_hexdigest(pkg, &digest);
 
        if (hexdigest && strlen(hexdigest) >= 3)
@@ -1135,7 +1135,7 @@ PAKFIRE_EXPORT char* pakfire_package_dump(struct pakfire_package* pkg, int flags
                if (build_id)
                        pakfire_package_dump_add_line(&string, _("Build ID"), build_id);
 
-               enum pakfire_digests digest = PAKFIRE_DIGEST_NONE;
+               enum pakfire_digests digest = 0;
 
                // Digest
                const char* hexdigest = pakfire_package_get_hexdigest(pkg, &digest);
@@ -1147,9 +1147,6 @@ PAKFIRE_EXPORT char* pakfire_package_dump(struct pakfire_package* pkg, int flags
                        case PAKFIRE_DIGEST_SHA256:
                                pakfire_package_dump_add_line(&string, _("SHA256 Digest"), hexdigest);
                                break;
-
-                       case PAKFIRE_DIGEST_NONE:
-                               break;
                }
 
                // Source package
index 0715dfbf99b06052da85950cdbce66fafea43a40..17c19fca2f4cd3cf89600cda1d42f59a22b1ae0b 100644 (file)
@@ -139,7 +139,7 @@ static int pakfire_repo_import_key(struct pakfire_repo* repo, const char* url) {
 
        // Try to download the key
        int r = pakfire_repo_retrieve(repo, NULL, url, path,
-               PAKFIRE_DIGEST_NONE, NULL, 0, PAKFIRE_TRANSFER_NOTEMP|PAKFIRE_TRANSFER_NOPROGRESS);
+               0, NULL, 0, PAKFIRE_TRANSFER_NOTEMP|PAKFIRE_TRANSFER_NOPROGRESS);
        if (r)
                goto ERROR;
 
@@ -307,7 +307,7 @@ static int pakfire_repo_download_database(struct pakfire_repo* repo, const char*
        pakfire_string_format(database_url, "repodata/%s", database);
 
        return pakfire_repo_retrieve(repo, title, database_url, cache_path,
-               PAKFIRE_DIGEST_NONE, NULL, 0, 0);
+               0, NULL, 0, 0);
 }
 
 static int pakfire_repo_read_metadata(struct pakfire_repo* repo, const char* path, int refresh) {
@@ -400,7 +400,7 @@ static int pakfire_repo_refresh_mirrorlist(struct pakfire_repo* repo, const int
 
        return pakfire_repo_retrieve(repo, NULL,
                repo->appdata->mirrorlist_url, repo->appdata->mirrorlist,
-               PAKFIRE_DIGEST_NONE, NULL, 0, PAKFIRE_TRANSFER_NOPROGRESS);
+               0, NULL, 0, PAKFIRE_TRANSFER_NOPROGRESS);
 }
 
 static int pakfire_repo_refresh_metadata(struct pakfire_repo* repo, const int force) {
@@ -415,7 +415,7 @@ static int pakfire_repo_refresh_metadata(struct pakfire_repo* repo, const int fo
        }
 
        int r = pakfire_repo_retrieve(repo, NULL,
-               "repodata/repomd.json", repo->appdata->metadata, PAKFIRE_DIGEST_NONE,
+               "repodata/repomd.json", repo->appdata->metadata, 0,
                NULL, 0, PAKFIRE_TRANSFER_NOPROGRESS);
        if (r)
                return r;
index 040ce4a72d81d22fe27ae609edbf603d9b9827cc..8607d93202195a07371430d2088cce03c5d6d50f 100644 (file)
@@ -471,7 +471,7 @@ static int pakfire_request_add_url(struct pakfire_request* request, int action,
 
        // Download the file
        r = pakfire_downloader_retrieve(downloader, NULL, NULL, NULL,
-                       url, path, PAKFIRE_DIGEST_NONE, NULL, 0, PAKFIRE_TRANSFER_NOTEMP);
+                       url, path, 0, NULL, 0, PAKFIRE_TRANSFER_NOTEMP);
        if (r)
                goto ERROR;
 
index fb47e5a47cebfadab8fb2713c40f22744bdf12b2..7d551e283b15b7c259c0efae156053df3f8e142b 100644 (file)
@@ -691,7 +691,7 @@ static int pakfire_transaction_verify(struct pakfire_transaction* transaction,
                return 0;
        }
 
-       enum pakfire_digests digest_type = PAKFIRE_DIGEST_NONE;
+       enum pakfire_digests digest_type = 0;
 
        // Fetch digest from package
        const unsigned char* expected_digest = pakfire_package_get_digest(pkg, &digest_type);
@@ -1169,7 +1169,7 @@ static int pakfire_transaction_download_package(struct pakfire_transaction* tran
                goto ERROR;
        }
 
-       enum pakfire_digests digest_type = PAKFIRE_DIGEST_NONE;
+       enum pakfire_digests digest_type = 0;
 
        // Retrieve package digest
        const unsigned char* digest = pakfire_package_get_digest(pkg, &digest_type);
index d901e5bad2d39c920b6ec008e124396c01b01710..49fbe2fec15311c55cf5ca663704d16a7b267322 100644 (file)
@@ -479,9 +479,6 @@ size_t pakfire_digest_length(enum pakfire_digests digest) {
 
                case PAKFIRE_DIGEST_SHA256:
                        return 32;
-
-               case PAKFIRE_DIGEST_NONE:
-                       return 0;
        }
 
        return 0;
index 94263ff17b7b32493a73fd073c38b47f9ae36ddd..e6618801fa416dfd8d9c5cd434a54fd2844cce31 100644 (file)
@@ -38,7 +38,7 @@ static int test_simple(const struct test* t) {
        // Retrieve a file
        ASSERT_SUCCESS(
                pakfire_downloader_retrieve(d, NULL, NULL, NULL, DOWNLOAD_URL, DOWNLOAD_PATH,
-                       PAKFIRE_DIGEST_NONE, NULL, 0, 0)
+                       0, NULL, 0, 0)
        );
 
        // Everything passed
@@ -61,13 +61,13 @@ static int test_retrieve_with_pending_transfers(const struct test* t) {
        // Add a transfer
        ASSERT_SUCCESS(
                pakfire_downloader_add_transfer(d, NULL, NULL, NULL, DOWNLOAD_URL, DOWNLOAD_PATH,
-                       PAKFIRE_DIGEST_NONE, NULL, 0, 0)
+                       0, NULL, 0, 0)
        );
 
        // Retrieve a file
        ASSERT_SUCCESS(
                pakfire_downloader_retrieve(d, NULL, NULL, NULL, DOWNLOAD_URL, DOWNLOAD_PATH,
-                       PAKFIRE_DIGEST_NONE, NULL, 0, 0)
+                       0, NULL, 0, 0)
        );
 
 
@@ -103,7 +103,7 @@ static int test_retrieve_with_mirrors(const struct test* t) {
 
        // Retrieve a file which exists
        ASSERT_SUCCESS(pakfire_downloader_retrieve(d, NULL, m,
-               NULL, "beep-1.3-2.ip3.x86_64.pfm", DOWNLOAD_PATH, PAKFIRE_DIGEST_NONE, NULL, 0, 0));
+               NULL, "beep-1.3-2.ip3.x86_64.pfm", DOWNLOAD_PATH, 0, NULL, 0, 0));
 
        // Everything passed
        r = EXIT_SUCCESS;
@@ -140,7 +140,7 @@ static int test_retrieve_online(const struct test* t) {
        ASSERT_SUCCESS(
                pakfire_downloader_retrieve(d, NULL, NULL, NULL,
                        "https://mirror1.ipfire.org/releases/pakfire/pakfire-0.9.27.tar.gz",
-                       DOWNLOAD_PATH, PAKFIRE_DIGEST_NONE, NULL, 0, 0)
+                       DOWNLOAD_PATH, 0, NULL, 0, 0)
        );
 
        // Everything passed