Test: oc-mr1-release->pi-dev with this CL upgrade with L3 offline
licenses, pi-dev without this CL to pi-dev with this CL upgrade with L3
offline licenses, pi-dev with this CL->qt-dev with
http://go/wvgerrit/77111 upgrade with L3 offline licenses, Linux unit
tests, Android unit/integration tests
Bug: b/112611429
Merge of http://go/wvgerrit/77151
The Level 3 uses the getUniqueID method to uniquely identify devices to
save device keys. This method needs to be consistent and as part of the
method, the length is set. In previous versions, this length isn't set,
but starting from Pi, it is. What this means is that decryption of the
device keys fails, and therefore offline licenses are lost. As a
workaround, we attempt to decrypt the device keys with the length
parameter and with the default if we failed to decrypt. Since the
generation number is also encrypted by the unique id, in the case where
we succeed in decrypting with the default, we reencrypt the generation
number so it can be read in when we handle the usage table. Finally, we
reencrypt everything with the correct length unique id.
Change-Id: Id682771c3921dea35592914fc7a1aaa92fa6737a