You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2010/05/25 23:44:02 UTC

svn commit: r948216 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main: ./ decaf/internal/net/ssl/openssl/

Author: tabish
Date: Tue May 25 21:44:01 2010
New Revision: 948216

URL: http://svn.apache.org/viewvc?rev=948216&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQCPP-140

Adds the OpenSSLParameters class for passing bulk OpenSSLSocket and OpenSSLServerSocket configuration data around.

Added:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/openssl/OpenSSLParameters.cpp   (with props)
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/openssl/OpenSSLParameters.h   (with props)
Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/openssl/OpenSSLServerSocket.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/openssl/OpenSSLServerSocket.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am?rev=948216&r1=948215&r2=948216&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am Tue May 25 21:44:01 2010
@@ -494,6 +494,7 @@ cc_sources = \
     decaf/internal/net/ssl/DefaultSSLServerSocketFactory.cpp \
     decaf/internal/net/ssl/DefaultSSLSocketFactory.cpp \
     decaf/internal/net/ssl/openssl/OpenSSLContextSpi.cpp \
+    decaf/internal/net/ssl/openssl/OpenSSLParameters.cpp \
     decaf/internal/net/ssl/openssl/OpenSSLServerSocket.cpp \
     decaf/internal/net/ssl/openssl/OpenSSLServerSocketFactory.cpp \
     decaf/internal/net/ssl/openssl/OpenSSLSocket.cpp \
@@ -1182,6 +1183,7 @@ h_sources = \
     decaf/internal/net/ssl/DefaultSSLServerSocketFactory.h \
     decaf/internal/net/ssl/DefaultSSLSocketFactory.h \
     decaf/internal/net/ssl/openssl/OpenSSLContextSpi.h \
+    decaf/internal/net/ssl/openssl/OpenSSLParameters.h \
     decaf/internal/net/ssl/openssl/OpenSSLServerSocket.h \
     decaf/internal/net/ssl/openssl/OpenSSLServerSocketFactory.h \
     decaf/internal/net/ssl/openssl/OpenSSLSocket.h \

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/openssl/OpenSSLParameters.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/openssl/OpenSSLParameters.cpp?rev=948216&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/openssl/OpenSSLParameters.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/openssl/OpenSSLParameters.cpp Tue May 25 21:44:01 2010
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+#include "OpenSSLParameters.h"
+
+using namespace decaf;
+using namespace decaf::internal;
+using namespace decaf::internal::net;
+using namespace decaf::internal::net::ssl;
+using namespace decaf::internal::net::ssl::openssl;
+
+#ifdef HAVE_OPENSSL
+
+////////////////////////////////////////////////////////////////////////////////
+OpenSSLParameters::OpenSSLParameters( SSL_CTX* context ) : context( context ) {
+
+}
+
+#endif
+
+////////////////////////////////////////////////////////////////////////////////
+OpenSSLParameters::~OpenSSLParameters() {
+
+#ifdef HAVE_OPENSSL
+
+#endif
+}

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/openssl/OpenSSLParameters.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/openssl/OpenSSLParameters.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/openssl/OpenSSLParameters.h?rev=948216&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/openssl/OpenSSLParameters.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/openssl/OpenSSLParameters.h Tue May 25 21:44:01 2010
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 _DECAF_INTERNAL_NET_SSL_OPENSSL_OPENSSLPARAMETERS_H_
+#define _DECAF_INTERNAL_NET_SSL_OPENSSL_OPENSSLPARAMETERS_H_
+
+#include <decaf/util/Config.h>
+
+#include <string>
+#include <vector>
+
+#ifdef HAVE_OPENSSL
+#include <openssl/ssl.h>
+#endif
+
+namespace decaf {
+namespace internal {
+namespace net {
+namespace ssl {
+namespace openssl {
+
+    /**
+     * Container class for parameters that are Common to OpenSSL socket classes.
+     *
+     * @since 1.0
+     */
+    class OpenSSLParameters {
+    private:
+
+        bool needClientAuth;
+        bool wantClientAuth;
+        bool useClientMode;
+
+#ifdef HAVE_OPENSSL
+        SSL_CTX* context;
+        SSL* ssl;
+#endif
+
+    public:
+
+#ifdef HAVE_OPENSSL
+        OpenSSLParameters( SSL_CTX* context );
+#endif
+
+        virtual ~OpenSSLParameters();
+
+        bool getNeedClientAuth() const {
+            return this->needClientAuth;
+        }
+
+        void setNeedClientAuth( bool value ) {
+            this->needClientAuth = value;
+            this->wantClientAuth = false;
+        }
+
+        bool getWantClientAuth() const {
+            return this->wantClientAuth;
+        }
+
+        void setWantClientAuth( bool value ) {
+            this->wantClientAuth = value;
+            this->needClientAuth = false;
+        }
+
+        bool getUseClientMode() const {
+            return this->useClientMode;
+        }
+
+        void setUseClientMode( bool value ) {
+            this->useClientMode = value;
+        }
+
+#ifdef HAVE_OPENSSL
+
+#endif
+    };
+
+}}}}}
+
+#endif /* _DECAF_INTERNAL_NET_SSL_OPENSSL_OPENSSLPARAMETERS_H_ */

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/openssl/OpenSSLParameters.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/openssl/OpenSSLServerSocket.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/openssl/OpenSSLServerSocket.cpp?rev=948216&r1=948215&r2=948216&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/openssl/OpenSSLServerSocket.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/openssl/OpenSSLServerSocket.cpp Tue May 25 21:44:01 2010
@@ -155,3 +155,9 @@ void OpenSSLServerSocket::setWantClientA
     this->data->needsClientAuth = value;
     this->data->wantsClientAuth = value;
 }
+
+////////////////////////////////////////////////////////////////////////////////
+Socket* OpenSSLServerSocket::accept() throw( decaf::io::IOException ) {
+
+    return NULL;
+}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/openssl/OpenSSLServerSocket.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/openssl/OpenSSLServerSocket.h?rev=948216&r1=948215&r2=948216&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/openssl/OpenSSLServerSocket.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/net/ssl/openssl/OpenSSLServerSocket.h Tue May 25 21:44:01 2010
@@ -98,6 +98,13 @@ namespace openssl {
          */
         virtual void setNeedClientAuth( bool value );
 
+    public:  // ServerSocket overrides
+
+        /**
+         * {@inheritDoc}
+         */
+        virtual decaf::net::Socket* accept() throw( decaf::io::IOException );
+
     };
 
 }}}}}