110 Commits

Author SHA1 Message Date
Andrew Gunnerson 4069429361 Version 3.23.2
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-11-04 20:55:17 -05:00
Andrew Gunnerson f0970aa80c Version 3.23.1
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-10-02 19:37:41 -04:00
Andrew Gunnerson f4e5c55fe9 Version 3.23.0
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-09-30 20:39:13 -04:00
Andrew Gunnerson c16636a68c Update dependencies
The only breaking changes are a few types from lzma-rust2 being renamed.

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-09-30 20:15:20 -04:00
Andrew Gunnerson 91074ae4c8 Update dependencies and fix clippy 1.90 lints
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-09-21 18:51:25 -04:00
Andrew Gunnerson a5c628b66f Version 3.22.0
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-08-27 23:47:22 -04:00
Andrew Gunnerson 2460d1807d Update dependencies
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-08-27 23:24:42 -04:00
Andrew Gunnerson 8f71b61b21 Version 3.21.0
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-08-23 21:18:59 -04:00
Andrew Gunnerson d75b87d3df Update dependencies
The e2e checksums were updated because the new lzma-rust2 version has
slight differences in compression ratio.

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-08-23 18:18:39 -04:00
Andrew Gunnerson 7d0bb378a6 Switch to rawzip crate for zip file handling
rawzip is a lower-level zip file library that is much more suited for
avbroot's use case. Its speed improvements aren't too important since
OTAs only have a handful of files, but it is a simpler layer of
abstraction and exposes more about zip file internals. We also no longer
need to maintain a perpetual fork of the zip library.

The only caveat is that rawzip (much like avbroot) is built around
writing zip files in a streaming fashion. To support `--zip-mode
seekable`, the output file is post-processed to copy the relevant data
descriptor fields to the local header. The unused data descriptors
remain in the file to avoid needing to shift file data, but this does
not violate the spec and Android's libziparchive accepts it just fine.

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-08-20 21:12:27 -04:00
Andrew Gunnerson c019ccad1c Version 3.20.0
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-08-10 22:35:40 -04:00
Andrew Gunnerson 339267149f Update dependencies and fix clippy lints
if-let chains!

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-08-10 22:21:24 -04:00
Andrew Gunnerson 2683781737 cli/avb: Add new subcommand to verify device partitions
This adds a new `avbroot avb verify-device` subcommand, which is just
like the normal `verify` subcommand, except it reads the actual
partitions on the device. This is only available with the Android build
of avbroot since it needs to run on the actual device.

Fixes: #482

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-08-10 21:24:28 -04:00
Andrew Gunnerson d7369e73e9 Remove cap-std and cap-tempfile dependencies
There is not much benefit for our use case to have kernel-level
openat-style sandboxing of paths. We already check all untrusted paths
for safety and the sandboxing prevented the use of symlinks that point
outside of the parent directory of specified paths.

This commit also moves the path safety checks to the util module to
avoid having multiple implementations spread out everywhere.

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-08-10 19:50:43 -04:00
Andrew Gunnerson ac95660e23 Switch to rust-lzma2 for XZ compression/decompression
The performance, both in CPU time and compression ratios, is very
comparable to liblzma. This lets us drop the last remaining
compression-related dependency written in C.

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-08-10 16:20:41 -04:00
Andrew Gunnerson 2bac85f080 Version 3.19.0
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-08-07 23:23:18 -04:00
Andrew Gunnerson 6a1da333eb Version 3.18.1
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-08-07 01:53:44 -04:00
Andrew Gunnerson 59cf37faaf Version 3.18.0
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-08-06 21:41:13 -04:00
Andrew Gunnerson 6aacc5a76c Update dependencies
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-08-06 21:33:54 -04:00
Andrew Gunnerson cd38217111 Version 3.17.2
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-07-03 14:48:16 -04:00
Andrew Gunnerson 8ca4eb5ad9 Version 3.17.1
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-07-01 19:07:13 -04:00
Andrew Gunnerson e397998d9e Update dependencies
The zip crate gained support for streaming writes in its master branch,
so we can finally upgrade from our ancient fork of it. The new
implementation is done a bit differently, with seekable writers having
the ZipWriter<W> type and streaming writers having the
ZipWriter<StreamWriter<W>> type. This forces us to add a new wrapper
type since we have to switch between them at runtime.

We still need to maintain a (hopefully temporary) fork of the crate due
to a few issues:

1. There's no way to get the original underlying writer instance back
   after finalizing a streaming zip. A fix for this has been submitted
   upstream:
   https://github.com/zip-rs/zip2/pull/367

2. The streaming writes implementation does not include the magic
   signature for data descriptors. While the zip spec says the magic
   value is optional and parsers should not require it, older versions
   of Android's libziparchive do. A fix for this has been submitted
   upstream:
   https://github.com/zip-rs/zip2/pull/368

3. There is currently no way to get the data offset of zip entries.
   avbroot requires this to fill in the OTA metadata's "property files"
   entries, which Android uses to read file data without parsing the zip
   file structures.

