awslabs / mls-rs

An implementation of Messaging Layer Security (RFC 9420)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Investigate out of order behavior

tomleavy opened this issue · comments

Problem:

Currently there is a limit of # of keys we persist for out of order processing. This might get in the way of decrypting new in-order messages when there is a large fanout gap. For example, it is reasonable to assume an application might just ignore fanout to one particular client to help filter their traffic down to relevant information. The packets are in order and do not require the library to hold the interim keys.

Solution:

Make sure that we always calculate the key for the message being received, even if it is far into the future. If it is larger than the max fanout gap, then simply keep the most recent N keys to fill the gap rather than erroring out.