diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-01-27 16:50:00 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-01-27 16:50:00 +0100 |
commit | 04beb6dc3ca878aab48f283c1dc6699ca6a8a27b (patch) | |
tree | 0a20683c76645e69b7236355df634fdd32842766 /src/protocols/ec25519_fhmqvc/handshake.c | |
parent | bb0235f7d8db0c0ea814118593da973609352089 (diff) | |
download | fastd-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/protocols/ec25519_fhmqvc/handshake.c')
-rw-r--r-- | src/protocols/ec25519_fhmqvc/handshake.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/protocols/ec25519_fhmqvc/handshake.c b/src/protocols/ec25519_fhmqvc/handshake.c index 3f08ecb..af899d7 100644 --- a/src/protocols/ec25519_fhmqvc/handshake.c +++ b/src/protocols/ec25519_fhmqvc/handshake.c @@ -54,7 +54,7 @@ static void derive_key(fastd_sha256_t *out, size_t blocks, const uint32_t *salt, const aligned_int256_t *A, const aligned_int256_t *B, const aligned_int256_t *X, const aligned_int256_t *Y, const aligned_int256_t *sigma) { size_t methodlen = strlen(method_name); - uint8_t info[4*PUBLICKEYBYTES + methodlen]; + data_t info[4*PUBLICKEYBYTES + methodlen]; memcpy(info, A, PUBLICKEYBYTES); memcpy(info+PUBLICKEYBYTES, B, PUBLICKEYBYTES); @@ -317,7 +317,7 @@ static void finish_handshake(fastd_context_t *ctx, fastd_socket_t *sock, const f bool valid; if (!compat) { - uint8_t mac[HASHBYTES]; + data_t mac[HASHBYTES]; memcpy(mac, handshake->records[RECORD_TLV_MAC].data, HASHBYTES); memset(handshake->records[RECORD_TLV_MAC].data, 0, HASHBYTES); |