Add clang-tidy support for the OPK Linux port

Bug: 256230932
Change-Id: I4f46e285376101ff129c1fca5c80a259c70cc0c7
This commit is contained in:
Ian Benz
2023-04-04 15:38:26 +00:00
committed by Robert Shih
parent 44e21cb9c2
commit b9d857649e
10 changed files with 27 additions and 38 deletions

View File

@@ -27,8 +27,6 @@
#include "oemcrypto_types.h"
#include "pst_report.h"
using namespace std;
// GTest requires PrintTo to be in the same namespace as the thing it prints,
// which is std::vector in this case.
namespace std {
@@ -38,13 +36,15 @@ void PrintTo(const vector<uint8_t>& value, ostream* os);
} // namespace std
namespace wvoec {
using namespace std;
// OEMCrypto Fuzzing: Set max signture length to 1mb.
const size_t MB = 1024 * 1024;
// Make sure this is larger than kMaxKeysPerSession.
constexpr size_t kMaxNumKeys = 30;
namespace {
#if defined(TEST_SPEED_MULTIPLIER) // Can slow test time limits when
// debugging is slowing everything.
constexpr int kSpeedMultiplier = TEST_SPEED_MULTIPLIER;
@@ -57,7 +57,6 @@ constexpr uint32_t kDuration = 2 * kSpeedMultiplier;
constexpr uint32_t kLongDuration = 5 * kSpeedMultiplier;
constexpr int32_t kTimeTolerance = 3 * kSpeedMultiplier;
constexpr int64_t kUsageTableTimeTolerance = 10 * kSpeedMultiplier;
} // namespace
// Note: The API does not specify a maximum key id length. We specify a
// maximum just for these tests, so that we have a fixed message size.
@@ -158,7 +157,7 @@ class RoundTrip {
required_request_signature_size_(0),
encrypted_response_length_(0),
response_signature_length_(0) {}
virtual ~RoundTrip() {}
virtual ~RoundTrip() = default;
// Have OEMCrypto sign a request message and then verify the signature and the
// core message.
@@ -380,7 +379,7 @@ class LicenseRoundTrip
: RoundTrip(session),
control_(wvoec::kControlNonceEnabled),
num_keys_(4),
pst_(""),
pst_(),
minimum_srm_version_(0),
update_mac_keys_(true),
api_version_(kCurrentAPI),
@@ -519,7 +518,7 @@ class RenewalRoundTrip
void EncryptAndSignResponse() override;
void InjectFuzzedResponseData(OEMCrypto_Renewal_Response_Fuzz& fuzzed_data,
const uint8_t* renewal_response,
const size_t renewal_response_size);
size_t renewal_response_size);
OEMCryptoResult LoadResponse() override { return LoadResponse(session_); }
OEMCryptoResult LoadResponse(Session* session) override;
uint64_t renewal_duration_seconds() const {
@@ -852,6 +851,7 @@ OEMCryptoResult GetKeyHandleIntoVector(OEMCrypto_SESSION session,
size_t key_id_length,
OEMCryptoCipherMode cipher_mode,
vector<uint8_t>& key_handle);
} // namespace wvoec
#endif // CDM_OEC_SESSION_UTIL_H_