diff options
author | Parménides GV <parmegv@sdf.org> | 2013-06-04 20:42:05 +0200 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2013-06-04 20:42:05 +0200 |
commit | 611bb7869ea6a98fe656b6e86ef98118d232fd45 (patch) | |
tree | 33195da594b99e90fbc813c62a349e0d18255ea1 /src/se/leap/leapclient/LeapSRPSession.java | |
parent | 46bc4830705bc0a21f28d3e7b3899c2a978f4915 (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.java | 7 |
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 |