diff options
author | Timo Teräs <timo.teras@iki.fi> | 2021-06-09 18:21:40 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2021-06-11 13:35:32 +0300 |
commit | 7ce4cc4b739127c0b4b36ffcabc007e5781b13c9 (patch) | |
tree | 1f751b9dc62c59a1fa1e05d34550961f39719137 /src/package.c | |
parent | 7c9f001cda932c74164e8aaa6740dcb6d24aa62f (diff) | |
download | apk-tools-7ce4cc4b739127c0b4b36ffcabc007e5781b13c9.tar.gz apk-tools-7ce4cc4b739127c0b4b36ffcabc007e5781b13c9.tar.bz2 apk-tools-7ce4cc4b739127c0b4b36ffcabc007e5781b13c9.tar.xz apk-tools-7ce4cc4b739127c0b4b36ffcabc007e5781b13c9.zip |
add basic abstraction for cryptographic operations
- basic digesting and signing apis (subject still to fine tuning)
- update digest code, and adb signing for the thin wrapping layer
- old v1 package and database handling not updated
- default mkpkg file hash to sha256
ref #10744
Diffstat (limited to 'src/package.c')
-rw-r--r-- | src/package.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/package.c b/src/package.c index 5f0e88a..6cfa1a9 100644 --- a/src/package.c +++ b/src/package.c @@ -300,6 +300,12 @@ void apk_dep_from_pkg(struct apk_dependency *dep, struct apk_database *db, }; } +static const int apk_checksum_compare(const struct apk_checksum *a, const struct apk_checksum *b) +{ + return apk_blob_compare(APK_BLOB_PTR_LEN((char *) a->data, a->type), + APK_BLOB_PTR_LEN((char *) b->data, b->type)); +} + static int apk_dep_match_checksum(struct apk_dependency *dep, struct apk_package *pkg) { struct apk_checksum csum; @@ -912,7 +918,7 @@ int apk_pkg_read(struct apk_database *db, const char *file, struct apk_file_info fi; int r; - r = apk_fileinfo_get(AT_FDCWD, file, APK_CHECKSUM_NONE, &fi, &db->atoms); + r = apk_fileinfo_get(AT_FDCWD, file, 0, &fi, &db->atoms); if (r != 0) return r; |