activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andytay...@apache.org
Subject [1/2] activemq-artemis git commit: [ARTEMIS-1552] differenciate empty frame from no frame such that a null response is accepted when valid
Date Mon, 22 Jan 2018 10:20:29 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 4977042cd -> 6428a897c


[ARTEMIS-1552] differenciate empty frame from no frame such that a null response is accepted
when valid


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

Branch: refs/heads/master
Commit: b6612c950562f764e620f916b5d0e7751e8caa1c
Parents: 4977042
Author: gtully <gary.tully@gmail.com>
Authored: Fri Jan 19 14:19:54 2018 +0000
Committer: gtully <gary.tully@gmail.com>
Committed: Fri Jan 19 14:19:54 2018 +0000

----------------------------------------------------------------------
 .../protocol/amqp/proton/handler/ProtonHandler.java       | 10 ++++++----
 .../artemis/protocol/amqp/sasl/GSSAPIServerSASL.java      |  5 +----
 2 files changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b6612c95/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ProtonHandler.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ProtonHandler.java
b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ProtonHandler.java
index 54201ea..666e147 100644
--- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ProtonHandler.java
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ProtonHandler.java
@@ -306,13 +306,15 @@ public class ProtonHandler extends ProtonInitializable {
             if (chosenMechanism != null) {
 
                byte[] dataSASL = new byte[sasl.pending()];
-               sasl.recv(dataSASL, 0, dataSASL.length);
-
+               int received = sasl.recv(dataSASL, 0, dataSASL.length);
                if (log.isTraceEnabled()) {
-                  log.trace("Working on sasl::" + (dataSASL != null && dataSASL.length
> 0 ? ByteUtil.bytesToHex(dataSASL, 2) : "Anonymous"));
+                  log.trace("Working on sasl ::" + (received > 0 ? ByteUtil.bytesToHex(dataSASL,
2) : "recv:" + received));
                }
 
-               byte[] response = chosenMechanism.processSASL(dataSASL);
+               byte[] response = null;
+               if (received != -1) {
+                  response = chosenMechanism.processSASL(dataSASL);
+               }
                if (response != null) {
                   sasl.send(response, 0, response.length);
                }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b6612c95/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/GSSAPIServerSASL.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/GSSAPIServerSASL.java
b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/GSSAPIServerSASL.java
index c9b43fe..e89d548 100644
--- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/GSSAPIServerSASL.java
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/sasl/GSSAPIServerSASL.java
@@ -74,10 +74,7 @@ public class GSSAPIServerSASL implements ServerSASL {
             }));
          }
 
-         byte[] challenge = null;
-         if (bytes.length > 0) {
-            challenge = Subject.doAs(jaasId, (PrivilegedExceptionAction<byte[]>) ()
-> saslServer.evaluateResponse(bytes));
-         }
+         byte[] challenge = Subject.doAs(jaasId, (PrivilegedExceptionAction<byte[]>)
() -> saslServer.evaluateResponse(bytes));
          if (saslServer.isComplete()) {
             result = new GSSAPISASLResult(true, new KerberosPrincipal(saslServer.getAuthorizationID()));
          }


Mime
View raw message