diff options
author | Werner Koch <wk@gnupg.org> | 2008-09-20 10:00:36 +0000 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2008-09-20 10:00:36 +0000 |
commit | 8e1654e4fb4c93c1d2e79669d319bc758b837bb3 (patch) | |
tree | d5bffcb5415b331048971177bbf66880a7bcb3fc /src/hmac256.c | |
parent | 336430669e56aa26196acac0526deeb231c395d7 (diff) | |
download | libgcrypt-8e1654e4fb4c93c1d2e79669d319bc758b837bb3.tar.gz |
fix sigbus
Diffstat (limited to 'src/hmac256.c')
-rw-r--r-- | src/hmac256.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/hmac256.c b/src/hmac256.c index 8a318af9..d8c059ba 100644 --- a/src/hmac256.c +++ b/src/hmac256.c @@ -271,10 +271,12 @@ 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 { *p++ = hd->h##a; *p++ = hd->h##a >> 8; \ + *p++ = hd->h##a >> 16; *p++ = hd->h##a >> 24; } 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) + #endif X(0); X(1); |