From: Anirudh Ramachandran Date: Mon, 8 May 2017 19:21:47 +0000 (-0700) Subject: Move OpenSSLPtrTypes.h from folly/io/async/ssl to folly/ssl X-Git-Tag: v2017.05.15.00~24 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=6b1a43fd0712c15cb98f134bc2d8c89713b24513;p=folly.git Move OpenSSLPtrTypes.h from folly/io/async/ssl to folly/ssl Summary: There's nothing io/async/ssl-specific in this file. Moving to the top-level directory will help this be more discoverable. Part of general cleanup for io/async/ssl Reviewed By: yfeldblum Differential Revision: D5005566 fbshipit-source-id: 66a05a2139ee80a6d63791d1851da3f1858e8abf --- diff --git a/folly/Makefile.am b/folly/Makefile.am index 52ae0d49..f5f5a8fc 100644 --- a/folly/Makefile.am +++ b/folly/Makefile.am @@ -248,7 +248,6 @@ nobase_follyinclude_HEADERS = \ io/async/EventUtil.h \ io/async/NotificationQueue.h \ io/async/HHWheelTimer.h \ - io/async/ssl/OpenSSLPtrTypes.h \ io/async/ssl/OpenSSLUtils.h \ io/async/ssl/SSLErrors.h \ io/async/ssl/TLSDefinitions.h \ @@ -360,6 +359,7 @@ nobase_follyinclude_HEADERS = \ SpookyHashV2.h \ ssl/OpenSSLCertUtils.h \ ssl/OpenSSLHash.h \ + ssl/OpenSSLPtrTypes.h \ ssl/OpenSSLVersionFinder.h \ ssl/SSLSession.h \ ssl/detail/SSLSessionImpl.h \ diff --git a/folly/io/async/AsyncSSLSocket.h b/folly/io/async/AsyncSSLSocket.h index 2121c2ff..accd120a 100644 --- a/folly/io/async/AsyncSSLSocket.h +++ b/folly/io/async/AsyncSSLSocket.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/folly/io/async/AsyncTransport.h b/folly/io/async/AsyncTransport.h index d20831f8..0c46ae64 100644 --- a/folly/io/async/AsyncTransport.h +++ b/folly/io/async/AsyncTransport.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include diff --git a/folly/io/async/SSLContext.h b/folly/io/async/SSLContext.h index a381eb37..7b9d3b89 100644 --- a/folly/io/async/SSLContext.h +++ b/folly/io/async/SSLContext.h @@ -31,7 +31,7 @@ #endif #include -#include +#include #include #include diff --git a/folly/io/async/ssl/OpenSSLPtrTypes.h b/folly/io/async/ssl/OpenSSLPtrTypes.h deleted file mode 100644 index c465fc13..00000000 --- a/folly/io/async/ssl/OpenSSLPtrTypes.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2017 Facebook, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#include -#include - -namespace folly { -namespace ssl { - -// ASN1 -using ASN1TimeDeleter = - folly::static_function_deleter; -using ASN1TimeUniquePtr = std::unique_ptr; - -// X509 -using X509Deleter = folly::static_function_deleter; -using X509UniquePtr = std::unique_ptr; -using X509StoreCtxDeleter = - folly::static_function_deleter; -using X509StoreCtxUniquePtr = - std::unique_ptr; -using X509VerifyParamDeleter = - folly::static_function_deleter; -using X509VerifyParam = - std::unique_ptr; - -// EVP -using EvpPkeyDel = folly::static_function_deleter; -using EvpPkeyUniquePtr = std::unique_ptr; -using EvpPkeySharedPtr = std::shared_ptr; - -// No EVP_PKEY_CTX <= 0.9.8b -#if OPENSSL_VERSION_NUMBER >= 0x10000002L -using EvpPkeyCtxDeleter = - folly::static_function_deleter; -using EvpPkeyCtxUniquePtr = std::unique_ptr; -#else -struct EVP_PKEY_CTX; -#endif - -using EvpMdCtxDeleter = - folly::static_function_deleter; -using EvpMdCtxUniquePtr = std::unique_ptr; - -// HMAC -using HmacCtxDeleter = folly::static_function_deleter; -using HmacCtxUniquePtr = std::unique_ptr; - -// BIO -using BioMethodDeleter = - folly::static_function_deleter; -using BioMethodUniquePtr = std::unique_ptr; -using BioDeleter = folly::static_function_deleter; -using BioUniquePtr = std::unique_ptr; -using BioChainDeleter = folly::static_function_deleter; -using BioChainUniquePtr = std::unique_ptr; -inline void BIO_free_fb(BIO* bio) { CHECK_EQ(1, BIO_free(bio)); } -using BioDeleterFb = folly::static_function_deleter; -using BioUniquePtrFb = std::unique_ptr; - -// RSA and EC -using RsaDeleter = folly::static_function_deleter; -using RsaUniquePtr = std::unique_ptr; -#ifndef OPENSSL_NO_EC -using EcKeyDeleter = folly::static_function_deleter; -using EcKeyUniquePtr = std::unique_ptr; -using EcGroupDeleter = folly::static_function_deleter; -using EcGroupUniquePtr = std::unique_ptr; -using EcPointDeleter = folly::static_function_deleter; -using EcPointUniquePtr = std::unique_ptr; -using EcdsaSignDeleter = - folly::static_function_deleter; -using EcdsaSigUniquePtr = std::unique_ptr; -#endif - -// BIGNUMs -using BIGNUMDeleter = folly::static_function_deleter; -using BIGNUMUniquePtr = std::unique_ptr; - -// SSL and SSL_CTX -using SSLDeleter = folly::static_function_deleter; -using SSLUniquePtr = std::unique_ptr; -} -} diff --git a/folly/io/async/ssl/OpenSSLUtils.h b/folly/io/async/ssl/OpenSSLUtils.h index 90135928..560d5cca 100644 --- a/folly/io/async/ssl/OpenSSLUtils.h +++ b/folly/io/async/ssl/OpenSSLUtils.h @@ -16,7 +16,7 @@ #pragma once #include -#include +#include #include #include diff --git a/folly/ssl/OpenSSLCertUtils.cpp b/folly/ssl/OpenSSLCertUtils.cpp index 10c5f996..b1bdf180 100644 --- a/folly/ssl/OpenSSLCertUtils.cpp +++ b/folly/ssl/OpenSSLCertUtils.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include namespace folly { namespace ssl { diff --git a/folly/ssl/OpenSSLHash.h b/folly/ssl/OpenSSLHash.h index 481a4f3e..10e3e561 100644 --- a/folly/ssl/OpenSSLHash.h +++ b/folly/ssl/OpenSSLHash.h @@ -18,7 +18,7 @@ #include #include -#include +#include #include namespace folly { diff --git a/folly/ssl/OpenSSLPtrTypes.h b/folly/ssl/OpenSSLPtrTypes.h new file mode 100644 index 00000000..c465fc13 --- /dev/null +++ b/folly/ssl/OpenSSLPtrTypes.h @@ -0,0 +1,101 @@ +/* + * Copyright 2017 Facebook, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include +#include + +namespace folly { +namespace ssl { + +// ASN1 +using ASN1TimeDeleter = + folly::static_function_deleter; +using ASN1TimeUniquePtr = std::unique_ptr; + +// X509 +using X509Deleter = folly::static_function_deleter; +using X509UniquePtr = std::unique_ptr; +using X509StoreCtxDeleter = + folly::static_function_deleter; +using X509StoreCtxUniquePtr = + std::unique_ptr; +using X509VerifyParamDeleter = + folly::static_function_deleter; +using X509VerifyParam = + std::unique_ptr; + +// EVP +using EvpPkeyDel = folly::static_function_deleter; +using EvpPkeyUniquePtr = std::unique_ptr; +using EvpPkeySharedPtr = std::shared_ptr; + +// No EVP_PKEY_CTX <= 0.9.8b +#if OPENSSL_VERSION_NUMBER >= 0x10000002L +using EvpPkeyCtxDeleter = + folly::static_function_deleter; +using EvpPkeyCtxUniquePtr = std::unique_ptr; +#else +struct EVP_PKEY_CTX; +#endif + +using EvpMdCtxDeleter = + folly::static_function_deleter; +using EvpMdCtxUniquePtr = std::unique_ptr; + +// HMAC +using HmacCtxDeleter = folly::static_function_deleter; +using HmacCtxUniquePtr = std::unique_ptr; + +// BIO +using BioMethodDeleter = + folly::static_function_deleter; +using BioMethodUniquePtr = std::unique_ptr; +using BioDeleter = folly::static_function_deleter; +using BioUniquePtr = std::unique_ptr; +using BioChainDeleter = folly::static_function_deleter; +using BioChainUniquePtr = std::unique_ptr; +inline void BIO_free_fb(BIO* bio) { CHECK_EQ(1, BIO_free(bio)); } +using BioDeleterFb = folly::static_function_deleter; +using BioUniquePtrFb = std::unique_ptr; + +// RSA and EC +using RsaDeleter = folly::static_function_deleter; +using RsaUniquePtr = std::unique_ptr; +#ifndef OPENSSL_NO_EC +using EcKeyDeleter = folly::static_function_deleter; +using EcKeyUniquePtr = std::unique_ptr; +using EcGroupDeleter = folly::static_function_deleter; +using EcGroupUniquePtr = std::unique_ptr; +using EcPointDeleter = folly::static_function_deleter; +using EcPointUniquePtr = std::unique_ptr; +using EcdsaSignDeleter = + folly::static_function_deleter; +using EcdsaSigUniquePtr = std::unique_ptr; +#endif + +// BIGNUMs +using BIGNUMDeleter = folly::static_function_deleter; +using BIGNUMUniquePtr = std::unique_ptr; + +// SSL and SSL_CTX +using SSLDeleter = folly::static_function_deleter; +using SSLUniquePtr = std::unique_ptr; +} +} diff --git a/folly/ssl/test/OpenSSLCertUtilsTest.cpp b/folly/ssl/test/OpenSSLCertUtilsTest.cpp index 874edb60..a9ca22b2 100644 --- a/folly/ssl/test/OpenSSLCertUtilsTest.cpp +++ b/folly/ssl/test/OpenSSLCertUtilsTest.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include