summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-07-25io_archive: Use SOURCE_DATE_EPOCH for meta files instead of current timekpcyrd3-1/+18
[TT: minor stylistic changes]
2021-07-25adb: fix error handling of non-adb filesTimo Teräs2-3/+7
2021-07-23db: allow read-only operations without cacheTimo Teräs4-4/+24
fixes #10748
2021-07-23extract: rework uvol name logicTimo Teräs2-15/+16
Add uvol_name to struct apk_file_info so it can be passed down the extract callbacks in future work. Modify uvol name to not include the path, but just the filename portion.
2021-07-23extract: fix uvol parameter orderDaniel Golle1-1/+1
2021-07-22extract: remove unneeded argument from uvol_extractTimo Teräs1-3/+3
2021-07-22adb: add a small adb blob header with versions and root objectTimo Teräs5-39/+74
2021-07-22adb: refactor struct adb_header to adb_file_headerTimo Teräs4-39/+37
In struct adb, do not keep the whole header, just the schema in host byte order.
2021-07-22adb: make adb mmap/stream parser more united, add ADB_BLOCK_DATAXTimo Teräs4-47/+61
Harden the error checking of expected block types and their order. Add ADB_BLOCK_DATAX as reserved for >1GB blocks.
2021-07-22adb, convndx: check istream_close resultTimo Teräs2-3/+2
2021-07-22io: make apk_istream_get/read() fail on incomplete readTimo Teräs5-59/+44
2021-07-22io: formalize apk_ostream_write() always writing full dataTimo Teräs6-60/+46
2021-07-22rework apk_istream_splice and apk_istream_teeTimo Teräs10-204/+120
- apk_istream_splice usage is converted to apk_stream_copy which is the newer variant. With caching enabled by default, this makes more sense mmapping or using separate buffers. - apk_istream_tee is reworked to write to apk_ostream, which simplifies quite a bit of various things
2021-07-22io: rework apk_istream_get_* to not return erros in blob valueTimo Teräs10-66/+68
The interface was slightly cumbersome, so replace these functions to return explicit error, and make the return blob a pointer arg.
2021-07-22adb: remove the now unused get_default_int() hookTimo Teräs2-8/+1
It is no longer needed, and can be later reintroduced if needed.
2021-07-22adb: unify various interfaces to adb_m_processTimo Teräs12-220/+252
Removes code duplication, and puts important checks in one place. Support seamless decompression in adbdump.
2021-07-22adbsign: support compressed adb filesTimo Teräs4-6/+9
2021-07-22adb: support seamless de/compression of adb filesTimo Teräs9-22/+111
Add compression header of adb files. Support uncompressed and deflate compression at this time.
2021-07-22convndx: add error reportingTimo Teräs1-1/+5
2021-07-16libfetch: simplify code by merging protocol error handling branchesTimo Teräs2-36/+22
removes some code duplication
2021-07-16extract: fix integrity check failure to remove the bad file/volumeTimo Teräs1-33/+31
2021-07-16genhelp: improve to work with lua 5.1Timo Teräs2-7/+7
Fix the script to not contain \x00 escape which was the only new feature used. Fix the meson build script to use given lua interpreter for running the genhelp.lua. Based on patch from Daniel Golle <daniel@makrotopia.org>
2021-07-16check trust in adb_trust_write_signatures()Timo Teräs1-1/+3
Based on patch from Daniel Golle <daniel@makrotopia.org>
2021-07-06define APK_DEFAULT_ARCH for loongarch targetsAriadne Conill1-0/+6
Macros used have been taken from Loongson's work-in-progress GCC 12 port.
2021-06-23mkpkg, extract: implement support for symlinks, devices and fifosTimo Teräs4-33/+101
2021-06-21openssl: explicitly ignore BIO_reset() return valueTimo Teräs1-1/+1
This caused some -Wall errors on certain gcc versions due to BIO_reset() being a macro with explicit cast.
2021-06-21db: check syscall errors in update_permissions()Timo Teräs1-5/+18
2021-06-21print: handle write() errors in apk_print_progress()Timo Teräs3-19/+25
2021-06-19doc: add missing options to index, info, and versionRodrigo Lourenço3-12/+23
2021-06-19reduce misuse of error codes from errno.hTimo Teräs17-118/+141
2021-06-19crypto: improve compatibilityTimo Teräs3-7/+9
EVP_MD_CTX_set_pkey_ctx() is fairly new openssl function, and not existing in many alternative. Use EVP_MD_CTX_reset() which is slightly more heavy but more portable. Add also signature buffer lengths to work with RSA.
2021-06-19mkpkg: ignore special files with warning instead of erroringTimo Teräs1-2/+1
2021-06-19fixup some includesTimo Teräs7-6/+1
- remove unneeded assert.h - add needed limits.h
2021-06-19Document apk-searchRodrigo Lourenço3-0/+45
Fixes #10746.
2021-06-19Remove AUTHORS section from man pagesTimo Teräs22-110/+0
Use of an AUTHORS section is strongly discouraged. Generally, it is better not to clutter every page with a list of (over time potentially numerous) authors. Add your name to comments in sources, or the root level AUTHORS file instead.
2021-06-14update Makefile to include new v3 code and appletsTimo Teräs1-11/+11
2021-06-12crypto: make EVP_MD_CTX_FLAG_FINALISE optionalTimo Teräs1-0/+2
Improves compatibility with libressl, wolfssl and older openssl libraries not having the flag. Usage of this is optional as it's purely performance optimization related flag.
2021-06-11fix glibc build of crypto abstraction headerTimo Teräs1-0/+1
2021-06-11fix makefile build after crypto abstraction workTimo Teräs1-1/+1
2021-06-11extract: add experimental support for uvol volumesTimo Teräs3-3/+104
2021-06-11extract: new applet to extract v2 packagesTimo Teräs14-65/+413
2021-06-11add basic abstraction for cryptographic operationsTimo Teräs25-260/+462
- 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
2021-06-11mkpkg: new applet to create v2 packages with basic functionalityTimo Teräs17-210/+647
2021-06-11genadb: fix maximum inner adb limit checkingTimo Teräs2-1/+3
2021-05-31Disable progress bar on dumb terminals by defaultSören Tempel1-1/+4
The progress bar requires the terminal emulator to support ANSI escape sequences. Normally, TERM is set to dumb to indicate that the terminal emulator doesn't support any ANSI escape sequences. Attempting to use ANSI escape sequences on dumb terminals will lead to weird output. In order to make apk work by default, even on dumb terminals, this commit introduces an additional check which consults $TERM and disables the progress bar if it is set to "dumb".
2021-06-02add adbgen applet to generate databases from it's text dumpTimo Teräs14-8/+430
2021-05-26add abstraction to adb "walking" - a sax like API to enumerate whole dbTimo Teräs7-202/+357
This converts 'adbdump' applet to generate adb_walk api callbacks, and implement gentext backend to generate the yaml-like text output.
2021-05-19solver: don't consider requirer count for preferenceTimo Teräs3-18/+29
The original intent was to choose packages to which there is most dependencies. However, since the code has evolved this is has been mostly obsolete. And in fact now interferes with the provides and provides priority mechanism. Remove this as obsolete. Fixes #10742
2021-04-12io_archive: add bounds limit for uname and gname tar header fieldsTimo Teräs3-10/+11
Modify apk_resolve_[ug]id to take the user/groupname as a blob, so proper length checking is done and honored. ==31584== Conditional jump or move depends on uninitialised value(s) ==31584== at 0x5C8CA5: strlen (strlen.c:17) ==31584== by 0x432575: APK_BLOB_STR (apk_blob.h:79) ==31584== by 0x4350EB: apk_resolve_uid (io.c:1112) ==31584== by 0x43696C: apk_tar_parse (io_archive.c:152) ==31584== by 0x4271BC: apk_pkg_read (package.c:929) ==31584== by 0x402D75: add_main (app_add.c:163) ==31584== by 0x40D5FF: main (apk-static.c:516) Fixes a potential crash (DoS) on a crafted TAR file. CVE-2021-30139. Reported-by: Sören Tempel <soeren+git@soeren-tempel.net> Reviewed-by: Ariadne Conill <ariadne@dereferenced.org>
2021-04-11io: fix fd leak in error handling pathsTimo Teräs1-5/+20
apk_dir_foreach_file and apk_resolve_[ug]id needs to free the fd in case fdopen/fdopendir fails. Additionally this does not rely on fdopen to fail if openat() returned -1, making sure that we don't call any syscalls with invalid file handle.