Details
-
Task
-
Resolution: Won't Fix
-
Major - P3
-
None
-
None
-
None
-
None
Description
_mongocrypt_key_equal is used to compare two _mongocrypt_key_doc_t structs.
A _mongocrypt_key_doc_t is a C struct of the parsed BSON key document which acts as a convenience to access data within that BSON document.
But _mongocrypt_key_equal compares each individual field of the struct, which was the source of a bug, and is much more code than necessary.
For the sake of simplicity, the comparison function should compare the original unparsed bson_t by using bson_equals.