Bugzilla – Attachment 2265 Details for
Bug 2101
Unaligned memory access on sparc in UMAC implemetation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug fix based on union
umac_align-union.patch (text/plain), 1.27 KB, created by
Tomas Kuthan
on 2013-05-13 21:53:44 AEST
(
hide
)
Description:
Bug fix based on union
Filename:
MIME Type:
Creator:
Tomas Kuthan
Created:
2013-05-13 21:53:44 AEST
Size:
1.27 KB
patch
obsolete
>--- old/mac.c 2013-05-13 04:36:03.443717399 -0700 >+++ openssh-6.2p1/mac.c 2013-05-13 04:45:18.458429727 -0700 >@@ -152,12 +152,15 @@ > u_char * > mac_compute(Mac *mac, u_int32_t seqno, u_char *data, int datalen) > { >- static u_char m[EVP_MAX_MD_SIZE]; >+ static union { >+ u_char m[EVP_MAX_MD_SIZE]; >+ u_int64_t for_align; >+ } u; > u_char b[4], nonce[8]; > >- if (mac->mac_len > sizeof(m)) >+ if (mac->mac_len > sizeof(u)) > fatal("mac_compute: mac too long %u %lu", >- mac->mac_len, (u_long)sizeof(m)); >+ mac->mac_len, (u_long)sizeof(u)); > > switch (mac->type) { > case SSH_EVP: >@@ -166,22 +169,22 @@ > HMAC_Init(&mac->evp_ctx, NULL, 0, NULL); > HMAC_Update(&mac->evp_ctx, b, sizeof(b)); > HMAC_Update(&mac->evp_ctx, data, datalen); >- HMAC_Final(&mac->evp_ctx, m, NULL); >+ HMAC_Final(&mac->evp_ctx, u.m, NULL); > break; > case SSH_UMAC: > put_u64(nonce, seqno); > umac_update(mac->umac_ctx, data, datalen); >- umac_final(mac->umac_ctx, m, nonce); >+ umac_final(mac->umac_ctx, u.m, nonce); > break; > case SSH_UMAC128: > put_u64(nonce, seqno); > umac128_update(mac->umac_ctx, data, datalen); >- umac128_final(mac->umac_ctx, m, nonce); >+ umac128_final(mac->umac_ctx, u.m, nonce); > break; > default: > fatal("mac_compute: unknown MAC type"); > } >- return (m); >+ return (u.m); > } > > void
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2101
:
2264
| 2265 |
2266
|
2281