From 7a3c8bee42879add84a143ff98f28cbd0251dc7b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 2 Nov 2013 13:42:55 +0100 Subject: Allow flexible specification of methods provided by an implementation --- src/protocols/ec25519_fhmqvc/handshake.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/protocols/ec25519_fhmqvc/handshake.c') diff --git a/src/protocols/ec25519_fhmqvc/handshake.c b/src/protocols/ec25519_fhmqvc/handshake.c index a9fc1a2..cb89462 100644 --- a/src/protocols/ec25519_fhmqvc/handshake.c +++ b/src/protocols/ec25519_fhmqvc/handshake.c @@ -102,12 +102,12 @@ static inline void new_session(fastd_context_t *ctx, fastd_peer_t *peer, const c fastd_sha256_t secret[blocks]; derive_key(secret, blocks, salt, method_name, A, B, X, Y, sigma); - peer->protocol_state->session.method_state = method->session_init(ctx, (const uint8_t*)secret, initiator); + peer->protocol_state->session.method_state = method->session_init(ctx, method_name, (const uint8_t*)secret, initiator); } else { fastd_sha256_t hash; fastd_sha256_blocks(&hash, X->p, Y->p, A->p, B->p, sigma->p, NULL); - peer->protocol_state->session.method_state = method->session_init_compat(ctx, hash.b, HASHBYTES, initiator); + peer->protocol_state->session.method_state = method->session_init_compat(ctx, method_name, hash.b, HASHBYTES, initiator); } peer->protocol_state->session.established = ctx->now; @@ -126,7 +126,7 @@ static bool establish(fastd_context_t *ctx, fastd_peer_t *peer, const char *meth return false; } - const fastd_method_t *method = fastd_method_get_by_name(method_name); + const fastd_method_t *method = fastd_method_get_by_name(ctx, method_name); if (!salt && !method->session_init_compat) { pr_warn(ctx, "can't establish session with %P[%I] (method without compat support)"); return false; -- cgit v1.2.3