diff options
Diffstat (limited to 'libvncserver/vncauth.c')
-rw-r--r-- | libvncserver/vncauth.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libvncserver/vncauth.c b/libvncserver/vncauth.c index b8ee288..0b73531 100644 --- a/libvncserver/vncauth.c +++ b/libvncserver/vncauth.c @@ -191,3 +191,18 @@ rfbEncryptBytes(unsigned char *bytes, char *passwd) rfbDes(bytes+i, bytes+i); } } + +void +rfbEncryptBytes2(unsigned char *where, const int length, unsigned char *key) { + int i, j; + rfbDesKey(key, EN0); + for (i = 0; i< 8; i++) + where[i] ^= key[i]; + rfbDes(where, where); + for (i = 8; i < length; i += 8) { + for (j = 0; j < 8; j++) + where[i + j] ^= where[i + j - 8]; + rfbDes(where + i, where + i); + } +} + |