Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CRYPTO_SCOPED_OPENSSL_TYPES_H_ | 5 #ifndef CRYPTO_SCOPED_OPENSSL_TYPES_H_ |
| 6 #define CRYPTO_SCOPED_OPENSSL_TYPES_H_ | 6 #define CRYPTO_SCOPED_OPENSSL_TYPES_H_ |
| 7 | 7 |
| 8 #include <openssl/bn.h> | 8 #include <openssl/bn.h> |
| 9 #include <openssl/dsa.h> | 9 #include <openssl/dsa.h> |
| 10 #include <openssl/ec.h> | 10 #include <openssl/ec.h> |
| 11 #include <openssl/ecdsa.h> | 11 #include <openssl/ecdsa.h> |
| 12 #include <openssl/evp.h> | 12 #include <openssl/evp.h> |
| 13 #include <openssl/rsa.h> | 13 #include <openssl/rsa.h> |
| 14 #include <openssl/x509.h> | |
| 14 | 15 |
| 15 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 16 | 17 |
| 17 namespace crypto { | 18 namespace crypto { |
| 18 | 19 |
| 19 // Simplistic helper that wraps a call to a deleter function. In a C++11 world, | 20 // Simplistic helper that wraps a call to a deleter function. In a C++11 world, |
| 20 // this would be std::function<>. An alternative would be to re-use | 21 // this would be std::function<>. An alternative would be to re-use |
| 21 // base::internal::RunnableAdapter<>, but that's far too heavy weight. | 22 // base::internal::RunnableAdapter<>, but that's far too heavy weight. |
| 22 template <typename Type, void (*Destroyer)(Type*)> | 23 template <typename Type, void (*Destroyer)(Type*)> |
| 23 struct OpenSSLDestroyer { | 24 struct OpenSSLDestroyer { |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 36 // certificates or PKI. | 37 // certificates or PKI. |
| 37 typedef ScopedOpenSSL<BIGNUM, BN_free>::Type ScopedBIGNUM; | 38 typedef ScopedOpenSSL<BIGNUM, BN_free>::Type ScopedBIGNUM; |
| 38 typedef ScopedOpenSSL<EC_KEY, EC_KEY_free>::Type ScopedEC_KEY; | 39 typedef ScopedOpenSSL<EC_KEY, EC_KEY_free>::Type ScopedEC_KEY; |
| 39 typedef ScopedOpenSSL<BIO, BIO_free_all>::Type ScopedBIO; | 40 typedef ScopedOpenSSL<BIO, BIO_free_all>::Type ScopedBIO; |
| 40 typedef ScopedOpenSSL<DSA, DSA_free>::Type ScopedDSA; | 41 typedef ScopedOpenSSL<DSA, DSA_free>::Type ScopedDSA; |
| 41 typedef ScopedOpenSSL<ECDSA_SIG, ECDSA_SIG_free>::Type ScopedECDSA_SIG; | 42 typedef ScopedOpenSSL<ECDSA_SIG, ECDSA_SIG_free>::Type ScopedECDSA_SIG; |
| 42 typedef ScopedOpenSSL<EC_KEY, EC_KEY_free>::Type ScopedEC_KEY; | 43 typedef ScopedOpenSSL<EC_KEY, EC_KEY_free>::Type ScopedEC_KEY; |
| 43 typedef ScopedOpenSSL<EVP_MD_CTX, EVP_MD_CTX_destroy>::Type ScopedEVP_MD_CTX; | 44 typedef ScopedOpenSSL<EVP_MD_CTX, EVP_MD_CTX_destroy>::Type ScopedEVP_MD_CTX; |
| 44 typedef ScopedOpenSSL<EVP_PKEY, EVP_PKEY_free>::Type ScopedEVP_PKEY; | 45 typedef ScopedOpenSSL<EVP_PKEY, EVP_PKEY_free>::Type ScopedEVP_PKEY; |
| 45 typedef ScopedOpenSSL<RSA, RSA_free>::Type ScopedRSA; | 46 typedef ScopedOpenSSL<RSA, RSA_free>::Type ScopedRSA; |
| 47 typedef ScopedOpenSSL<X509, X509_free>::Type ScopedX509; | |
|
Ryan Sleevi
2014/07/11 01:06:23
Please read the comments on line 34-37
davidben
2014/07/11 13:47:16
Oops. Done. :-)
| |
| 46 | 48 |
| 47 } // namespace crypto | 49 } // namespace crypto |
| 48 | 50 |
| 49 #endif // CRYPTO_SCOPED_OPENSSL_TYPES_H_ | 51 #endif // CRYPTO_SCOPED_OPENSSL_TYPES_H_ |
| OLD | NEW |