int sig2_valid = 0;
// Check first signature
- if (db->signature1.data) {
+ if (db->signature1.length) {
hexdump(db->ctx, db->signature1.data, db->signature1.length);
r = EVP_DigestVerifyFinal(mdctx,
}
// Check second signature only when the first one was invalid
- if (r && db->signature2.data) {
+ if (db->signature2.length) {
hexdump(db->ctx, db->signature2.data, db->signature2.length);
r = EVP_DigestVerifyFinal(mdctx,
// If this node has a leaf, we will check if it matches
if (__loc_database_node_is_leaf(node_v1)) {
r = __loc_database_lookup_handle_leaf(db, address, network, network_address, level, node_v1);
- if (r <= 0)
+ if (r < 0)
return r;
}
- return 1;
+ // Return no error - even if nothing was found
+ return 0;
}
LOC_EXPORT int loc_database_lookup(struct loc_database* db,