cfc2cc11d0
ok naddy@ ajacoutot@
14 lines
608 B
Plaintext
14 lines
608 B
Plaintext
Fix alignment issue on sparc64.
|
|
$OpenBSD: patch-src_hmac256_c,v 1.1 2008/10/26 10:39:27 landry Exp $
|
|
--- src/hmac256.c.orig Thu Oct 16 13:51:12 2008
|
|
+++ src/hmac256.c Thu Oct 16 13:51:40 2008
|
|
@@ -271,7 +271,7 @@ finalize (hmac256_context_t hd)
|
|
/* Store the digest into hd->buf. */
|
|
p = hd->buf;
|
|
#ifdef WORDS_BIGENDIAN
|
|
-#define X(a) do { *(u32*)p = hd->h##a ; p += 4; } while(0)
|
|
+#define X(a) do { memcpy(p, &hd->h##a, sizeof(u32)); p += 4; } while(0)
|
|
#else /* little endian */
|
|
#define X(a) do { *p++ = hd->h##a >> 24; *p++ = hd->h##a >> 16; \
|
|
*p++ = hd->h##a >> 8; *p++ = hd->h##a; } while(0)
|