Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144416927
D41211.id125246.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
964 B
Referenced Files
None
Subscribers
None
D41211.id125246.diff
View Options
diff --git a/sys/opencrypto/cbc_mac.c b/sys/opencrypto/cbc_mac.c
--- a/sys/opencrypto/cbc_mac.c
+++ b/sys/opencrypto/cbc_mac.c
@@ -40,19 +40,16 @@
xor_and_encrypt(struct aes_cbc_mac_ctx *ctx,
const uint8_t *src, uint8_t *dst)
{
- const uint64_t *b1;
- uint64_t *b2;
- uint64_t temp_block[CCM_CBC_BLOCK_LEN/sizeof(uint64_t)];
+#define NWORDS (CCM_CBC_BLOCK_LEN / sizeof(uint64_t))
+ uint64_t b1[NWORDS], b2[NWORDS], temp[NWORDS];
- b1 = (const uint64_t*)src;
- b2 = (uint64_t*)dst;
+ memcpy(b1, src, CCM_CBC_BLOCK_LEN);
+ memcpy(b2, dst, CCM_CBC_BLOCK_LEN);
- for (size_t count = 0;
- count < CCM_CBC_BLOCK_LEN/sizeof(uint64_t);
- count++) {
- temp_block[count] = b1[count] ^ b2[count];
- }
- rijndaelEncrypt(ctx->keysched, ctx->rounds, (void*)temp_block, dst);
+ for (size_t count = 0; count < NWORDS; count++)
+ temp[count] = b1[count] ^ b2[count];
+ rijndaelEncrypt(ctx->keysched, ctx->rounds, (void *)temp, dst);
+#undef NWORDS
}
void
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 9, 8:16 AM (15 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28528953
Default Alt Text
D41211.id125246.diff (964 B)
Attached To
Mode
D41211: opencrypto: Respect alignment constraints in xor_and_encrypt()
Attached
Detach File
Event Timeline
Log In to Comment