Revert "Verify index-meta"

This reverts commit 09125769bd.
This commit is contained in:
Juan RP 2020-01-06 14:48:39 +01:00
parent 10b2f7b425
commit 8b2c62adfc
No known key found for this signature in database
GPG Key ID: AF19F6CB482F9368

View File

@ -77,36 +77,15 @@ repo_get_dict(struct xbps_repo *repo)
archive_error_string(repo->ar)); archive_error_string(repo->ar));
return NULL; return NULL;
} }
return xbps_archive_get_dictionary(repo->ar, entry); dict = xbps_archive_get_dictionary(repo->ar, entry, &bytes);
} if (verified != NULL &&
bytes != NULL &&
(digest = xbps_buffer_hash_raw(bytes, strlen(bytes))) != NULL &&
xbps_dictionary_t HIDDEN repo_verify_index(repo, digest))
get_safe_idxmeta(xbps_dictionary_t full) { *verified = true;
static const char *keys[] = { free(digest);
"public-key", free(bytes);
"public-key-size", return dict;
"signature-by",
"signature-type",
};
static const unsigned fields_count = (sizeof keys)/(sizeof *keys);
xbps_dictionary_t safe = NULL;
if (full == NULL) {
return NULL;
}
safe = xbps_dictionary_create();
for (unsigned i = 0; i < fields_count; ++i) {
const char *key = keys[i];
xbps_object_t value = xbps_dictionary_get(full, key);
if (value != NULL) {
xbps_dictionary_set(safe, key, value);
}
}
return safe;
} }
bool bool