| Index: net/ssl/ssl_platform_key_android.cc
|
| diff --git a/net/ssl/ssl_platform_key_android.cc b/net/ssl/ssl_platform_key_android.cc
|
| index 136c63ad8228f29835863077b2e5c07f2b521364..48ab99accccef597d1e19b2b88a937139c222ab5 100644
|
| --- a/net/ssl/ssl_platform_key_android.cc
|
| +++ b/net/ssl/ssl_platform_key_android.cc
|
| @@ -24,6 +24,7 @@
|
| #include "net/ssl/ssl_platform_key_util.h"
|
| #include "net/ssl/threaded_ssl_private_key.h"
|
| #include "third_party/boringssl/src/include/openssl/ecdsa.h"
|
| +#include "third_party/boringssl/src/include/openssl/evp.h"
|
| #include "third_party/boringssl/src/include/openssl/mem.h"
|
| #include "third_party/boringssl/src/include/openssl/nid.h"
|
| #include "third_party/boringssl/src/include/openssl/rsa.h"
|
| @@ -74,7 +75,7 @@ void LeakEngine(const JavaRef<jobject>& private_key) {
|
|
|
| class SSLPlatformKeyAndroid : public ThreadedSSLPrivateKey::Delegate {
|
| public:
|
| - SSLPlatformKeyAndroid(SSLPrivateKey::Type type,
|
| + SSLPlatformKeyAndroid(int type,
|
| const JavaRef<jobject>& key,
|
| size_t max_length,
|
| android::AndroidRSA* legacy_rsa)
|
| @@ -84,8 +85,6 @@ class SSLPlatformKeyAndroid : public ThreadedSSLPrivateKey::Delegate {
|
|
|
| ~SSLPlatformKeyAndroid() override {}
|
|
|
| - SSLPrivateKey::Type GetType() override { return type_; }
|
| -
|
| std::vector<SSLPrivateKey::Hash> GetDigestPreferences() override {
|
| static const SSLPrivateKey::Hash kHashes[] = {
|
| SSLPrivateKey::Hash::SHA512, SSLPrivateKey::Hash::SHA384,
|
| @@ -94,8 +93,6 @@ class SSLPlatformKeyAndroid : public ThreadedSSLPrivateKey::Delegate {
|
| kHashes + arraysize(kHashes));
|
| }
|
|
|
| - size_t GetMaxSignatureLengthInBytes() override { return max_length_; }
|
| -
|
| Error SignDigest(SSLPrivateKey::Hash hash,
|
| const base::StringPiece& input_in,
|
| std::vector<uint8_t>* signature) override {
|
| @@ -103,7 +100,7 @@ class SSLPlatformKeyAndroid : public ThreadedSSLPrivateKey::Delegate {
|
|
|
| // Prepend the DigestInfo for RSA.
|
| bssl::UniquePtr<uint8_t> digest_info_storage;
|
| - if (type_ == SSLPrivateKey::Type::RSA) {
|
| + if (type_ == EVP_PKEY_RSA) {
|
| int hash_nid = NID_undef;
|
| switch (hash) {
|
| case SSLPrivateKey::Hash::MD5_SHA1:
|
| @@ -168,7 +165,7 @@ class SSLPlatformKeyAndroid : public ThreadedSSLPrivateKey::Delegate {
|
| }
|
|
|
| private:
|
| - SSLPrivateKey::Type type_;
|
| + int type_;
|
| ScopedJavaGlobalRef<jobject> key_;
|
| size_t max_length_;
|
| android::AndroidRSA* legacy_rsa_;
|
| @@ -181,13 +178,13 @@ class SSLPlatformKeyAndroid : public ThreadedSSLPrivateKey::Delegate {
|
| scoped_refptr<SSLPrivateKey> WrapJavaPrivateKey(
|
| const X509Certificate* certificate,
|
| const JavaRef<jobject>& key) {
|
| - SSLPrivateKey::Type type;
|
| + int type;
|
| size_t max_length;
|
| if (!GetClientCertInfo(certificate, &type, &max_length))
|
| return nullptr;
|
|
|
| android::AndroidRSA* sys_rsa = nullptr;
|
| - if (type == SSLPrivateKey::Type::RSA) {
|
| + if (type == EVP_PKEY_RSA) {
|
| const int kAndroid42ApiLevel = 17;
|
| if (base::android::BuildInfo::GetInstance()->sdk_int() <
|
| kAndroid42ApiLevel) {
|
|
|