Skip to content

Conversation

@coriolinus
Copy link
Contributor

@coriolinus coriolinus commented Nov 7, 2025

What's new in this PR

  • add the Keypackage type just straight using the OpenMLS one
  • add the KeypackageRef type just straight using the OpenMLS one actually we needed a fat ref after all
  • add a Keypackage.ref() method that returns a KeypackageRef
  • add the following methods:
    • client.generateKeypackages
    • client.getKeypackages
    • client.removeKeypackage
    • client.removeKeypackagesFor
  • add comprehensive tests for the new API to all bindings
    • ts
    • kotlin
    • swift
  • update client.removeCredential to remove all key packages related to the credential
  • remove old API related to key packages, and in particular:
    • clientKeypackages
    • deleteStaleKeypackages
    • clientValidKeypackagesCount

PR Submission Checklist for internal contributors
  • The PR Title
    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@coriolinus coriolinus requested a review from a team as a code owner November 7, 2025 16:38
@coriolinus coriolinus marked this pull request as draft November 7, 2025 16:38
@coriolinus
Copy link
Contributor Author

How to handle the migration:

  • migrate signature scheme to ciphersuite
    • where unambiguous, it's easy
    • where ambiguous, duplicate the entries
  • ensure we have both "find by signature scheme" and "find by ciphersuite" on credential ref
  • and find by ciphersuite exists at the FFI layer

@coriolinus coriolinus force-pushed the prgn/feat/19574-new-keypackage-api branch 3 times, most recently from f6e27a8 to c223af1 Compare November 19, 2025 16:24
@github-actions
Copy link

github-actions bot commented Nov 20, 2025

🐰 Bencher Report

Branchprgn/feat/19574-new-keypackage-api
Testbedubuntu-latest

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymicroseconds (µs)
Commit add f(group size)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
17,541.00 µs
Commit add f(group size)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
790.41 µs
Commit add f(group size)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
4,294.50 µs
Commit add f(group size)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
7,654.30 µs
Commit add f(group size)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
11,603.00 µs
Commit add f(group size)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
14,439.00 µs
Commit add f(number clients)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
996,710.00 µs
Commit add f(number clients)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
764.30 µs
Commit add f(number clients)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
79,536.00 µs
Commit add f(number clients)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
218,150.00 µs
Commit add f(number clients)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
431,060.00 µs
Commit add f(number clients)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
682,620.00 µs
Commit pending proposals f(group size)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
116,520.00 µs
Commit pending proposals f(group size)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
23,494.00 µs
Commit pending proposals f(group size)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
42,286.00 µs
Commit pending proposals f(group size)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
58,044.00 µs
Commit pending proposals f(group size)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
77,946.00 µs
Commit pending proposals f(group size)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
93,300.00 µs
Commit pending proposals f(pending size)/cs1/mem/1📈 view plot
⚠️ NO THRESHOLD
17,199.00 µs
Commit pending proposals f(pending size)/cs1/mem/101📈 view plot
⚠️ NO THRESHOLD
115,750.00 µs
Commit pending proposals f(pending size)/cs1/mem/21📈 view plot
⚠️ NO THRESHOLD
34,466.00 µs
Commit pending proposals f(pending size)/cs1/mem/41📈 view plot
⚠️ NO THRESHOLD
55,999.00 µs
Commit pending proposals f(pending size)/cs1/mem/61📈 view plot
⚠️ NO THRESHOLD
75,451.00 µs
Commit pending proposals f(pending size)/cs1/mem/81📈 view plot
⚠️ NO THRESHOLD
95,282.00 µs
Commit remove f(group size)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
10,987.00 µs
Commit remove f(group size)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
576.92 µs
Commit remove f(group size)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
2,324.10 µs
Commit remove f(group size)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
4,252.20 µs
Commit remove f(group size)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
6,486.00 µs
Commit remove f(group size)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
8,890.40 µs
Commit remove f(number clients)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
14,407.00 µs
Commit remove f(number clients)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
135,220.00 µs
Commit remove f(number clients)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
111,290.00 µs
Commit remove f(number clients)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
86,779.00 µs
Commit remove f(number clients)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
62,649.00 µs
Commit remove f(number clients)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
38,278.00 µs
Commit update f(group size)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
135,420.00 µs
Commit update f(group size)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
759.51 µs
Commit update f(group size)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
27,982.00 µs
Commit update f(group size)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
55,092.00 µs
Commit update f(group size)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
83,038.00 µs
Commit update f(group size)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
108,880.00 µs
🐰 View full continuous benchmarking report in Bencher

@github-actions
Copy link

🐰 Bencher Report

Branchprgn/feat/19574-new-keypackage-api
Testbedubuntu-latest

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
decrypt1000MessagesWeb📈 view plot
⚠️ NO THRESHOLD
251.10 ms
🐰 View full continuous benchmarking report in Bencher

@coriolinus coriolinus force-pushed the prgn/feat/19574-new-keypackage-api branch 22 times, most recently from 27cbc33 to fb05227 Compare November 27, 2025 09:16
These methods will be particularly useful later on, when we want to
implement the trait on a fatter ref type.
The new CC API involves minimizing transfer of biggish data across
the FFI boundary, and using smaller typesafe references instead wherever
possible.

These references should know enough about their referenced struct to
cheaply do relevant sorting and filtering operations.

We'd previously been exposing the raw OpenMLS `KeyPackage` and `KeyPackageRef`
types. However, `KeyPackageRef` doesn't know enough about its referenced
Keypackage to be useful. So we fatten it in this commit so that we can
remove obsolete methods without losing functionality.
Mostly this is about making `KeypackageRef` a fat ref not just a pointer,
and reexporting its data methods so clients can see them.
Somehow it used to be that going through an e2ei enrollment would
just automatically clear out all keypackages created with a basic
credential, despite comments in the code mentioning that this could
potentially lead to orphan keypackages.

We've removed the method which did that, so now those keypackages
are no longer removed, which meant we needed to adjust this test.
This test assumed that e2ei rotation implicitly cleared out all existing
keypackages and also generated an equal number of new ones. That behavior
cannot remain with the new keypackage API, so we needed to adjust this test
to test the actual behavior.
@coriolinus coriolinus force-pushed the prgn/feat/19574-new-keypackage-api branch from 524fde3 to 326ba95 Compare December 1, 2025 16:09
@coriolinus coriolinus merged commit 326ba95 into main Dec 1, 2025
34 checks passed
@coriolinus coriolinus deleted the prgn/feat/19574-new-keypackage-api branch December 1, 2025 16:09
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.

5 participants