]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
test-database: Remove signature checks
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 12 Dec 2019 13:34:21 +0000 (13:34 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 12 Dec 2019 13:34:21 +0000 (13:34 +0000)
These are performed in an extra test now

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/test-database.c

index 9e16608c1297e7d3b2c7bad002b8b4ed8a718456..228567bd28aedef1db66882b0e696b3a369f61b5 100644 (file)
@@ -40,20 +40,6 @@ const char* LICENSE = "CC";
 int main(int argc, char** argv) {
        int err;
 
-       // Open public key
-       FILE* public_key = fopen(ABS_SRCDIR "/examples/public-key.pem", "r");
-       if (!public_key) {
-               fprintf(stderr, "Could not open public key file: %s\n", strerror(errno));
-               exit(EXIT_FAILURE);
-       }
-
-       // Open private key
-       FILE* private_key = fopen(ABS_SRCDIR "/examples/private-key.pem", "r");
-       if (!private_key) {
-               fprintf(stderr, "Could not open private key file: %s\n", strerror(errno));
-               exit(EXIT_FAILURE);
-       }
-
        struct loc_ctx* ctx;
        err = loc_new(&ctx);
        if (err < 0)
@@ -61,7 +47,7 @@ int main(int argc, char** argv) {
 
        // Create a database
        struct loc_writer* writer;
-       err = loc_writer_new(ctx, &writer, private_key);
+       err = loc_writer_new(ctx, &writer, NULL);
        if (err < 0)
                exit(EXIT_FAILURE);
 
@@ -143,13 +129,6 @@ int main(int argc, char** argv) {
                exit(EXIT_FAILURE);
        }
 
-       // Verify the database signature
-       err = loc_database_verify(db, public_key);
-       if (err) {
-               fprintf(stderr, "Could not verify the database: %d\n", err);
-               exit(EXIT_FAILURE);
-       }
-
        // Try reading something from the database
        vendor = loc_database_get_vendor(db);
        if (!vendor) {
@@ -165,8 +144,5 @@ int main(int argc, char** argv) {
 
        loc_unref(ctx);
 
-       fclose(private_key);
-       fclose(public_key);
-
        return EXIT_SUCCESS;
 }