diff options
Diffstat (limited to 'src/methods/composed_gmac/composed_gmac.c')
-rw-r--r-- | src/methods/composed_gmac/composed_gmac.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/methods/composed_gmac/composed_gmac.c b/src/methods/composed_gmac/composed_gmac.c index cac24d6..b6506dd 100644 --- a/src/methods/composed_gmac/composed_gmac.c +++ b/src/methods/composed_gmac/composed_gmac.c @@ -256,7 +256,7 @@ static bool method_encrypt(UNUSED fastd_peer_t *peer, fastd_method_session_state } /** Verifies and decrypts a packet */ -static bool method_decrypt(fastd_peer_t *peer, fastd_method_session_state_t *session, fastd_buffer_t *out, fastd_buffer_t in) { +static bool method_decrypt(fastd_peer_t *peer, fastd_method_session_state_t *session, fastd_buffer_t *out, fastd_buffer_t in, bool *reordered) { if (in.len < COMMON_HEADBYTES+sizeof(fastd_block128_t)) return false; @@ -308,7 +308,11 @@ static bool method_decrypt(fastd_peer_t *peer, fastd_method_session_state_t *ses fastd_buffer_push_head(out, sizeof(fastd_block128_t)); - if (!fastd_method_reorder_check(peer, &session->common, in_nonce, age)) { + fastd_tristate_t reorder_check = fastd_method_reorder_check(peer, &session->common, in_nonce, age); + if (reorder_check.set) { + *reordered = reorder_check.state; + } + else { fastd_buffer_free(*out); *out = fastd_buffer_alloc(0, 0, 0); } |