Fix bugs in authorization set deserialization

Added a value check when deserializing a boolean tag. Booleans are converted to
int when serializing so they should only be 0 or 1 when deserializing. Any
other value means the data is malformed.

Check the entire buffer is consumed after deserializing tags. The total number
of bytes read while deserializing tags must be equal to the number of bytes
reported (elements_size) otherwise the data is malformed.

Bug: 110153632
Test: VtsHalKeymasterV3_0TargetTest
Change-Id: I780caebb8492d15ca6f59b24ab2b03c57a8e2317
1 file changed