summaryrefslogtreecommitdiff
path: root/src/se/leap/leapclient/LeapSRPSession.java
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2013-06-04 20:42:05 +0200
committerParménides GV <parmegv@sdf.org>2013-06-04 20:42:05 +0200
commit611bb7869ea6a98fe656b6e86ef98118d232fd45 (patch)
tree33195da594b99e90fbc813c62a349e0d18255ea1 /src/se/leap/leapclient/LeapSRPSession.java
parent46bc4830705bc0a21f28d3e7b3899c2a978f4915 (diff)
Fixed SRP strange characters bugs.
The problem was the encoding of the bytes when calculating the password hash. I supposed that it was UTF-8 (I already saw that encoding in the html code from leap_web), but not, it was ISO-8859-1 (trial/error).
Diffstat (limited to 'src/se/leap/leapclient/LeapSRPSession.java')
-rw-r--r--src/se/leap/leapclient/LeapSRPSession.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/se/leap/leapclient/LeapSRPSession.java b/src/se/leap/leapclient/LeapSRPSession.java
index 8d6f77bf..77f43945 100644
--- a/src/se/leap/leapclient/LeapSRPSession.java
+++ b/src/se/leap/leapclient/LeapSRPSession.java
@@ -97,10 +97,11 @@ public class LeapSRPSession {
byte[] user = null;
byte[] password_bytes = null;
byte[] colon = {};
+ String encoding = "ISO-8859-1";
try {
- user = Util.trim(username.getBytes("UTF-8"));
- colon = Util.trim(":".getBytes("UTF-8"));
- password_bytes = Util.trim(password.getBytes("UTF-8"));
+ user = Util.trim(username.getBytes(encoding));
+ colon = Util.trim(":".getBytes(encoding));
+ password_bytes = Util.trim(password.getBytes(encoding));
}
catch(UnsupportedEncodingException e) {
// Use the default platform encoding