summaryrefslogtreecommitdiffstats
path: root/common/vncauth.c
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2019-02-06 16:56:55 +0100
committerSlávek Banko <slavek.banko@axis.cz>2019-02-06 16:56:55 +0100
commitf3f392caec43b4095bc1d84b315ed7972c13c144 (patch)
tree5c4ba8b5d38f1ae33de71507c5634a15a0b35bfe /common/vncauth.c
parent8c081c8888bccbf5adfe0fc4ec518e2cbfba9871 (diff)
parent0a70095271d845d16a3ed17354841b01f33963ad (diff)
downloadlibtdevnc-f3f392caec43b4095bc1d84b315ed7972c13c144.tar.gz
libtdevnc-f3f392caec43b4095bc1d84b315ed7972c13c144.zip
Merge tag 'LibVNCServer-0.9.12'
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'common/vncauth.c')
-rw-r--r--common/vncauth.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/common/vncauth.c b/common/vncauth.c
index 9434ae4..53347d3 100644
--- a/common/vncauth.c
+++ b/common/vncauth.c
@@ -26,7 +26,9 @@
#endif
#include <stdio.h>
#include <stdlib.h>
+#ifdef LIBVNCSERVER_HAVE_UNISTD_H
#include <unistd.h>
+#endif
#include <rfb/rfbproto.h>
#include "d3des.h"
@@ -200,8 +202,9 @@ rfbEncryptBytes2(unsigned char *where, const int length, unsigned char *key) {
where[i] ^= key[i];
rfbDes(where, where);
for (i = 8; i < length; i += 8) {
- for (j = 0; j < 8; j++)
+ for (j = 0; j < 8; j++) {
where[i + j] ^= where[i + j - 8];
- rfbDes(where + i, where + i);
+ }
+ rfbDes(where + i, where + i);
}
}