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

MONGOCRYPT-572 remove QE-V1 code and tests #934

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

kevinAlbs
Copy link
Contributor

@kevinAlbs kevinAlbs commented Jan 3, 2025

Summary

  • Remove unused code for the QE-V1 protocol.
  • Add tests to ensure expected payloads can be decrypted.

Resolves MONGOCRYPT-572. Verified with this patch build.

Background & Motivation

MongoDB 7.0 dropped QE-V1 and added stable support of QE-V2 (SPM-2972). MONGOCRYPT-561 makes QE-V2 the default and prevents using QE-V1 with public API. This PR removes code for QE-V1 and updates tests. No behavior change is expected when using the public API. The removal is intended to ease implementation of MONGOCRYPT-723.

Tests explicitly decrypting each payload type are added. This is intended to serve as a reference and add missing test coverage for decrypting QE-V2 payloads.

The defunct mongocrypt_setopt_fle2v2 is removed. mongocrypt_setopt_fle2v2 was private API only used in outdated tests of the QE-V1 protocol.

Generating deleteTokens is now removed. deleteTokens are not generated for QE-V2.

References to the eccCollection in tests are removed. The eccCollection was needed for QE-V1 but is not used in QE-V2 (SERVER-75683).

Test payloads are updated from V1 to V2 as needed. dump_payload can be used to identify a payload:

$ dump_payload.py DIkAAAAFZAAgAAAAAE8KGPgq7h3n9nH5lfHcia8wtOTLwGkZNLBesb6PULqbBXMAIAAAAACq0558QyD3c3jkR5k0Zc9UpQK8ByhXhtn2d1xVQnuJ3AVsACAAAAAAlO36MaVLVRDFW6xrI+0UTkyQdFfSCEBPkZg8sFzuTJYSY20AAAAAAAAAAAAA
blob_subtype: 12 (FLE2FindEqualityPayloadV2)
[...]

This script was used to find and unused JSON test files. Unused test files were removed with one exception: test/data/keys/12345678123498761234123456789014-local-document.json was kept for consistency with other keys in the test/data/keys directory.

This PR notably does not remove the Range-V1 protocol. Removing RangeV1 is tracked in MONGOCRYPT-711.

`mongocrypt_setopt_fle2v2` can only be called privately. It is only used in now-defunct tests of QEv1.
QEv2 does not append `deleteTokens`
Update payloads to V2 payloads. Remove `eccCollection`. The `eccCollection` is not used in QEv2.
v1 tests were converted to v2. v1 is no longer needed.
The `eccCollection` is unused in QEv2
Edges are sent for range payloads. Tested elsewhere. Redundant test is soon to be removed.
@kevinAlbs kevinAlbs marked this pull request as ready for review January 3, 2025 21:16
@kevinAlbs kevinAlbs requested a review from a team as a code owner January 3, 2025 21:16
@kevinAlbs kevinAlbs requested review from adriandole and removed request for a team January 3, 2025 21:16
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.

1 participant