Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/rfb.c
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | |||||
#ifndef NO_OPENSSL | #ifndef NO_OPENSSL | ||||
#include <openssl/des.h> | #include <openssl/des.h> | ||||
#endif | #endif | ||||
static int rfb_debug = 0; | static int rfb_debug = 0; | ||||
#define DPRINTF(params) if (rfb_debug) PRINTLN params | #define DPRINTF(params) if (rfb_debug) PRINTLN params | ||||
#define WPRINTF(params) PRINTLN params | #define WPRINTF(params) PRINTLN params | ||||
#define VERSION_LENGTH 12 | |||||
#define AUTH_LENGTH 16 | #define AUTH_LENGTH 16 | ||||
#define PASSWD_LENGTH 8 | #define PASSWD_LENGTH 8 | ||||
#define SECURITY_TYPE_NONE 1 | #define SECURITY_TYPE_NONE 1 | ||||
#define SECURITY_TYPE_VNC_AUTH 2 | #define SECURITY_TYPE_VNC_AUTH 2 | ||||
#define AUTH_FAILED_UNAUTH 1 | #define AUTH_FAILED_UNAUTH 1 | ||||
#define AUTH_FAILED_ERROR 2 | #define AUTH_FAILED_ERROR 2 | ||||
▲ Show 20 Lines • Show All 677 Lines • ▼ Show 20 Lines | #endif | ||||
int perror = 1; | int perror = 1; | ||||
rc->cfd = cfd; | rc->cfd = cfd; | ||||
/* 1a. Send server version */ | /* 1a. Send server version */ | ||||
stream_write(cfd, vbuf, strlen(vbuf)); | stream_write(cfd, vbuf, strlen(vbuf)); | ||||
/* 1b. Read client version */ | /* 1b. Read client version */ | ||||
len = read(cfd, buf, sizeof(buf)); | len = stream_read(cfd, buf, VERSION_LENGTH); | ||||
grehan: Put in
```
#define VERSION_LENGTH 12
```
at the top, use that instead of 12, and this will be… | |||||
Done Inline ActionsChanged as suggested. khng: Changed as suggested. | |||||
/* 2a. Send security type */ | /* 2a. Send security type */ | ||||
buf[0] = 1; | buf[0] = 1; | ||||
#ifndef NO_OPENSSL | #ifndef NO_OPENSSL | ||||
if (rc->password) | if (rc->password) | ||||
buf[1] = SECURITY_TYPE_VNC_AUTH; | buf[1] = SECURITY_TYPE_VNC_AUTH; | ||||
else | else | ||||
buf[1] = SECURITY_TYPE_NONE; | buf[1] = SECURITY_TYPE_NONE; | ||||
#else | #else | ||||
▲ Show 20 Lines • Show All 284 Lines • Show Last 20 Lines |
Put in
at the top, use that instead of 12, and this will be good to go.