summaryrefslogtreecommitdiffstats
path: root/src/protocol_ec25519_fhmqvc_xsalsa20_poly1305.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-04-01 22:18:22 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-04-01 22:18:22 +0200
commit14d6915f098c6d51a6e879b81f70d9b9dba0b867 (patch)
tree8f5aa91f201016b187e480d5a3e68bf586181a96 /src/protocol_ec25519_fhmqvc_xsalsa20_poly1305.c
parent9be0a607eb2e452958e4128803ace2e3aaad19cc (diff)
downloadfastd-14d6915f098c6d51a6e879b81f70d9b9dba0b867.tar
fastd-14d6915f098c6d51a6e879b81f70d9b9dba0b867.zip
Use 2 bytes to encode handshake field types and lengths; breaks compatiblity with v0.1-rc2 and earlier
Diffstat (limited to 'src/protocol_ec25519_fhmqvc_xsalsa20_poly1305.c')
-rw-r--r--src/protocol_ec25519_fhmqvc_xsalsa20_poly1305.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/protocol_ec25519_fhmqvc_xsalsa20_poly1305.c b/src/protocol_ec25519_fhmqvc_xsalsa20_poly1305.c
index 326d1b5..29c02fa 100644
--- a/src/protocol_ec25519_fhmqvc_xsalsa20_poly1305.c
+++ b/src/protocol_ec25519_fhmqvc_xsalsa20_poly1305.c
@@ -277,7 +277,7 @@ static protocol_handshake* new_handshake(fastd_context *ctx, fastd_peer *peer, c
static void protocol_handshake_init(fastd_context *ctx, fastd_peer *peer) {
init_peer_state(ctx, peer);
- fastd_buffer buffer = fastd_handshake_new_init(ctx, peer, 3*(2+PUBLICKEYBYTES) /* sender key, receipient key, handshake key */);
+ fastd_buffer buffer = fastd_handshake_new_init(ctx, peer, 3*(4+PUBLICKEYBYTES) /* sender key, receipient key, handshake key */);
protocol_handshake *handshake = new_handshake(ctx, peer, peer->config, true);
@@ -343,7 +343,7 @@ static void respond_handshake(fastd_context *ctx, fastd_peer *peer, const fastd_
crypto_auth_hmacsha256(hmacbuf, hashinput, 2*PUBLICKEYBYTES, peer->protocol_state->accepting_handshake->shared_handshake_key);
- fastd_buffer buffer = fastd_handshake_new_reply(ctx, peer, handshake, 4*(2+PUBLICKEYBYTES) + 2+HMACBYTES);
+ fastd_buffer buffer = fastd_handshake_new_reply(ctx, peer, handshake, 4*(4+PUBLICKEYBYTES) + 4+HMACBYTES);
fastd_handshake_add(ctx, &buffer, RECORD_SENDER_KEY, PUBLICKEYBYTES, ctx->conf->protocol_config->public_key.p);
fastd_handshake_add(ctx, &buffer, RECORD_RECEIPIENT_KEY, PUBLICKEYBYTES, peer->protocol_state->accepting_handshake->peer_config->protocol_config->public_key.p);
@@ -475,7 +475,7 @@ static void finish_handshake(fastd_context *ctx, fastd_peer *peer, const fastd_h
memcpy(hashinput+PUBLICKEYBYTES, peer->protocol_state->initiating_handshake->public_key.p, PUBLICKEYBYTES);
crypto_auth_hmacsha256(hmacbuf, hashinput, 2*PUBLICKEYBYTES, peer->protocol_state->initiating_handshake->shared_handshake_key);
- fastd_buffer buffer = fastd_handshake_new_reply(ctx, peer, handshake, 4*(2+PUBLICKEYBYTES) + 2+HMACBYTES);
+ fastd_buffer buffer = fastd_handshake_new_reply(ctx, peer, handshake, 4*(4+PUBLICKEYBYTES) + 4+HMACBYTES);
fastd_handshake_add(ctx, &buffer, RECORD_SENDER_KEY, PUBLICKEYBYTES, ctx->conf->protocol_config->public_key.p);
fastd_handshake_add(ctx, &buffer, RECORD_RECEIPIENT_KEY, PUBLICKEYBYTES, peer->protocol_state->initiating_handshake->peer_config->protocol_config->public_key.p);