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/ecdsa.h> | 7 #include <openssl/ecdsa.h> |
8 #include <openssl/obj.h> | 8 #include <openssl/obj.h> |
9 #include <openssl/rsa.h> | 9 #include <openssl/rsa.h> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "crypto/openssl_util.h" | 27 #include "crypto/openssl_util.h" |
28 #include "crypto/scoped_openssl_types.h" | 28 #include "crypto/scoped_openssl_types.h" |
29 #include "net/base/net_errors.h" | 29 #include "net/base/net_errors.h" |
30 #include "net/cert/x509_certificate.h" | 30 #include "net/cert/x509_certificate.h" |
31 #include "net/ssl/ssl_platform_key_task_runner.h" | 31 #include "net/ssl/ssl_platform_key_task_runner.h" |
32 #include "net/ssl/ssl_private_key.h" | 32 #include "net/ssl/ssl_private_key.h" |
33 #include "net/ssl/threaded_ssl_private_key.h" | 33 #include "net/ssl/threaded_ssl_private_key.h" |
34 | 34 |
35 namespace net { | 35 namespace net { |
36 | 36 |
| 37 // CSSM functions are deprecated as of OSX 10.7, but have no replacement. |
| 38 // https://bugs.chromium.org/p/chromium/issues/detail?id=590914#c1 |
| 39 #pragma clang diagnostic push |
| 40 #pragma clang diagnostic ignored "-Wdeprecated-declarations" |
| 41 |
37 namespace { | 42 namespace { |
38 | 43 |
39 class ScopedCSSM_CC_HANDLE { | 44 class ScopedCSSM_CC_HANDLE { |
40 public: | 45 public: |
41 ScopedCSSM_CC_HANDLE() : handle_(0) {} | 46 ScopedCSSM_CC_HANDLE() : handle_(0) {} |
42 explicit ScopedCSSM_CC_HANDLE(CSSM_CC_HANDLE handle) : handle_(handle) {} | 47 explicit ScopedCSSM_CC_HANDLE(CSSM_CC_HANDLE handle) : handle_(handle) {} |
43 | 48 |
44 ~ScopedCSSM_CC_HANDLE() { reset(); } | 49 ~ScopedCSSM_CC_HANDLE() { reset(); } |
45 | 50 |
46 CSSM_CC_HANDLE get() const { return handle_; } | 51 CSSM_CC_HANDLE get() const { return handle_; } |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 if (cssm_key->KeyHeader.AlgorithmId != CSSM_ALGID_RSA && | 239 if (cssm_key->KeyHeader.AlgorithmId != CSSM_ALGID_RSA && |
235 cssm_key->KeyHeader.AlgorithmId != CSSM_ALGID_ECDSA) { | 240 cssm_key->KeyHeader.AlgorithmId != CSSM_ALGID_ECDSA) { |
236 LOG(ERROR) << "Unknown key type: " << cssm_key->KeyHeader.AlgorithmId; | 241 LOG(ERROR) << "Unknown key type: " << cssm_key->KeyHeader.AlgorithmId; |
237 return nullptr; | 242 return nullptr; |
238 } | 243 } |
239 return make_scoped_refptr(new ThreadedSSLPrivateKey( | 244 return make_scoped_refptr(new ThreadedSSLPrivateKey( |
240 make_scoped_ptr(new SSLPlatformKeyMac(private_key.get(), cssm_key)), | 245 make_scoped_ptr(new SSLPlatformKeyMac(private_key.get(), cssm_key)), |
241 GetSSLPlatformKeyTaskRunner())); | 246 GetSSLPlatformKeyTaskRunner())); |
242 } | 247 } |
243 | 248 |
| 249 #pragma clang diagnostic pop // "-Wdeprecated-declarations" |
| 250 |
244 } // namespace net | 251 } // namespace net |
OLD | NEW |