Details
-
Task
-
Resolution: Unresolved
-
Trivial - P5
-
None
-
None
-
None
-
Not Needed
Description
Background & Motivation
mongocrypt_ctx_t::nothing_to_do is an optimization to avoid an extra copy when no encryption or decryption is required. It is vaguely named.
nothing_to_do is set to true under these conditions:
1. No keys are requested
2. The command is bypassed for automatic encryption (e.g. ping).
3. bypass_query_analysis is true.
The assumptions about what is safe to access when nothing_to_do is false are not immediately obvious.
Scope
- Rename nothing_to_do to has_markings.
- Only set has_markings to true if traversing a document encounters markings to process.