remove vncauth.c
This commit is contained in:
parent
013c114995
commit
7ac2f6506f
@ -1,6 +1,7 @@
|
||||
|
||||
VNCOBJ = ../common/os_calls.o vnc.o ../common/d3des.o vncauth.o
|
||||
VNCOBJ = vnc.o os_calls.o d3des.o
|
||||
CFLAGS = -Wall -O2 -I../common
|
||||
C_OS_FLAGS = $(CFLAGS) -c
|
||||
LDFLAGS = -shared
|
||||
LIBS = -ldl
|
||||
CC = gcc
|
||||
@ -12,3 +13,9 @@ vnc: $(VNCOBJ)
|
||||
|
||||
clean:
|
||||
rm -f $(VNCOBJ) libvnc.so
|
||||
|
||||
os_calls.o:
|
||||
$(CC) $(C_OS_FLAGS) ../common/os_calls.c
|
||||
|
||||
d3des.o:
|
||||
$(CC) $(C_OS_FLAGS) ../common/d3des.c
|
||||
|
16
vnc/vnc.c
16
vnc/vnc.c
@ -22,6 +22,20 @@
|
||||
|
||||
#include "vnc.h"
|
||||
|
||||
/******************************************************************************/
|
||||
/* taken from vncauth.c */
|
||||
void rfbEncryptBytes(char* bytes, char* passwd)
|
||||
{
|
||||
char key[12];
|
||||
|
||||
/* key is simply password padded with nulls */
|
||||
g_memset(key, 0, sizeof(key));
|
||||
g_strncpy(key, passwd, 8);
|
||||
rfbDesKey((unsigned char*)key, EN0); /* 0, encrypt */
|
||||
rfbDes((unsigned char*)bytes, (unsigned char*)bytes);
|
||||
rfbDes((unsigned char*)(bytes + 8), (unsigned char*)(bytes + 8));
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* returns error */
|
||||
int lib_recv(struct vnc* v, char* data, int len)
|
||||
@ -849,7 +863,7 @@ int lib_mod_connect(struct vnc* v)
|
||||
error = lib_recv(v, s->data, 16);
|
||||
if (error == 0)
|
||||
{
|
||||
rfbEncryptBytes((unsigned char*)s->data, v->password);
|
||||
rfbEncryptBytes(s->data, v->password);
|
||||
error = lib_send(v, s->data, 16);
|
||||
}
|
||||
}
|
||||
|
@ -24,8 +24,7 @@
|
||||
#include "arch.h"
|
||||
#include "parse.h"
|
||||
#include "os_calls.h"
|
||||
|
||||
void rfbEncryptBytes(unsigned char *bytes, char *passwd);
|
||||
#include "d3des.h"
|
||||
|
||||
struct vnc
|
||||
{
|
||||
|
@ -1,56 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
|
||||
*
|
||||
* This is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
* vncauth.c - Functions for VNC password management and authentication.
|
||||
*/
|
||||
|
||||
/*
|
||||
stripped down Jay Sorg for xrdp
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include "d3des.h"
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
void rfbEncryptBytes(unsigned char *bytes, char *passwd)
|
||||
{
|
||||
unsigned char key[8];
|
||||
unsigned int i;
|
||||
|
||||
/* key is simply password padded with nulls */
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (i < strlen(passwd)) {
|
||||
key[i] = passwd[i];
|
||||
} else {
|
||||
key[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
rfbDesKey(key, EN0);
|
||||
|
||||
for (i = 0; i < 16; i += 8) {
|
||||
rfbDes(bytes+i, bytes+i);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user