Change ERROR_INVALID_RSA_KEY to ERROR_INVALID_KEY
[ Merge of http://go/wvgerrit/149269 ] This mostly affects tests and documentation. Bug: 201581141 Bug: 236317198 Change-Id: I1bc0ec4c3767106c01dfac9956f83ccfbffc49b7
This commit is contained in:
@@ -72,7 +72,7 @@ OEMCryptoResult DrmPrivateKey::GetSessionKey(
|
||||
if (rsa_key_) {
|
||||
if (!(rsa_key_->allowed_schemes() & kSign_RSASSA_PSS)) {
|
||||
LOGE("RSA key cannot be used for session key decryption");
|
||||
return OEMCrypto_ERROR_INVALID_RSA_KEY;
|
||||
return OEMCrypto_ERROR_INVALID_KEY;
|
||||
}
|
||||
size_t session_key_size = rsa_key_->SessionKeyLength();
|
||||
session_key->resize(session_key_size);
|
||||
@@ -168,7 +168,7 @@ OEMCryptoResult DrmPrivateKey::GenerateRsaSignature(
|
||||
size_t* signature_length) const {
|
||||
if (!rsa_key_) {
|
||||
LOGE("Only RSA DRM keys can generate PKCS1 signatures");
|
||||
return OEMCrypto_ERROR_INVALID_RSA_KEY;
|
||||
return OEMCrypto_ERROR_INVALID_KEY;
|
||||
}
|
||||
return rsa_key_->GenerateSignature(message, message_length, kRsaPkcs1Cast,
|
||||
signature, signature_length);
|
||||
|
||||
@@ -38,11 +38,11 @@ OEMCryptoResult VerifyRsaKey(const RSA* public_key,
|
||||
RsaPrivateKey::Load(private_key_data);
|
||||
if (!private_key) {
|
||||
LOGE("Failed to parse provided RSA private key");
|
||||
return OEMCrypto_ERROR_INVALID_RSA_KEY;
|
||||
return OEMCrypto_ERROR_INVALID_KEY;
|
||||
}
|
||||
if (!RsaKeysAreMatchingPair(public_key, private_key->GetRsaKey())) {
|
||||
LOGE("OEM certificate keys do not match");
|
||||
return OEMCrypto_ERROR_INVALID_RSA_KEY;
|
||||
return OEMCrypto_ERROR_INVALID_KEY;
|
||||
}
|
||||
return OEMCrypto_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -647,7 +647,7 @@ OEMCryptoResult RsaPublicKey::VerifySignaturePss(
|
||||
// Step 0: Ensure the signature algorithm is supported by key.
|
||||
if (!(allowed_schemes_ & kSign_RSASSA_PSS)) {
|
||||
LOGE("RSA key cannot verify using PSS");
|
||||
return OEMCrypto_ERROR_INVALID_RSA_KEY;
|
||||
return OEMCrypto_ERROR_INVALID_KEY;
|
||||
}
|
||||
// Step 1: Create a high-level key from RSA key.
|
||||
ScopedEvpPkey pkey(EVP_PKEY_new());
|
||||
@@ -715,7 +715,7 @@ OEMCryptoResult RsaPublicKey::VerifySignaturePkcs1Cast(
|
||||
// Step 0: Ensure the signature algorithm is supported by key.
|
||||
if (!(allowed_schemes_ & kSign_PKCS1_Block1)) {
|
||||
LOGE("RSA key cannot verify using PKCS1");
|
||||
return OEMCrypto_ERROR_INVALID_RSA_KEY;
|
||||
return OEMCrypto_ERROR_INVALID_KEY;
|
||||
}
|
||||
if (message_length > kRsaPkcs1CastMaxMessageSize) {
|
||||
LOGE("Message is too large for CAST PKCS1 signature: size = %zu",
|
||||
@@ -1158,7 +1158,7 @@ OEMCryptoResult RsaPrivateKey::GenerateSignaturePss(
|
||||
// Step 0: Ensure the signature algorithm is supported by key.
|
||||
if (!(allowed_schemes_ & kSign_RSASSA_PSS)) {
|
||||
LOGE("RSA key cannot sign using PSS");
|
||||
return OEMCrypto_ERROR_INVALID_RSA_KEY;
|
||||
return OEMCrypto_ERROR_INVALID_KEY;
|
||||
}
|
||||
// Step 1: Create a high-level key from RSA key.
|
||||
ScopedEvpPkey pkey(EVP_PKEY_new());
|
||||
@@ -1237,7 +1237,7 @@ OEMCryptoResult RsaPrivateKey::GenerateSignaturePkcs1Cast(
|
||||
// Step 0: Ensure the signature algorithm is supported by key.
|
||||
if (!(allowed_schemes_ & kSign_PKCS1_Block1)) {
|
||||
LOGE("RSA key cannot sign PKCS1");
|
||||
return OEMCrypto_ERROR_INVALID_RSA_KEY;
|
||||
return OEMCrypto_ERROR_INVALID_KEY;
|
||||
}
|
||||
if (message_length > kRsaPkcs1CastMaxMessageSize) {
|
||||
LOGE("Message is too large for CAST PKCS1 signature: size = %zu",
|
||||
|
||||
Reference in New Issue
Block a user