summaryrefslogtreecommitdiffstats
path: root/vncauth.c
diff options
context:
space:
mode:
authordscho <dscho>2001-10-06 17:45:42 +0000
committerdscho <dscho>2001-10-06 17:45:42 +0000
commit446f334cc1ee67b280e218ae58fef34d5b063cea (patch)
treef238279505d71a241b20154a43aee10b7acde3fa /vncauth.c
parent018e90db5918a75ceaf3835be084e2387f31a47e (diff)
downloadlibtdevnc-446f334cc1ee67b280e218ae58fef34d5b063cea.tar.gz
libtdevnc-446f334cc1ee67b280e218ae58fef34d5b063cea.zip
WIN32 compatibility, removed kbdptr.c
Diffstat (limited to 'vncauth.c')
-rw-r--r--vncauth.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/vncauth.c b/vncauth.c
index 75f1cc3..1014291 100644
--- a/vncauth.c
+++ b/vncauth.c
@@ -26,7 +26,13 @@
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
+#ifdef WIN32
+#include <time.h>
+#define srandom srand
+#define random rand
+#else
#include <sys/time.h>
+#endif
#include "rfb.h"
#include "d3des.h"
@@ -49,12 +55,15 @@ int
vncEncryptAndStorePasswd(char *passwd, char *fname)
{
FILE *fp;
- int i;
+ unsigned int i;
unsigned char encryptedPasswd[8];
if ((fp = fopen(fname,"w")) == NULL) return 1;
+ /* windows security sux */
+#ifndef WIN32
chmod(fname, S_IRUSR|S_IWUSR);
+#endif
/* pad password with nulls */
@@ -142,7 +151,7 @@ void
vncEncryptBytes(unsigned char *bytes, char *passwd)
{
unsigned char key[8];
- int i;
+ unsigned int i;
/* key is simply password padded with nulls */