OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/ssl/ssl_platform_key.h" | 5 #include "net/ssl/ssl_platform_key.h" |
6 | 6 |
7 #include <openssl/digest.h> | 7 #include <openssl/digest.h> |
8 #include <openssl/evp.h> | 8 #include <openssl/evp.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 break; | 116 break; |
117 case EVP_PKEY_EC: | 117 case EVP_PKEY_EC: |
118 type = SSLPrivateKey::Type::ECDSA; | 118 type = SSLPrivateKey::Type::ECDSA; |
119 break; | 119 break; |
120 default: | 120 default: |
121 LOG(ERROR) << "Unknown key type: " << EVP_PKEY_id(key.get()); | 121 LOG(ERROR) << "Unknown key type: " << EVP_PKEY_id(key.get()); |
122 return nullptr; | 122 return nullptr; |
123 } | 123 } |
124 return make_scoped_refptr(new ThreadedSSLPrivateKey( | 124 return make_scoped_refptr(new ThreadedSSLPrivateKey( |
125 base::WrapUnique(new SSLPlatformKeyAndroid(std::move(key), type)), | 125 base::WrapUnique(new SSLPlatformKeyAndroid(std::move(key), type)), |
126 GetSSLPlatformKeyTaskRunner())); | 126 SSLPlatformKeyTaskRunner::Get())); |
127 } | 127 } |
128 | 128 |
129 } // namespace | 129 } // namespace |
130 | 130 |
131 scoped_refptr<SSLPrivateKey> FetchClientCertPrivateKey( | 131 scoped_refptr<SSLPrivateKey> FetchClientCertPrivateKey( |
132 X509Certificate* certificate) { | 132 X509Certificate* certificate) { |
133 crypto::ScopedEVP_PKEY key = | 133 crypto::ScopedEVP_PKEY key = |
134 OpenSSLClientKeyStore::GetInstance()->FetchClientCertPrivateKey( | 134 OpenSSLClientKeyStore::GetInstance()->FetchClientCertPrivateKey( |
135 certificate); | 135 certificate); |
136 return WrapOpenSSLPrivateKey(std::move(key)); | 136 return WrapOpenSSLPrivateKey(std::move(key)); |
137 } | 137 } |
138 | 138 |
139 } // namespace net | 139 } // namespace net |
OLD | NEW |