summaryrefslogtreecommitdiffstats
path: root/src/methods/cipher_test/cipher_test.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-01-27 16:50:00 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-01-27 16:50:00 +0100
commit04beb6dc3ca878aab48f283c1dc6699ca6a8a27b (patch)
tree0a20683c76645e69b7236355df634fdd32842766 /src/methods/cipher_test/cipher_test.c
parentbb0235f7d8db0c0ea814118593da973609352089 (diff)
downloadfastd-04beb6dc3ca878aab48f283c1dc6699ca6a8a27b.tar
fastd-04beb6dc3ca878aab48f283c1dc6699ca6a8a27b.zip
Add an aligned uint8_t type data_t and use it to ensure the alignment of various buffers on the stack
Diffstat (limited to 'src/methods/cipher_test/cipher_test.c')
-rw-r--r--src/methods/cipher_test/cipher_test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/methods/cipher_test/cipher_test.c b/src/methods/cipher_test/cipher_test.c
index 3241acf..f6e01d0 100644
--- a/src/methods/cipher_test/cipher_test.c
+++ b/src/methods/cipher_test/cipher_test.c
@@ -117,7 +117,7 @@ static bool method_encrypt(fastd_context_t *ctx, fastd_peer_t *peer UNUSED, fast
if (tail_len)
memset(in.data+in.len, 0, tail_len);
- uint8_t nonce[session->method->cipher_info->iv_length];
+ data_t nonce[session->method->cipher_info->iv_length];
fastd_method_expand_nonce(nonce, session->common.send_nonce, sizeof(nonce));
int n_blocks = block_count(in.len, sizeof(fastd_block128_t));
@@ -156,7 +156,7 @@ static bool method_decrypt(fastd_context_t *ctx, fastd_peer_t *peer, fastd_metho
if (flags)
return false;
- uint8_t nonce[session->method->cipher_info->iv_length];
+ data_t nonce[session->method->cipher_info->iv_length];
fastd_method_expand_nonce(nonce, in_nonce, sizeof(nonce));
size_t tail_len = alignto(in.len, sizeof(fastd_block128_t))-in.len;