GUACAMOLE-197: Deal with null state field..

This commit is contained in:
Nick Couchman
2018-02-03 23:17:30 -05:00
parent 77b4665c5c
commit 41dd9fc60d

View File

@@ -157,7 +157,14 @@ public class AuthenticationProviderService {
// This is a response to a previous challenge, authenticate with that. // This is a response to a previous challenge, authenticate with that.
else { else {
try { try {
byte[] stateBytes = DatatypeConverter.parseHexBinary(request.getParameter(RadiusStateField.PARAMETER_NAME)); String stateString = request.getParameter(RadiusStateField.PARAMETER_NAME);
if (stateString == null) {
logger.error("Could not retrieve RADIUS state.");
logger.debug("Received null value while retrieving RADIUS state parameter.");
throws new GuacamoleInvalidCredentialsException("Authentication error.", CredentialsInfo.USERNAME_PASSWORD);
}
byte[] stateBytes = DatatypeConverter.parseHexBinary(stateString);
radPack = radiusService.sendChallengeResponse(credentials.getUsername(), radPack = radiusService.sendChallengeResponse(credentials.getUsername(),
challengeResponse, challengeResponse,
stateBytes); stateBytes);