5
0
mirror of git://git.proxmox.com/git/vncterm.git synced 2024-12-22 21:33:49 +03:00

new option -notls

We need this for novnc (encryption is done by websocket)
This commit is contained in:
Dietmar Maurer 2014-06-23 13:09:45 +02:00
parent 2b83813dca
commit 07e8de89e1

View File

@ -2196,6 +2196,8 @@ new_client (rfbClientPtr client)
return RFB_CLIENT_ACCEPT;
}
static char *vncticket = NULL;
vncTerm *
create_vncterm (int argc, char** argv, int maxx, int maxy)
{
@ -2204,6 +2206,8 @@ create_vncterm (int argc, char** argv, int maxx, int maxy)
rfbScreenInfoPtr screen = rfbGetScreen (&argc, argv, maxx, maxy, 8, 1, 1);
screen->frameBuffer=(char*)calloc(maxx*maxy, 1);
char **passwds = calloc(sizeof(char**), 2);
vncTerm *vt = (vncTerm *)calloc (sizeof(vncTerm), 1);
rfbColourMap *cmap =&screen->colourMap;
@ -2272,7 +2276,15 @@ create_vncterm (int argc, char** argv, int maxx, int maxy)
//screen->autoPort = 1;
rfbRegisterSecurityHandler(&VncSecurityHandlerVencrypt);
if (vncticket) {
passwds[0] = vncticket;
passwds[1] = NULL;
screen->authPasswdData = (void *)passwds;
screen->passwordCheck = rfbCheckPasswordByList;
} else {
rfbRegisterSecurityHandler(&VncSecurityHandlerVencrypt);
}
rfbInitServer(screen);
@ -2334,6 +2346,13 @@ main (int argc, char** argv)
auth_perm = argv[i+1];
rfbPurgeArguments(&argc, &i, 2, argv);
}
if (!strcmp (argv[i], "-notls")) {
rfbPurgeArguments(&argc, &i, 1, argv);
if ((vncticket = getenv("PVE_VNC_TICKET")) == NULL) {
fprintf(stderr, "missing env PVE_VNC_TICKET (-notls)\n");
exit(-1);
}
}
}
#ifdef DEBUG