Skip to content

Commit 0f9a2ec

Browse files
authored
Add mongocrypt_setopt_use_range_v2 to libmongocrypt API (#768)
1 parent 1bf8b95 commit 0f9a2ec

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

src/mongocrypt-private.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,4 @@ bool _mongocrypt_needs_credentials_for_provider(mongocrypt_t *crypt,
174174
*/
175175
bool mongocrypt_setopt_fle2v2(mongocrypt_t *crypt, bool enable);
176176

177-
/**
178-
* Enable use of Queryable Encryption Range V2 protocol.
179-
*
180-
* @param[in] crypt The @ref mongocrypt_t object.
181-
*
182-
* @returns A boolean indicating success. If false, an error status is set.
183-
* Retrieve it with @ref mongocrypt_status
184-
*/
185-
bool mongocrypt_enable_range_v2(mongocrypt_t *crypt);
186-
187177
#endif /* MONGOCRYPT_PRIVATE_H */

src/mongocrypt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ bool mongocrypt_setopt_fle2v2(mongocrypt_t *crypt, bool enable) {
153153
return true;
154154
}
155155

156-
bool mongocrypt_enable_range_v2(mongocrypt_t *crypt) {
156+
bool mongocrypt_setopt_use_range_v2(mongocrypt_t *crypt) {
157157
ASSERT_MONGOCRYPT_PARAM_UNINIT(crypt);
158158

159159
crypt->opts.use_range_v2 = true;

src/mongocrypt.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,6 +1382,17 @@ bool mongocrypt_setopt_crypto_hook_sign_rsaes_pkcs1_v1_5(mongocrypt_t *crypt,
13821382
MONGOCRYPT_EXPORT
13831383
void mongocrypt_setopt_bypass_query_analysis(mongocrypt_t *crypt);
13841384

1385+
/**
1386+
* @brief Opt-into use of Queryable Encryption Range V2 protocol.
1387+
*
1388+
* @param[in] crypt The @ref mongocrypt_t object.
1389+
*
1390+
* @returns A boolean indicating success. If false, an error status is set.
1391+
* Retrieve it with @ref mongocrypt_status
1392+
*/
1393+
MONGOCRYPT_EXPORT
1394+
bool mongocrypt_setopt_use_range_v2(mongocrypt_t *crypt);
1395+
13851396
/**
13861397
* Set the contention factor used for explicit encryption.
13871398
* The contention factor is only used for indexed Queryable Encryption.

test/test-mongocrypt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ mongocrypt_t *_mongocrypt_tester_mongocrypt(tester_mongocrypt_flags flags) {
495495
mongocrypt_setopt_append_crypt_shared_lib_search_path(crypt, "$ORIGIN");
496496
}
497497
if (flags & TESTER_MONGOCRYPT_WITH_RANGE_V2) {
498-
ASSERT(mongocrypt_enable_range_v2(crypt));
498+
ASSERT(mongocrypt_setopt_use_range_v2(crypt));
499499
}
500500
ASSERT_OK(mongocrypt_init(crypt), crypt);
501501
if (flags & TESTER_MONGOCRYPT_WITH_CRYPT_SHARED_LIB) {

0 commit comments

Comments
 (0)