2lib: Move firmware body size reporting to separate function

We used to return the firmware body size as part of vb2api_init_hash().
With persistent context and other recent developments, coreboot is
caching less data itself and relying more on vboot's data structures, so
it may now need this information at more points than just during the
hashing process. So let's create a custom function to return this.

BRANCH=hatch
BUG=b:143994765
TEST=make runtests

Cq-Depend: chromium:1965837
Change-Id: I2bc968cd163016fd0130416c2679724caad895a2
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1965920
Reviewed-by: Mathew King <mathewk@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
5 files changed