You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2016/08/12 22:40:23 UTC
[2/2] mesos git commit: Split src/openssl.hpp adding
include/process/ssl/flags.hpp.
Split src/openssl.hpp adding include/process/ssl/flags.hpp.
This allows tests and other code, such as modules, to identify the
current SSL-specific setup of their hosting process (i.e. master or
agent). The libprocess SSL flags are now publically exposed.
The newly added flags.hpp is guarded by a `USE_SSL_SOCKET` define
check. This means that files can include `<process/ssl/flags.hpp>`
without checking if SSL sockets are available.
Review: https://reviews.apache.org/r/51015/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/5090c4ad
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/5090c4ad
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/5090c4ad
Branch: refs/heads/master
Commit: 5090c4ada7c9abd3a019853df2542c3f5f0dbdd6
Parents: 7a52298
Author: Till Toenshoff <to...@me.com>
Authored: Fri Aug 12 14:28:23 2016 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Fri Aug 12 15:39:57 2016 -0700
----------------------------------------------------------------------
3rdparty/libprocess/include/Makefile.am | 1 +
.../libprocess/include/process/ssl/flags.hpp | 66 ++++++++++++++++++++
3rdparty/libprocess/src/openssl.cpp | 3 +-
3rdparty/libprocess/src/openssl.hpp | 27 --------
4 files changed, 69 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/5090c4ad/3rdparty/libprocess/include/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/Makefile.am b/3rdparty/libprocess/include/Makefile.am
index a27e9f7..17c5d11 100644
--- a/3rdparty/libprocess/include/Makefile.am
+++ b/3rdparty/libprocess/include/Makefile.am
@@ -63,6 +63,7 @@ nobase_include_HEADERS = \
process/system.hpp \
process/subprocess.hpp \
process/subprocess_base.hpp \
+ process/ssl/flags.hpp \
process/ssl/gtest.hpp \
process/ssl/utilities.hpp \
process/time.hpp \
http://git-wip-us.apache.org/repos/asf/mesos/blob/5090c4ad/3rdparty/libprocess/include/process/ssl/flags.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/ssl/flags.hpp b/3rdparty/libprocess/include/process/ssl/flags.hpp
new file mode 100644
index 0000000..13fa7a0
--- /dev/null
+++ b/3rdparty/libprocess/include/process/ssl/flags.hpp
@@ -0,0 +1,66 @@
+// 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
+
+#ifndef __PROCESS_SSL_FLAGS_HPP__
+#define __PROCESS_SSL_FLAGS_HPP__
+
+#ifdef USE_SSL_SOCKET
+
+#include <string>
+
+#include <stout/flags.hpp>
+#include <stout/option.hpp>
+
+namespace process {
+namespace network {
+namespace openssl {
+
+/**
+ * Defines the _global_ OpenSSL configuration loaded by libprocess.
+ * These flags are captured from environment variables with the
+ * prefix "LIBPROCESS_SSL_".
+ */
+class Flags : public virtual flags::FlagsBase
+{
+public:
+ Flags();
+
+ bool enabled;
+ bool support_downgrade;
+ Option<std::string> cert_file;
+ Option<std::string> key_file;
+ bool verify_cert;
+ bool require_cert;
+ bool verify_ipadd;
+ unsigned int verification_depth;
+ Option<std::string> ca_dir;
+ Option<std::string> ca_file;
+ std::string ciphers;
+ bool enable_ssl_v3;
+ bool enable_tls_v1_0;
+ bool enable_tls_v1_1;
+ bool enable_tls_v1_2;
+};
+
+
+/**
+ * Returns the _global_ OpenSSL configuration used by libprocess.
+ */
+const Flags& flags();
+
+} // namespace openssl {
+} // namespace network {
+} // namespace process {
+
+#endif // USE_SSL_SOCKET
+
+#endif // __PROCESS_SSL_FLAGS_HPP__
http://git-wip-us.apache.org/repos/asf/mesos/blob/5090c4ad/3rdparty/libprocess/src/openssl.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/openssl.cpp b/3rdparty/libprocess/src/openssl.cpp
index a73313b..c09cdc8 100644
--- a/3rdparty/libprocess/src/openssl.cpp
+++ b/3rdparty/libprocess/src/openssl.cpp
@@ -26,7 +26,8 @@
#include <process/once.hpp>
-#include <stout/flags.hpp>
+#include <process/ssl/flags.hpp>
+
#include <stout/os.hpp>
#include <stout/strings.hpp>
http://git-wip-us.apache.org/repos/asf/mesos/blob/5090c4ad/3rdparty/libprocess/src/openssl.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/openssl.hpp b/3rdparty/libprocess/src/openssl.hpp
index f33614c..7ded2c7 100644
--- a/3rdparty/libprocess/src/openssl.hpp
+++ b/3rdparty/libprocess/src/openssl.hpp
@@ -17,7 +17,6 @@
#include <string>
-#include <stout/flags.hpp>
#include <stout/ip.hpp>
#include <stout/nothing.hpp>
#include <stout/option.hpp>
@@ -27,32 +26,6 @@ namespace process {
namespace network {
namespace openssl {
-// Capture the environment variables that influence how we initialize
-// the OpenSSL library via flags.
-class Flags : public virtual flags::FlagsBase
-{
-public:
- Flags();
-
- bool enabled;
- bool support_downgrade;
- Option<std::string> cert_file;
- Option<std::string> key_file;
- bool verify_cert;
- bool require_cert;
- bool verify_ipadd;
- unsigned int verification_depth;
- Option<std::string> ca_dir;
- Option<std::string> ca_file;
- std::string ciphers;
- bool enable_ssl_v3;
- bool enable_tls_v1_0;
- bool enable_tls_v1_1;
- bool enable_tls_v1_2;
-};
-
-const Flags& flags();
-
// Initializes the _global_ OpenSSL context (SSL_CTX) as well as the
// crypto library in order to support multi-threading. The global
// context gets initialized using the environment variables: