libmongocrypt-helper 1.13.2.0.1001 → 1.14.0.0.1001

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. checksums.yaml +4 -4
  2. data/ext/libmongocrypt/libmongocrypt/CHANGELOG.md +8 -0
  3. data/ext/libmongocrypt/libmongocrypt/CMakeLists.txt +5 -1
  4. data/ext/libmongocrypt/libmongocrypt/CODEOWNERS +4 -1
  5. data/ext/libmongocrypt/libmongocrypt/Earthfile +18 -17
  6. data/ext/libmongocrypt/libmongocrypt/README.md +8 -8
  7. data/ext/libmongocrypt/libmongocrypt/bindings/python/CHANGELOG.rst +7 -0
  8. data/ext/libmongocrypt/libmongocrypt/bindings/python/CONTRIBUTING.md +34 -0
  9. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/asynchronous/state_machine.py +6 -2
  10. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/binding.py +18 -2
  11. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/mongocrypt.py +9 -1
  12. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/options.py +14 -0
  13. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/synchronous/state_machine.py +6 -2
  14. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/version.py +1 -1
  15. data/ext/libmongocrypt/libmongocrypt/bindings/python/sbom.json +8 -8
  16. data/ext/libmongocrypt/libmongocrypt/bindings/python/scripts/libmongocrypt-version.txt +1 -0
  17. data/ext/libmongocrypt/libmongocrypt/bindings/python/{release.sh → scripts/release.sh} +9 -3
  18. data/ext/libmongocrypt/libmongocrypt/bindings/python/{synchro.py → scripts/synchro.py} +16 -9
  19. data/ext/libmongocrypt/libmongocrypt/bindings/python/scripts/synchro.sh +8 -0
  20. data/ext/libmongocrypt/libmongocrypt/bindings/python/scripts/update-version.sh +27 -0
  21. data/ext/libmongocrypt/libmongocrypt/bindings/python/scripts/update_binding.py +78 -0
  22. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_mongocrypt.py +15 -0
  23. data/ext/libmongocrypt/libmongocrypt/doc/releasing.md +25 -18
  24. data/ext/libmongocrypt/libmongocrypt/etc/calc_release_version.py +39 -13
  25. data/ext/libmongocrypt/libmongocrypt/etc/calc_release_version_selftest.sh +1 -1
  26. data/ext/libmongocrypt/libmongocrypt/etc/cyclonedx.sbom.json +2 -2
  27. data/ext/libmongocrypt/libmongocrypt/kms-message/CMakeLists.txt +1 -1
  28. data/ext/libmongocrypt/libmongocrypt/kms-message/src/hexlify.c +5 -0
  29. data/ext/libmongocrypt/libmongocrypt/kms-message/src/hexlify.h +1 -1
  30. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_azure_request.c +1 -1
  31. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_gcp_request.c +1 -1
  32. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_reader_writer.c +4 -2
  33. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_request.c +1 -2
  34. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message_private.h +5 -1
  35. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request.c +1 -1
  36. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request_opt.c +1 -1
  37. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request_str.c +2 -8
  38. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request_str.h +9 -0
  39. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_response_parser.c +0 -1
  40. data/ext/libmongocrypt/libmongocrypt/kms-message/src/sort.c +7 -3
  41. data/ext/libmongocrypt/libmongocrypt/kms-message/src/sort.h +2 -0
  42. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kmip_reader_writer.c +8 -1
  43. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_assert.h +5 -4
  44. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_azure_online.c +1 -1
  45. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_gcp_online.c +1 -1
  46. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_kmip_request.c +4 -0
  47. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_kmip_response.c +3 -0
  48. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_kmip_response_parser.c +4 -0
  49. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_online_util.c +1 -1
  50. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_online_util.h +1 -1
  51. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_request.c +39 -39
  52. data/ext/libmongocrypt/libmongocrypt/src/crypto/libcrypto.c +235 -65
  53. data/ext/libmongocrypt/libmongocrypt/src/crypto/none.c +1 -1
  54. data/ext/libmongocrypt/libmongocrypt/src/csfle-markup.cpp +4 -2
  55. data/ext/libmongocrypt/libmongocrypt/src/mc-dec128.h +2 -2
  56. data/ext/libmongocrypt/libmongocrypt/src/mc-dec128.test.cpp +2 -2
  57. data/ext/libmongocrypt/libmongocrypt/src/mc-efc-private.h +1 -4
  58. data/ext/libmongocrypt/libmongocrypt/src/mc-efc.c +9 -11
  59. data/ext/libmongocrypt/libmongocrypt/src/mc-fle-blob-subtype-private.h +1 -0
  60. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder-private.h +10 -8
  61. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder.c +167 -176
  62. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-v2.c +6 -17
  63. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload.c +6 -17
  64. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-private-v2.h +1 -1
  65. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-v2.c +25 -26
  66. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload.c +2 -1
  67. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-text-payload-private.h +122 -0
  68. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-text-payload.c +477 -0
  69. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-private-v2.h +1 -3
  70. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-v2.c +28 -43
  71. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload.c +6 -17
  72. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev-v2.c +6 -5
  73. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev.c +13 -10
  74. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-common.c +3 -2
  75. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-rfds.c +7 -6
  76. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-tag-and-encrypted-metadata-block.c +4 -3
  77. data/ext/libmongocrypt/libmongocrypt/src/mc-optional-private.h +1 -1
  78. data/ext/libmongocrypt/libmongocrypt/src/mc-parse-utils-private.h +27 -0
  79. data/ext/libmongocrypt/libmongocrypt/src/mc-parse-utils.c +48 -0
  80. data/ext/libmongocrypt/libmongocrypt/src/mc-range-edge-generation-private.h +5 -5
  81. data/ext/libmongocrypt/libmongocrypt/src/mc-range-edge-generation.c +15 -20
  82. data/ext/libmongocrypt/libmongocrypt/src/mc-range-encoding-private.h +4 -6
  83. data/ext/libmongocrypt/libmongocrypt/src/mc-range-encoding.c +9 -18
  84. data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover-generator.template.h +4 -5
  85. data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover-private.h +5 -9
  86. data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover.c +14 -19
  87. data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts-private.h +2 -4
  88. data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts.c +109 -119
  89. data/ext/libmongocrypt/libmongocrypt/src/mc-reader-private.h +2 -2
  90. data/ext/libmongocrypt/libmongocrypt/src/mc-reader.c +4 -2
  91. data/ext/libmongocrypt/libmongocrypt/src/mc-schema-broker-private.h +0 -3
  92. data/ext/libmongocrypt/libmongocrypt/src/mc-schema-broker.c +4 -14
  93. data/ext/libmongocrypt/libmongocrypt/src/mc-str-encode-string-sets-private.h +1 -1
  94. data/ext/libmongocrypt/libmongocrypt/src/mc-str-encode-string-sets.c +3 -3
  95. data/ext/libmongocrypt/libmongocrypt/src/mc-text-search-str-encode-private.h +8 -1
  96. data/ext/libmongocrypt/libmongocrypt/src/mc-text-search-str-encode.c +78 -2
  97. data/ext/libmongocrypt/libmongocrypt/src/mc-tokens-private.h +34 -16
  98. data/ext/libmongocrypt/libmongocrypt/src/mc-tokens.c +66 -74
  99. data/ext/libmongocrypt/libmongocrypt/src/mc-writer-private.h +1 -1
  100. data/ext/libmongocrypt/libmongocrypt/src/mc-writer.c +4 -2
  101. data/ext/libmongocrypt/libmongocrypt/src/mlib/error.h +1 -1
  102. data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.h +12 -1
  103. data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.test.cpp +5 -0
  104. data/ext/libmongocrypt/libmongocrypt/src/mlib/path.h +5 -5
  105. data/ext/libmongocrypt/libmongocrypt/src/mlib/path.test.c +2 -5
  106. data/ext/libmongocrypt/libmongocrypt/src/mlib/str.h +65 -58
  107. data/ext/libmongocrypt/libmongocrypt/src/mlib/str.test.c +3 -3
  108. data/ext/libmongocrypt/libmongocrypt/src/mlib/thread.h +1 -1
  109. data/ext/libmongocrypt/libmongocrypt/src/mlib/user-check.h +1 -1
  110. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-collinfo-private.h +1 -1
  111. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-collinfo.c +4 -0
  112. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ciphertext-private.h +1 -1
  113. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-crypto-private.h +4 -4
  114. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-crypto.c +29 -25
  115. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-datakey.c +3 -2
  116. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-decrypt.c +6 -3
  117. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-encrypt.c +48 -58
  118. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-rewrap-many-datakey.c +12 -0
  119. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx.c +5 -13
  120. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-dll-private.h +19 -2
  121. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-broker.c +9 -9
  122. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking-private.h +3 -4
  123. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking.c +285 -89
  124. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts-private.h +0 -2
  125. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts.c +0 -1
  126. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-private.h +1 -1
  127. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-util.c +4 -1
  128. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt.c +47 -31
  129. data/ext/libmongocrypt/libmongocrypt/src/os_posix/os_dll.c +2 -0
  130. data/ext/libmongocrypt/libmongocrypt/src/os_posix/os_mutex.c +1 -1
  131. data/ext/libmongocrypt/libmongocrypt/src/os_win/os_dll.c +3 -1
  132. data/ext/libmongocrypt/libmongocrypt/src/os_win/os_mutex.c +1 -1
  133. data/ext/libmongocrypt/libmongocrypt/src/unicode/case-fold-map.c +1 -1
  134. data/ext/libmongocrypt/libmongocrypt/src/unicode/diacritic-fold-map.c +1 -1
  135. data/ext/libmongocrypt/libmongocrypt/src/unicode/fold.c +1 -1
  136. data/ext/libmongocrypt/libmongocrypt/test/crypt_shared-stub.cpp +0 -14
  137. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/encrypted-field-config-map.json +6 -1
  138. data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/FLE2InsertUpdatePayloadV2-RangeV2.json +8 -0
  139. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/encrypted-field-map.json +1 -1
  140. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/encrypted-payload.json +6 -4
  141. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/mongocryptd-reply.json +1 -1
  142. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/encrypted-field-map.json +1 -1
  143. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/encrypted-payload.json +6 -4
  144. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/mongocryptd-reply.json +2 -2
  145. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/encrypted-field-map.json +1 -1
  146. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/encrypted-payload.json +6 -4
  147. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/mongocryptd-reply.json +1 -1
  148. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision-v2/encrypted-payload.json +14 -6
  149. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/encrypted-field-map.json +1 -1
  150. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/encrypted-payload.json +6 -4
  151. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/mongocryptd-reply.json +1 -1
  152. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/encrypted-field-map.json +1 -1
  153. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/encrypted-payload.json +6 -4
  154. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/mongocryptd-reply.json +1 -1
  155. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/encrypted-field-map.json +1 -1
  156. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/encrypted-payload.json +6 -4
  157. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/mongocryptd-reply.json +1 -1
  158. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double/encrypted-payload-v2.json +1 -1
  159. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double-precision/encrypted-payload-v2.json +1 -1
  160. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32/encrypted-payload-v2.json +1 -1
  161. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-openinterval/encrypted-payload-v2.json +1 -1
  162. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/encrypted-field-map.json +1 -1
  163. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/encrypted-payload.json +6 -4
  164. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/mongocryptd-reply.json +1 -1
  165. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/encrypted-field-map.json +1 -1
  166. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/encrypted-payload.json +6 -4
  167. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/mongocryptd-reply.json +1 -1
  168. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/encrypted-field-map.json +1 -1
  169. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/encrypted-payload.json +6 -4
  170. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/mongocryptd-reply.json +1 -1
  171. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision-v2/encrypted-payload.json +14 -6
  172. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/encrypted-field-map.json +1 -1
  173. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/encrypted-payload.json +6 -4
  174. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/mongocryptd-reply.json +1 -1
  175. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/encrypted-field-map.json +1 -1
  176. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/encrypted-payload.json +3 -3
  177. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/mongocryptd-reply.json +1 -1
  178. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/encrypted-field-map.json +1 -1
  179. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/encrypted-payload.json +6 -4
  180. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/mongocryptd-reply.json +1 -1
  181. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double/encrypted-payload-v2.json +1 -1
  182. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double-precision/encrypted-payload-v2.json +1 -1
  183. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32/encrypted-payload-v2.json +1 -1
  184. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/sparsity-2/encrypted-payload-v2.json +1 -1
  185. data/ext/libmongocrypt/libmongocrypt/test/data/tokens/mc.json +8 -0
  186. data/ext/libmongocrypt/libmongocrypt/test/data/tokens/server.json +8 -0
  187. data/ext/libmongocrypt/libmongocrypt/test/example-state-machine.c +5 -5
  188. data/ext/libmongocrypt/libmongocrypt/test/test-dll.cpp +11 -5
  189. data/ext/libmongocrypt/libmongocrypt/test/test-gcp-auth.c +2 -2
  190. data/ext/libmongocrypt/libmongocrypt/test/test-mc-efc.c +9 -11
  191. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-encryption-placeholder.c +18 -29
  192. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-find-equality-payload-v2.c +1 -1
  193. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-find-range-payload-v2.c +2 -18
  194. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-find-text-payload.c +320 -0
  195. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iup-v2.c +2 -17
  196. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iup.c +1 -1
  197. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-rfds.c +8 -5
  198. data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-edge-generation.c +6 -10
  199. data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-encoding.c +29 -33
  200. data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-mincover.c +12 -20
  201. data/ext/libmongocrypt/libmongocrypt/test/test-mc-rangeopts.c +5 -20
  202. data/ext/libmongocrypt/libmongocrypt/test/test-mc-reader.c +5 -5
  203. data/ext/libmongocrypt/libmongocrypt/test/test-mc-text-search-str-encode.c +147 -18
  204. data/ext/libmongocrypt/libmongocrypt/test/test-mc-tokens.c +35 -14
  205. data/ext/libmongocrypt/libmongocrypt/test/test-mc-writer.c +10 -10
  206. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert-match-bson.c +3 -7
  207. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert.h +36 -24
  208. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-buffer.c +4 -4
  209. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cache.c +2 -2
  210. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ciphertext.c +13 -13
  211. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cleanup.c +49 -55
  212. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-compact.c +64 -67
  213. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-hooks.c +18 -18
  214. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-std-hooks.c +4 -0
  215. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto.c +4 -3
  216. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-csfle-lib.c +13 -3
  217. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-decrypt.c +31 -13
  218. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-encrypt.c +35 -52
  219. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-rewrap-many-datakey.c +28 -1
  220. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-setopt.c +50 -91
  221. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-datakey.c +1 -1
  222. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-dll.c +7 -4
  223. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-endpoint.c +1 -1
  224. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kek.c +1 -1
  225. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key-cache.c +3 -5
  226. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kms-ctx.c +2 -2
  227. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-local-kms.c +1 -1
  228. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-log.c +2 -2
  229. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-marking.c +527 -225
  230. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-status.c +1 -1
  231. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.c +45 -56
  232. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.h +12 -3
  233. data/ext/libmongocrypt/libmongocrypt/test/test-named-kms-providers.c +11 -11
  234. data/ext/libmongocrypt/libmongocrypt/test/test-unicode-fold.c +6 -2
  235. data/ext/libmongocrypt/libmongocrypt/test/util/HELP.autogen +1 -1
  236. data/ext/libmongocrypt/libmongocrypt/test/util/csfle.c +1 -1
  237. data/ext/libmongocrypt/libmongocrypt/test/util/util.c +5 -5
  238. data/ext/libmongocrypt/libmongocrypt/test/util/util.h +7 -6
  239. data/lib/libmongocrypt_helper/version.rb +2 -2
  240. metadata +17 -13
  241. data/ext/libmongocrypt/libmongocrypt/bindings/python/libmongocrypt-version.txt +0 -1
  242. data/ext/libmongocrypt/libmongocrypt/bindings/python/strip_header.py +0 -50
  243. data/ext/libmongocrypt/libmongocrypt/bindings/python/update-sbom.sh +0 -14
  244. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/success/encrypted-payload.json +0 -29
  245. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/encrypted-payload.json +0 -29
  246. data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/FLE2EqualityIndexedValueV2.json +0 -8
  247. data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/FLE2RangeIndexedValueV2.json +0 -8
  248. /data/ext/libmongocrypt/libmongocrypt/bindings/python/{build-manylinux-wheel.sh → scripts/build-manylinux-wheel.sh} +0 -0
  249. /data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/{FLE2InsertUpdatePayload-with-edges.json → FLE2InsertUpdatePayload-RangeV1.json} +0 -0
  250. /data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/{FLE2InsertUpdatePayload-with-edges-V2.json → FLE2InsertUpdatePayloadV2-RangeV1.json} +0 -0
@@ -25,80 +25,19 @@ static void _test_compact_success(_mongocrypt_tester_t *tester) {
25
25
  strcpy(datapath, basepath);
26
26
  size_t nullb = strlen(basepath);
27
27
  for (int use_anchor_pad = 0; use_anchor_pad <= 1; use_anchor_pad++) {
28
- for (int use_range_v2 = 0; use_range_v2 <= 1; use_range_v2++) {
29
- datapath[nullb] = 0;
30
- strcat(datapath, use_anchor_pad ? "anchor-pad/" : "success/");
31
- strcpy(cmdfile, datapath);
32
- strcat(cmdfile, "cmd.json");
33
- strcpy(collfile, datapath);
34
- strcat(collfile, "collinfo.json");
35
- strcpy(payloadfile, datapath);
36
- strcat(payloadfile, use_range_v2 ? "encrypted-payload-range-v2.json" : "encrypted-payload.json");
37
-
38
- mongocrypt_t *crypt;
39
- mongocrypt_ctx_t *ctx;
40
-
41
- crypt = _mongocrypt_tester_mongocrypt(use_range_v2 ? TESTER_MONGOCRYPT_WITH_RANGE_V2
42
- : TESTER_MONGOCRYPT_DEFAULT);
43
- ctx = mongocrypt_ctx_new(crypt);
44
-
45
- ASSERT_OK(mongocrypt_ctx_encrypt_init(ctx, "db", -1, TEST_FILE(cmdfile)), ctx);
46
-
47
- ASSERT_STATE_EQUAL(mongocrypt_ctx_state(ctx), MONGOCRYPT_CTX_NEED_MONGO_COLLINFO);
48
- {
49
- ASSERT_OK(mongocrypt_ctx_mongo_feed(ctx, TEST_FILE(collfile)), ctx);
50
- ASSERT_OK(mongocrypt_ctx_mongo_done(ctx), ctx);
51
- }
52
-
53
- ASSERT_STATE_EQUAL(mongocrypt_ctx_state(ctx), MONGOCRYPT_CTX_NEED_MONGO_KEYS);
54
- {
55
- ASSERT_OK(mongocrypt_ctx_mongo_feed(ctx,
56
- TEST_FILE("./test/data/keys/"
57
- "12345678123498761234123456789012-local-document.json")),
58
- ctx);
59
- ASSERT_OK(mongocrypt_ctx_mongo_feed(ctx,
60
- TEST_FILE("./test/data/keys/"
61
- "ABCDEFAB123498761234123456789012-local-document.json")),
62
- ctx);
63
- ASSERT_OK(mongocrypt_ctx_mongo_feed(ctx,
64
- TEST_FILE("./test/data/keys/"
65
- "12345678123498761234123456789013-local-document.json")),
66
- ctx);
67
- ASSERT_OK(mongocrypt_ctx_mongo_done(ctx), ctx);
68
- }
69
-
70
- ASSERT_STATE_EQUAL(mongocrypt_ctx_state(ctx), MONGOCRYPT_CTX_READY);
71
- {
72
- mongocrypt_binary_t *out = mongocrypt_binary_new();
73
- ASSERT_OK(mongocrypt_ctx_finalize(ctx, out), ctx);
74
- ASSERT_MONGOCRYPT_BINARY_EQUAL_BSON(TEST_FILE(payloadfile), out);
75
- mongocrypt_binary_destroy(out);
76
- }
77
-
78
- ASSERT_STATE_EQUAL(mongocrypt_ctx_state(ctx), MONGOCRYPT_CTX_DONE);
79
-
80
- mongocrypt_ctx_destroy(ctx);
81
- mongocrypt_destroy(crypt);
82
- }
83
- }
84
-
85
- // Test `compactStructuredEncryptionData` without range fields omits encryptionInformation.
86
- // This is a regression test for MONGOCRYPT-699.
87
- for (int use_range_v2 = 0; use_range_v2 <= 1; use_range_v2++) {
88
28
  datapath[nullb] = 0;
89
- strcat(datapath, "no-range/");
29
+ strcat(datapath, use_anchor_pad ? "anchor-pad/" : "success/");
90
30
  strcpy(cmdfile, datapath);
91
31
  strcat(cmdfile, "cmd.json");
92
32
  strcpy(collfile, datapath);
93
33
  strcat(collfile, "collinfo.json");
94
34
  strcpy(payloadfile, datapath);
95
- strcat(payloadfile, "encrypted-payload.json"); // Expect same result regardless of range v2.
35
+ strcat(payloadfile, "encrypted-payload-range-v2.json");
96
36
 
97
37
  mongocrypt_t *crypt;
98
38
  mongocrypt_ctx_t *ctx;
99
39
 
100
- crypt =
101
- _mongocrypt_tester_mongocrypt(use_range_v2 ? TESTER_MONGOCRYPT_WITH_RANGE_V2 : TESTER_MONGOCRYPT_DEFAULT);
40
+ crypt = _mongocrypt_tester_mongocrypt(TESTER_MONGOCRYPT_DEFAULT);
102
41
  ctx = mongocrypt_ctx_new(crypt);
103
42
 
104
43
  ASSERT_OK(mongocrypt_ctx_encrypt_init(ctx, "db", -1, TEST_FILE(cmdfile)), ctx);
@@ -139,6 +78,61 @@ static void _test_compact_success(_mongocrypt_tester_t *tester) {
139
78
  mongocrypt_ctx_destroy(ctx);
140
79
  mongocrypt_destroy(crypt);
141
80
  }
81
+
82
+ // Test `compactStructuredEncryptionData` without range fields omits encryptionInformation.
83
+ // This is a regression test for MONGOCRYPT-699.
84
+ datapath[nullb] = 0;
85
+ strcat(datapath, "no-range/");
86
+ strcpy(cmdfile, datapath);
87
+ strcat(cmdfile, "cmd.json");
88
+ strcpy(collfile, datapath);
89
+ strcat(collfile, "collinfo.json");
90
+ strcpy(payloadfile, datapath);
91
+ strcat(payloadfile, "encrypted-payload.json");
92
+
93
+ mongocrypt_t *crypt;
94
+ mongocrypt_ctx_t *ctx;
95
+
96
+ crypt = _mongocrypt_tester_mongocrypt(TESTER_MONGOCRYPT_DEFAULT);
97
+ ctx = mongocrypt_ctx_new(crypt);
98
+
99
+ ASSERT_OK(mongocrypt_ctx_encrypt_init(ctx, "db", -1, TEST_FILE(cmdfile)), ctx);
100
+
101
+ ASSERT_STATE_EQUAL(mongocrypt_ctx_state(ctx), MONGOCRYPT_CTX_NEED_MONGO_COLLINFO);
102
+ {
103
+ ASSERT_OK(mongocrypt_ctx_mongo_feed(ctx, TEST_FILE(collfile)), ctx);
104
+ ASSERT_OK(mongocrypt_ctx_mongo_done(ctx), ctx);
105
+ }
106
+
107
+ ASSERT_STATE_EQUAL(mongocrypt_ctx_state(ctx), MONGOCRYPT_CTX_NEED_MONGO_KEYS);
108
+ {
109
+ ASSERT_OK(mongocrypt_ctx_mongo_feed(ctx,
110
+ TEST_FILE("./test/data/keys/"
111
+ "12345678123498761234123456789012-local-document.json")),
112
+ ctx);
113
+ ASSERT_OK(mongocrypt_ctx_mongo_feed(ctx,
114
+ TEST_FILE("./test/data/keys/"
115
+ "ABCDEFAB123498761234123456789012-local-document.json")),
116
+ ctx);
117
+ ASSERT_OK(mongocrypt_ctx_mongo_feed(ctx,
118
+ TEST_FILE("./test/data/keys/"
119
+ "12345678123498761234123456789013-local-document.json")),
120
+ ctx);
121
+ ASSERT_OK(mongocrypt_ctx_mongo_done(ctx), ctx);
122
+ }
123
+
124
+ ASSERT_STATE_EQUAL(mongocrypt_ctx_state(ctx), MONGOCRYPT_CTX_READY);
125
+ {
126
+ mongocrypt_binary_t *out = mongocrypt_binary_new();
127
+ ASSERT_OK(mongocrypt_ctx_finalize(ctx, out), ctx);
128
+ ASSERT_MONGOCRYPT_BINARY_EQUAL_BSON(TEST_FILE(payloadfile), out);
129
+ mongocrypt_binary_destroy(out);
130
+ }
131
+
132
+ ASSERT_STATE_EQUAL(mongocrypt_ctx_state(ctx), MONGOCRYPT_CTX_DONE);
133
+
134
+ mongocrypt_ctx_destroy(ctx);
135
+ mongocrypt_destroy(crypt);
142
136
  }
143
137
 
144
138
  static void _test_compact_nonlocal_kms(_mongocrypt_tester_t *tester) {
@@ -204,7 +198,8 @@ static void _test_compact_nonlocal_kms(_mongocrypt_tester_t *tester) {
204
198
  {
205
199
  mongocrypt_binary_t *out = mongocrypt_binary_new();
206
200
  ASSERT_OK(mongocrypt_ctx_finalize(ctx, out), ctx);
207
- ASSERT_MONGOCRYPT_BINARY_EQUAL_BSON(TEST_FILE("./test/data/compact/success/encrypted-payload.json"), out);
201
+ ASSERT_MONGOCRYPT_BINARY_EQUAL_BSON(TEST_FILE("./test/data/compact/success/encrypted-payload-range-v2.json"),
202
+ out);
208
203
  mongocrypt_binary_destroy(out);
209
204
  }
210
205
 
@@ -338,7 +333,8 @@ static void _test_compact_need_kms_credentials(_mongocrypt_tester_t *tester) {
338
333
  {
339
334
  mongocrypt_binary_t *out = mongocrypt_binary_new();
340
335
  ASSERT_OK(mongocrypt_ctx_finalize(ctx, out), ctx);
341
- ASSERT_MONGOCRYPT_BINARY_EQUAL_BSON(TEST_FILE("./test/data/compact/success/encrypted-payload.json"), out);
336
+ ASSERT_MONGOCRYPT_BINARY_EQUAL_BSON(TEST_FILE("./test/data/compact/success/encrypted-payload-range-v2.json"),
337
+ out);
342
338
  mongocrypt_binary_destroy(out);
343
339
  }
344
340
 
@@ -422,7 +418,8 @@ static void _test_compact_from_encrypted_field_config_map(_mongocrypt_tester_t *
422
418
  {
423
419
  mongocrypt_binary_t *out = mongocrypt_binary_new();
424
420
  ASSERT_OK(mongocrypt_ctx_finalize(ctx, out), ctx);
425
- ASSERT_MONGOCRYPT_BINARY_EQUAL_BSON(TEST_FILE("./test/data/compact/success/encrypted-payload.json"), out);
421
+ ASSERT_MONGOCRYPT_BINARY_EQUAL_BSON(TEST_FILE("./test/data/compact/success/encrypted-payload-range-v2.json"),
422
+ out);
426
423
  mongocrypt_binary_destroy(out);
427
424
  }
428
425
 
@@ -117,11 +117,11 @@ static bool _mock_aes_256_xxx_decrypt(void *ctx,
117
117
  return true;
118
118
  }
119
119
 
120
- bool _hmac_sha_512(void *ctx,
121
- mongocrypt_binary_t *key,
122
- mongocrypt_binary_t *in,
123
- mongocrypt_binary_t *out,
124
- mongocrypt_status_t *status) {
120
+ static bool _hmac_sha_512(void *ctx,
121
+ mongocrypt_binary_t *key,
122
+ mongocrypt_binary_t *in,
123
+ mongocrypt_binary_t *out,
124
+ mongocrypt_status_t *status) {
125
125
  _mongocrypt_buffer_t tmp;
126
126
 
127
127
  BSON_ASSERT(0 == strncmp("error_on:", (char *)ctx, strlen("error_on:")));
@@ -141,11 +141,11 @@ bool _hmac_sha_512(void *ctx,
141
141
  return true;
142
142
  }
143
143
 
144
- bool _hmac_sha_256(void *ctx,
145
- mongocrypt_binary_t *key,
146
- mongocrypt_binary_t *in,
147
- mongocrypt_binary_t *out,
148
- mongocrypt_status_t *status) {
144
+ static bool _hmac_sha_256(void *ctx,
145
+ mongocrypt_binary_t *key,
146
+ mongocrypt_binary_t *in,
147
+ mongocrypt_binary_t *out,
148
+ mongocrypt_status_t *status) {
149
149
  _mongocrypt_buffer_t tmp;
150
150
 
151
151
  BSON_ASSERT(0 == strncmp("error_on:", (char *)ctx, strlen("error_on:")));
@@ -165,7 +165,7 @@ bool _hmac_sha_256(void *ctx,
165
165
  return true;
166
166
  }
167
167
 
168
- bool _sha_256(void *ctx, mongocrypt_binary_t *in, mongocrypt_binary_t *out, mongocrypt_status_t *status) {
168
+ static bool _sha_256(void *ctx, mongocrypt_binary_t *in, mongocrypt_binary_t *out, mongocrypt_status_t *status) {
169
169
  _mongocrypt_buffer_t tmp;
170
170
 
171
171
  BSON_ASSERT(0 == strncmp("error_on:", (char *)ctx, strlen("error_on:")));
@@ -184,7 +184,7 @@ bool _sha_256(void *ctx, mongocrypt_binary_t *in, mongocrypt_binary_t *out, mong
184
184
  return true;
185
185
  }
186
186
 
187
- bool _random(void *ctx, mongocrypt_binary_t *out, uint32_t count, mongocrypt_status_t *status) {
187
+ static bool _random(void *ctx, mongocrypt_binary_t *out, uint32_t count, mongocrypt_status_t *status) {
188
188
  /* only have 32 bytes of random test data. */
189
189
  BSON_ASSERT(count <= 96);
190
190
 
@@ -204,11 +204,11 @@ bool _random(void *ctx, mongocrypt_binary_t *out, uint32_t count, mongocrypt_sta
204
204
  return true;
205
205
  }
206
206
 
207
- bool _sign_rsaes_pkcs1_v1_5(void *ctx,
208
- mongocrypt_binary_t *key,
209
- mongocrypt_binary_t *in,
210
- mongocrypt_binary_t *out,
211
- mongocrypt_status_t *status) {
207
+ static bool _sign_rsaes_pkcs1_v1_5(void *ctx,
208
+ mongocrypt_binary_t *key,
209
+ mongocrypt_binary_t *in,
210
+ mongocrypt_binary_t *out,
211
+ mongocrypt_status_t *status) {
212
212
  _mongocrypt_buffer_t tmp;
213
213
 
214
214
  BSON_ASSERT(0 == strncmp("error_on:", (char *)ctx, strlen("error_on:")));
@@ -696,7 +696,7 @@ static bool _aes_256_ecb_encrypt(void *ctx,
696
696
  return _native_crypto_aes_256_ecb_encrypt(args);
697
697
  }
698
698
 
699
- void _test_fle2_crypto_via_ecb_hook(_mongocrypt_tester_t *tester) {
699
+ static void _test_fle2_crypto_via_ecb_hook(_mongocrypt_tester_t *tester) {
700
700
  const _mongocrypt_value_encryption_algorithm_t *fle2alg = _mcFLE2Algorithm();
701
701
  bool ret;
702
702
  _mongocrypt_buffer_t key;
@@ -14,6 +14,10 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
+ #include "test-mongocrypt-crypto-std-hooks.h"
18
+
19
+ //
20
+
17
21
  #include <mongocrypt-buffer-private.h>
18
22
 
19
23
  #include "test-mongocrypt.h"
@@ -44,9 +44,10 @@ static bool _test_uses_ctr(const _test_mc_crypto_roundtrip_t *test) {
44
44
  /* we just get garbage data. */ \
45
45
  ASSERT(out.len == test->plaintext.len); \
46
46
  ASSERT(memcmp(out.data, test->plaintext.data, out.len) != 0); \
47
- } else { \
47
+ } else if (1) { \
48
48
  ASSERT_FAILS_STATUS(ret, status, "HMAC validation failure"); \
49
- }
49
+ } else \
50
+ ((void)0)
50
51
 
51
52
  static void _test_roundtrip_single(const _test_mc_crypto_roundtrip_t *test) {
52
53
  if (!_aes_ctr_is_supported_by_os && _test_uses_ctr(test)) {
@@ -283,7 +284,7 @@ typedef struct {
283
284
  const char *expect;
284
285
  } hmac_sha_256_test_t;
285
286
 
286
- void _test_native_crypto_hmac_sha_256(_mongocrypt_tester_t *tester) {
287
+ static void _test_native_crypto_hmac_sha_256(_mongocrypt_tester_t *tester) {
287
288
  /* Test data generated with OpenSSL CLI:
288
289
  $ echo -n "test" | openssl dgst -mac hmac -macopt \
289
290
  hexkey:6bb2664e8d444377d3cd9566c005593b7ed8a35ab8eac9eb5ffa6e426854e5cc \
@@ -96,7 +96,7 @@ static void _test_csfle_load_twice_fail(_mongocrypt_tester_t *tester) {
96
96
  mongocrypt_t *const crypt2 = get_test_mongocrypt(tester);
97
97
  mongocrypt_setopt_set_crypt_shared_lib_path_override(crypt2, "$ORIGIN/stubbed-crypt_shared-2.dll");
98
98
  // Loading a second different library is an error:
99
- ASSERT_FAILS(_mongocrypt_init_for_test(crypt2), crypt2, "attempted to load a second CSFLE library");
99
+ ASSERT_FAILS(_mongocrypt_init_for_test(crypt2), crypt2, "attempted to load a second crypt_shared library");
100
100
 
101
101
  mstr_view version = mstrv_view_cstr(mongocrypt_crypt_shared_lib_version_string(crypt1, NULL));
102
102
  if (TEST_MONGOCRYPT_HAVE_REAL_CRYPT_SHARED_LIB) {
@@ -143,7 +143,7 @@ static void _test_csfle_path_override_fail(_mongocrypt_tester_t *tester) {
143
143
  static void _test_cur_exe_path(_mongocrypt_tester_t *tester) {
144
144
  current_module_result self = current_module_path();
145
145
  BSON_ASSERT(self.error == 0);
146
- BSON_ASSERT(self.path.len != 0);
146
+ BSON_ASSERT(self.path.raw.len != 0);
147
147
  mstr_free(self.path);
148
148
  }
149
149
 
@@ -180,7 +180,7 @@ static void _test_lookup_version_check(_mongocrypt_tester_t *tester) {
180
180
  mongocrypt_t *crypt = _mongocrypt_tester_mongocrypt(TESTER_MONGOCRYPT_WITH_CRYPT_SHARED_LIB);
181
181
  uint64_t version = crypt->csfle.get_version();
182
182
  mongocrypt_ctx_t *ctx = mongocrypt_ctx_new(crypt);
183
- mongocrypt_binary_t *cmd = TEST_FILE("./test/data/lookup/csfle/01-cmd.json");
183
+ mongocrypt_binary_t *cmd = TEST_FILE("./test/data/lookup/csfle/cmd.json");
184
184
  if (version >= CRYPT_SHARED_8_1) {
185
185
  ASSERT_OK(mongocrypt_ctx_encrypt_init(ctx, "db", -1, cmd), ctx);
186
186
  } else {
@@ -190,6 +190,15 @@ static void _test_lookup_version_check(_mongocrypt_tester_t *tester) {
190
190
  mongocrypt_destroy(crypt);
191
191
  }
192
192
 
193
+ static void _test_loading_libmongocrypt_fails(_mongocrypt_tester_t *tester) {
194
+ mongocrypt_t *const crypt = get_test_mongocrypt(tester);
195
+ const char *path_to_libmongocrypt = TEST_MONGOCRYPT_MONGOCRYPT_SHARED_PATH;
196
+ mongocrypt_setopt_set_crypt_shared_lib_path_override(crypt, path_to_libmongocrypt);
197
+ bool ok = mongocrypt_init(crypt);
198
+ ASSERT_FAILS(ok, crypt, "detected libmongocrypt");
199
+ mongocrypt_destroy(crypt);
200
+ }
201
+
193
202
  void _mongocrypt_tester_install_csfle_lib(_mongocrypt_tester_t *tester) {
194
203
  INSTALL_TEST(_test_csfle_no_paths);
195
204
  INSTALL_TEST(_test_csfle_not_found);
@@ -202,4 +211,5 @@ void _mongocrypt_tester_install_csfle_lib(_mongocrypt_tester_t *tester) {
202
211
  INSTALL_TEST(_test_csfle_not_loaded_with_bypassqueryanalysis);
203
212
  INSTALL_TEST(_test_override_error_includes_reason);
204
213
  INSTALL_TEST(_test_lookup_version_check);
214
+ INSTALL_TEST(_test_loading_libmongocrypt_fails);
205
215
  }
@@ -123,7 +123,7 @@ static void _test_decrypt_ready(_mongocrypt_tester_t *tester) {
123
123
  }
124
124
 
125
125
  /* Test with empty AWS credentials. */
126
- void _test_decrypt_empty_aws(_mongocrypt_tester_t *tester) {
126
+ static void _test_decrypt_empty_aws(_mongocrypt_tester_t *tester) {
127
127
  mongocrypt_t *crypt;
128
128
  mongocrypt_ctx_t *ctx;
129
129
 
@@ -888,7 +888,8 @@ static void _test_explicit_decrypt(_mongocrypt_tester_t *tester) {
888
888
  }
889
889
 
890
890
  // FLE2InsertUpdatePayload can be decrypted.
891
- // Payload is only used in the QE-V1 protocol removed in MongoDB 7.0. Decrypting is currently still supported.
891
+ // Payload is only used in the QE-V1 protocol removed in MongoDB 7.0. Decrypting is still supported.
892
+ // libmongocrypt no longer produces QE-V1 payloads. Payload is copied from libmongocrypt 1.8.0.
892
893
  {
893
894
  ed_testcase tc = {
894
895
  .desc = "FLE2InsertUpdatePayload",
@@ -899,12 +900,13 @@ static void _test_explicit_decrypt(_mongocrypt_tester_t *tester) {
899
900
  ed_testcase_run(&tc);
900
901
  }
901
902
 
902
- // FLE2InsertUpdatePayload with edges can be decrypted.
903
- // Edges are sent on payloads for range algorithm.
903
+ // FLE2InsertUpdatePayload for RangeV1 can be decrypted. Range payloads include additional fields.
904
+ // Payload is only used in the Range-V1 protocol removed in MongoDB 8.0. Decrypting is still supported.
905
+ // libmongocrypt no longer produces Range-V1 payloads. Payload is copied from libmongocrypt 1.11.0.
904
906
  {
905
907
  ed_testcase tc = {
906
- .desc = "FLE2InsertUpdatePayload with edges",
907
- .msg = TEST_FILE("./test/data/explicit-decrypt/FLE2InsertUpdatePayload-with-edges.json"),
908
+ .desc = "FLE2InsertUpdatePayload for RangeV1",
909
+ .msg = TEST_FILE("./test/data/explicit-decrypt/FLE2InsertUpdatePayload-RangeV1.json"),
908
910
  .keys_to_feed = {keyABC},
909
911
  .expect = TEST_BSON(BSON_STR({"v" : 123456})),
910
912
  };
@@ -912,7 +914,8 @@ static void _test_explicit_decrypt(_mongocrypt_tester_t *tester) {
912
914
  }
913
915
 
914
916
  // FLE2UnindexedEncryptedValue can be decrypted.
915
- // Payload is only used in the QE-V1 protocol removed in MongoDB 7.0. Decrypting is currently still supported.
917
+ // Payload is only used in the QE-V1 protocol removed in MongoDB 7.0. Decrypting is still supported.
918
+ // libmongocrypt no longer produces QE-V1 payloads. Payload is copied from libmongocrypt 1.8.0.
916
919
  {
917
920
  ed_testcase tc = {
918
921
  .desc = "FLE2UnindexedEncryptedValue",
@@ -924,7 +927,8 @@ static void _test_explicit_decrypt(_mongocrypt_tester_t *tester) {
924
927
  }
925
928
 
926
929
  // FLE2IndexedEqualityEncryptedValue can be decrypted.
927
- // Payload is only used in the QE-V1 protocol removed in MongoDB 7.0. Decrypting is currently still supported.
930
+ // Payload is only used in the QE-V1 protocol removed in MongoDB 7.0. Decrypting is still supported.
931
+ // libmongocrypt no longer produces QE-V1 payloads. Payload is copied from libmongocrypt 1.8.0.
928
932
  {
929
933
  ed_testcase tc = {
930
934
  .desc = "FLE2IndexedEqualityEncryptedValue",
@@ -936,7 +940,8 @@ static void _test_explicit_decrypt(_mongocrypt_tester_t *tester) {
936
940
  }
937
941
 
938
942
  // FLE2IndexedRangeEncryptedValue can be decrypted.
939
- // Payload is only used in the QE-V1 protocol removed in MongoDB 7.0. Decrypting is currently still supported.
943
+ // Payload is only used in the QE-V1 protocol removed in MongoDB 7.0. Decrypting is still supported.
944
+ // libmongocrypt no longer produces QE-V1 payloads. Payload is copied from libmongocrypt 1.8.0.
940
945
  {
941
946
  ed_testcase tc = {
942
947
  .desc = "FLE2IndexedRangeEncryptedValue",
@@ -967,12 +972,24 @@ static void _test_explicit_decrypt(_mongocrypt_tester_t *tester) {
967
972
  ed_testcase_run(&tc);
968
973
  }
969
974
 
970
- // FLE2InsertUpdatePayloadV2 with edges can be decrypted.
971
- // Edges are sent on payloads for range algorithm.
975
+ // FLE2InsertUpdatePayloadV2 for RangeV1 can be decrypted. Range payloads include additional fields.
976
+ // Payload is only used in the Range-V1 protocol removed in MongoDB 8.0. Decrypting is still supported.
977
+ // libmongocrypt no longer produces Range-V1 payloads. Payload is copied from libmongocrypt 1.11.0.
972
978
  {
973
979
  ed_testcase tc = {
974
- .desc = "FLE2InsertUpdatePayloadV2 with edges",
975
- .msg = TEST_FILE("./test/data/explicit-decrypt/FLE2InsertUpdatePayload-with-edges-V2.json"),
980
+ .desc = "FLE2InsertUpdatePayloadV2 for RangeV1",
981
+ .msg = TEST_FILE("./test/data/explicit-decrypt/FLE2InsertUpdatePayloadV2-RangeV1.json"),
982
+ .keys_to_feed = {keyABC},
983
+ .expect = TEST_BSON(BSON_STR({"v" : 123456})),
984
+ };
985
+ ed_testcase_run(&tc);
986
+ }
987
+
988
+ // FLE2InsertUpdatePayloadV2 for RangeV2 can be decrypted. Range payloads include additional fields.
989
+ {
990
+ ed_testcase tc = {
991
+ .desc = "FLE2InsertUpdatePayloadV2 for RangeV2",
992
+ .msg = TEST_FILE("./test/data/explicit-decrypt/FLE2InsertUpdatePayloadV2-RangeV2.json"),
976
993
  .keys_to_feed = {keyABC},
977
994
  .expect = TEST_BSON(BSON_STR({"v" : 123456})),
978
995
  };
@@ -1002,6 +1019,7 @@ static void _test_explicit_decrypt(_mongocrypt_tester_t *tester) {
1002
1019
  }
1003
1020
 
1004
1021
  // FLE2IndexedRangeEncryptedValueV2 can be decrypted.
1022
+ // Payload did not change between RangeV1 and RangeV2.
1005
1023
  {
1006
1024
  ed_testcase tc = {
1007
1025
  .desc = "FLE2IndexedRangeEncryptedValueV2",