This new zip update produces files that are slightly different to
before. The "version made by" and "version needed to extract" fields are
now set to their minimum possible values. Previously, the zip crate was
hardcoded to use versions 4.6 and 2.0, respectively.

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-06-19 18:55:08 -04:00
Andrew Gunnerson 72a1c3f216 Version 3.17.0
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-05-31 12:00:31 -04:00
Andrew Gunnerson 1448e55205 Update dependencies
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-05-31 10:21:14 -04:00
Andrew Gunnerson b1410c869d Version 3.16.1
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-05-19 22:54:52 -04:00
Andrew Gunnerson 0eac8e6614 Update dependencies
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-05-19 22:37:32 -04:00
Andrew Gunnerson 19129ae927 Version 3.16.0
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-05-04 18:15:02 -04:00
Andrew Gunnerson 182d937d34 Update all dependencies
This also fixes a number of disabled-by-default clippy warnings and
updates the Rust edition to 2024.

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-05-04 18:06:59 -04:00
Andrew Gunnerson da124e4e05 Version 3.15.0
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-04-06 00:09:21 -04:00
Andrew Gunnerson 98745afe33 Update dependencies
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-04-05 23:54:20 -04:00
Andrew Gunnerson f2e47a65d4 Switch back to ring
This reverts commit e929ecbe44.

Ring is back to being maintained again, so let's switch back to it since
it has fewer build dependencies and is much faster to compile.

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-04-05 23:52:53 -04:00
Andrew Gunnerson 3f09a506a0 Version 3.14.0
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-03-23 19:27:05 -04:00
Andrew Gunnerson 796e2a4fa2 Update dependencies
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-03-23 19:17:15 -04:00
Andrew Gunnerson 0cdc7172dd Version 3.13.0
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-03-12 18:39:59 -04:00
Andrew Gunnerson a62d0a5c91 Update dependencies
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-03-12 18:25:35 -04:00
Andrew Gunnerson e929ecbe44 Replace ring with aws-lc
The author of ring recently announced that the library is no longer
being maintained and fixes for security issues may be significantly
delayed. Big thanks to Brian Smith for creating and maintaining the
library for so long!

This commit replaces ring with aws-lc, a cryptography library maintained
by Amazon AWS. It seems to be well-regarded and is used by high-profile
projects like rustls. It is also API-compatible with ring, so it is
effectively a drop-in replacement.

Unfortunately, we still cannot switch back to the RustCrypto SHA1 and
SHA2 implementations because they are still significantly slower than
ring and aws-lc on systems that do not support the SHA-NI extensions.

https://rustsec.org/advisories/RUSTSEC-2025-0007

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-02-21 20:44:19 -05:00
Andrew Gunnerson 0dab7aa32c Switch to stable bzip2-rs release and use zlib-rs flate2 backend
* There is now a stable release of bzip2-rs with the fix for both the C
  and Rust versions of bzip2 being compiled.

* The zlib-rs deflate implementation is faster than the default
  miniz_oxide. Changing this requires updating the checksums in the e2e
  tests due to slight differences in compression levels between the two
  implementations.

* Temporarily silence RUSTSEC-2025-0007 to avoid blocking CI. The ring
  library is no longer maintained.

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-02-21 19:27:18 -05:00
Andrew Gunnerson 43db728b9d Version 3.12.0
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-01-26 18:20:06 -05:00
Andrew Gunnerson 80d5f19223 Update dependencies
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2025-01-26 18:10:42 -05:00
Andrew Gunnerson cf064e145d Version 3.11.0
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-12-25 20:05:57 -05:00
Andrew Gunnerson 2d4f08f48b Update dependencies
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-12-25 19:56:02 -05:00
Andrew Gunnerson e0b114cf71 Switch to upstream master branch of bzip2-rs
The only remaining fix from our fork has been merged. This can be
switched to a stable release after the next release.

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-12-25 14:59:44 -05:00
Andrew Gunnerson d1b6bce227 Update bzip2-rs to 0.5.0 and switch to Rust backend implementation
The bzip2-rs library now has a new maintainer (same folks that maintain
the sudo-rs project). Version 0.5.0 was recently released, which
includes some much needed bug fixes, but is missing one final one, so we
still need to keep our fork for now.

This commit also switches the backend implementation from the official C
implementation to a Rust implementation maintained by the bzip2-rs
folks. This leaves xz as the only C dependency remaining in avbroot.

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-12-11 20:23:40 -05:00
Andrew Gunnerson 05cd74719e Version 3.10.0
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-12-08 19:20:39 -05:00
Andrew Gunnerson b351d47f28 Update dependencies and fix most pedantic clippy warnings
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-12-08 18:46:40 -05:00
Andrew Gunnerson 99c5800f96 Update dependencies and pin Github Actions actions to specific commits
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-12-01 17:42:35 -05:00
Andrew Gunnerson 5c353a5f42 Remove unused byteorder crate
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-12-01 17:04:57 -05:00
Andrew Gunnerson b2610fa0e9 Update zerocopy to 0.8.11
>=0.8.10 is needed for the new read_from_io()/write_to_io() helper
functions.

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-12-01 16:57:39 -05:00
Andrew Gunnerson 983e6c40a5 Version 3.9.0
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-11-11 20:04:59 -05:00
Andrew Gunnerson 0d1beb7734 Update dependencies
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-11-11 19:54:50 -05:00