You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2014/08/15 20:44:56 UTC

svn commit: r1618257 - in /qpid/dispatch/trunk: etc/qdrouterd.conf include/qpid/dispatch/server.h python/qpid_dispatch_internal/management/qdrouter.json src/connection_manager.c src/server.c

Author: tross
Date: Fri Aug 15 18:44:56 2014
New Revision: 1618257

URL: http://svn.apache.org/r1618257
Log:
DISPATCH-67 - Added listener configuration for allowing skipped SASL exchange.

Modified:
    qpid/dispatch/trunk/etc/qdrouterd.conf
    qpid/dispatch/trunk/include/qpid/dispatch/server.h
    qpid/dispatch/trunk/python/qpid_dispatch_internal/management/qdrouter.json
    qpid/dispatch/trunk/src/connection_manager.c
    qpid/dispatch/trunk/src/server.c

Modified: qpid/dispatch/trunk/etc/qdrouterd.conf
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/etc/qdrouterd.conf?rev=1618257&r1=1618256&r2=1618257&view=diff
==============================================================================
--- qpid/dispatch/trunk/etc/qdrouterd.conf (original)
+++ qpid/dispatch/trunk/etc/qdrouterd.conf Fri Aug 15 18:44:56 2014
@@ -32,6 +32,7 @@ ssl-profile {
 listener {
     addr: 0.0.0.0
     port: amqp
+    allow-no-sasl: yes
     sasl-mechanisms: ANONYMOUS
     max-frame-size: 16384
 }

Modified: qpid/dispatch/trunk/include/qpid/dispatch/server.h
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/include/qpid/dispatch/server.h?rev=1618257&r1=1618256&r2=1618257&view=diff
==============================================================================
--- qpid/dispatch/trunk/include/qpid/dispatch/server.h (original)
+++ qpid/dispatch/trunk/include/qpid/dispatch/server.h Fri Aug 15 18:44:56 2014
@@ -271,6 +271,12 @@ typedef struct qd_server_config_t {
     int ssl_allow_unsecured_client;
 
     /**
+     * Iff non-zero, this listener will allow clients to connect even if they skip the
+     * SASL authentication protocol.
+     */
+    int allow_no_sasl;
+
+    /**
      * Path to the file containing the PEM-formatted public certificate for the local end
      * of the connection.
      */

Modified: qpid/dispatch/trunk/python/qpid_dispatch_internal/management/qdrouter.json
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/python/qpid_dispatch_internal/management/qdrouter.json?rev=1618257&r1=1618256&r2=1618257&view=diff
==============================================================================
--- qpid/dispatch/trunk/python/qpid_dispatch_internal/management/qdrouter.json (original)
+++ qpid/dispatch/trunk/python/qpid_dispatch_internal/management/qdrouter.json Fri Aug 15 18:44:56 2014
@@ -176,6 +176,11 @@
           "default": false,
           "description": "For listeners using SSL only.  If set to \"yes\", this option causes the listener to watch the initial network traffic to determine if the client is using SSL or is running in-the-clear.  The listener will enable SSL only if the client uis using SSL. "
         },
+        "allow-no-sasl": {
+          "type": "Boolean",
+          "default": false,
+          "description": "If set to \"yes\", this option causes the listener to allow clients to connect even if they skip the SASL authentication protocol. "
+        },
         "max-frame-size": {
           "type": "Integer",
           "default": 65536,

Modified: qpid/dispatch/trunk/src/connection_manager.c
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/src/connection_manager.c?rev=1618257&r1=1618256&r2=1618257&view=diff
==============================================================================
--- qpid/dispatch/trunk/src/connection_manager.c (original)
+++ qpid/dispatch/trunk/src/connection_manager.c Fri Aug 15 18:44:56 2014
@@ -96,22 +96,24 @@ static qd_error_t load_server_config(qd_
     config->max_frame_size = qd_entity_long(entity, "max-frame-size"); CHECK();
     config->sasl_mechanisms = qd_entity_string(entity, "sasl-mechanisms"); CHECK();
     config->ssl_enabled = has_attrs(entity, ssl_attributes, ssl_attributes_count);
+    config->allow_no_sasl =
+        qd_entity_opt_bool(entity, "allow-no-sasl", false); CHECK();
     if (config->ssl_enabled) {
         config->ssl_server = 1;
-	config->ssl_allow_unsecured_client =
-	  qd_entity_opt_bool(entity, "allow-unsecured", false); CHECK();
-	config->ssl_certificate_file =
-	  qd_entity_opt_string(entity, "cert-file", 0); CHECK();
-	config->ssl_private_key_file =
-	  qd_entity_opt_string(entity, "key-file", 0); CHECK();
+        config->ssl_allow_unsecured_client =
+            qd_entity_opt_bool(entity, "allow-unsecured", false); CHECK();
+        config->ssl_certificate_file =
+            qd_entity_opt_string(entity, "cert-file", 0); CHECK();
+        config->ssl_private_key_file =
+            qd_entity_opt_string(entity, "key-file", 0); CHECK();
         config->ssl_password =
-	  qd_entity_opt_string(entity, "password", 0); CHECK();
-	config->ssl_trusted_certificate_db =
-	  qd_entity_opt_string(entity, "cert-db", 0); CHECK();
-	config->ssl_trusted_certificates =
-	  qd_entity_opt_string(entity, "trusted-certs", 0); CHECK();
+            qd_entity_opt_string(entity, "password", 0); CHECK();
+        config->ssl_trusted_certificate_db =
+            qd_entity_opt_string(entity, "cert-db", 0); CHECK();
+        config->ssl_trusted_certificates =
+            qd_entity_opt_string(entity, "trusted-certs", 0); CHECK();
         config->ssl_require_peer_authentication =
-	  qd_entity_opt_bool(entity, "require-peer-auth", true);
+            qd_entity_opt_bool(entity, "require-peer-auth", true);
     }
     return QD_ERROR_NONE;
 
@@ -129,7 +131,7 @@ void qd_dispatch_configure_listener(qd_d
     DEQ_ITEM_INIT(cl);
     DEQ_INSERT_TAIL(cm->config_listeners, cl);
     qd_log(cm->log_source, QD_LOG_INFO, "Configured Listener: %s:%s role=%s",
-	   cl->configuration.host, cl->configuration.port, cl->configuration.role);
+           cl->configuration.host, cl->configuration.port, cl->configuration.role);
 }
 
 

Modified: qpid/dispatch/trunk/src/server.c
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/src/server.c?rev=1618257&r1=1618256&r2=1618257&view=diff
==============================================================================
--- qpid/dispatch/trunk/src/server.c (original)
+++ qpid/dispatch/trunk/src/server.c Fri Aug 15 18:44:56 2014
@@ -143,6 +143,7 @@ static void thread_process_listeners(qd_
         pn_sasl_t *sasl = pn_sasl(tport);
         pn_sasl_mechanisms(sasl, config->sasl_mechanisms);
         pn_sasl_server(sasl);
+        pn_sasl_allow_skip(sasl, config->allow_no_sasl);
         pn_sasl_done(sasl, PN_SASL_OK);  // TODO - This needs to go away
 
         pn_connector_set_context(cxtr, ctx);
@@ -225,7 +226,8 @@ static int process_connector(qd_server_t
             pn_transport_t *tport = pn_connector_transport(cxtr);
             pn_sasl_t      *sasl  = pn_sasl(tport);
 
-            if (pn_sasl_outcome(sasl) == PN_SASL_OK) {
+            if (pn_sasl_outcome(sasl) == PN_SASL_OK ||
+                pn_sasl_outcome(sasl) == PN_SASL_SKIPPED) {
                 ctx->state = CONN_STATE_OPERATIONAL;
 
                 qd_conn_event_t ce = QD_CONN_EVENT_PROCESS; // Initialize to keep the compiler happy



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org