catch null pointer in ScramSHA1 sasl

This commit is contained in:
Daniel Gultsch 2015-08-16 11:50:33 +02:00
parent 11fbc3d79e
commit c082066118
1 changed files with 3 additions and 0 deletions

View File

@ -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 = "";