summaryrefslogtreecommitdiffstats
path: root/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-09-09 19:35:06 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-09-09 19:35:06 +0200
commitbcc60920ca4881b4e7c3eb42c55c72cca61562b5 (patch)
treef70f1d8ea93f38db0e542c826560e77a62a33c5f /src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
parentde7f8c4765faa3f5cdc4ed440dfcec8d91130994 (diff)
downloadfastd-bcc60920ca4881b4e7c3eb42c55c72cca61562b5.tar
fastd-bcc60920ca4881b4e7c3eb42c55c72cca61562b5.zip
Add current method of connections to status output
Diffstat (limited to 'src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c')
-rw-r--r--src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c b/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
index 8533c2b..60947b3 100644
--- a/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
+++ b/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
@@ -200,6 +200,17 @@ void fastd_protocol_ec25519_fhmqvc_send_empty(fastd_peer_t *peer, protocol_sessi
session_send(peer, fastd_buffer_alloc(0, alignto(session->method->provider->min_encrypt_head_space, 8), session->method->provider->min_encrypt_tail_space), session);
}
+/** get_current_method implementation for ec25519-fhmqvp */
+const fastd_method_info_t * protocol_get_current_method(const fastd_peer_t *peer) {
+ if (!peer->protocol_state || !fastd_peer_is_established(peer))
+ return NULL;
+
+ if (peer->protocol_state->session.method->provider->session_is_initiator(peer->protocol_state->session.method_state) && is_session_valid(&peer->protocol_state->old_session))
+ return peer->protocol_state->old_session.method;
+ else
+ return peer->protocol_state->session.method;
+}
+
/** The \em ec25519-fhmqvc protocol definition */
const fastd_protocol_t fastd_protocol_ec25519_fhmqvc = {
@@ -224,6 +235,8 @@ const fastd_protocol_t fastd_protocol_ec25519_fhmqvc = {
.check_peer = protocol_check_peer,
.find_peer = fastd_protocol_ec25519_fhmqvc_find_peer,
+ .get_current_method = protocol_get_current_method,
+
.generate_key = fastd_protocol_ec25519_fhmqvc_generate_key,
.show_key = fastd_protocol_ec25519_fhmqvc_show_key,