Add Privacy Mode and Serivce Certificate Support
This merges the following changes from the Widevine CDM repository:
da001b6 Add Privacy mode and service certificate
This adds support to the CDM for privacy mode and service certificates.
92bf200 Add support for using Youtube Content Protection server for testing
Enables testing with Youtube Content Protection server. Google Play license
server is still the default. Select YTCP server by using the flag -icp
e.g. adb shell '/system/bin/request_license_test -icp'
85dcd60 Fixes to enable privacy mode
These includes changes to use PKCS7 padding, corrected root CA formatting
and changes to integration test. Also refactored service certificate
handling.
989971c Correction to request license test
Corrected PropertySetTest to provision when needed. Also added disabled
privacy tests to run against YTCP staging server until GooglePlay
integration is complete.
Bug: 10109249
Change-Id: If81d68c65d743d77a485406f48d1be41a74de0af
This commit is contained in:
@@ -22,7 +22,6 @@ UrlRequest::UrlRequest(const std::string& url, const std::string& port,
|
||||
port_.assign(port);
|
||||
}
|
||||
if (socket_.Connect((server_url_).c_str(), port_, true, secure_connection)) {
|
||||
LOGD("connected to %s", socket_.domain_name().c_str());
|
||||
is_connected_ = true;
|
||||
} else {
|
||||
LOGE("failed to connect to %s, port=%s", socket_.domain_name().c_str(),
|
||||
@@ -99,26 +98,6 @@ void UrlRequest::ConcatenateChunkedResponse(const std::string http_response,
|
||||
}
|
||||
}
|
||||
|
||||
void UrlRequest::DumpMessage(const std::string& description,
|
||||
const std::string& message) {
|
||||
if (description.empty()) return;
|
||||
|
||||
LOGD("%s (%d bytes):", description.c_str(), message.size());
|
||||
|
||||
size_t remaining = message.size();
|
||||
size_t portion = 0;
|
||||
size_t start = 0;
|
||||
while (remaining > 0) {
|
||||
// LOGX may not get to empty its buffer if it is too large,
|
||||
// pick an arbitrary small size to be safe
|
||||
portion = (remaining < 512) ? remaining : 512;
|
||||
LOGD("%s", message.substr(start, portion).c_str());
|
||||
start += portion;
|
||||
remaining -= portion;
|
||||
}
|
||||
LOGD("total bytes dumped(%d)", start);
|
||||
}
|
||||
|
||||
int UrlRequest::GetResponse(std::string* message) {
|
||||
message->clear();
|
||||
|
||||
@@ -137,7 +116,7 @@ int UrlRequest::GetResponse(std::string* message) {
|
||||
} while (bytes > 0);
|
||||
|
||||
ConcatenateChunkedResponse(response, message);
|
||||
LOGD("%d bytes returned", message->size());
|
||||
LOGD("HTTP response: (%d): %s", message->size(), b2a_hex(*message).c_str());
|
||||
return message->size();
|
||||
}
|
||||
|
||||
@@ -202,6 +181,8 @@ bool UrlRequest::PostRequest(const std::string& data) {
|
||||
request_.append("\r\n\r\n");
|
||||
|
||||
socket_.Write(request_.c_str(), request_.size());
|
||||
LOGD("HTTP request: (%d): %s", request_.size(), request_.c_str());
|
||||
LOGD("HTTP request: (%d): %s", request_.size(), b2a_hex(request_).c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -221,6 +202,8 @@ bool UrlRequest::PostCertRequestInQueryString(const std::string& data) {
|
||||
request_.append("\r\n"); // terminates the request
|
||||
|
||||
socket_.Write(request_.c_str(), request_.size());
|
||||
LOGD("HTTP request: (%d): %s", request_.size(), request_.c_str());
|
||||
LOGD("HTTP request: (%d): %s", request_.size(), b2a_hex(request_).c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user