Merge changes I10f0c1bc,I4abad9d6,Ic1d42756 into tm-dev am: d210233e58
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17300766 Change-Id: Idef2f4b8dfb60bead7bdaa8f370b2ebf853e045c
This commit is contained in:
@@ -1447,8 +1447,13 @@ CdmResponseType CryptoSession::GetBootCertificateChain(
|
|||||||
&additional_signature_length);
|
&additional_signature_length);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return MapOEMCryptoResult(sts, GET_BOOT_CERTIFICATE_CHAIN_ERROR,
|
if (sts != OEMCrypto_SUCCESS) {
|
||||||
"GetBootCertificateChain");
|
return MapOEMCryptoResult(sts, GET_BOOT_CERTIFICATE_CHAIN_ERROR,
|
||||||
|
"GetBootCertificateChain");
|
||||||
|
}
|
||||||
|
bcc->resize(bcc_length);
|
||||||
|
additional_signature->resize(additional_signature_length);
|
||||||
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
CdmResponseType CryptoSession::GenerateCertificateKeyPair(
|
CdmResponseType CryptoSession::GenerateCertificateKeyPair(
|
||||||
@@ -1494,6 +1499,11 @@ CdmResponseType CryptoSession::GenerateCertificateKeyPair(
|
|||||||
&wrapped_private_key_length, &oemcrypto_key_type),
|
&wrapped_private_key_length, &oemcrypto_key_type),
|
||||||
metrics_, oemcrypto_generate_certificate_key_pair_, status);
|
metrics_, oemcrypto_generate_certificate_key_pair_, status);
|
||||||
});
|
});
|
||||||
|
if (status != OEMCrypto_SUCCESS) {
|
||||||
|
return MapOEMCryptoResult(status, GENERATE_CERTIFICATE_KEY_PAIR_ERROR,
|
||||||
|
"GenerateCertificateKeyPair");
|
||||||
|
}
|
||||||
|
|
||||||
public_key->resize(public_key_length);
|
public_key->resize(public_key_length);
|
||||||
public_key_signature->resize(public_key_signature_length);
|
public_key_signature->resize(public_key_signature_length);
|
||||||
wrapped_private_key->resize(wrapped_private_key_length);
|
wrapped_private_key->resize(wrapped_private_key_length);
|
||||||
@@ -1505,13 +1515,10 @@ CdmResponseType CryptoSession::GenerateCertificateKeyPair(
|
|||||||
} else {
|
} else {
|
||||||
LOGE("Unexpected key type returned from GenerateCertificateKeyPair: %d",
|
LOGE("Unexpected key type returned from GenerateCertificateKeyPair: %d",
|
||||||
static_cast<int>(oemcrypto_key_type));
|
static_cast<int>(oemcrypto_key_type));
|
||||||
return MapOEMCryptoResult(status,
|
return GENERATE_CERTIFICATE_KEY_PAIR_UNKNOWN_TYPE_ERROR;
|
||||||
GENERATE_CERTIFICATE_KEY_PAIR_UNKNOWN_TYPE_ERROR,
|
|
||||||
"GenerateCertificateKeyPair");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return MapOEMCryptoResult(status, GENERATE_CERTIFICATE_KEY_PAIR_ERROR,
|
return NO_ERROR;
|
||||||
"GenerateCertificateKeyPair");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CdmResponseType CryptoSession::LoadOemCertificatePrivateKey(
|
CdmResponseType CryptoSession::LoadOemCertificatePrivateKey(
|
||||||
|
|||||||
@@ -1407,6 +1407,7 @@ Session::Session()
|
|||||||
Session::~Session() {
|
Session::~Session() {
|
||||||
if (!forced_session_id_ && open_) close();
|
if (!forced_session_id_ && open_) close();
|
||||||
if (public_rsa_) RSA_free(public_rsa_);
|
if (public_rsa_) RSA_free(public_rsa_);
|
||||||
|
if (public_ec_) EC_KEY_free(public_ec_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::open() {
|
void Session::open() {
|
||||||
|
|||||||
@@ -1340,6 +1340,8 @@ TEST_F(OEMCryptoProv40Test, GenerateCertificateKeyPairSuccess) {
|
|||||||
} else if (key_type == OEMCrypto_PrivateKeyType::OEMCrypto_ECC_Private_Key) {
|
} else if (key_type == OEMCrypto_PrivateKeyType::OEMCrypto_ECC_Private_Key) {
|
||||||
ASSERT_NO_FATAL_FAILURE(
|
ASSERT_NO_FATAL_FAILURE(
|
||||||
s.SetEcPublicKey(public_key.data(), public_key_size));
|
s.SetEcPublicKey(public_key.data(), public_key_size));
|
||||||
|
} else {
|
||||||
|
FAIL() << "Unknown private key type: " << static_cast<int>(key_type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user