Code Drop Two (Update One)

This is the second code drop for the white-box api reference
implementation and tests. This corrects the errors in the license
white-box reference implementation and implements the remaining
test cases.

It should be noted that there is one test case missing, the test case
for handling ChromeOS's unique policy settings.

In order to make the tests easier to create and read, a license
builder class was created and golden content and keys were wrapped in
their own classes.

How key errors are communicated was changed in the API.
WB_RESULT_NO_SUCH_KEY and WB_RESULT_WRONG_KEY_TYPE were merged into
WB_RESULT_KEY_UNAVAILABLE.
This commit is contained in:
Aaron Vaage
2020-05-26 19:46:26 -07:00
parent 77f7ef98c0
commit ab70a5e358
18 changed files with 2908 additions and 665 deletions

View File

@@ -0,0 +1,34 @@
// Copyright 2020 Google LLC. All Rights Reserved.
#ifndef WHITEBOX_API_LICENSE_WHITEBOX_TEST_BASE_H_
#define WHITEBOX_API_LICENSE_WHITEBOX_TEST_BASE_H_
#include <memory>
#include "api/golden_data.h"
#include "api/license_whitebox.h"
#include "crypto_utils/rsa_key.h"
#include "testing/include/gtest/gtest.h"
namespace widevine {
class LicenseWhiteboxTestBase : public ::testing::Test {
protected:
void SetUp() override;
void TearDown() override;
// Modify a buffer so that it won't be the exact same as it was before. This
// to make it easier to invalidate signatures.
void Modify(std::vector<uint8_t>* data) const;
std::unique_ptr<RsaPublicKey> public_key_;
GoldenData golden_data_;
WB_License_Whitebox* whitebox_;
};
} // namespace widevine
#endif // WHITEBOX_API_LICENSE_WHITEBOX_TEST_BASE_H_