Merge "Give Nonce Error Explicit Name"
This commit is contained in:
committed by
Android (Google) Code Review
commit
2dbc81318a
@@ -54,7 +54,7 @@ enum CdmResponseType {
|
||||
CERT_PROVISIONING_GET_KEYBOX_ERROR_2,
|
||||
CERT_PROVISIONING_INVALID_CERT_TYPE,
|
||||
CERT_PROVISIONING_REQUEST_ERROR_1,
|
||||
CERT_PROVISIONING_REQUEST_ERROR_2, /* 15 */
|
||||
CERT_PROVISIONING_NONCE_GENERATION_ERROR, /* 15 */
|
||||
CERT_PROVISIONING_REQUEST_ERROR_3,
|
||||
CERT_PROVISIONING_REQUEST_ERROR_4,
|
||||
CERT_PROVISIONING_RESPONSE_ERROR_1,
|
||||
|
||||
@@ -178,7 +178,7 @@ CdmResponseType CertificateProvisioning::GetProvisioningRequest(
|
||||
uint32_t nonce;
|
||||
if (!crypto_session_.GenerateNonce(&nonce)) {
|
||||
LOGE("GetProvisioningRequest: fails to generate a nonce");
|
||||
return CERT_PROVISIONING_REQUEST_ERROR_2;
|
||||
return CERT_PROVISIONING_NONCE_GENERATION_ERROR;
|
||||
}
|
||||
|
||||
// The provisioning server does not convert the nonce to uint32_t, it just
|
||||
|
||||
@@ -84,7 +84,7 @@ class WvCdmEngineTest : public testing::Test {
|
||||
for (int i = 0; i < 2; i++) { // Retry once if there is a nonce problem.
|
||||
result = cdm_engine_.GetProvisioningRequest(
|
||||
cert_type, cert_authority, &prov_request, &provisioning_server_url);
|
||||
if (result == LICENSE_REQUEST_NONCE_GENERATION_ERROR) {
|
||||
if (result == CERT_PROVISIONING_NONCE_GENERATION_ERROR) {
|
||||
LOGW("Woops. Nonce problem. Try again?");
|
||||
sleep(1);
|
||||
} else {
|
||||
@@ -140,7 +140,7 @@ class WvCdmEngineTest : public testing::Test {
|
||||
CdmResponseType result = NO_ERROR;
|
||||
for (int i = 0; i < 2; i++) { // Retry once if there is a nonce problem.
|
||||
result = cdm_engine_.GenerateRenewalRequest(session_id_, &request);
|
||||
if (result == LICENSE_REQUEST_NONCE_GENERATION_ERROR) {
|
||||
if (result == LICENSE_RENEWAL_NONCE_GENERATION_ERROR) {
|
||||
LOGW("Woops. Nonce problem. Try again?");
|
||||
sleep(1);
|
||||
} else {
|
||||
|
||||
@@ -42,8 +42,8 @@ void PrintTo(const enum CdmResponseType& value, ::std::ostream* os) {
|
||||
case CERT_PROVISIONING_REQUEST_ERROR_1:
|
||||
*os << "CERT_PROVISIONING_REQUEST_ERROR_1";
|
||||
break;
|
||||
case CERT_PROVISIONING_REQUEST_ERROR_2:
|
||||
*os << "CERT_PROVISIONING_REQUEST_ERROR_2";
|
||||
case CERT_PROVISIONING_NONCE_GENERATION_ERROR:
|
||||
*os << "CERT_PROVISIONING_NONCE_GENERATION_ERROR";
|
||||
break;
|
||||
case CERT_PROVISIONING_REQUEST_ERROR_3:
|
||||
*os << "CERT_PROVISIONING_REQUEST_ERROR_3";
|
||||
|
||||
Reference in New Issue
Block a user