diff options
author | Parménides GV <parmegv@sdf.org> | 2014-05-08 09:51:53 +0200 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2014-05-08 09:51:53 +0200 |
commit | 6d9770518b0d94931e9521b72131516a841b193f (patch) | |
tree | 19a625deafa5eb91e3e6b14f0094b27cc6255217 /app/src/main | |
parent | 69c299b9c891d92ff7e5bc87e32b9acb10901b91 (diff) |
Raw json error messages shown.
A bit of refactoring too, sendM1 much simpler.
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/LeapSRPSession.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/LeapSRPSession.java b/app/src/main/java/se/leap/bitmaskclient/LeapSRPSession.java index f8279b64..29b429d1 100644 --- a/app/src/main/java/se/leap/bitmaskclient/LeapSRPSession.java +++ b/app/src/main/java/se/leap/bitmaskclient/LeapSRPSession.java @@ -219,7 +219,7 @@ public class LeapSRPSession { * @return the parameter M1 * @throws NoSuchAlgorithmException */ - public byte[] response(byte[] salt_bytes, byte[] Bbytes) throws NoSuchAlgorithmException { + public byte[] response(byte[] salt_bytes, byte[] Bbytes) { // Calculate x = H(s | H(U | ':' | password)) byte[] M1 = null; if(new BigInteger(1, Bbytes).mod(new BigInteger(1, N_bytes)) != BigInteger.ZERO) { @@ -257,8 +257,7 @@ public class LeapSRPSession { byte[] S_bytes = ConfigHelper.trim(S.toByteArray()); // K = SessionHash(S) - String hash_algorithm = params.hashAlgorithm; - MessageDigest sessionDigest = MessageDigest.getInstance(hash_algorithm); + MessageDigest sessionDigest = newDigest(); K = ConfigHelper.trim(sessionDigest.digest(S_bytes)); // clientHash = H(N) xor H(g) | H(U) | A | B | K |