| Index: net/cert/x509_util_openssl.cc
|
| diff --git a/net/cert/x509_util_openssl.cc b/net/cert/x509_util_openssl.cc
|
| index 4a2aba01dc60aa7df5163741d2faab3526e25f96..4e79ad8a2115cad3b04d4e9048ad8efe7e094be1 100644
|
| --- a/net/cert/x509_util_openssl.cc
|
| +++ b/net/cert/x509_util_openssl.cc
|
| @@ -25,6 +25,7 @@
|
| #include "third_party/boringssl/src/include/openssl/asn1.h"
|
| #include "third_party/boringssl/src/include/openssl/digest.h"
|
| #include "third_party/boringssl/src/include/openssl/mem.h"
|
| +#include "third_party/boringssl/src/include/openssl/pool.h"
|
|
|
| namespace net {
|
|
|
| @@ -190,6 +191,19 @@ class DERCacheInitSingleton {
|
| base::LazyInstance<DERCacheInitSingleton>::Leaky g_der_cache_singleton =
|
| LAZY_INSTANCE_INITIALIZER;
|
|
|
| +class BufferPoolSingleton {
|
| + public:
|
| + BufferPoolSingleton() : pool_(CRYPTO_BUFFER_POOL_new()) {}
|
| + CRYPTO_BUFFER_POOL* pool() { return pool_; }
|
| +
|
| + private:
|
| + // The singleton is leaky, so there is no need to use a smart pointer.
|
| + CRYPTO_BUFFER_POOL* pool_;
|
| +};
|
| +
|
| +base::LazyInstance<BufferPoolSingleton>::Leaky g_buffer_pool_singleton =
|
| + LAZY_INSTANCE_INITIALIZER;
|
| +
|
| } // namespace
|
|
|
| bool CreateSelfSignedCert(crypto::RSAPrivateKey* key,
|
| @@ -347,6 +361,10 @@ bool GetTLSServerEndPointChannelBinding(const X509Certificate& certificate,
|
| return true;
|
| }
|
|
|
| +CRYPTO_BUFFER_POOL* GetBufferPool() {
|
| + return g_buffer_pool_singleton.Get().pool();
|
| +}
|
| +
|
| } // namespace x509_util
|
|
|
| } // namespace net
|
|
|