You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2016/01/28 16:31:43 UTC

[5/5] qpid-proton git commit: PROTON-1055: Change SASL PLAIN for better interop: - Don't send a username, because it is always derived from the authentication id (some servers get erroneously confused when the username is present)

PROTON-1055: Change SASL PLAIN for better interop:
- Don't send a username, because it is always derived from the authentication id
  (some servers get erroneously confused when the username is present)


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/9e852c5f
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/9e852c5f
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/9e852c5f

Branch: refs/heads/0.12.x
Commit: 9e852c5f1080007e258790ec138c047adea7126c
Parents: f936737
Author: Andrew Stitcher <as...@apache.org>
Authored: Mon Dec 7 17:28:48 2015 -0500
Committer: Andrew Stitcher <as...@apache.org>
Committed: Thu Jan 28 10:24:09 2016 -0500

----------------------------------------------------------------------
 proton-c/src/sasl/cyrus_sasl.c |  4 ++--
 proton-c/src/sasl/none_sasl.c  | 11 +++++------
 2 files changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/9e852c5f/proton-c/src/sasl/cyrus_sasl.c
----------------------------------------------------------------------
diff --git a/proton-c/src/sasl/cyrus_sasl.c b/proton-c/src/sasl/cyrus_sasl.c
index 809bad5..4af1f52 100644
--- a/proton-c/src/sasl/cyrus_sasl.c
+++ b/proton-c/src/sasl/cyrus_sasl.c
@@ -53,8 +53,8 @@ static void pni_cyrus_interact(pni_sasl_t *sasl, sasl_interact_t *interact)
   for (sasl_interact_t *i = interact; i->id!=SASL_CB_LIST_END; i++) {
     switch (i->id) {
     case SASL_CB_USER:
-      i->result = sasl->username;
-      i->len = strlen(sasl->username);
+      i->result = 0;
+      i->len = 0;
       break;
     case SASL_CB_AUTHNAME:
       i->result = sasl->username;

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/9e852c5f/proton-c/src/sasl/none_sasl.c
----------------------------------------------------------------------
diff --git a/proton-c/src/sasl/none_sasl.c b/proton-c/src/sasl/none_sasl.c
index 674326f..d1ee67f 100644
--- a/proton-c/src/sasl/none_sasl.c
+++ b/proton-c/src/sasl/none_sasl.c
@@ -81,17 +81,16 @@ bool pni_process_mechanisms(pn_transport_t *transport, const char *mechs)
     transport->sasl->selected_mechanism = pn_strdup(PLAIN);
     size_t usize = strlen(transport->sasl->username);
     size_t psize = strlen(transport->sasl->password);
-    size_t size = 2*usize + psize + 2;
+    size_t size = usize + psize + 2;
     char *iresp = (char *) malloc(size);
     if (!iresp) return false;
 
     transport->sasl->impl_context = iresp;
 
-    memmove(iresp, transport->sasl->username, usize);
-    iresp[usize] = 0;
-    memmove(iresp + usize + 1, transport->sasl->username, usize);
-    iresp[2*usize + 1] = 0;
-    memmove(iresp + 2*usize + 2, transport->sasl->password, psize);
+    iresp[0] = 0;
+    memmove(&iresp[1], transport->sasl->username, usize);
+    iresp[usize + 1] = 0;
+    memmove(&iresp[usize + 2], transport->sasl->password, psize);
     transport->sasl->bytes_out.start = iresp;
     transport->sasl->bytes_out.size =  size;
 


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