Certificate provisioning proto updates

[ Merge of http://go/wvgerrit/117266 ]

These changes facilitate communication of provisioning errors from
provisioning service/SDK to the client.

Clients will indicate in the SignedProvisioningMessage whether they
support handling of error information in the ProvisioningResponse.
The provisioning service/SDK can then indicate why the provisioning
request is being rejected.

The protocol_version field from SignedProvisioningMessage has also been
broken into separate protocol version and provisioning type fields.
This will support changes planned for future releases.

Bug: 174174765
Test: WV unit/integration tests
Change-Id: Ic1a41ed8f83b69697300c586a78266fac20298fb
This commit is contained in:
Rahul Frias
2021-02-18 00:21:20 -08:00
parent a1d66834de
commit 41ecde78cc
4 changed files with 60 additions and 13 deletions

View File

@@ -263,10 +263,11 @@ bool FakeProvisioningServer::MakeResponse(
? "WIDEVINE_DRM"
: "X509");
video_widevine::SignedProvisioningMessage::ProtocolVersion version =
signed_request.protocol_version();
LOGD("Request uses protocol version: %d", version);
if (version != video_widevine::SignedProvisioningMessage::PROVISIONING_20) {
const video_widevine::SignedProvisioningMessage::ProvisioningType
provisioning_type = signed_request.provisioning_type();
LOGD("Request uses provisioning type: %d", provisioning_type);
if (provisioning_type !=
video_widevine::SignedProvisioningMessage::PROVISIONING_20) {
LOGE("Fake provisioning server only handles Keyboxes");
return false;
}
@@ -314,7 +315,7 @@ bool FakeProvisioningServer::MakeResponse(
// Sign the response.
video_widevine::SignedProvisioningMessage signed_response;
signed_response.set_protocol_version(signed_request.protocol_version());
signed_response.set_provisioning_type(signed_request.provisioning_type());
std::string message;
provisioning_response.SerializeToString(&message);
signed_response.set_message(message);