diff options
author | dscho <dscho> | 2001-10-06 17:45:42 +0000 |
---|---|---|
committer | dscho <dscho> | 2001-10-06 17:45:42 +0000 |
commit | 446f334cc1ee67b280e218ae58fef34d5b063cea (patch) | |
tree | f238279505d71a241b20154a43aee10b7acde3fa /vncauth.c | |
parent | 018e90db5918a75ceaf3835be084e2387f31a47e (diff) | |
download | libtdevnc-446f334cc1ee67b280e218ae58fef34d5b063cea.tar.gz libtdevnc-446f334cc1ee67b280e218ae58fef34d5b063cea.zip |
WIN32 compatibility, removed kbdptr.c
Diffstat (limited to 'vncauth.c')
-rw-r--r-- | vncauth.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -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 */ |