| Index: net/android/keystore_openssl.cc
|
| diff --git a/net/android/keystore_openssl.cc b/net/android/keystore_openssl.cc
|
| index 91c5b78fbe6abab07a2bd513694e45cc2a2a25bf..88578981f5349d8e52a56aa4b161d05be7bbacc4 100644
|
| --- a/net/android/keystore_openssl.cc
|
| +++ b/net/android/keystore_openssl.cc
|
| @@ -179,7 +179,7 @@ int RsaMethodEncrypt(RSA* rsa,
|
| int padding) {
|
| NOTIMPLEMENTED();
|
| OPENSSL_PUT_ERROR(RSA, encrypt, RSA_R_UNKNOWN_ALGORITHM_TYPE);
|
| - return 1;
|
| + return 0;
|
| }
|
|
|
| int RsaMethodSignRaw(RSA* rsa,
|
| @@ -198,7 +198,7 @@ int RsaMethodSignRaw(RSA* rsa,
|
| // the same Android version as the "NONEwithRSA"
|
| // java.security.Signature algorithm, so the same version checks
|
| // for GetRsaLegacyKey should work.
|
| - OPENSSL_PUT_ERROR(RSA, sign_raw, RSA_R_UNKNOWN_ALGORITHM_TYPE);
|
| + OPENSSL_PUT_ERROR(RSA, sign_raw, RSA_R_UNKNOWN_PADDING_TYPE);
|
| return 0;
|
| }
|
|
|
| @@ -271,8 +271,8 @@ int RsaMethodDecrypt(RSA* rsa,
|
| size_t in_len,
|
| int padding) {
|
| NOTIMPLEMENTED();
|
| - OPENSSL_PUT_ERROR(RSA, decrypt, RSA_R_UNKNOWN_PADDING_TYPE);
|
| - return 1;
|
| + OPENSSL_PUT_ERROR(RSA, decrypt, RSA_R_UNKNOWN_ALGORITHM_TYPE);
|
| + return 0;
|
| }
|
|
|
| int RsaMethodVerifyRaw(RSA* rsa,
|
| @@ -284,7 +284,7 @@ int RsaMethodVerifyRaw(RSA* rsa,
|
| int padding) {
|
| NOTIMPLEMENTED();
|
| OPENSSL_PUT_ERROR(RSA, verify_raw, RSA_R_UNKNOWN_ALGORITHM_TYPE);
|
| - return 1;
|
| + return 0;
|
| }
|
|
|
| const RSA_METHOD android_rsa_method = {
|
| @@ -445,9 +445,9 @@ jobject EcKeyGetKey(const EC_KEY* ec_key) {
|
| return ex_data->private_key;
|
| }
|
|
|
| -size_t EcdsaMethodGroupOrderSize(const EC_KEY* key) {
|
| +size_t EcdsaMethodGroupOrderSize(const EC_KEY* ec_key) {
|
| KeyExData* ex_data = reinterpret_cast<KeyExData*>(EC_KEY_get_ex_data(
|
| - key, global_boringssl_engine.Get().ec_key_ex_index()));
|
| + ec_key, global_boringssl_engine.Get().ec_key_ex_index()));
|
| return ex_data->cached_size;
|
| }
|
|
|
| @@ -455,9 +455,9 @@ int EcdsaMethodSign(const uint8_t* digest,
|
| size_t digest_len,
|
| uint8_t* sig,
|
| unsigned int* sig_len,
|
| - EC_KEY* eckey) {
|
| + EC_KEY* ec_key) {
|
| // Retrieve private key JNI reference.
|
| - jobject private_key = EcKeyGetKey(eckey);
|
| + jobject private_key = EcKeyGetKey(ec_key);
|
| if (!private_key) {
|
| LOG(WARNING) << "Null JNI reference passed to EcdsaMethodSign!";
|
| return 0;
|
| @@ -473,7 +473,7 @@ int EcdsaMethodSign(const uint8_t* digest,
|
|
|
| // Note: With ECDSA, the actual signature may be smaller than
|
| // ECDSA_size().
|
| - size_t max_expected_size = ECDSA_size(eckey);
|
| + size_t max_expected_size = ECDSA_size(ec_key);
|
| if (signature.size() > max_expected_size) {
|
| LOG(ERROR) << "ECDSA Signature size mismatch, actual: "
|
| << signature.size() << ", expected <= "
|
| @@ -490,7 +490,7 @@ int EcdsaMethodVerify(const uint8_t* digest,
|
| size_t digest_len,
|
| const uint8_t* sig,
|
| size_t sig_len,
|
| - EC_KEY* eckey) {
|
| + EC_KEY* ec_key) {
|
| NOTIMPLEMENTED();
|
| OPENSSL_PUT_ERROR(ECDSA, ECDSA_do_verify, ECDSA_R_NOT_IMPLEMENTED);
|
| return 0;
|
| @@ -504,7 +504,7 @@ int EcdsaMethodVerify(const uint8_t* digest,
|
| // is owned by and destroyed with the EVP_PKEY. I.e. the caller shall
|
| // always free |private_key| after the call.
|
| bool GetEcdsaPkeyWrapper(jobject private_key, EVP_PKEY* pkey) {
|
| - crypto::ScopedEC_KEY eckey(
|
| + crypto::ScopedEC_KEY ec_key(
|
| EC_KEY_new_method(global_boringssl_engine.Get().engine()));
|
|
|
| ScopedJavaGlobalRef<jobject> global_key;
|
| @@ -526,9 +526,9 @@ bool GetEcdsaPkeyWrapper(jobject private_key, EVP_PKEY* pkey) {
|
| ex_data->cached_size = VectorBignumSize(order);
|
|
|
| EC_KEY_set_ex_data(
|
| - eckey.get(), global_boringssl_engine.Get().ec_key_ex_index(), ex_data);
|
| + ec_key.get(), global_boringssl_engine.Get().ec_key_ex_index(), ex_data);
|
|
|
| - EVP_PKEY_assign_EC_KEY(pkey, eckey.release());
|
| + EVP_PKEY_assign_EC_KEY(pkey, ec_key.release());
|
| return true;
|
| }
|
|
|
|
|