Update Unit tests and reference code

This patch adds a suite of tests for OEMCrypto that verifying buffer
overflow and off-by-one errors. The reference code has also been
updated to pass these tests.

The ODK library and the OEMCrypto API have not changed since the
release of version 16.4.
This commit is contained in:
Fred Gylys-Colwell
2021-01-25 19:51:10 -08:00
parent 7e3c282944
commit bb16924e69
45 changed files with 3119 additions and 489 deletions

View File

@@ -1,6 +1,6 @@
// Copyright 2019 Google LLC. All Rights Reserved. This file and proprietary
// source code may only be used and distributed under the Widevine Master
// License Agreement.
// source code may only be used and distributed under the Widevine License
// Agreement.
//
// TestSleep - Controls sleep and clock adjustment during tests.
//
@@ -44,8 +44,8 @@ class TestSleep {
// Roll the system clock forward to undo all previous calls to
// RollBackSystemTime. Returns true on success.
static bool ResetRollback() {
return total_clock_rollback_ == 0 ||
RollbackSystemTime(-total_clock_rollback_);
return total_clock_rollback_seconds_ == 0 ||
RollbackSystemTime(-total_clock_rollback_seconds_);
}
// Returns true if the system time can be rolled back. This is true on some
@@ -67,7 +67,7 @@ class TestSleep {
static CallBack* callback_;
// The sum of all calls to RollBackSystemTime. Kept so we can undo all changes
// at the end of a test.
static int total_clock_rollback_;
static int total_clock_rollback_seconds_;
};
} // namespace wvcdm