diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-08-16 11:50:33 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-08-16 11:50:33 +0200 |
commit | c082066118431a380dc62892c4363f73591b6666 (patch) | |
tree | b76c8994610a2a896f28b69e457c8e1767db2f07 | |
parent | 11fbc3d79e5896a4ba7d7e0c0c68415824c7b8cd (diff) |
catch null pointer in ScramSHA1 sasl
-rw-r--r-- | src/main/java/eu/siacs/conversations/crypto/sasl/ScramSha1.java | 3 |
1 files changed, 3 insertions, 0 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 c95a62df..f47677f6 100644 --- a/src/main/java/eu/siacs/conversations/crypto/sasl/ScramSha1.java +++ b/src/main/java/eu/siacs/conversations/crypto/sasl/ScramSha1.java @@ -101,6 +101,9 @@ public class ScramSha1 extends SaslMechanism { public String getResponse(final String challenge) throws AuthenticationException { switch (state) { case AUTH_TEXT_SENT: + if (challenge == null) { + throw new AuthenticationException("challenge can not be null"); + } serverFirstMessage = Base64.decode(challenge, Base64.DEFAULT); final Tokenizer tokenizer = new Tokenizer(serverFirstMessage); String nonce = ""; |