Instead of only recording the UUID field, which may not be of interest
to all tpmback implementations, provide a user-settable opaque pointer
associated with the tpmback instance.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
return status;
}
+/* Set up the opaque field to contain a pointer to the UUID */
+static void set_opaque_to_uuid(domid_t domid, unsigned int handle)
+{
+ tpmback_set_opaque(domid, handle, tpmback_get_uuid(domid, handle));
+}
+
TPM_RESULT vtpmmgr_init(int argc, char** argv) {
TPM_RESULT status = TPM_SUCCESS;
}
//Setup tpmback device
- init_tpmback(NULL, NULL);
+ init_tpmback(set_opaque_to_uuid, NULL);
//Setup tpm access
switch(opts.tpmdriver) {
tpmcmd->resp = respbuf;
/* Process the command */
- vtpmmgr_handle_cmd(tpmcmd->uuid, tpmcmd);
+ vtpmmgr_handle_cmd(tpmcmd->opaque, tpmcmd);
/* Send response */
tpmback_resp(tpmcmd);