You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ta...@apache.org on 2016/04/05 20:04:26 UTC
qpid-jms git commit: QPIDJMS-169 Enforce user / pass encoded as UTF-0
Repository: qpid-jms
Updated Branches:
refs/heads/master e97a6f94b -> 98ba84240
QPIDJMS-169 Enforce user / pass encoded as UTF-0
Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/98ba8424
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/98ba8424
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/98ba8424
Branch: refs/heads/master
Commit: 98ba842408afad3275966b0eb8041501e54d86c5
Parents: e97a6f9
Author: Timothy Bish <ta...@gmail.com>
Authored: Tue Apr 5 14:03:50 2016 -0400
Committer: Timothy Bish <ta...@gmail.com>
Committed: Tue Apr 5 14:03:50 2016 -0400
----------------------------------------------------------------------
.../src/main/java/org/apache/qpid/jms/sasl/PlainMechanism.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/98ba8424/qpid-jms-client/src/main/java/org/apache/qpid/jms/sasl/PlainMechanism.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/sasl/PlainMechanism.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/sasl/PlainMechanism.java
index d7a8cd0..4d4e94d 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/sasl/PlainMechanism.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/sasl/PlainMechanism.java
@@ -16,6 +16,7 @@
*/
package org.apache.qpid.jms.sasl;
+import java.nio.charset.Charset;
import java.security.Principal;
/**
@@ -49,8 +50,8 @@ public class PlainMechanism extends AbstractMechanism {
password = "";
}
- byte[] usernameBytes = username.getBytes();
- byte[] passwordBytes = password.getBytes();
+ byte[] usernameBytes = username.getBytes(Charset.forName("UTF-8"));
+ byte[] passwordBytes = password.getBytes(Charset.forName("UTF-8"));
byte[] data = new byte[usernameBytes.length + passwordBytes.length + 2];
System.arraycopy(usernameBytes, 0, data, 1, usernameBytes.length);
System.arraycopy(passwordBytes, 0, data, 2 + usernameBytes.length, passwordBytes.length);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org