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

View File

@ -101,6 +101,9 @@ public class ScramSha1 extends SaslMechanism {
public String getResponse(final String challenge) throws AuthenticationException { public String getResponse(final String challenge) throws AuthenticationException {
switch (state) { switch (state) {
case AUTH_TEXT_SENT: case AUTH_TEXT_SENT:
if (challenge == null) {
throw new AuthenticationException("challenge can not be null");
}
serverFirstMessage = Base64.decode(challenge, Base64.DEFAULT); serverFirstMessage = Base64.decode(challenge, Base64.DEFAULT);
final Tokenizer tokenizer = new Tokenizer(serverFirstMessage); final Tokenizer tokenizer = new Tokenizer(serverFirstMessage);
String nonce = ""; String nonce = "";