[MONGOCRYPT-97] _mongocrypt_key_equal should compare bson_t instead of parsed fields Created: 26/May/19 Updated: 13/Feb/20 Resolved: 15/Oct/19 |
|
| Status: | Closed |
| Project: | Libmongocrypt |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Kevin Albertson | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| 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. |