Re: [PATCH v4 2/2] tpm_emulator: Read control channel response in 2 passes

2024-10-17 Thread Daniel P . Berrangé
On Wed, Oct 16, 2024 at 01:51:29PM -0400, Stefan Berger wrote: > Error responses from swtpm are typically only 4 bytes long with the > exception of a few commands that return more bytes. Therefore, read the > entire response in 2 steps and stop if the first few bytes indicate an > error response wi

[PATCH v4 2/2] tpm_emulator: Read control channel response in 2 passes

2024-10-16 Thread Stefan Berger
Error responses from swtpm are typically only 4 bytes long with the exception of a few commands that return more bytes. Therefore, read the entire response in 2 steps and stop if the first few bytes indicate an error response with no subsequent bytes readable. Read the rest in a 2nd step, if needed