]> git.sur5r.net Git - openldap/blobdiff - libraries/liblutil/sha1.c
fix flag on formatMessage to not allocate buffer
[openldap] / libraries / liblutil / sha1.c
index a40fea46115dc1c3b16a836b360c0137f52b3c46..3c356afc00d639f776637617cf8b51d4b8b3d159 100644 (file)
@@ -61,18 +61,16 @@ void
 lutil_SHA1Transform( uint32 *state, const unsigned char *buffer )
 {
     uint32 a, b, c, d, e;
-    typedef union {
+    typedef union char64long16_u {
        unsigned char c[64];
        u_int l[16];
     } CHAR64LONG16;
-    CHAR64LONG16 *block;
 
 #ifdef SHA1HANDSOFF
-    static unsigned char workspace[64];
-    block = (CHAR64LONG16 *)workspace;
+    CHAR64LONG16 block[1];
     (void)memcpy(block, buffer, 64);
 #else
-    block = (CHAR64LONG16 *)buffer;
+    CHAR64LONG16 *block = (CHAR64LONG16 *)buffer;
 #endif
 
     /* Copy context->state[] to working vars */
@@ -140,7 +138,7 @@ void
 lutil_SHA1Update(
     lutil_SHA1_CTX     *context,
     const unsigned char        *data,
-    u_int              len
+    uint32             len
 )
 {
     u_int i, j;
@@ -202,7 +200,7 @@ static char rcsid[] = "$OpenBSD: sha1hl.c,v 1.1 1997/07/12 20:06:03 millert Exp
 #endif /* LIBC_SCCS and not lint */
 
 #include <stdio.h>
-#include <stdlib.h>
+#include <ac/stdlib.h>
 
 #include <ac/errno.h>
 #include <ac/unistd.h>