summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/methods/common.h2
-rw-r--r--src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/methods/common.h b/src/methods/common.h
index 0a26a32..0769a6c 100644
--- a/src/methods/common.h
+++ b/src/methods/common.h
@@ -59,7 +59,7 @@ static inline bool fastd_method_session_common_is_initiator(const fastd_method_c
}
static inline bool fastd_method_session_common_want_refresh(fastd_context_t *ctx, const fastd_method_common_t *session) {
- return timespec_after(&ctx->now, &session->refresh_after);
+ return fastd_method_session_common_is_initiator(session) && timespec_after(&ctx->now, &session->refresh_after);
}
static inline void fastd_method_session_common_superseded(fastd_context_t *ctx, fastd_method_common_t *session) {
diff --git a/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c b/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
index 18e0b3a..8b79d64 100644
--- a/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
+++ b/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
@@ -41,7 +41,7 @@ static inline bool read_key(uint8_t key[32], const char *hexkey) {
static inline void check_session_refresh(fastd_context_t *ctx, fastd_peer_t *peer) {
protocol_session_t *session = &peer->protocol_state->session;
- if (!session->refreshing && session->method->session_is_initiator(ctx, session->method_state) && session->method->session_want_refresh(ctx, session->method_state)) {
+ if (!session->refreshing && session->method->session_want_refresh(ctx, session->method_state)) {
pr_verbose(ctx, "refreshing session with %P", peer);
session->handshakes_cleaned = true;
session->refreshing = true;