Fix VNC SecurityType None on RFB v3.8 (#7287)

This commit is contained in:
Nicolas Vazquez 2023-02-24 07:45:30 -03:00 committed by GitHub
parent aa881f6bf3
commit b8bc0b3e13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 9 deletions

View File

@ -200,7 +200,7 @@ public class ConsoleProxyNoVncClient implements ConsoleProxyClient {
client.processHandshakeSecurityType(secType, getClientHostPassword(),
getClientHostAddress(), getClientHostPort());
client.processSecurityResultMsg(secType);
client.processSecurityResultMsg();
byte[] securityResultToClient = new byte[] { 0, 0, 0, 0 };
sendMessageToVNCClient(securityResultToClient, 4);
client.setWaitForNoVnc(true);

View File

@ -472,18 +472,13 @@ public class NoVncClient {
return new Pair<>(result, message);
}
public void processSecurityResultMsg(int securityType) {
public void processSecurityResultMsg() {
if (s_logger.isDebugEnabled()) {
s_logger.debug("Processing security result message");
}
int result;
if (securityType == RfbConstants.NO_AUTH) {
result = RfbConstants.VNC_AUTH_OK;
} else {
nioSocketConnection.waitForBytesAvailableForReading(1);
result = nioSocketConnection.readUnsignedInteger(32);
}
nioSocketConnection.waitForBytesAvailableForReading(1);
int result = nioSocketConnection.readUnsignedInteger(32);
Pair<Boolean, String> securityResultType = processSecurityResultType(result);
boolean success = BooleanUtils.toBoolean(securityResultType.first());