Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug where double-hitting a ciphertext deleted the whole ratchet #228

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

mulmarta
Copy link
Contributor

Problem in an application

  • Receive a ciphertext from leaf 2, generation 0
  • Receive that ciphertext again
    • ratchet is deleted
    • message_key_generation throws an error
    • we exit, ratchet is gone
  • We can't receive from leaf 2, generation 1

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

@mulmarta mulmarta requested a review from a team as a code owner December 23, 2024 09:35
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.05%. Comparing base (3add368) to head (9bf329b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #228   +/-   ##
=======================================
  Coverage   90.04%   90.05%           
=======================================
  Files         176      176           
  Lines       31547    31568   +21     
=======================================
+ Hits        28407    28428   +21     
  Misses       3140     3140           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mulmarta mulmarta merged commit 543b050 into main Dec 23, 2024
32 checks passed
@mulmarta mulmarta deleted the sec-tree-fix branch December 23, 2024 15:20
tomleavy added a commit that referenced this pull request Jan 7, 2025
* Fix CI (#223)

* feat(mls-rs): Verify the update path even in case of a self removal (#224)

* Fix bug where double-hitting a ciphertext deleted the whole ratchet (#228)

Co-authored-by: Marta Mularczyk <[email protected]>

* Work around rust < 1.78 crash (#231)

Somehow the DWARF info generated by the compiler for the
`hash`-replacement assignment is confusing to LLVM, which crashes.

By using a different form for the same operation, the compiler is happy.

* Avoid intermediate Vec in TreeKemPublic::update_hashes (#230)

[slice, slice].concat() creates an intermediate Vec, which can be
avoided by chaining updated_leaves and trailing_blanks before the first
Vec is created.

* Add API for deleting exporters (#227)

* Add API for deleting exporters

* Apply suggestions from code review

Co-authored-by: Stephane Raux <[email protected]>

---------

Co-authored-by: Marta Mularczyk <[email protected]>
Co-authored-by: Tom Leavy <[email protected]>
Co-authored-by: Stephane Raux <[email protected]>

* Key package generation 1.x

* Fix clippy warnings

* Initial implementation of group join 1.x

* Add example for 1x API

* Apply suggestions from code review

* Add SigningData struct

* Fixup

* Add more tests

* Fixup

* Fixup

---------

Co-authored-by: Félix Lescaudey de Maneville <[email protected]>
Co-authored-by: Marta Mularczyk <[email protected]>
Co-authored-by: Mike Hommey <[email protected]>
Co-authored-by: Tom Leavy <[email protected]>
Co-authored-by: Stephane Raux <[email protected]>
mulmarta added a commit that referenced this pull request Jan 8, 2025
* Fix CI (#223)

* feat(mls-rs): Verify the update path even in case of a self removal (#224)

* Fix bug where double-hitting a ciphertext deleted the whole ratchet (#228)

Co-authored-by: Marta Mularczyk <[email protected]>

* Work around rust < 1.78 crash (#231)

Somehow the DWARF info generated by the compiler for the
`hash`-replacement assignment is confusing to LLVM, which crashes.

By using a different form for the same operation, the compiler is happy.

* Avoid intermediate Vec in TreeKemPublic::update_hashes (#230)

[slice, slice].concat() creates an intermediate Vec, which can be
avoided by chaining updated_leaves and trailing_blanks before the first
Vec is created.

* Add API for deleting exporters (#227)

* Add API for deleting exporters

* Apply suggestions from code review

Co-authored-by: Stephane Raux <[email protected]>

---------

Co-authored-by: Marta Mularczyk <[email protected]>
Co-authored-by: Tom Leavy <[email protected]>
Co-authored-by: Stephane Raux <[email protected]>

* Key package generation 1.x

* Fix clippy warnings

* Initial implementation of group join 1.x

* Add example for 1x API

* Apply suggestions from code review

* Add SigningData struct

* Fixup

* Add more tests

* Fixup

* Fixup

---------

Co-authored-by: Félix Lescaudey de Maneville <[email protected]>
Co-authored-by: Marta Mularczyk <[email protected]>
Co-authored-by: Mike Hommey <[email protected]>
Co-authored-by: Tom Leavy <[email protected]>
Co-authored-by: Stephane Raux <[email protected]>
mulmarta added a commit that referenced this pull request Jan 14, 2025
* Fix CI (#223)

* feat(mls-rs): Verify the update path even in case of a self removal (#224)

* Fix bug where double-hitting a ciphertext deleted the whole ratchet (#228)

Co-authored-by: Marta Mularczyk <[email protected]>

* Work around rust < 1.78 crash (#231)

Somehow the DWARF info generated by the compiler for the
`hash`-replacement assignment is confusing to LLVM, which crashes.

By using a different form for the same operation, the compiler is happy.

* Avoid intermediate Vec in TreeKemPublic::update_hashes (#230)

[slice, slice].concat() creates an intermediate Vec, which can be
avoided by chaining updated_leaves and trailing_blanks before the first
Vec is created.

* Add API for deleting exporters (#227)

* Add API for deleting exporters

* Apply suggestions from code review

Co-authored-by: Stephane Raux <[email protected]>

---------

Co-authored-by: Marta Mularczyk <[email protected]>
Co-authored-by: Tom Leavy <[email protected]>
Co-authored-by: Stephane Raux <[email protected]>

* Key package generation 1.x

* Fix clippy warnings

* Initial implementation of group join 1.x

* Add example for 1x API

* Apply suggestions from code review

* Add SigningData struct

* Fixup

* Add more tests

* Fixup

* Fixup

---------

Co-authored-by: Félix Lescaudey de Maneville <[email protected]>
Co-authored-by: Marta Mularczyk <[email protected]>
Co-authored-by: Mike Hommey <[email protected]>
Co-authored-by: Tom Leavy <[email protected]>
Co-authored-by: Stephane Raux <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants