From ef65e86ee279162458428359c10d3116c3a72918 Mon Sep 17 00:00:00 2001 From: Fred Gylys-Colwell Date: Sat, 10 Apr 2021 11:14:18 -0700 Subject: [PATCH] Modify OEMCrypto unit tests to allow 16.3 or 16.4 Merge from Widevine repo of http://go/wvgerrit/121790 Some unit tests expected OEMCrypto to be the latest ODK version, but we do not require this for v16. Bug: 184905579 Change-Id: Iccdbcc0b28587aad79a2a63d8c39a564a47fb585 --- libwvdrmengine/oemcrypto/test/oec_session_util.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libwvdrmengine/oemcrypto/test/oec_session_util.cpp b/libwvdrmengine/oemcrypto/test/oec_session_util.cpp index 0fc0f909..b2bf3de7 100644 --- a/libwvdrmengine/oemcrypto/test/oec_session_util.cpp +++ b/libwvdrmengine/oemcrypto/test/oec_session_util.cpp @@ -502,9 +502,13 @@ void LicenseRoundTrip::FillAndVerifyCoreRequest( oemcrypto_core_message::deserialize::CoreLicenseRequestFromMessage( core_message_string, &core_request_)); EXPECT_EQ(global_features.api_version, core_request_.api_major_version); - // If we are testing the latest OEMCrypto version, make sure it is built with - // the latest ODK version, too: - if (global_features.api_version == ODK_MAJOR_VERSION) { + if (global_features.api_version == 16) { + // We support either 16.3 or 16.4 for OEMCrypto 16. + EXPECT_LE(3, core_request_.api_minor_version); + EXPECT_GE(4, core_request_.api_minor_version); + } else if (global_features.api_version == ODK_MAJOR_VERSION) { + // If we are testing the latest OEMCrypto version, make sure it is built + // with the latest ODK version, too: EXPECT_EQ(ODK_MINOR_VERSION, core_request_.api_minor_version); } if (expect_request_has_correct_nonce_) {