summaryrefslogtreecommitdiffstats
path: root/auth.c
diff options
context:
space:
mode:
authordscho <dscho>2001-10-11 15:44:58 +0000
committerdscho <dscho>2001-10-11 15:44:58 +0000
commit67094d7c281993497decb1459ea1663765a760eb (patch)
tree6317d81c1ddca58b5e3b8e1556ae9b904e0d160b /auth.c
parent519a8e0e399bf44893f2d61a3676f3257ab8d201 (diff)
downloadlibvncserver-67094d7c281993497decb1459ea1663765a760eb.zip
libvncserver-67094d7c281993497decb1459ea1663765a760eb.tar.gz
replaced xalloc with malloc functions, udp input support (untested), fixed http
Diffstat (limited to 'auth.c')
-rw-r--r--auth.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/auth.c b/auth.c
index 3e23ada..4244cd6 100644
--- a/auth.c
+++ b/auth.c
@@ -30,10 +30,6 @@
#include <stdlib.h>
#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");
}
OpenPOWER on IntegriCloud