Sync oemcrypto reference code

This is a merge from the Widevine repo of
http://go/wvgerrit/117311
Update backwards compatibility builds

http://go/wvgerrit/117423
Restrict maximum size of key id
To protect from out-of-memory found by fuzz testing.

http://go/wvgerrit/117683
Generation number should wrap

The master generation number should wrap around on overflow. This
means that we cannot use less than to check for a skew of 1.

http://go/wvgerrit/119232
Replace 0 with nullptr

Bug: 176234903
Bug: 184866351
Bug: 161243686
Test: ran unit tests (CL affects test code only)
Merged-In: Ie787bcf9c66a7605700c3dc29a8aa16406926ce3
Change-Id: I2b02a36a70a0920f31ffc00de102a23516d4b20e
This commit is contained in:
Fred Gylys-Colwell
2021-06-21 23:10:45 +00:00
parent 52d3c9f7c1
commit 830a7acc48
9 changed files with 30 additions and 95 deletions

View File

@@ -107,7 +107,7 @@ class UsageTable {
OEMCryptoResult ShrinkUsageTableHeader(uint32_t new_table_size,
uint8_t* header_buffer,
size_t* header_buffer_length);
void ReleaseEntry(uint32_t index) { sessions_[index] = 0; }
void ReleaseEntry(uint32_t index) { sessions_[index] = nullptr; }
void IncrementGeneration();
static size_t SignedHeaderSize(size_t count);