Add support for Trusty RpcServer to accept three types of client ids
Background:
- Trusty RpcServer implements the UnbufferedService trait whose methods
expect the client identifier to be of type Uuid.
- However, with the VM-TZ communication enabled by the TZ reduction
project, the clients from the VMs can be identified with a VM-ID or
a client sequence number.
- In ag/33192048, we introduce a new method to the UnbufferedService
trait to accept an enum with three variants representing the three
types of client identifiers.
This CL introduces the following changes:
- Update the C++ code for Trusty RpcServer to accept and pass on a
pointer to a tagged client id and the length, instead of a pointer to
a Uuid.
- Implement the new method: "on_new_connection" added to the
UnbufferedService trait and update the implementation of the existing
method "on_connect" to pass a pointer to a tagged client id and length
to the C++ code.
- Introduce a new constructor for the Trusty RpcServer, which takes a
new call back that accepts the new enum for the client identifier.
- Add a FFI-wrapper to invoke the new callback from the C++ code, and
update the FFI-wrapper for the existing callback to extract the Uuid
from a tagged client id data.
Bug: 401776482
Flag: EXEMPT, opt-in is controlled by TRUSTY_SYSTEM_VM
Test: ./build-root/build-qemu-generic-arm64-test-debug/run --headless
--boot-test "com.android.trusty.rust.authmgr_be_lib.test"
Change-Id: I67b0edd036ae50cc067db5d9e4844e3bff26f9fe
Loading
Please register or sign in to comment