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:22 UTC

[1/2] mesos git commit: Updated includes to follow the SSL flag split.

Repository: mesos
Updated Branches:
  refs/heads/master 7a5229819 -> b2ae63af6


Updated includes to follow the SSL flag split.

Review: https://reviews.apache.org/r/51016/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/b2ae63af
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/b2ae63af
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/b2ae63af

Branch: refs/heads/master
Commit: b2ae63af6c16e359ef204e6caf4c70c318fc6241
Parents: 5090c4a
Author: Till Toenshoff <to...@me.com>
Authored: Fri Aug 12 14:28:24 2016 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Fri Aug 12 15:39:57 2016 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/src/libevent_ssl_socket.cpp | 2 ++
 3rdparty/libprocess/src/process.cpp             | 5 ++---
 3rdparty/libprocess/src/socket.cpp              | 3 ++-
 3rdparty/libprocess/src/tests/ssl_client.cpp    | 2 ++
 4 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b2ae63af/3rdparty/libprocess/src/libevent_ssl_socket.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/libevent_ssl_socket.cpp b/3rdparty/libprocess/src/libevent_ssl_socket.cpp
index 05c2bd4..99a12b8 100644
--- a/3rdparty/libprocess/src/libevent_ssl_socket.cpp
+++ b/3rdparty/libprocess/src/libevent_ssl_socket.cpp
@@ -23,6 +23,8 @@
 #include <process/queue.hpp>
 #include <process/socket.hpp>
 
+#include <process/ssl/flags.hpp>
+
 #include <stout/net.hpp>
 #include <stout/synchronized.hpp>
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/b2ae63af/3rdparty/libprocess/src/process.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/process.cpp b/3rdparty/libprocess/src/process.cpp
index 629f164..a6fbf92 100644
--- a/3rdparty/libprocess/src/process.cpp
+++ b/3rdparty/libprocess/src/process.cpp
@@ -87,6 +87,8 @@
 
 #include <process/metrics/metrics.hpp>
 
+#include <process/ssl/flags.hpp>
+
 #include <stout/duration.hpp>
 #include <stout/foreach.hpp>
 #include <stout/lambda.hpp>
@@ -107,9 +109,6 @@
 #include "encoder.hpp"
 #include "event_loop.hpp"
 #include "gate.hpp"
-#ifdef USE_SSL_SOCKET
-#include "openssl.hpp"
-#endif
 #include "process_reference.hpp"
 
 namespace firewall = process::firewall;

http://git-wip-us.apache.org/repos/asf/mesos/blob/b2ae63af/3rdparty/libprocess/src/socket.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/socket.cpp b/3rdparty/libprocess/src/socket.cpp
index 668f26d..1e49518 100644
--- a/3rdparty/libprocess/src/socket.cpp
+++ b/3rdparty/libprocess/src/socket.cpp
@@ -19,11 +19,12 @@
 #include <process/owned.hpp>
 #include <process/socket.hpp>
 
+#include <process/ssl/flags.hpp>
+
 #include <stout/os.hpp>
 
 #ifdef USE_SSL_SOCKET
 #include "libevent_ssl_socket.hpp"
-#include "openssl.hpp"
 #endif
 #include "poll_socket.hpp"
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/b2ae63af/3rdparty/libprocess/src/tests/ssl_client.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/tests/ssl_client.cpp b/3rdparty/libprocess/src/tests/ssl_client.cpp
index dffd9ff..8d62fc2 100644
--- a/3rdparty/libprocess/src/tests/ssl_client.cpp
+++ b/3rdparty/libprocess/src/tests/ssl_client.cpp
@@ -22,6 +22,8 @@
 #include <process/gtest.hpp>
 #include <process/socket.hpp>
 
+#include <process/ssl/flags.hpp>
+
 #include <stout/gtest.hpp>
 #include <stout/try.hpp>
 


[2/2] mesos git commit: Split src/openssl.hpp adding include/process/ssl/flags.hpp.

Posted by jo...@apache.org.
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: