summaryrefslogtreecommitdiffstats
path: root/auth.c
diff options
context:
space:
mode:
authordscho <dscho>2001-10-13 15:14:27 +0000
committerdscho <dscho>2001-10-13 15:14:27 +0000
commit9f07e222f828b7b2bf2775b9dc8cd18b22a829c1 (patch)
tree96d8ade36b70799217d3cfd9fb89193c2c1be7a0 /auth.c
parentac263ce9aa1561847427b71298861594d8623e61 (diff)
downloadlibtdevnc-9f07e222f828b7b2bf2775b9dc8cd18b22a829c1.tar.gz
libtdevnc-9f07e222f828b7b2bf2775b9dc8cd18b22a829c1.zip
rfbSelectBox, consoleFonts, too many changes
Diffstat (limited to 'auth.c')
-rw-r--r--auth.c29
1 files changed, 3 insertions, 26 deletions
diff --git a/auth.c b/auth.c
index 4244cd6..e7bd74f 100644
--- a/auth.c
+++ b/auth.c
@@ -73,8 +73,7 @@ void
rfbAuthProcessClientMessage(cl)
rfbClientPtr cl;
{
- char passwd[1024];
- int i, n;
+ int n;
CARD8 response[CHALLENGESIZE];
CARD32 authResult;
@@ -85,8 +84,8 @@ rfbAuthProcessClientMessage(cl)
return;
}
- if(!cl->screen->getPassword(cl,passwd,MAXPWLEN)) {
- rfbLog("rfbAuthProcessClientMessage: could not get password\n");
+ if(!cl->screen->passwordCheck(cl,response,CHALLENGESIZE)) {
+ rfbLog("rfbAuthProcessClientMessage: password check failed\n");
authResult = Swap32IfLE(rfbVncAuthFailed);
if (WriteExact(cl, (char *)&authResult, 4) < 0) {
rfbLogPerror("rfbAuthProcessClientMessage: write");
@@ -95,28 +94,6 @@ rfbAuthProcessClientMessage(cl)
return;
}
- vncEncryptBytes(cl->authChallenge, passwd);
-
- /* Lose the password from memory */
- for (i = strlen(passwd); i >= 0; i--) {
- passwd[i] = '\0';
- }
-
- free((char *)passwd);
-
- if (memcmp(cl->authChallenge, response, CHALLENGESIZE) != 0) {
- rfbLog("rfbAuthProcessClientMessage: authentication failed from %s\n",
- cl->host);
-
- authResult = Swap32IfLE(rfbVncAuthFailed);
-
- if (WriteExact(cl, (char *)&authResult, 4) < 0) {
- rfbLogPerror("rfbAuthProcessClientMessage: write");
- }
- rfbCloseClient(cl);
- return;
- }
-
authResult = Swap32IfLE(rfbVncAuthOK);
if (WriteExact(cl, (char *)&authResult, 4) < 0) {