>From cf978711c019cc31677e13263653588147191a50 Mon Sep 17 00:00:00 2001 From: magnum Date: Thu, 2 Feb 2012 14:09:48 +0100 Subject: [PATCH 1/2] NSLDAPS_opencl_fmt.c bodge to be sure to satisfy the salt alignment test of 1.7.9.3 --- src/NSLDAPS_opencl_fmt.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/NSLDAPS_opencl_fmt.c b/src/NSLDAPS_opencl_fmt.c index b04963c..87e9edd 100644 --- a/src/NSLDAPS_opencl_fmt.c +++ b/src/NSLDAPS_opencl_fmt.c @@ -259,8 +259,12 @@ static void *binary(char *ciphertext) static void *get_salt(char *ciphertext) { - static char realcipher[BINARY_SIZE + SALT_SIZE + 9]; - memset(realcipher, 0, sizeof(realcipher)); + static char *realcipher; + + // Cludge to be sure to satisfy the salt aligment test of 1.7.9.3 on 64-bit + if (!realcipher) realcipher = mem_alloc_tiny(BINARY_SIZE + SALT_SIZE + 9 + 4, MEM_ALIGN_WORD) + 4; + + memset(realcipher, 0, BINARY_SIZE + SALT_SIZE + 9 + 4); base64_decode(NSLDAP_MAGIC_LENGTH + ciphertext, CIPHERTEXT_LENGTH, realcipher); return (void *) &realcipher[BINARY_SIZE]; -- 1.7.5.4