platform_hardware_interfaces/keymaster/4.0
Janis Danisevskis 93c7276e3a Fix strict weak ordering requirement of less than operation
operator< on hidl_vec<uint8_t> violates strict weak ordering in the case
that one oparand is shorter that the other and the shorter is a prefix
of the longer.

if x and y are incomparable, i.e., neither x < y nor y < x and
   y and z are incomparable, i.e., neither y < z nor z < y, then
   x and z must be incomparable.
As for the current implementation the first two statements are true but
the third is not given the following example input:
x:="aa", y:="a", z:="ab".

This patch fixes the issue by defining a < b if a is a prefix of b.

As this relation is used in a std::sort algorithm which demands strict
weak ordering this bug leads to undefined behavior.

Change-Id: I4961bb35e2fd4f5fcf561ec0c7c536f81830aab8
2019-03-19 09:54:04 -07:00
..
default Fix default keymaster so it doesn't start an extra thread. 2018-05-24 20:52:11 +00:00
support Fix strict weak ordering requirement of less than operation 2019-03-19 09:54:04 -07:00
vts pack VTS cc_test binaries as general-tests 2018-12-07 10:49:56 -08:00
Android.bp Update makefies: no 'types' 2019-03-04 11:27:17 -08:00
IKeymasterDevice.hal Fixed minor comment typos in IKeymasterDevice.hal 2018-09-26 06:10:20 +00:00
types.hal Minor corrections to the Keymaster4 documentation. 2018-05-30 16:20:48 -06:00