libgbl: combine Fuchsia/Android avb ops
Fuchsia and Android each had their own `avb::Ops` implementation, but
90% of the code was identical. This CL combines them to reduce
duplication.
For now there's a bool parameter to determine whether to use the cert
extensions or not, because initially Fuchsia always does and Android
never does. Eventually this will probably want to be a `GblOps` API
instead to open up the option for Android devices as well, but we don't
need it any time soon.
The main logic should be unchanged for both platforms, but more
unittests have been added and some error codes have been tightened up
(e.g. libavb NoSuchPartition/RangeOutsidePartition rather than the
previous generic IoError that was used everywhere).
Bug: b/363074091
Change-Id: I56f55e921f5ca12d9a77e042029e5e7007f15a16
6 files changed