diff options
Diffstat (limited to 'deps/ntlmclient/util.c')
-rw-r--r-- | deps/ntlmclient/util.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/deps/ntlmclient/util.c b/deps/ntlmclient/util.c index d0e3e53be..07d10f6c6 100644 --- a/deps/ntlmclient/util.c +++ b/deps/ntlmclient/util.c @@ -8,14 +8,28 @@ #include <stdlib.h> #include <stdint.h> +#include <arpa/inet.h> #include "compat.h" #include "util.h" -void memzero(void *data, size_t size) +void ntlm_memzero(void *data, size_t size) { volatile uint8_t *scan = (volatile uint8_t *)data; while (size--) *scan++ = 0x0; } + +uint64_t ntlm_htonll(uint64_t value) +{ + static union { + uint32_t i; + char c[8]; + } test = { 0x01020304 }; + + if (test.c[0] == 0x01) + return value; + else + return ((uint64_t)htonl(value) << 32) | htonl((uint64_t)value >> 32); +} |