Implement the request_locality function. To set the locality on the backend we define vendor-specific TPM 1.2 and TPM 2 ordinals and send a command to the backend to set the locality for the next commands. To avoid recursing into requesting the locality, we set the TPM_TRANSMIT_RAW flag when calling tpm_transmit_cmd. To avoid recursing into TPM 2 space related commands, we set the space parameter to NULL.
Showing the changes to include/uapi/linux (1 of 3 files). Show all
Unified · Split
| @@ -46,4 +46,8 @@ struct vtpm_proxy_new_dev { · 45 unmodified lines | ||
| 46 | 46 | |
| 47 | 47 | #define VTPM_PROXY_IOC_NEW_DEV _IOWR(0xa1, 0x00, struct vtpm_proxy_new_dev) |
| 48 | 48 | |
| 49 | +/* vendor specific commands to set locality */ | |
| 50 | +#define TPM2_CC_SET_LOCALITY 0x20001000 | |
| 51 | +#define TPM_ORD_SET_LOCALITY 0x20001000 | |
| 52 | + | |
| 49 | 53 | #endif /* _UAPI_LINUX_VTPM_PROXY_H */ |