| 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 <windows.h> | 7 #include <windows.h> |
| 8 #include <NCrypt.h> | 8 #include <NCrypt.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <utility> |
| 12 #include <vector> | 13 #include <vector> |
| 13 | 14 |
| 14 #include <openssl/bn.h> | 15 #include <openssl/bn.h> |
| 15 #include <openssl/ecdsa.h> | 16 #include <openssl/ecdsa.h> |
| 16 #include <openssl/evp.h> | 17 #include <openssl/evp.h> |
| 17 #include <openssl/x509.h> | 18 #include <openssl/x509.h> |
| 18 | 19 |
| 19 #include "base/lazy_instance.h" | 20 #include "base/lazy_instance.h" |
| 20 #include "base/logging.h" | 21 #include "base/logging.h" |
| 21 #include "base/macros.h" | 22 #include "base/macros.h" |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 CHECK_EQ(must_free, TRUE); | 352 CHECK_EQ(must_free, TRUE); |
| 352 | 353 |
| 353 scoped_ptr<ThreadedSSLPrivateKey::Delegate> delegate; | 354 scoped_ptr<ThreadedSSLPrivateKey::Delegate> delegate; |
| 354 if (key_spec == CERT_NCRYPT_KEY_SPEC) { | 355 if (key_spec == CERT_NCRYPT_KEY_SPEC) { |
| 355 delegate.reset(new SSLPlatformKeyCNG(prov_or_key, key_type, max_length)); | 356 delegate.reset(new SSLPlatformKeyCNG(prov_or_key, key_type, max_length)); |
| 356 } else { | 357 } else { |
| 357 DCHECK(SSLPrivateKey::Type::RSA == key_type); | 358 DCHECK(SSLPrivateKey::Type::RSA == key_type); |
| 358 delegate.reset(new SSLPlatformKeyCAPI(prov_or_key, key_spec, max_length)); | 359 delegate.reset(new SSLPlatformKeyCAPI(prov_or_key, key_spec, max_length)); |
| 359 } | 360 } |
| 360 return make_scoped_refptr(new ThreadedSSLPrivateKey( | 361 return make_scoped_refptr(new ThreadedSSLPrivateKey( |
| 361 delegate.Pass(), GetSSLPlatformKeyTaskRunner())); | 362 std::move(delegate), GetSSLPlatformKeyTaskRunner())); |
| 362 } | 363 } |
| 363 | 364 |
| 364 } // namespace net | 365 } // namespace net |
| OLD | NEW |