Clean comments, namespace, and variable names

This CL removes TODOs and email addresses from comments, unifies some
namespaces and cleans a few variable names.  It is a copy of multiple
CLs on the widevine side.

Change-Id: I1bb649096476a5001a56d746427399de6a88ff69
This commit is contained in:
Fred Gylys-Colwell
2014-05-16 13:10:59 -07:00
parent 1dfd204f22
commit 6bac5bc50d
38 changed files with 154 additions and 1064 deletions

View File

@@ -547,11 +547,9 @@ bool SessionContext::RefreshKey(const KeyId& key_id,
// Decrypt encrypted key control block
std::vector<uint8_t> control;
if (key_control_iv.empty()) {
// TODO(fredg): get confirmation from server team this is valid.
LOGD("Key control block is NOT encrypted.");
control = key_control;
} else {
// TODO(fredg): get confirmation from server team this is valid, too.
LOGD("Key control block is encrypted.");
if (!DecryptMessage(content_key_value, key_control_iv, key_control,
&control)) {
@@ -1024,9 +1022,13 @@ OEMCryptoResult SessionContext::DecryptCTR(
size_t cipher_data_length, bool is_encrypted, uint8_t* clear_data,
BufferType buffer_type) {
// If the data is clear, we do not need a current key selected.
if (!is_encrypted && buffer_type != kBufferTypeDirect) {
memcpy(reinterpret_cast<uint8_t*>(clear_data),
cipher_data, cipher_data_length);
if (!is_encrypted) {
if (buffer_type != kBufferTypeDirect) {
memcpy(reinterpret_cast<uint8_t*>(clear_data), cipher_data,
cipher_data_length);
return OEMCrypto_SUCCESS;
}
// For reference implementation, we quietly drop the clear direct video.
return OEMCrypto_SUCCESS;
}
@@ -1083,7 +1085,7 @@ OEMCryptoResult SessionContext::DecryptCTR(
}
if (buffer_type == kBufferTypeDirect) {
// For reference implementation, we quietly drop direct video.
// For reference implementation, we quietly drop the decrypted direct video.
return OEMCrypto_SUCCESS;
}

View File

@@ -39,7 +39,6 @@ static void dump_hex(std::string name, const uint8_t* vector, size_t length) {
printf("NULL;\n");
return;
}
// TODO(fredgc): replace with HEXEncode.
for (size_t i = 0; i < length; i++) {
if (i == 0) {
printf("\n wvcdm::a2b_hex(\"");