From 407d39699bf72bb87e33086ba0ba2ee875e7809e Mon Sep 17 00:00:00 2001 From: Fred Gylys-Colwell Date: Sun, 5 May 2019 19:51:06 -0700 Subject: [PATCH] Test MAC signature after license reload Merge from Widevine repo of http://go/wvgerrit/78143 This verifies that the correct mac keys are used to sign a message when generating a usage report or secure stop. Test: unit tests on ref code and taimen Bug: 111261264 Change-Id: I7d56a6ff0aae68a5554f7ce84d467697d1f9997b --- libwvdrmengine/oemcrypto/test/oec_session_util.cpp | 3 +++ libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libwvdrmengine/oemcrypto/test/oec_session_util.cpp b/libwvdrmengine/oemcrypto/test/oec_session_util.cpp index 4ed98c50..a3134553 100644 --- a/libwvdrmengine/oemcrypto/test/oec_session_util.cpp +++ b/libwvdrmengine/oemcrypto/test/oec_session_util.cpp @@ -1359,6 +1359,9 @@ void Session::GenerateVerifyReport(const std::string& pst, Test_PST_Report expected(pst, status); ASSERT_NO_FATAL_FAILURE(VerifyReport(expected, time_license_received, time_first_decrypt, time_last_decrypt)); + // The PST report was signed above. Below we verify that the entire message + // that is sent to the server will be signed by the right mac keys. + ASSERT_NO_FATAL_FAILURE(VerifyClientSignature()); } void Session::CreateOldEntry(const Test_PST_Report& report) { diff --git a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp index 3674d835..c43b2c5b 100644 --- a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp +++ b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp @@ -5432,9 +5432,9 @@ TEST_P(UsageTableTestWithMAC, ReloadOfflineLicenseWithRefresh) { ASSERT_NO_FATAL_FAILURE(s.close()); } -// Verify that a license that has been we can still reload an offline license -// after OEMCrypto_Terminate and Initialize are called. This is as close to a -// reboot as we can do in a unit test. +// Verify that we can still reload an offline license after OEMCrypto_Terminate +// and Initialize are called. This is as close to a reboot as we can do in a +// unit test. TEST_P(UsageTableTestWithMAC, ReloadOfflineLicenseWithTerminate) { std::string pst = "my_pst"; Session s;