Log bad provisioning response
[ Merge of http://go/wvgerrit/156177 ] If the json from a provisioning request is not parsed, we log it as an error. Bug: 242744857 Test: WV unit/integration tests Change-Id: Ie8ff9388fb520c848b951d6102b23552ce309903
This commit is contained in:
@@ -566,7 +566,8 @@ CdmResponseType CertificateProvisioning::HandleProvisioningResponse(
|
|||||||
const bool result =
|
const bool result =
|
||||||
ExtractAndDecodeSignedMessage(response_message, &response);
|
ExtractAndDecodeSignedMessage(response_message, &response);
|
||||||
if (!result || response.empty()) {
|
if (!result || response.empty()) {
|
||||||
LOGE("Provisioning response message is an invalid JSON/base64 string");
|
LOGE("Provisioning response message is an invalid JSON/base64 string: %s",
|
||||||
|
response.c_str());
|
||||||
return CERT_PROVISIONING_RESPONSE_ERROR_1;
|
return CERT_PROVISIONING_RESPONSE_ERROR_1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -733,7 +734,7 @@ bool CertificateProvisioning::ExtractAndDecodeSignedMessage(
|
|||||||
|
|
||||||
if (start == provisioning_response.npos) {
|
if (start == provisioning_response.npos) {
|
||||||
// Message is not properly wrapped - reject it.
|
// Message is not properly wrapped - reject it.
|
||||||
LOGE("Cannot locate start substring");
|
LOGE("Cannot locate start substring '%s'", json_start_substr.c_str());
|
||||||
result->clear();
|
result->clear();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -742,7 +743,7 @@ bool CertificateProvisioning::ExtractAndDecodeSignedMessage(
|
|||||||
const size_t end = provisioning_response.find(
|
const size_t end = provisioning_response.find(
|
||||||
json_end_substr, start + json_start_substr.length());
|
json_end_substr, start + json_start_substr.length());
|
||||||
if (end == provisioning_response.npos) {
|
if (end == provisioning_response.npos) {
|
||||||
LOGE("Cannot locate end substring");
|
LOGE("Cannot locate end substring '%s'", json_end_substr.c_str());
|
||||||
result->clear();
|
result->clear();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user