pvmfw: Encrypt instance.img entries
As the host owns the files backing the virtio-blk devices, encrypt the
entries in a tamper-evident way.
Derive the private key used for encryption from the sealing CDI. Note
that this patch uses a _randnonce() AEAD but doesn't provide entropy,
which will be added in a future patch.
Implement a wrapper for BoringSSL AEAD functions, key derivation,
hashing, and error handling. Implement the CRYPTO_sysrand* symbols those
require.
Add sterror(), required by ERR_reason_error_string, to vmbase instead of
using the Bionic version, which is harder to integrate due to
thread-safety support and TLS layout. Error reporting also requires the
standard bsearch() function.
Note: Entries added to an instance.img before applying this patch will
now be rejected.
Bug: 249723852
Test: atest MicrodroidHostTests
Change-Id: If41aa8e1961121d9aee116c14b54d983dd10f61e
diff --git a/pvmfw/Android.bp b/pvmfw/Android.bp
index 193ffa9..d78f4f2 100644
--- a/pvmfw/Android.bp
+++ b/pvmfw/Android.bp
@@ -13,6 +13,7 @@
],
rustlibs: [
"libaarch64_paging",
+ "libbssl_ffi_nostd",
"libbuddy_system_allocator",
"libdiced_open_dice_nostd",
"libfdtpci",