Skip to content

Commit b8bc0b3

Browse files
authored
Fix VNC SecurityType None on RFB v3.8 (#7287)
1 parent aa881f6 commit b8bc0b3

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

services/console-proxy/server/src/main/java/com/cloud/consoleproxy/ConsoleProxyNoVncClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ protected void handshakeSecurityResult(int secType) {
200200
client.processHandshakeSecurityType(secType, getClientHostPassword(),
201201
getClientHostAddress(), getClientHostPort());
202202

203-
client.processSecurityResultMsg(secType);
203+
client.processSecurityResultMsg();
204204
byte[] securityResultToClient = new byte[] { 0, 0, 0, 0 };
205205
sendMessageToVNCClient(securityResultToClient, 4);
206206
client.setWaitForNoVnc(true);

services/console-proxy/server/src/main/java/com/cloud/consoleproxy/vnc/NoVncClient.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -472,18 +472,13 @@ private Pair<Boolean, String> processSecurityResultType(int authResult) {
472472
return new Pair<>(result, message);
473473
}
474474

475-
public void processSecurityResultMsg(int securityType) {
475+
public void processSecurityResultMsg() {
476476
if (s_logger.isDebugEnabled()) {
477477
s_logger.debug("Processing security result message");
478478
}
479479

480-
int result;
481-
if (securityType == RfbConstants.NO_AUTH) {
482-
result = RfbConstants.VNC_AUTH_OK;
483-
} else {
484-
nioSocketConnection.waitForBytesAvailableForReading(1);
485-
result = nioSocketConnection.readUnsignedInteger(32);
486-
}
480+
nioSocketConnection.waitForBytesAvailableForReading(1);
481+
int result = nioSocketConnection.readUnsignedInteger(32);
487482

488483
Pair<Boolean, String> securityResultType = processSecurityResultType(result);
489484
boolean success = BooleanUtils.toBoolean(securityResultType.first());

0 commit comments

Comments
 (0)