diff options
author | Timo Teräs <timo.teras@iki.fi> | 2019-12-13 15:22:33 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2020-02-28 23:18:52 +0200 |
commit | 9530fbfa044bedf5821ff5ffffb7d4f3994f603f (patch) | |
tree | a54a0dcc1eff93429c822fcb89dfaccb73ab6285 /src/database.c | |
parent | c054fbc11e9beca0d45285c3e1f448c81416c5ce (diff) | |
download | apk-tools-v3.0-wip.tar.bz2 apk-tools-v3.0-wip.tar.xz |
adb: introduce apk-tools database format, and few appletsv3.0-wip
This is a flat buffers inspired format that allows fast
mmaped access to the data with low overhead, signature support
and relatively good forward support.
Diffstat (limited to 'src/database.c')
-rw-r--r-- | src/database.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/database.c b/src/database.c index 06d1619..18cfc0d 100644 --- a/src/database.c +++ b/src/database.c @@ -1652,6 +1652,12 @@ int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts) dbopts->keys_dir ?: "etc/apk/keys", O_RDONLY | O_CLOEXEC); + r = adb_trust_init(&db->trust, dup(db->keys_fd), dbopts->private_keys); + if (r) { + msg = "Unable to read trusted keys"; + goto ret_r; + } + if (apk_flags & APK_OVERLAY_FROM_STDIN) { apk_flags &= ~APK_OVERLAY_FROM_STDIN; apk_db_read_overlay(db, apk_istream_from_fd(STDIN_FILENO)); @@ -1827,6 +1833,8 @@ void apk_db_close(struct apk_database *db) db->cache_remount_dir = NULL; } + adb_trust_free(&db->trust); + if (db->keys_fd) close(db->keys_fd); if (db->cache_fd) |