[MONGOCRYPT-122] Clean up internal usage of binary types. Created: 04/Mar/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: Minor - P4
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

Issue Links:
Related
is related to MONGOCRYPT-37 libmongocrypt: base types Closed

 Description   

We have three ways of representing binary/BSON

  • mongocrypt_binary_t - public
  • _mongocrypt_buffer_t - private, has conveniences
  • bson_t - for working with bson

Let's be consistent with usage and behavior and document it somewhere. Also regarding const-ness, passing by pointer vs. value, and ownership semantics.

_mongocrypt_buffer_t should be used everywhere possible, and should statically initialize a bson_t when needed (perhaps it could have a bson_t member).

Consider having _mongocrypt_buffer_t data-inherit mongocrypt_binary_t, so we can return it directly by casting in public functions.

Consider where the BSON helpers for traversing/transforming should live (_mongocrypt_transform_binary_in_bson and _mongocrypt_traverse_binary_in_bson).


Generated at Thu Feb 08 09:08:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.