Move OpenSSLPtrTypes.h from folly/io/async/ssl to folly/ssl
authorAnirudh Ramachandran <avr@fb.com>
Mon, 8 May 2017 19:21:47 +0000 (12:21 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 8 May 2017 19:44:32 +0000 (12:44 -0700)
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

folly/Makefile.am
folly/io/async/AsyncSSLSocket.h
folly/io/async/AsyncTransport.h
folly/io/async/SSLContext.h
folly/io/async/ssl/OpenSSLPtrTypes.h [deleted file]
folly/io/async/ssl/OpenSSLUtils.h
folly/ssl/OpenSSLCertUtils.cpp
folly/ssl/OpenSSLHash.h
folly/ssl/OpenSSLPtrTypes.h [new file with mode: 0644]
folly/ssl/test/OpenSSLCertUtilsTest.cpp

index 52ae0d490994bb8269ceff0496e7f6b2d8baff74..f5f5a8fc82cc7578c03ca3149cf2b478e8563813 100644 (file)
@@ -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 \
index 2121c2ff89a857b7e9db571921afbb3726b1283a..accd120a3690f812b58641453593e81141c0cf34 100644 (file)
@@ -24,7 +24,7 @@
 #include <folly/io/async/AsyncTimeout.h>
 #include <folly/io/async/SSLContext.h>
 #include <folly/io/async/TimeoutManager.h>
-#include <folly/io/async/ssl/OpenSSLPtrTypes.h>
+#include <folly/ssl/OpenSSLPtrTypes.h>
 #include <folly/io/async/ssl/OpenSSLUtils.h>
 #include <folly/io/async/ssl/SSLErrors.h>
 #include <folly/io/async/ssl/TLSDefinitions.h>
index d20831f833798de8045873503fa8b9d77771d0d0..0c46ae640e5f290b72515e0ac038a0c298ac2ef7 100644 (file)
@@ -22,7 +22,7 @@
 #include <folly/io/async/AsyncSocketBase.h>
 #include <folly/io/async/DelayedDestruction.h>
 #include <folly/io/async/EventBase.h>
-#include <folly/io/async/ssl/OpenSSLPtrTypes.h>
+#include <folly/ssl/OpenSSLPtrTypes.h>
 #include <folly/portability/OpenSSL.h>
 #include <folly/portability/SysUio.h>
 
index a381eb37e578a3f5c5fd49f66f5409f234fcf98b..7b9d3b89264e4d55d69c108c20d2d475defc70d6 100644 (file)
@@ -31,7 +31,7 @@
 #endif
 
 #include <folly/Range.h>
-#include <folly/io/async/ssl/OpenSSLPtrTypes.h>
+#include <folly/ssl/OpenSSLPtrTypes.h>
 #include <folly/io/async/ssl/OpenSSLUtils.h>
 #include <folly/portability/OpenSSL.h>
 
diff --git a/folly/io/async/ssl/OpenSSLPtrTypes.h b/folly/io/async/ssl/OpenSSLPtrTypes.h
deleted file mode 100644 (file)
index c465fc1..0000000
+++ /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 <glog/logging.h>
-
-#include <folly/Memory.h>
-#include <folly/portability/OpenSSL.h>
-
-namespace folly {
-namespace ssl {
-
-// ASN1
-using ASN1TimeDeleter =
-    folly::static_function_deleter<ASN1_TIME, &ASN1_TIME_free>;
-using ASN1TimeUniquePtr = std::unique_ptr<ASN1_TIME, ASN1TimeDeleter>;
-
-// X509
-using X509Deleter = folly::static_function_deleter<X509, &X509_free>;
-using X509UniquePtr = std::unique_ptr<X509, X509Deleter>;
-using X509StoreCtxDeleter =
-    folly::static_function_deleter<X509_STORE_CTX, &X509_STORE_CTX_free>;
-using X509StoreCtxUniquePtr =
-    std::unique_ptr<X509_STORE_CTX, X509StoreCtxDeleter>;
-using X509VerifyParamDeleter =
-    folly::static_function_deleter<X509_VERIFY_PARAM, &X509_VERIFY_PARAM_free>;
-using X509VerifyParam =
-    std::unique_ptr<X509_VERIFY_PARAM, X509VerifyParamDeleter>;
-
-// EVP
-using EvpPkeyDel = folly::static_function_deleter<EVP_PKEY, &EVP_PKEY_free>;
-using EvpPkeyUniquePtr = std::unique_ptr<EVP_PKEY, EvpPkeyDel>;
-using EvpPkeySharedPtr = std::shared_ptr<EVP_PKEY>;
-
-// No EVP_PKEY_CTX <= 0.9.8b
-#if OPENSSL_VERSION_NUMBER >= 0x10000002L
-using EvpPkeyCtxDeleter =
-    folly::static_function_deleter<EVP_PKEY_CTX, &EVP_PKEY_CTX_free>;
-using EvpPkeyCtxUniquePtr = std::unique_ptr<EVP_PKEY_CTX, EvpPkeyCtxDeleter>;
-#else
-struct EVP_PKEY_CTX;
-#endif
-
-using EvpMdCtxDeleter =
-    folly::static_function_deleter<EVP_MD_CTX, &EVP_MD_CTX_free>;
-using EvpMdCtxUniquePtr = std::unique_ptr<EVP_MD_CTX, EvpMdCtxDeleter>;
-
-// HMAC
-using HmacCtxDeleter = folly::static_function_deleter<HMAC_CTX, &HMAC_CTX_free>;
-using HmacCtxUniquePtr = std::unique_ptr<HMAC_CTX, HmacCtxDeleter>;
-
-// BIO
-using BioMethodDeleter =
-    folly::static_function_deleter<BIO_METHOD, &BIO_meth_free>;
-using BioMethodUniquePtr = std::unique_ptr<BIO_METHOD, BioMethodDeleter>;
-using BioDeleter = folly::static_function_deleter<BIO, &BIO_vfree>;
-using BioUniquePtr = std::unique_ptr<BIO, BioDeleter>;
-using BioChainDeleter = folly::static_function_deleter<BIO, &BIO_free_all>;
-using BioChainUniquePtr = std::unique_ptr<BIO, BioChainDeleter>;
-inline void BIO_free_fb(BIO* bio) { CHECK_EQ(1, BIO_free(bio)); }
-using BioDeleterFb = folly::static_function_deleter<BIO, &BIO_free_fb>;
-using BioUniquePtrFb = std::unique_ptr<BIO, BioDeleterFb>;
-
-// RSA and EC
-using RsaDeleter = folly::static_function_deleter<RSA, &RSA_free>;
-using RsaUniquePtr = std::unique_ptr<RSA, RsaDeleter>;
-#ifndef OPENSSL_NO_EC
-using EcKeyDeleter = folly::static_function_deleter<EC_KEY, &EC_KEY_free>;
-using EcKeyUniquePtr = std::unique_ptr<EC_KEY, EcKeyDeleter>;
-using EcGroupDeleter = folly::static_function_deleter<EC_GROUP, &EC_GROUP_free>;
-using EcGroupUniquePtr = std::unique_ptr<EC_GROUP, EcGroupDeleter>;
-using EcPointDeleter = folly::static_function_deleter<EC_POINT, &EC_POINT_free>;
-using EcPointUniquePtr = std::unique_ptr<EC_POINT, EcPointDeleter>;
-using EcdsaSignDeleter =
-    folly::static_function_deleter<ECDSA_SIG, &ECDSA_SIG_free>;
-using EcdsaSigUniquePtr = std::unique_ptr<ECDSA_SIG, EcdsaSignDeleter>;
-#endif
-
-// BIGNUMs
-using BIGNUMDeleter = folly::static_function_deleter<BIGNUM, &BN_clear_free>;
-using BIGNUMUniquePtr = std::unique_ptr<BIGNUM, BIGNUMDeleter>;
-
-// SSL and SSL_CTX
-using SSLDeleter = folly::static_function_deleter<SSL, &SSL_free>;
-using SSLUniquePtr = std::unique_ptr<SSL, SSLDeleter>;
-}
-}
index 90135928c8233cbb612dcc74ae073d204dbc5f1e..560d5ccaeb50a161eebd99b0521b3eb24cc130d9 100644 (file)
@@ -16,7 +16,7 @@
 #pragma once
 
 #include <folly/Range.h>
-#include <folly/io/async/ssl/OpenSSLPtrTypes.h>
+#include <folly/ssl/OpenSSLPtrTypes.h>
 #include <folly/portability/OpenSSL.h>
 #include <folly/portability/Sockets.h>
 
index 10c5f9964e0799f38a3c68d57684d8ff9b53e597..b1bdf180e737e8dbdfa5e4f1d0566d38e905aafa 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <folly/ScopeGuard.h>
 #include <folly/String.h>
-#include <folly/io/async/ssl/OpenSSLPtrTypes.h>
+#include <folly/ssl/OpenSSLPtrTypes.h>
 
 namespace folly {
 namespace ssl {
index 481a4f3e6ab99636a83da41265541de84642dbfe..10e3e56146c1b69afe8fd4a1929ce2accbe19ead 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <folly/Range.h>
 #include <folly/io/IOBuf.h>
-#include <folly/io/async/ssl/OpenSSLPtrTypes.h>
+#include <folly/ssl/OpenSSLPtrTypes.h>
 #include <folly/portability/OpenSSL.h>
 
 namespace folly {
diff --git a/folly/ssl/OpenSSLPtrTypes.h b/folly/ssl/OpenSSLPtrTypes.h
new file mode 100644 (file)
index 0000000..c465fc1
--- /dev/null
@@ -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 <glog/logging.h>
+
+#include <folly/Memory.h>
+#include <folly/portability/OpenSSL.h>
+
+namespace folly {
+namespace ssl {
+
+// ASN1
+using ASN1TimeDeleter =
+    folly::static_function_deleter<ASN1_TIME, &ASN1_TIME_free>;
+using ASN1TimeUniquePtr = std::unique_ptr<ASN1_TIME, ASN1TimeDeleter>;
+
+// X509
+using X509Deleter = folly::static_function_deleter<X509, &X509_free>;
+using X509UniquePtr = std::unique_ptr<X509, X509Deleter>;
+using X509StoreCtxDeleter =
+    folly::static_function_deleter<X509_STORE_CTX, &X509_STORE_CTX_free>;
+using X509StoreCtxUniquePtr =
+    std::unique_ptr<X509_STORE_CTX, X509StoreCtxDeleter>;
+using X509VerifyParamDeleter =
+    folly::static_function_deleter<X509_VERIFY_PARAM, &X509_VERIFY_PARAM_free>;
+using X509VerifyParam =
+    std::unique_ptr<X509_VERIFY_PARAM, X509VerifyParamDeleter>;
+
+// EVP
+using EvpPkeyDel = folly::static_function_deleter<EVP_PKEY, &EVP_PKEY_free>;
+using EvpPkeyUniquePtr = std::unique_ptr<EVP_PKEY, EvpPkeyDel>;
+using EvpPkeySharedPtr = std::shared_ptr<EVP_PKEY>;
+
+// No EVP_PKEY_CTX <= 0.9.8b
+#if OPENSSL_VERSION_NUMBER >= 0x10000002L
+using EvpPkeyCtxDeleter =
+    folly::static_function_deleter<EVP_PKEY_CTX, &EVP_PKEY_CTX_free>;
+using EvpPkeyCtxUniquePtr = std::unique_ptr<EVP_PKEY_CTX, EvpPkeyCtxDeleter>;
+#else
+struct EVP_PKEY_CTX;
+#endif
+
+using EvpMdCtxDeleter =
+    folly::static_function_deleter<EVP_MD_CTX, &EVP_MD_CTX_free>;
+using EvpMdCtxUniquePtr = std::unique_ptr<EVP_MD_CTX, EvpMdCtxDeleter>;
+
+// HMAC
+using HmacCtxDeleter = folly::static_function_deleter<HMAC_CTX, &HMAC_CTX_free>;
+using HmacCtxUniquePtr = std::unique_ptr<HMAC_CTX, HmacCtxDeleter>;
+
+// BIO
+using BioMethodDeleter =
+    folly::static_function_deleter<BIO_METHOD, &BIO_meth_free>;
+using BioMethodUniquePtr = std::unique_ptr<BIO_METHOD, BioMethodDeleter>;
+using BioDeleter = folly::static_function_deleter<BIO, &BIO_vfree>;
+using BioUniquePtr = std::unique_ptr<BIO, BioDeleter>;
+using BioChainDeleter = folly::static_function_deleter<BIO, &BIO_free_all>;
+using BioChainUniquePtr = std::unique_ptr<BIO, BioChainDeleter>;
+inline void BIO_free_fb(BIO* bio) { CHECK_EQ(1, BIO_free(bio)); }
+using BioDeleterFb = folly::static_function_deleter<BIO, &BIO_free_fb>;
+using BioUniquePtrFb = std::unique_ptr<BIO, BioDeleterFb>;
+
+// RSA and EC
+using RsaDeleter = folly::static_function_deleter<RSA, &RSA_free>;
+using RsaUniquePtr = std::unique_ptr<RSA, RsaDeleter>;
+#ifndef OPENSSL_NO_EC
+using EcKeyDeleter = folly::static_function_deleter<EC_KEY, &EC_KEY_free>;
+using EcKeyUniquePtr = std::unique_ptr<EC_KEY, EcKeyDeleter>;
+using EcGroupDeleter = folly::static_function_deleter<EC_GROUP, &EC_GROUP_free>;
+using EcGroupUniquePtr = std::unique_ptr<EC_GROUP, EcGroupDeleter>;
+using EcPointDeleter = folly::static_function_deleter<EC_POINT, &EC_POINT_free>;
+using EcPointUniquePtr = std::unique_ptr<EC_POINT, EcPointDeleter>;
+using EcdsaSignDeleter =
+    folly::static_function_deleter<ECDSA_SIG, &ECDSA_SIG_free>;
+using EcdsaSigUniquePtr = std::unique_ptr<ECDSA_SIG, EcdsaSignDeleter>;
+#endif
+
+// BIGNUMs
+using BIGNUMDeleter = folly::static_function_deleter<BIGNUM, &BN_clear_free>;
+using BIGNUMUniquePtr = std::unique_ptr<BIGNUM, BIGNUMDeleter>;
+
+// SSL and SSL_CTX
+using SSLDeleter = folly::static_function_deleter<SSL, &SSL_free>;
+using SSLUniquePtr = std::unique_ptr<SSL, SSLDeleter>;
+}
+}
index 874edb60ba7b01a82be65e367bc7edf6c5f4c097..a9ca22b260b848b98875ac573ce19f793c2543b9 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <folly/Range.h>
 #include <folly/String.h>
-#include <folly/io/async/ssl/OpenSSLPtrTypes.h>
+#include <folly/ssl/OpenSSLPtrTypes.h>
 #include <folly/portability/GTest.h>
 #include <folly/portability/OpenSSL.h>