From 67094d7c281993497decb1459ea1663765a760eb Mon Sep 17 00:00:00 2001 From: dscho Date: Thu, 11 Oct 2001 15:44:58 +0000 Subject: replaced xalloc with malloc functions, udp input support (untested), fixed http --- auth.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'auth.c') diff --git a/auth.c b/auth.c index 3e23ada..4244cd6 100644 --- a/auth.c +++ b/auth.c @@ -30,10 +30,6 @@ #include #include "rfb.h" - -char *rfbAuthPasswdFile = NULL; - - /* * rfbAuthNewClient is called when we reach the point of authenticating * a new client. If authentication isn't being used then we simply send @@ -49,15 +45,12 @@ rfbAuthNewClient(cl) cl->state = RFB_AUTHENTICATION; - if (rfbAuthPasswdFile && !cl->reverseConnection) { - + if (cl->screen->rfbAuthPasswdData && !cl->reverseConnection) { *(CARD32 *)buf = Swap32IfLE(rfbVncAuth); vncRandomBytes(cl->authChallenge); memcpy(&buf[4], (char *)cl->authChallenge, CHALLENGESIZE); len = 4 + CHALLENGESIZE; - } else { - *(CARD32 *)buf = Swap32IfLE(rfbNoAuth); len = 4; cl->state = RFB_INITIALISATION; @@ -80,7 +73,7 @@ void rfbAuthProcessClientMessage(cl) rfbClientPtr cl; { - char *passwd; + char passwd[1024]; int i, n; CARD8 response[CHALLENGESIZE]; CARD32 authResult; @@ -92,14 +85,9 @@ rfbAuthProcessClientMessage(cl) return; } - passwd = vncDecryptPasswdFromFile(rfbAuthPasswdFile); - - if (passwd == NULL) { - rfbLog("rfbAuthProcessClientMessage: could not get password from %s\n", - rfbAuthPasswdFile); - + if(!cl->screen->getPassword(cl,passwd,MAXPWLEN)) { + rfbLog("rfbAuthProcessClientMessage: could not get password\n"); authResult = Swap32IfLE(rfbVncAuthFailed); - if (WriteExact(cl, (char *)&authResult, 4) < 0) { rfbLogPerror("rfbAuthProcessClientMessage: write"); } -- cgit v1.1