Update ODK version to 18.4 and unit tests

Test: odk tests, opk_ta, fake_l1_tests
Bug: 294440012
Merged from https://widevine-internal-review.googlesource.com/181150

Change-Id: Ia33962f9d244333b1ca17c9a64efc29de35db093
This commit is contained in:
Cong Lin
2023-08-03 11:11:51 -07:00
committed by Robert Shih
parent 10d9bc272f
commit 7277331f92
6 changed files with 11 additions and 10 deletions

View File

@@ -26,9 +26,9 @@ struct CoreMessageFeatures {
// This is the published version of the ODK Core Message library. The default // This is the published version of the ODK Core Message library. The default
// behavior is for the server to restrict messages to at most this version // behavior is for the server to restrict messages to at most this version
// number. The default is 18.3. // number. The default is 18.4.
uint32_t maximum_major_version = 18; uint32_t maximum_major_version = 18;
uint32_t maximum_minor_version = 3; uint32_t maximum_minor_version = 4;
bool operator==(const CoreMessageFeatures &other) const; bool operator==(const CoreMessageFeatures &other) const;
bool operator!=(const CoreMessageFeatures &other) const { bool operator!=(const CoreMessageFeatures &other) const {

View File

@@ -16,10 +16,10 @@ extern "C" {
/* The version of this library. */ /* The version of this library. */
#define ODK_MAJOR_VERSION 18 #define ODK_MAJOR_VERSION 18
#define ODK_MINOR_VERSION 3 #define ODK_MINOR_VERSION 4
/* ODK Version string. Date changed automatically on each release. */ /* ODK Version string. Date changed automatically on each release. */
#define ODK_RELEASE_DATE "ODK v18.3 2023-07-07" #define ODK_RELEASE_DATE "ODK v18.4 2023-08-03"
/* The lowest version number for an ODK message. */ /* The lowest version number for an ODK message. */
#define ODK_FIRST_VERSION 16 #define ODK_FIRST_VERSION 16

View File

@@ -28,7 +28,7 @@ CoreMessageFeatures CoreMessageFeatures::DefaultFeatures(
features.maximum_minor_version = 2; // 17.2 features.maximum_minor_version = 2; // 17.2
break; break;
case 18: case 18:
features.maximum_minor_version = 3; // 18.3 features.maximum_minor_version = 4; // 18.4
break; break;
default: default:
features.maximum_minor_version = 0; features.maximum_minor_version = 0;

View File

@@ -272,7 +272,7 @@ OEMCryptoResult ODK_InitializeSessionValues(ODK_TimerLimits* timer_limits,
nonce_values->api_minor_version = 2; nonce_values->api_minor_version = 2;
break; break;
case 18: case 18:
nonce_values->api_minor_version = 3; nonce_values->api_minor_version = 4;
break; break;
default: default:
nonce_values->api_minor_version = 0; nonce_values->api_minor_version = 0;

View File

@@ -1216,7 +1216,7 @@ std::vector<VersionParameters> TestCases() {
// number. // number.
{16, ODK_MAJOR_VERSION, ODK_MINOR_VERSION, 16, 5}, {16, ODK_MAJOR_VERSION, ODK_MINOR_VERSION, 16, 5},
{17, ODK_MAJOR_VERSION, ODK_MINOR_VERSION, 17, 2}, {17, ODK_MAJOR_VERSION, ODK_MINOR_VERSION, 17, 2},
{18, ODK_MAJOR_VERSION, ODK_MINOR_VERSION, 18, 3}, {18, ODK_MAJOR_VERSION, ODK_MINOR_VERSION, 18, 4},
// Here are some known good versions. Make extra sure they work. // Here are some known good versions. Make extra sure they work.
{ODK_MAJOR_VERSION, 16, 3, 16, 3}, {ODK_MAJOR_VERSION, 16, 3, 16, 3},
{ODK_MAJOR_VERSION, 16, 4, 16, 4}, {ODK_MAJOR_VERSION, 16, 4, 16, 4},
@@ -1226,12 +1226,13 @@ std::vector<VersionParameters> TestCases() {
{ODK_MAJOR_VERSION, 18, 1, 18, 1}, {ODK_MAJOR_VERSION, 18, 1, 18, 1},
{ODK_MAJOR_VERSION, 18, 2, 18, 2}, {ODK_MAJOR_VERSION, 18, 2, 18, 2},
{ODK_MAJOR_VERSION, 18, 3, 18, 3}, {ODK_MAJOR_VERSION, 18, 3, 18, 3},
{ODK_MAJOR_VERSION, 18, 4, 18, 4},
{0, 16, 3, 16, 3}, {0, 16, 3, 16, 3},
{0, 16, 4, 16, 4}, {0, 16, 4, 16, 4},
{0, 16, 5, 16, 5}, {0, 16, 5, 16, 5},
{0, 17, 1, 17, 1}, {0, 17, 1, 17, 1},
{0, 17, 2, 17, 2}, {0, 17, 2, 17, 2},
{0, 18, 3, 18, 3}, // Change to 19 when the default version is updated. {0, 18, 4, 18, 4}, // Change to 19 when the default version is updated.
}; };
return test_cases; return test_cases;
} }

View File

@@ -156,7 +156,7 @@ TEST_F(OEMCryptoClientTest, FreeUnallocatedSecureBufferNoFailure) {
*/ */
TEST_F(OEMCryptoClientTest, VersionNumber) { TEST_F(OEMCryptoClientTest, VersionNumber) {
const std::string log_message = const std::string log_message =
"OEMCrypto unit tests for API 18.3. Tests last updated 2023-07-07"; "OEMCrypto unit tests for API 18.4. Tests last updated 2023-08-03";
cout << " " << log_message << "\n"; cout << " " << log_message << "\n";
cout << " " cout << " "
<< "These tests are part of Android U." << "These tests are part of Android U."
@@ -165,7 +165,7 @@ TEST_F(OEMCryptoClientTest, VersionNumber) {
// If any of the following fail, then it is time to update the log message // If any of the following fail, then it is time to update the log message
// above. // above.
EXPECT_EQ(ODK_MAJOR_VERSION, 18); EXPECT_EQ(ODK_MAJOR_VERSION, 18);
EXPECT_EQ(ODK_MINOR_VERSION, 3); EXPECT_EQ(ODK_MINOR_VERSION, 4);
EXPECT_EQ(kCurrentAPI, static_cast<unsigned>(ODK_MAJOR_VERSION)); EXPECT_EQ(kCurrentAPI, static_cast<unsigned>(ODK_MAJOR_VERSION));
OEMCrypto_Security_Level level = OEMCrypto_SecurityLevel(); OEMCrypto_Security_Level level = OEMCrypto_SecurityLevel();
EXPECT_GT(level, OEMCrypto_Level_Unknown); EXPECT_GT(level, OEMCrypto_Level_Unknown);