I was thinking about a host computer having a hardware TPM (Trusted Platform Module), with which I can get trustworthy information about the platform (first and foremost, that I am not in a virtual machine).
Then I thought, what would happen, if I (a program of mine) was started in a VM and wanted to ask a (then virtual) TPM the same questions. Presumably I could try to get its certificate, based on the Endorsement Key, that only manufacturers like Intel can provide. A virtual TPM can't have something like this.
But: What if the vTPM works together with the hTPM, trying to make me think that I am not in a VM?
Can all the identifying information requests simply be passed through to the hTPM and the answers given into the VM to my program?
I think my question is a bit general and could become more specific, with the TPM at play, but:
How can you detect or circumvent a MITM, when he and the communication partner are on the same team?