diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-07-10 12:16:30 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-07-10 12:16:30 +0200 |
commit | 492e38748258abe3d4efcbd4c76ef281af44783a (patch) | |
tree | dbf4bad833c81693c766da597fc27b2998ef6378 /src/main | |
parent | 7eac30d1f48d6bb676ebd0e55a5ffabb37053559 (diff) |
added null check in sasl response verifier
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/eu/siacs/conversations/crypto/sasl/ScramSha1.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/crypto/sasl/ScramSha1.java b/src/main/java/eu/siacs/conversations/crypto/sasl/ScramSha1.java index 10cd3167..c95a62df 100644 --- a/src/main/java/eu/siacs/conversations/crypto/sasl/ScramSha1.java +++ b/src/main/java/eu/siacs/conversations/crypto/sasl/ScramSha1.java @@ -185,7 +185,7 @@ public class ScramSha1 extends SaslMechanism { case RESPONSE_SENT: final String clientCalculatedServerFinalMessage = "v=" + Base64.encodeToString(serverSignature, Base64.NO_WRAP); - if (!clientCalculatedServerFinalMessage.equals(new String(Base64.decode(challenge, Base64.DEFAULT)))) { + if (challenge == null || !clientCalculatedServerFinalMessage.equals(new String(Base64.decode(challenge, Base64.DEFAULT)))) { throw new AuthenticationException("Server final message does not match calculated final message"); } state = State.VALID_SERVER_RESPONSE; |