awslabs / mls-rs

An implementation of Messaging Layer Security (RFC 9420)
Apache License 2.0
105 stars 19 forks source link

Add a Replace proposal #174

Open bifurcation opened 4 months ago

bifurcation commented 4 months ago

Issues:

Resolves #170

Description of changes:

This PR implements a Replace proposal long the lines discussed in #170 and draft-barnes-mls-replace. Changes are gated behind a feature flag replace_proposal, as discussed in #171.

Call-outs:

There are a few questions around error codes highlighted with XXX(RLB) in the code.

The current code does not reflect support for the Replace proposal in Capabilities when this feature is enabled, and probably should to be specification-compliant. Somewhat surprisingly, this does not cause tests to fail. I suspect there's a general bug to fix in that there doesn't seem to be any check that a proposal is supported by the group before it is applied.

Testing:

In general, the testing strategy is broadly parallel to testing of Update, since this new proposal type is closely related:

As a small drive-by, I also added tests that duplicate Updates are correctly filtered / detected, and the corresponding code to implement this policy.

I think these tests are complete and in the right places, but my familiarity with this code base is pretty rudimentary.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT license.