parent
64449b249a
commit
2b9a886edd
|
@ -524,10 +524,34 @@ static rfbBool ReadSupportedSecurityType(rfbClient* client, uint32_t* result,
|
||||||
static rfbBool HandleVncAuth(rfbClient* client)
|
static rfbBool HandleVncAuth(rfbClient* client)
|
||||||
{
|
{
|
||||||
uint8_t challenge[CHALLENGESIZE];
|
uint8_t challenge[CHALLENGESIZE];
|
||||||
|
char* passwd = NULL;
|
||||||
|
int i;
|
||||||
|
|
||||||
if (!ReadFromRFBServer(client, (char*)challenge, CHALLENGESIZE))
|
if (!ReadFromRFBServer(client, (char*)challenge, CHALLENGESIZE))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
if (client->GetPassword)
|
||||||
|
passwd = client->GetPassword(client);
|
||||||
|
|
||||||
|
if ((!passwd) || (strlen(passwd) == 0)) {
|
||||||
|
rfbClientLog("Reading password failed\n");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if (strlen(passwd) > 8) {
|
||||||
|
passwd[8] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
rfbClientEncryptBytes(challenge, passwd);
|
||||||
|
|
||||||
|
/* Lose the password from memory */
|
||||||
|
for (i = strlen(passwd); i >= 0; i--) {
|
||||||
|
passwd[i] = '\0';
|
||||||
|
}
|
||||||
|
free(passwd);
|
||||||
|
|
||||||
|
if (!WriteToRFBServer(client, (char*)challenge, CHALLENGESIZE))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
/* Handle the SecurityResult message */
|
/* Handle the SecurityResult message */
|
||||||
if (!rfbHandleAuthResult(client))
|
if (!rfbHandleAuthResult(client))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
Loading…
Reference in New Issue