Fix or ignore compiler warnings

Merge from Widevine repo of http://go/wvgerrit/24688

b/35466719

Change-Id: If89f0cad0c61f37536a84f8dadaf08072356343a
This commit is contained in:
Fred Gylys-Colwell
2017-03-21 15:09:02 -07:00
parent c4aad89fd0
commit 85365a1497
6 changed files with 35 additions and 31 deletions

View File

@@ -93,7 +93,7 @@ Session::Session()
num_keys_(4) { // Most tests only use 4 keys.
// Other tests will explicitly call set_num_keys.
// Stripe the padded message.
for (int i = 0; i < sizeof(padded_message_.padding); i++) {
for (size_t i = 0; i < sizeof(padded_message_.padding); i++) {
padded_message_.padding[i] = i % 0x100;
}
}
@@ -424,7 +424,7 @@ void Session::VerifyClientSignature(size_t data_length) {
// In the real world, a message should be signed by the client and
// verified by the server. This simulates that.
vector<uint8_t> data(data_length);
for (int i = 0; i < data.size(); i++) data[i] = i % 0xFF;
for (size_t i = 0; i < data.size(); i++) data[i] = i % 0xFF;
OEMCryptoResult sts;
size_t gen_signature_length = 0;
sts = OEMCrypto_GenerateSignature(session_id(), &data[0], data.size(), NULL,
@@ -580,7 +580,7 @@ void Session::LoadOEMCert(bool verify_cert) {
ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER,
OEMCrypto_GetOEMPublicCertificate(session_id(), NULL,
&public_cert_length));
ASSERT_GT(public_cert_length, 0);
ASSERT_LT(0u, public_cert_length);
public_cert.resize(public_cert_length);
ASSERT_EQ(OEMCrypto_SUCCESS,
OEMCrypto_GetOEMPublicCertificate(session_id(), &public_cert[0],
@@ -674,7 +674,6 @@ void Session::RewrapRSAKey(const struct RSAPrivateKeyMessage& encrypted,
}
}
void Session::RewrapRSAKey30(const struct RSAPrivateKeyMessage& encrypted,
size_t message_size,
const std::vector<uint8_t>& encrypted_message_key,
vector<uint8_t>* wrapped_key, bool force) {
size_t wrapped_key_length = 0;
@@ -861,8 +860,7 @@ void Session::UpdateUsageEntry(std::vector<uint8_t>* header_buffer) {
&encrypted_usage_entry_[0], &entry_buffer_length));
}
void Session::DeactivateUsageEntry(const std::string& pst,
OEMCryptoResult expect_result) {
void Session::DeactivateUsageEntry(const std::string& pst) {
ASSERT_EQ(OEMCrypto_SUCCESS,
OEMCrypto_DeactivateUsageEntry(
session_id(), reinterpret_cast<const uint8_t*>(pst.c_str()),