summaryrefslogtreecommitdiffstats
path: root/libvncserver/vncauth.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvncserver/vncauth.c')
-rw-r--r--libvncserver/vncauth.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libvncserver/vncauth.c b/libvncserver/vncauth.c
index f530cc4..4c81d30 100644
--- a/libvncserver/vncauth.c
+++ b/libvncserver/vncauth.c
@@ -21,6 +21,8 @@
* vncauth.c - Functions for VNC password management and authentication.
*/
+#define _BSD_SOURCE
+#define _POSIX_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -47,6 +49,9 @@
#endif
+/* libvncclient does not need this */
+#ifndef rfbEncryptBytes
+
/*
* We use a fixed key to store passwords, since we assume that our local
* file system is secure but nonetheless don't want to store passwords
@@ -147,7 +152,7 @@ rfbRandomBytes(unsigned char *bytes)
static rfbBool s_srandom_called = FALSE;
if (!s_srandom_called) {
- srandom((unsigned int)time(0) ^ (unsigned int)getpid());
+ srandom((unsigned int)time(NULL) ^ (unsigned int)getpid());
s_srandom_called = TRUE;
}
@@ -156,6 +161,7 @@ rfbRandomBytes(unsigned char *bytes)
}
}
+#endif
/*
* Encrypt CHALLENGESIZE bytes in memory using a password.