One wasn't able to get more than a few bytes (far less than the 4kb limit) from Tspi_TPM_GetRandom without raising a "Bad input size" error.
One wasn't able to get more than a few bytes (far less than the 4kb limit) from Tspi_TPM_GetRandom without raising a "Bad input size" error.

The 'offset' attribute is not reset between each call when less bytes
are received than requested, which cause an malformed request to
be sent on subsequent iterations. Also the memcpy  operation always
overwrite the beginning of the destination buffer ateach iteration,
letting the other part uninitialized.

Signed-off-by: Jean Revertera <72d9a6a557b852e43ca9a8bc0d329404c86ed75a@no-log.org>

Distrotech/trousers,Distrotech/trousers,Distrotech/trousers,emilcondrea/trousers,emilcondrea/trousers,emilcondrea/trousers