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
6 files changed
tree: 326f8d3c0c234f593e7943311337b800096ba438
  1. apex/
  2. apkdmverity/
  3. authfs/
  4. avmd/
  5. compos/
  6. demo/
  7. docs/
  8. encryptedstore/
  9. javalib/
  10. launcher/
  11. libs/
  12. microdroid/
  13. microdroid_manager/
  14. pvmfw/
  15. rialto/
  16. tests/
  17. virtualizationmanager/
  18. virtualizationservice/
  19. vm/
  20. vm_payload/
  21. vmbase/
  22. vmclient/
  23. zipfuse/
  24. .clang-format
  25. .gitignore
  26. Android.bp
  27. OWNERS
  28. PREUPLOAD.cfg
  29. README.md
  30. TEST_MAPPING
README.md

Virtualization

This repository contains userspace services related to running virtual machines on Android, especially protected virtual machines. See the getting started documentation and Microdroid README for more information.