libmongocrypt-helper 1.8.0.0.1001 → 1.11.0.0.1001

Sign up to get free protection for your applications and to get access to all the features.
Files changed (385) hide show
  1. checksums.yaml +4 -4
  2. data/ext/libmongocrypt/libmongocrypt/CHANGELOG.md +33 -0
  3. data/ext/libmongocrypt/libmongocrypt/CMakeLists.txt +12 -1
  4. data/ext/libmongocrypt/libmongocrypt/CODEOWNERS +1 -4
  5. data/ext/libmongocrypt/libmongocrypt/Earthfile +151 -3
  6. data/ext/libmongocrypt/libmongocrypt/README.md +36 -40
  7. data/ext/libmongocrypt/libmongocrypt/bindings/cs/CMakeLists.txt +1 -0
  8. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Driver.snk +0 -0
  9. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/AssemblyInfo.cs +2 -2
  10. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/Binary.cs +16 -2
  11. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptClientFactory.cs +8 -4
  12. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/Library.cs +10 -0
  13. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/LibraryLoader.cs +81 -44
  14. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/MongoDB.Libmongocrypt.csproj +2 -1
  15. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/MongoDB.Libmongocrypt.Test.csproj +2 -0
  16. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test32/MongoDB.Libmongocrypt.Test32.csproj +2 -0
  17. data/ext/libmongocrypt/libmongocrypt/bindings/cs/README.md +3 -0
  18. data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.cake +21 -26
  19. data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.config +3 -0
  20. data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.sh +0 -0
  21. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/benchmarks/build.gradle.kts +28 -0
  22. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/benchmarks/src/main/java/com/mongodb/crypt/benchmark/BenchmarkRunner.java +217 -0
  23. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/benchmarks/src/main/resources/keyDocument.json +24 -0
  24. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/build.gradle.kts +21 -6
  25. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradle/wrapper/gradle-wrapper.jar +0 -0
  26. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradle/wrapper/gradle-wrapper.properties +1 -1
  27. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradlew +154 -108
  28. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradlew.bat +7 -18
  29. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/settings.gradle.kts +1 -0
  30. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/CAPI.java +41 -6
  31. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/CAPIHelper.java +5 -5
  32. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/CipherCallback.java +27 -1
  33. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCryptImpl.java +34 -19
  34. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoExplicitEncryptOptions.java +6 -4
  35. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/resources/META-INF/native-image/jni-config.json +180 -0
  36. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/resources/META-INF/native-image/reflect-config.json +134 -0
  37. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/java/com/mongodb/crypt/capi/MongoCryptTest.java +44 -2
  38. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit-v2/int32/encrypted-payload.json +1 -1
  39. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit-v2/int32/rangeopts.json +3 -0
  40. data/ext/libmongocrypt/libmongocrypt/bindings/node/README.md +4 -900
  41. data/ext/libmongocrypt/libmongocrypt/bindings/python/CHANGELOG.rst +60 -0
  42. data/ext/libmongocrypt/libmongocrypt/bindings/python/README.rst +41 -20
  43. data/ext/libmongocrypt/libmongocrypt/bindings/python/RELEASE.rst +6 -24
  44. data/ext/libmongocrypt/libmongocrypt/bindings/python/build-manylinux-wheel.sh +4 -13
  45. data/ext/libmongocrypt/libmongocrypt/bindings/python/hatch_build.py +36 -0
  46. data/ext/libmongocrypt/libmongocrypt/bindings/python/libmongocrypt-version.txt +1 -0
  47. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/__init__.py +2 -2
  48. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/asynchronous/auto_encrypter.py +61 -0
  49. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/asynchronous/credentials.py +156 -0
  50. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/asynchronous/explicit_encrypter.py +156 -0
  51. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/asynchronous/state_machine.py +149 -0
  52. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/auto_encrypter.py +2 -46
  53. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/binary.py +14 -17
  54. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/binding.py +107 -61
  55. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/compat.py +6 -4
  56. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/credentials.py +2 -121
  57. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/crypto.py +31 -20
  58. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/errors.py +2 -2
  59. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/explicit_encrypter.py +2 -233
  60. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/mongocrypt.py +168 -238
  61. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/options.py +265 -0
  62. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/state_machine.py +2 -141
  63. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/synchronous/auto_encrypter.py +61 -0
  64. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/synchronous/credentials.py +156 -0
  65. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/synchronous/explicit_encrypter.py +156 -0
  66. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/synchronous/state_machine.py +149 -0
  67. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/version.py +2 -2
  68. data/ext/libmongocrypt/libmongocrypt/bindings/python/pyproject.toml +118 -0
  69. data/ext/libmongocrypt/libmongocrypt/bindings/python/release.sh +97 -61
  70. data/ext/libmongocrypt/libmongocrypt/bindings/python/{test-requirements.txt → requirements-test.txt} +4 -1
  71. data/ext/libmongocrypt/libmongocrypt/bindings/python/requirements.txt +4 -0
  72. data/ext/libmongocrypt/libmongocrypt/bindings/python/sbom.json +76 -0
  73. data/ext/libmongocrypt/libmongocrypt/bindings/python/strip_header.py +6 -7
  74. data/ext/libmongocrypt/libmongocrypt/bindings/python/synchro.py +64 -0
  75. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/__init__.py +1 -0
  76. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/collection-info.json +1 -1
  77. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/command.json +1 -1
  78. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/compact/success/encrypted-payload.json +21 -21
  79. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/encrypted-command-reply.json +1 -1
  80. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/encrypted-field-config-map.json +1 -1
  81. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-range-explicit-v2/int32/encrypted-payload.json +1 -1
  82. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-range-explicit-v2/int32/rangeopts.json +3 -0
  83. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-rangePreview-explicit/int32/rangeopts.json +11 -0
  84. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-rangePreview-explicit/int32/value-to-encrypt.json +20 -0
  85. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-document-azure.json +1 -1
  86. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-document-gcp.json +1 -1
  87. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-document.json +1 -1
  88. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-filter.json +1 -1
  89. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/list-collections-filter.json +1 -1
  90. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/mongocryptd-command.json +1 -1
  91. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/mongocryptd-reply.json +1 -1
  92. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/schema-map.json +1 -1
  93. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/performance/keyDocument.json +24 -0
  94. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/performance/perf_test.py +165 -0
  95. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_binding.py +8 -12
  96. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_crypto.py +9 -11
  97. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_mongocrypt.py +988 -340
  98. data/ext/libmongocrypt/libmongocrypt/bindings/python/update-sbom.sh +14 -0
  99. data/ext/libmongocrypt/libmongocrypt/cmake/FetchMongoC.cmake +19 -1
  100. data/ext/libmongocrypt/libmongocrypt/cmake/ImportBSON.cmake +23 -0
  101. data/ext/libmongocrypt/libmongocrypt/cmake/IntelDFP.cmake +19 -227
  102. data/ext/libmongocrypt/libmongocrypt/cmake/Patch.cmake +54 -0
  103. data/ext/libmongocrypt/libmongocrypt/doc/img/cli-icon.png +0 -0
  104. data/ext/libmongocrypt/libmongocrypt/doc/img/reference-targets.png +0 -0
  105. data/ext/libmongocrypt/libmongocrypt/doc/releasing.md +153 -0
  106. data/ext/libmongocrypt/libmongocrypt/etc/calc_release_version.py +61 -28
  107. data/ext/libmongocrypt/libmongocrypt/etc/calc_release_version_selftest.sh +73 -0
  108. data/ext/libmongocrypt/libmongocrypt/etc/cyclonedx.sbom.json +108 -0
  109. data/ext/libmongocrypt/libmongocrypt/etc/format.sh +1 -1
  110. data/ext/libmongocrypt/libmongocrypt/etc/libbson-remove-GCC-diagnostic-pragma.patch +27 -0
  111. data/ext/libmongocrypt/libmongocrypt/etc/mongo-inteldfp-alpine-arm-fix.patch +17 -0
  112. data/ext/libmongocrypt/libmongocrypt/etc/packager.py +120 -91
  113. data/ext/libmongocrypt/libmongocrypt/etc/purls.txt +14 -0
  114. data/ext/libmongocrypt/libmongocrypt/etc/repo_config.yaml +56 -0
  115. data/ext/libmongocrypt/libmongocrypt/etc/silk-create-asset-group.sh +70 -0
  116. data/ext/libmongocrypt/libmongocrypt/etc/ssdlc_compliance_report.md +37 -0
  117. data/ext/libmongocrypt/libmongocrypt/etc/third_party_vulnerabilities.md +42 -0
  118. data/ext/libmongocrypt/libmongocrypt/integrating.md +18 -1
  119. data/ext/libmongocrypt/libmongocrypt/kms-message/CMakeLists.txt +11 -3
  120. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_gcp_request.c +1 -1
  121. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_reader_writer.c +17 -0
  122. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_reader_writer_private.h +6 -0
  123. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_request.c +211 -1
  124. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_response.c +163 -0
  125. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_tag_type_private.h +2 -1
  126. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_kmip_request.h +17 -0
  127. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_kmip_response.h +6 -0
  128. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_port.c +3 -2
  129. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request.c +4 -2
  130. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request_str.c +2 -2
  131. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kmip_reader_writer.c +23 -2
  132. data/ext/libmongocrypt/libmongocrypt/src/crypto/libcrypto.c +13 -10
  133. data/ext/libmongocrypt/libmongocrypt/src/mc-dec128.h +1 -1
  134. data/ext/libmongocrypt/libmongocrypt/src/mc-efc-private.h +16 -2
  135. data/ext/libmongocrypt/libmongocrypt/src/mc-efc.c +94 -6
  136. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder-private.h +15 -5
  137. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder.c +114 -53
  138. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-private-v2.h +1 -1
  139. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-private.h +1 -1
  140. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-v2.c +2 -2
  141. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload.c +2 -2
  142. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-private-v2.h +21 -6
  143. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-private.h +5 -5
  144. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-v2.c +38 -2
  145. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload.c +1 -1
  146. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-private-v2.h +20 -7
  147. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-private.h +8 -8
  148. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-v2.c +89 -1
  149. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev-v2.c +3 -3
  150. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev.c +1 -23
  151. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-rfds-private.h +4 -3
  152. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-rfds.c +15 -12
  153. data/ext/libmongocrypt/libmongocrypt/src/mc-optional-private.h +11 -0
  154. data/ext/libmongocrypt/libmongocrypt/src/mc-range-edge-generation-private.h +16 -6
  155. data/ext/libmongocrypt/libmongocrypt/src/mc-range-edge-generation.c +64 -22
  156. data/ext/libmongocrypt/libmongocrypt/src/mc-range-encoding-private.h +23 -4
  157. data/ext/libmongocrypt/libmongocrypt/src/mc-range-encoding.c +359 -65
  158. data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover-generator.template.h +26 -14
  159. data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover-private.h +17 -6
  160. data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover.c +31 -13
  161. data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts-private.h +16 -3
  162. data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts.c +259 -63
  163. data/ext/libmongocrypt/libmongocrypt/src/mc-tokens-private.h +40 -24
  164. data/ext/libmongocrypt/libmongocrypt/src/mc-tokens.c +57 -13
  165. data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.h +17 -0
  166. data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.test.cpp +5 -0
  167. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-binary-private.h +0 -5
  168. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-buffer.c +5 -7
  169. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-key.c +1 -0
  170. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-oauth-private.h +16 -18
  171. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-oauth.c +105 -76
  172. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-crypto.c +9 -3
  173. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-datakey.c +170 -89
  174. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-decrypt.c +5 -5
  175. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-encrypt.c +505 -124
  176. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-private.h +31 -6
  177. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx.c +81 -13
  178. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-dll-private.h +7 -0
  179. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kek-private.h +5 -1
  180. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kek.c +161 -103
  181. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-broker-private.h +2 -7
  182. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-broker.c +191 -69
  183. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key.c +1 -1
  184. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kms-ctx-private.h +50 -15
  185. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kms-ctx.c +365 -69
  186. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking-private.h +2 -1
  187. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking.c +200 -107
  188. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts-private.h +50 -5
  189. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts.c +591 -15
  190. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-private.h +6 -13
  191. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-util.c +3 -2
  192. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt.c +47 -234
  193. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt.h +75 -24
  194. data/ext/libmongocrypt/libmongocrypt/src/os_posix/os_dll.c +18 -2
  195. data/ext/libmongocrypt/libmongocrypt/src/os_win/os_dll.c +4 -0
  196. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/bypassQueryAnalysis/payload.json +53 -0
  197. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/jsonSchema/cmd-to-mongocryptd.json +23 -0
  198. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/jsonSchema/cmd.json +20 -0
  199. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/cmd-to-mongocryptd.json +50 -0
  200. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/cmd.json +20 -0
  201. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/collinfo.json +44 -0
  202. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/encrypted-field-map.json +24 -0
  203. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/encrypted-payload-pattern.json +53 -0
  204. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/mongocryptd-reply.json +62 -0
  205. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/unencrypted/cmd-to-mongocryptd.json +30 -0
  206. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/unencrypted/cmd.json +17 -0
  207. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/unencrypted/mongocryptd-reply.json +39 -0
  208. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/unencrypted/payload.json +21 -0
  209. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/missing-key-id/collinfo.json +20 -0
  210. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/no-fields/collinfo.json +9 -0
  211. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/no-fields/encrypted-payload.json +4 -0
  212. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/success/cmd.json +1 -0
  213. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/success/collinfo.json +63 -0
  214. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/success/encrypted-field-config-map.json +61 -0
  215. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/success/encrypted-payload-range-v2.json +37 -0
  216. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/success/encrypted-payload.json +29 -0
  217. data/ext/libmongocrypt/libmongocrypt/test/data/compact/anchor-pad/cmd.json +1 -0
  218. data/ext/libmongocrypt/libmongocrypt/test/data/compact/anchor-pad/collinfo.json +64 -0
  219. data/ext/libmongocrypt/libmongocrypt/test/data/compact/anchor-pad/encrypted-payload-range-v2.json +105 -0
  220. data/ext/libmongocrypt/libmongocrypt/test/data/compact/anchor-pad/encrypted-payload.json +30 -0
  221. data/ext/libmongocrypt/libmongocrypt/test/data/compact/no-range/cmd.json +1 -0
  222. data/ext/libmongocrypt/libmongocrypt/test/data/compact/no-range/collinfo.json +49 -0
  223. data/ext/libmongocrypt/libmongocrypt/test/data/compact/no-range/encrypted-field-config-map.json +47 -0
  224. data/ext/libmongocrypt/libmongocrypt/test/data/compact/no-range/encrypted-payload.json +23 -0
  225. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/collinfo.json +15 -0
  226. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/encrypted-field-config-map.json +10 -0
  227. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/encrypted-payload-range-v2.json +104 -0
  228. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/encrypted-payload.json +6 -0
  229. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-csfle/collinfo.json +4 -4
  230. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-csfle/encrypted-payload.json +3 -3
  231. data/ext/libmongocrypt/libmongocrypt/test/data/kms-azure/decrypt-response.txt +16 -0
  232. data/ext/libmongocrypt/libmongocrypt/test/data/kms-azure/encrypt-response.txt +16 -0
  233. data/ext/libmongocrypt/libmongocrypt/test/data/kms-azure/oauth-response.txt +19 -0
  234. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/find/cmd.json +9 -0
  235. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/find/encrypted-field-map.json +19 -0
  236. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/find/encrypted-payload.json +62 -0
  237. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/find/mongocryptd-reply.json +69 -0
  238. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/insert/cmd.json +11 -0
  239. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/insert/encrypted-field-map.json +19 -0
  240. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/insert/encrypted-payload.json +40 -0
  241. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/insert/mongocryptd-reply.json +47 -0
  242. data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_decimal128.cstruct +1 -1
  243. data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_double.cstruct +8637 -7958
  244. data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_int32.cstruct +5522 -1382
  245. data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_int64.cstruct +5042 -1262
  246. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_decimal128.cstruct +1 -1
  247. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_decimal128_precision.cstruct +1 -1
  248. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_double.cstruct +1 -1
  249. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_double_precision.cstruct +2 -2
  250. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_int32.cstruct +1 -1
  251. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_int64.cstruct +1 -1
  252. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-find-int32/cmd.json +8 -0
  253. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-find-int32/encrypted-field-map.json +19 -0
  254. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-find-int32/encrypted-payload.json +53 -0
  255. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-find-int32/mongocryptd-reply.json +58 -0
  256. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-insert-int32/cmd.json +11 -0
  257. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-insert-int32/encrypted-field-map.json +19 -0
  258. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-insert-int32/encrypted-payload.json +40 -0
  259. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-insert-int32/mongocryptd-reply.json +45 -0
  260. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-find-int32/expected.json +26 -0
  261. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-find-int32/to-encrypt.json +20 -0
  262. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-find-int32-defaults/expected.json +26 -0
  263. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-find-int32-defaults/to-encrypt.json +20 -0
  264. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-insert-double/expected.json +8 -0
  265. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-insert-int32/expected.json +8 -0
  266. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-insert-int32-defaults/expected.json +8 -0
  267. data/ext/libmongocrypt/libmongocrypt/test/data/tokens/README.md +7 -4
  268. data/ext/libmongocrypt/libmongocrypt/test/data/tokens/mc.json +9 -5
  269. data/ext/libmongocrypt/libmongocrypt/test/data/tokens/server.json +9 -5
  270. data/ext/libmongocrypt/libmongocrypt/test/example-state-machine.c +1 -0
  271. data/ext/libmongocrypt/libmongocrypt/test/test-gcp-auth.c +8 -8
  272. data/ext/libmongocrypt/libmongocrypt/test/test-mc-efc.c +6 -4
  273. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-find-range-payload-v2.c +43 -3
  274. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iup-v2.c +76 -0
  275. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-rfds.c +5 -5
  276. data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-edge-generation.c +89 -14
  277. data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-encoding.c +342 -76
  278. data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-mincover.c +94 -12
  279. data/ext/libmongocrypt/libmongocrypt/test/test-mc-rangeopts.c +205 -7
  280. data/ext/libmongocrypt/libmongocrypt/test/test-mc-tokens.c +49 -23
  281. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert-match-bson.c +16 -19
  282. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert-match-bson.h +22 -1
  283. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cache-oauth.c +94 -11
  284. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cleanup.c +374 -0
  285. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-compact.c +121 -42
  286. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-hooks.c +134 -4
  287. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-std-hooks.c +40 -0
  288. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-std-hooks.h +16 -0
  289. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-csfle-lib.c +11 -11
  290. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-decrypt.c +8 -5
  291. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-encrypt.c +922 -92
  292. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-rewrap-many-datakey.c +2 -2
  293. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-setopt.c +114 -12
  294. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-datakey.c +14 -9
  295. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kms-ctx.c +424 -3
  296. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-log.c +1 -1
  297. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-marking.c +447 -28
  298. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-opts.c +42 -0
  299. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-traverse-util.c +30 -26
  300. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-util.c +7 -0
  301. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-util.h +3 -0
  302. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.c +66 -14
  303. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.h +11 -0
  304. data/ext/libmongocrypt/libmongocrypt/test/test-named-kms-providers.c +2381 -0
  305. data/ext/libmongocrypt/libmongocrypt/test/util/HELP.autogen +3 -1
  306. data/ext/libmongocrypt/libmongocrypt/test/util/README.md +1 -0
  307. data/ext/libmongocrypt/libmongocrypt/test/util/csfle.c +4 -0
  308. data/ext/libmongocrypt/libmongocrypt/test/util/make_includes.py +1 -1
  309. data/ext/libmongocrypt/libmongocrypt/test/util/util.c +38 -3
  310. data/lib/libmongocrypt_helper/version.rb +2 -2
  311. metadata +112 -106
  312. checksums.yaml.gz.sig +0 -0
  313. data/ext/libmongocrypt/libmongocrypt/VERSION_CURRENT +0 -1
  314. data/ext/libmongocrypt/libmongocrypt/bindings/cs/cs.sln +0 -79
  315. data/ext/libmongocrypt/libmongocrypt/bindings/node/CHANGELOG.md +0 -105
  316. data/ext/libmongocrypt/libmongocrypt/bindings/node/LICENSE +0 -201
  317. data/ext/libmongocrypt/libmongocrypt/bindings/node/binding.gyp +0 -79
  318. data/ext/libmongocrypt/libmongocrypt/bindings/node/etc/README.hbs +0 -44
  319. data/ext/libmongocrypt/libmongocrypt/bindings/node/etc/build-static.sh +0 -36
  320. data/ext/libmongocrypt/libmongocrypt/bindings/node/index.d.ts +0 -641
  321. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/autoEncrypter.js +0 -420
  322. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/buffer_pool.js +0 -123
  323. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/clientEncryption.js +0 -821
  324. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/common.js +0 -98
  325. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/cryptoCallbacks.js +0 -87
  326. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/errors.js +0 -75
  327. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/index.js +0 -73
  328. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/mongocryptdManager.js +0 -66
  329. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/aws.js +0 -26
  330. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/azure.js +0 -178
  331. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/gcp.js +0 -24
  332. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/index.js +0 -54
  333. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/utils.js +0 -39
  334. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/stateMachine.js +0 -492
  335. data/ext/libmongocrypt/libmongocrypt/bindings/node/package-lock.json +0 -15302
  336. data/ext/libmongocrypt/libmongocrypt/bindings/node/package.json +0 -100
  337. data/ext/libmongocrypt/libmongocrypt/bindings/node/src/mongocrypt.cc +0 -956
  338. data/ext/libmongocrypt/libmongocrypt/bindings/node/src/mongocrypt.h +0 -114
  339. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/autoEncrypter.test.js +0 -950
  340. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/buffer_pool.test.js +0 -91
  341. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/clientEncryption.test.js +0 -1093
  342. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/common.test.js +0 -94
  343. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/cryptoCallbacks.test.js +0 -240
  344. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/README.md +0 -5
  345. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/cmd.json +0 -6
  346. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/collection-info.json +0 -37
  347. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/encrypted-document-nested.json +0 -8
  348. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/encrypted-document.json +0 -11
  349. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/encryptedFields.json +0 -30
  350. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/key-document.json +0 -32
  351. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/key1-document.json +0 -30
  352. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/mongocryptd-reply.json +0 -18
  353. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/index.test.js +0 -45
  354. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/mongocryptdManager.test.js +0 -48
  355. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/providers/credentialsProvider.test.js +0 -551
  356. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/release.test.js +0 -66
  357. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/requirements.helper.js +0 -51
  358. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/stateMachine.test.js +0 -331
  359. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/tools/chai-addons.js +0 -8
  360. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/tools/mongodb_reporter.js +0 -325
  361. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/types/index.test-d.ts +0 -63
  362. data/ext/libmongocrypt/libmongocrypt/bindings/python/setup.py +0 -89
  363. data/ext/libmongocrypt/libmongocrypt/debian/build_snapshot.sh +0 -79
  364. data/ext/libmongocrypt/libmongocrypt/debian/changelog +0 -105
  365. data/ext/libmongocrypt/libmongocrypt/debian/compat +0 -1
  366. data/ext/libmongocrypt/libmongocrypt/debian/control +0 -41
  367. data/ext/libmongocrypt/libmongocrypt/debian/copyright +0 -129
  368. data/ext/libmongocrypt/libmongocrypt/debian/gbp.conf +0 -23
  369. data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt-dev.dirs +0 -2
  370. data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt-dev.install +0 -5
  371. data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt0.dirs +0 -1
  372. data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt0.install +0 -1
  373. data/ext/libmongocrypt/libmongocrypt/debian/rules +0 -46
  374. data/ext/libmongocrypt/libmongocrypt/debian/source/format +0 -1
  375. data/ext/libmongocrypt/libmongocrypt/debian/source/lintian-overrides +0 -3
  376. data/ext/libmongocrypt/libmongocrypt/debian/source/options +0 -1
  377. data/ext/libmongocrypt/libmongocrypt/debian/watch +0 -3
  378. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/mongocryptd-reply.json +0 -72
  379. data.tar.gz.sig +0 -1
  380. metadata.gz.sig +0 -0
  381. /data/ext/libmongocrypt/libmongocrypt/{bindings/node/test/data/kms-decrypt-reply.txt → test/data/kms-aws/decrypt-response.txt} +0 -0
  382. /data/ext/libmongocrypt/libmongocrypt/{bindings/node/test/data/kms-encrypt-reply.txt → test/data/kms-aws/encrypt-response.txt} +0 -0
  383. /data/ext/libmongocrypt/libmongocrypt/test/data/{gcp-auth → kms-gcp}/decrypt-response.txt +0 -0
  384. /data/ext/libmongocrypt/libmongocrypt/test/data/{gcp-auth → kms-gcp}/encrypt-response.txt +0 -0
  385. /data/ext/libmongocrypt/libmongocrypt/test/data/{gcp-auth → kms-gcp}/oauth-response.txt +0 -0
@@ -0,0 +1,14 @@
1
+ #!/bin/bash
2
+
3
+ set -eux
4
+
5
+ LIBMONGOCRYPT_VERSION=$(cat ./libmongocrypt-version.txt)
6
+ if [ $(command -v podman) ]; then
7
+ DOCKER=podman
8
+ else
9
+ DOCKER=docker
10
+ fi
11
+
12
+ echo "pkg:github/mongodb/libmongocrypt@$LIBMONGOCRYPT_VERSION" > purls.txt
13
+ $DOCKER run --platform="linux/amd64" -it --rm -v $(pwd):$(pwd) artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:1.0 update --purls=$(pwd)/purls.txt -o $(pwd)/sbom.json
14
+ rm purls.txt
@@ -1,12 +1,30 @@
1
1
  include (FetchContent)
2
2
 
3
3
  # Set the tag that we will fetch.
4
- set (MONGOC_FETCH_TAG_FOR_LIBBSON "1.17.7" CACHE STRING "The Git tag of mongo-c-driver that will be fetched to obtain libbson")
4
+ # When updating the version of libbson, also update the version in etc/purls.txt
5
+ set (MONGOC_FETCH_TAG_FOR_LIBBSON "1.27.1" CACHE STRING "The Git tag of mongo-c-driver that will be fetched to obtain libbson")
6
+
7
+ # Add an option to disable patching if a patch command is unavailable.
8
+ option (LIBBSON_PATCH_ENABLED "Whether to apply patches to the libbson library" ON)
9
+ set (patch_disabled OFF)
10
+ if (NOT LIBBSON_PATCH_ENABLED)
11
+ set (patch_disabled ON)
12
+ endif ()
13
+
14
+ include (Patch)
15
+ make_patch_command (patch_command
16
+ STRIP_COMPONENTS 1
17
+ DIRECTORY "<SOURCE_DIR>"
18
+ DISABLED "${patch_disabled}"
19
+ PATCHES
20
+ ${PROJECT_SOURCE_DIR}/etc/libbson-remove-GCC-diagnostic-pragma.patch
21
+ )
5
22
 
6
23
  # Fetch the source archive for the requested tag from GitHub
7
24
  FetchContent_Declare (
8
25
  embedded_mcd
9
26
  URL "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/${MONGOC_FETCH_TAG_FOR_LIBBSON}.tar.gz"
27
+ PATCH_COMMAND ${patch_command} --verbose
10
28
  )
11
29
  # Populate it:
12
30
  FetchContent_GetProperties (embedded_mcd)
@@ -132,6 +132,8 @@ function (_import_bson)
132
132
  set (ENABLE_MONGODB_AWS_AUTH OFF CACHE BOOL "Disable kms-message content in mongoc for libmongocrypt" FORCE)
133
133
  # Disable install() for the libbson static library. We'll do it ourselves
134
134
  set (ENABLE_STATIC BUILD_ONLY)
135
+ # Disable zlib, which isn't necessary for libmongocrypt and isn't necessarily available.
136
+ set (ENABLE_ZLIB OFF CACHE BOOL "Toggle zlib for the mongoc subproject (not required by libmongocrypt)")
135
137
  # Disable libzstd, which isn't necessary for libmongocrypt and isn't necessarily available.
136
138
  set (ENABLE_ZSTD OFF CACHE BOOL "Toggle libzstd for the mongoc subproject (not required by libmongocrypt)")
137
139
  # Disable snappy, which isn't necessary for libmongocrypt and isn't necessarily available.
@@ -142,6 +144,21 @@ function (_import_bson)
142
144
  set (ENABLE_EXTRA_ALIGNMENT ${_extra_alignment_default} CACHE BOOL "Toggle extra alignment of bson_t")
143
145
  # We don't want the subproject to find libmongocrypt
144
146
  set (ENABLE_CLIENT_SIDE_ENCRYPTION OFF CACHE BOOL "Disable client-side encryption for the libmongoc subproject")
147
+ # Clear `BUILD_VERSION` so C driver does not use a `BUILD_VERSION` meant for libmongocrypt.
148
+ # Both libmongocrypt and C driver support setting a `BUILD_VERSION` to override the version.
149
+ if (DEFINED CACHE{BUILD_VERSION})
150
+ set (saved_cached_build_version "${BUILD_VERSION}")
151
+ unset (BUILD_VERSION CACHE) # Undefine cache variable.
152
+ endif ()
153
+ if (DEFINED BUILD_VERSION)
154
+ set (saved_build_version "${BUILD_VERSION}")
155
+ unset (BUILD_VERSION) # Undefine normal variable.
156
+ endif ()
157
+ # Disable building tests in C driver:
158
+ set (ENABLE_TESTS OFF)
159
+ set (BUILD_TESTING OFF)
160
+ # Disable counters in C driver. Counters are not supported on all platforms.
161
+ set (ENABLE_SHM_COUNTERS OFF)
145
162
  # Add the subdirectory as a project. EXCLUDE_FROM_ALL to inhibit building and installing of components unless requested
146
163
  # SYSTEM (on applicable CMake versions) to prevent warnings (particularly from -Wconversion/-Wsign-conversion) from the C driver code
147
164
  if (CMAKE_VERSION VERSION_GREATER 3.25)
@@ -149,6 +166,12 @@ function (_import_bson)
149
166
  else ()
150
167
  add_subdirectory ("${MONGOCRYPT_MONGOC_DIR}" _mongo-c-driver EXCLUDE_FROM_ALL)
151
168
  endif ()
169
+ if (DEFINED saved_cached_build_version)
170
+ set (BUILD_VERSION "${saved_cached_build_version}" CACHE STRING "Library version")
171
+ endif ()
172
+ if (DEFINED saved_build_version)
173
+ set (BUILD_VERSION "${saved_build_version}")
174
+ endif ()
152
175
  if (TARGET mongoc_static)
153
176
  # Workaround: Embedded mongoc_static does not set its INCLUDE_DIRECTORIES for user targets
154
177
  target_include_directories (mongoc_static
@@ -1,8 +1,7 @@
1
1
 
2
2
  include (FetchContent)
3
- find_program (GIT_EXECUTABLE git)
4
- find_program (PATCH_EXECUTABLE patch)
5
3
 
4
+ # When updating the version of IntelDFP, also update the version in etc/purls.txt
6
5
  set (_default_url "${PROJECT_SOURCE_DIR}/third-party/IntelRDFPMathLib20U2.tar.xz")
7
6
 
8
7
  set (INTEL_DFP_LIBRARY_URL "${_default_url}"
@@ -18,16 +17,23 @@ if (NOT INTEL_DFP_LIBRARY_URL_SHA256 STREQUAL "no-verify")
18
17
  set (_hash_arg URL_HASH "${INTEL_DFP_LIBRARY_URL_HASH}")
19
18
  endif ()
20
19
 
21
- # Make the PATCH_COMMAND a no-op if it was disabled
22
- set (patch_command)
20
+ set (patch_disabled OFF)
23
21
  if (NOT INTEL_DFP_LIBRARY_PATCH_ENABLED)
24
- set (patch_command "${CMAKE_COMMAND}" -E true)
25
- elseif (GIT_EXECUTABLE)
26
- set (patch_command "${GIT_EXECUTABLE}" --work-tree=<SOURCE_DIR> apply)
27
- else ()
28
- set (patch_command "${PATCH_EXECUTABLE}" --dir=<SOURCE_DIR>)
22
+ set (patch_disabled ON)
29
23
  endif ()
30
24
 
25
+ include (Patch)
26
+ make_patch_command (patch_command
27
+ STRIP_COMPONENTS 4
28
+ DIRECTORY "<SOURCE_DIR>"
29
+ DISABLED "${patch_disabled}"
30
+ PATCHES
31
+ "${PROJECT_SOURCE_DIR}/etc/mongo-inteldfp-s390x.patch"
32
+ "${PROJECT_SOURCE_DIR}/etc/mongo-inteldfp-MONGOCRYPT-571.patch"
33
+ "${PROJECT_SOURCE_DIR}/etc/mongo-inteldfp-libmongocrypt-pr-625.patch"
34
+ "${PROJECT_SOURCE_DIR}/etc/mongo-inteldfp-alpine-arm-fix.patch"
35
+ )
36
+
31
37
  # NOTE: The applying of the patch expects the correct input directly from the
32
38
  # expanded archive. If the patch needs to be reapplied, you may see errors
33
39
  # about trying to update the intel_dfp component. If you are seeing such
@@ -37,13 +43,7 @@ FetchContent_Declare (
37
43
  intel_dfp
38
44
  URL "${_default_url}"
39
45
  ${_hash_arg}
40
- PATCH_COMMAND
41
- ${patch_command}
42
- -p 4 # Strip four path components
43
- "${PROJECT_SOURCE_DIR}/etc/mongo-inteldfp-s390x.patch"
44
- "${PROJECT_SOURCE_DIR}/etc/mongo-inteldfp-MONGOCRYPT-571.patch"
45
- "${PROJECT_SOURCE_DIR}/etc/mongo-inteldfp-libmongocrypt-pr-625.patch"
46
- --verbose
46
+ PATCH_COMMAND ${patch_command} --verbose
47
47
  )
48
48
 
49
49
  FetchContent_GetProperties (intel_dfp)
@@ -52,247 +52,39 @@ if (NOT intel_dfp_POPULATED)
52
52
  FetchContent_Populate (intel_dfp)
53
53
  endif ()
54
54
 
55
- # This list of sources matches the ones used within MongoDB server. The
56
- # "<library>" prefix is replaced below.
55
+ # This list of sources was generated by copying the MongoDB server and removing any unnecessary.
56
+ # Carefully add sources if more functionality is needed. Bundled sources are checked by static analysis, and may result in a larger binary.
57
+ # The "<library>" prefix is replaced below.
57
58
  # Refer: https://github.com/mongodb/mongo/blob/e9be40f47a77af1931773ad671d4927c0fe6969a/src/third_party/IntelRDFPMathLib20U1/SConscript
58
59
  set (_dfp_sources
59
60
  "<library>/float128/dpml_exception.c"
60
- "<library>/float128/dpml_four_over_pi.c"
61
- "<library>/float128/dpml_ux_bessel.c"
62
61
  "<library>/float128/dpml_ux_bid.c"
63
- "<library>/float128/dpml_ux_cbrt.c"
64
- "<library>/float128/dpml_ux_erf.c"
65
- "<library>/float128/dpml_ux_exp.c"
66
- "<library>/float128/dpml_ux_int.c"
67
- "<library>/float128/dpml_ux_inv_hyper.c"
68
- "<library>/float128/dpml_ux_inv_trig.c"
69
- "<library>/float128/dpml_ux_lgamma.c"
70
62
  "<library>/float128/dpml_ux_log.c"
71
- "<library>/float128/dpml_ux_mod.c"
72
63
  "<library>/float128/dpml_ux_ops.c"
73
64
  "<library>/float128/dpml_ux_ops_64.c"
74
- "<library>/float128/dpml_ux_pow.c"
75
- "<library>/float128/dpml_ux_powi.c"
76
- "<library>/float128/dpml_ux_sqrt.c"
77
- "<library>/float128/dpml_ux_trig.c"
78
- "<library>/float128/sqrt_tab_t.c"
79
65
  "<library>/src/bid128.c"
80
66
  "<library>/src/bid128_2_str_tables.c"
81
- "<library>/src/bid128_acos.c"
82
- "<library>/src/bid128_acosh.c"
83
67
  "<library>/src/bid128_add.c"
84
- "<library>/src/bid128_asin.c"
85
- "<library>/src/bid128_asinh.c"
86
- "<library>/src/bid128_atan.c"
87
- "<library>/src/bid128_atan2.c"
88
- "<library>/src/bid128_atanh.c"
89
- "<library>/src/bid128_cbrt.c"
90
68
  "<library>/src/bid128_compare.c"
91
- "<library>/src/bid128_cos.c"
92
- "<library>/src/bid128_cosh.c"
93
69
  "<library>/src/bid128_div.c"
94
- "<library>/src/bid128_erf.c"
95
- "<library>/src/bid128_erfc.c"
96
- "<library>/src/bid128_exp.c"
97
- "<library>/src/bid128_exp10.c"
98
- "<library>/src/bid128_exp2.c"
99
- "<library>/src/bid128_expm1.c"
100
- "<library>/src/bid128_fdimd.c"
101
70
  "<library>/src/bid128_fma.c"
102
71
  "<library>/src/bid128_fmod.c"
103
- "<library>/src/bid128_frexp.c"
104
- "<library>/src/bid128_hypot.c"
105
- "<library>/src/bid128_ldexp.c"
106
- "<library>/src/bid128_lgamma.c"
107
- "<library>/src/bid128_llrintd.c"
108
- "<library>/src/bid128_log.c"
109
72
  "<library>/src/bid128_log10.c"
110
- "<library>/src/bid128_log1p.c"
111
73
  "<library>/src/bid128_log2.c"
112
- "<library>/src/bid128_logb.c"
113
- "<library>/src/bid128_logbd.c"
114
- "<library>/src/bid128_lrintd.c"
115
- "<library>/src/bid128_lround.c"
116
- "<library>/src/bid128_minmax.c"
117
74
  "<library>/src/bid128_modf.c"
118
75
  "<library>/src/bid128_mul.c"
119
- "<library>/src/bid128_nearbyintd.c"
120
- "<library>/src/bid128_next.c"
121
- "<library>/src/bid128_nexttowardd.c"
122
76
  "<library>/src/bid128_noncomp.c"
123
- "<library>/src/bid128_pow.c"
124
- "<library>/src/bid128_quantexpd.c"
125
- "<library>/src/bid128_quantize.c"
126
- "<library>/src/bid128_rem.c"
127
77
  "<library>/src/bid128_round_integral.c"
128
78
  "<library>/src/bid128_scalb.c"
129
79
  "<library>/src/bid128_scalbl.c"
130
- "<library>/src/bid128_sin.c"
131
- "<library>/src/bid128_sinh.c"
132
- "<library>/src/bid128_sqrt.c"
133
80
  "<library>/src/bid128_string.c"
134
- "<library>/src/bid128_tan.c"
135
- "<library>/src/bid128_tanh.c"
136
- "<library>/src/bid128_tgamma.c"
137
- "<library>/src/bid128_to_int16.c"
138
- "<library>/src/bid128_to_int32.c"
139
81
  "<library>/src/bid128_to_int64.c"
140
- "<library>/src/bid128_to_int8.c"
141
- "<library>/src/bid128_to_uint16.c"
142
- "<library>/src/bid128_to_uint32.c"
143
- "<library>/src/bid128_to_uint64.c"
144
- "<library>/src/bid128_to_uint8.c"
145
- "<library>/src/bid32_acos.c"
146
- "<library>/src/bid32_acosh.c"
147
- "<library>/src/bid32_add.c"
148
- "<library>/src/bid32_asin.c"
149
- "<library>/src/bid32_asinh.c"
150
- "<library>/src/bid32_atan.c"
151
- "<library>/src/bid32_atan2.c"
152
- "<library>/src/bid32_atanh.c"
153
- "<library>/src/bid32_cbrt.c"
154
- "<library>/src/bid32_compare.c"
155
- "<library>/src/bid32_cos.c"
156
- "<library>/src/bid32_cosh.c"
157
- "<library>/src/bid32_div.c"
158
- "<library>/src/bid32_erf.c"
159
- "<library>/src/bid32_erfc.c"
160
- "<library>/src/bid32_exp.c"
161
- "<library>/src/bid32_exp10.c"
162
- "<library>/src/bid32_exp2.c"
163
- "<library>/src/bid32_expm1.c"
164
- "<library>/src/bid32_fdimd.c"
165
- "<library>/src/bid32_fma.c"
166
- "<library>/src/bid32_fmod.c"
167
- "<library>/src/bid32_frexp.c"
168
- "<library>/src/bid32_hypot.c"
169
- "<library>/src/bid32_ldexp.c"
170
- "<library>/src/bid32_lgamma.c"
171
- "<library>/src/bid32_llrintd.c"
172
- "<library>/src/bid32_log.c"
173
- "<library>/src/bid32_log10.c"
174
- "<library>/src/bid32_log1p.c"
175
- "<library>/src/bid32_log2.c"
176
- "<library>/src/bid32_logb.c"
177
- "<library>/src/bid32_logbd.c"
178
- "<library>/src/bid32_lrintd.c"
179
- "<library>/src/bid32_lround.c"
180
- "<library>/src/bid32_minmax.c"
181
- "<library>/src/bid32_modf.c"
182
- "<library>/src/bid32_mul.c"
183
- "<library>/src/bid32_nearbyintd.c"
184
- "<library>/src/bid32_next.c"
185
- "<library>/src/bid32_nexttowardd.c"
186
- "<library>/src/bid32_noncomp.c"
187
- "<library>/src/bid32_pow.c"
188
- "<library>/src/bid32_quantexpd.c"
189
- "<library>/src/bid32_quantize.c"
190
- "<library>/src/bid32_rem.c"
191
- "<library>/src/bid32_round_integral.c"
192
- "<library>/src/bid32_scalb.c"
193
- "<library>/src/bid32_scalbl.c"
194
- "<library>/src/bid32_sin.c"
195
- "<library>/src/bid32_sinh.c"
196
- "<library>/src/bid32_sqrt.c"
197
- "<library>/src/bid32_string.c"
198
- "<library>/src/bid32_sub.c"
199
- "<library>/src/bid32_tan.c"
200
- "<library>/src/bid32_tanh.c"
201
- "<library>/src/bid32_tgamma.c"
202
- "<library>/src/bid32_to_bid128.c"
203
- "<library>/src/bid32_to_bid64.c"
204
- "<library>/src/bid32_to_int16.c"
205
- "<library>/src/bid32_to_int32.c"
206
- "<library>/src/bid32_to_int64.c"
207
- "<library>/src/bid32_to_int8.c"
208
- "<library>/src/bid32_to_uint16.c"
209
- "<library>/src/bid32_to_uint32.c"
210
- "<library>/src/bid32_to_uint64.c"
211
- "<library>/src/bid32_to_uint8.c"
212
- "<library>/src/bid64_acos.c"
213
- "<library>/src/bid64_acosh.c"
214
- "<library>/src/bid64_add.c"
215
- "<library>/src/bid64_asin.c"
216
- "<library>/src/bid64_asinh.c"
217
- "<library>/src/bid64_atan.c"
218
- "<library>/src/bid64_atan2.c"
219
- "<library>/src/bid64_atanh.c"
220
- "<library>/src/bid64_cbrt.c"
221
- "<library>/src/bid64_compare.c"
222
- "<library>/src/bid64_cos.c"
223
- "<library>/src/bid64_cosh.c"
224
- "<library>/src/bid64_div.c"
225
- "<library>/src/bid64_erf.c"
226
- "<library>/src/bid64_erfc.c"
227
- "<library>/src/bid64_exp.c"
228
- "<library>/src/bid64_exp10.c"
229
- "<library>/src/bid64_exp2.c"
230
- "<library>/src/bid64_expm1.c"
231
- "<library>/src/bid64_fdimd.c"
232
- "<library>/src/bid64_fma.c"
233
- "<library>/src/bid64_fmod.c"
234
- "<library>/src/bid64_frexp.c"
235
- "<library>/src/bid64_hypot.c"
236
- "<library>/src/bid64_ldexp.c"
237
- "<library>/src/bid64_lgamma.c"
238
- "<library>/src/bid64_llrintd.c"
239
- "<library>/src/bid64_log.c"
240
- "<library>/src/bid64_log10.c"
241
- "<library>/src/bid64_log1p.c"
242
- "<library>/src/bid64_log2.c"
243
- "<library>/src/bid64_logb.c"
244
- "<library>/src/bid64_logbd.c"
245
- "<library>/src/bid64_lrintd.c"
246
- "<library>/src/bid64_lround.c"
247
- "<library>/src/bid64_minmax.c"
248
- "<library>/src/bid64_modf.c"
249
- "<library>/src/bid64_mul.c"
250
- "<library>/src/bid64_nearbyintd.c"
251
- "<library>/src/bid64_next.c"
252
- "<library>/src/bid64_nexttowardd.c"
253
- "<library>/src/bid64_noncomp.c"
254
- "<library>/src/bid64_pow.c"
255
- "<library>/src/bid64_quantexpd.c"
256
- "<library>/src/bid64_quantize.c"
257
- "<library>/src/bid64_rem.c"
258
- "<library>/src/bid64_round_integral.c"
259
- "<library>/src/bid64_scalb.c"
260
- "<library>/src/bid64_scalbl.c"
261
- "<library>/src/bid64_sin.c"
262
- "<library>/src/bid64_sinh.c"
263
- "<library>/src/bid64_sqrt.c"
264
- "<library>/src/bid64_string.c"
265
- "<library>/src/bid64_tan.c"
266
- "<library>/src/bid64_tanh.c"
267
- "<library>/src/bid64_tgamma.c"
268
82
  "<library>/src/bid64_to_bid128.c"
269
- "<library>/src/bid64_to_int16.c"
270
- "<library>/src/bid64_to_int32.c"
271
- "<library>/src/bid64_to_int64.c"
272
- "<library>/src/bid64_to_int8.c"
273
- "<library>/src/bid64_to_uint16.c"
274
- "<library>/src/bid64_to_uint32.c"
275
- "<library>/src/bid64_to_uint64.c"
276
- "<library>/src/bid64_to_uint8.c"
277
83
  "<library>/src/bid_binarydecimal.c"
278
84
  "<library>/src/bid_convert_data.c"
279
85
  "<library>/src/bid_decimal_data.c"
280
- "<library>/src/bid_decimal_globals.c"
281
- "<library>/src/bid_dpd.c"
282
- "<library>/src/bid_feclearexcept.c"
283
- "<library>/src/bid_fegetexceptflag.c"
284
- "<library>/src/bid_feraiseexcept.c"
285
- "<library>/src/bid_fesetexceptflag.c"
286
- "<library>/src/bid_fetestexcept.c"
287
86
  "<library>/src/bid_flag_operations.c"
288
- "<library>/src/bid_from_int.c"
289
87
  "<library>/src/bid_round.c"
290
- "<library>/src/strtod128.c"
291
- "<library>/src/strtod32.c"
292
- "<library>/src/strtod64.c"
293
- "<library>/src/wcstod128.c"
294
- "<library>/src/wcstod32.c"
295
- "<library>/src/wcstod64.c"
296
88
  )
297
89
  # Put in the actual library path:
298
90
  string (REPLACE "<library>" "${intel_dfp_SOURCE_DIR}/LIBRARY" _dfp_sources "${_dfp_sources}")
@@ -0,0 +1,54 @@
1
+ find_program(GIT_EXECUTABLE git)
2
+ find_program(PATCH_EXECUTABLE patch)
3
+
4
+ #[[
5
+ Form a new Patch-applying command for the given inputs
6
+
7
+ make_patch_command(
8
+ <outvar>
9
+ [DISABLED <bool>]
10
+ [DIRECTORY <dir>]
11
+ [STRIP_COMPONENTS <N>]
12
+ PATCHES [<file> ...]
13
+ )
14
+ ]]
15
+ function(make_patch_command out)
16
+ cmake_parse_arguments(PARSE_ARGV 1 patch "" "DIRECTORY;STRIP_COMPONENTS;DISABLED" "PATCHES")
17
+ if(patch_DISABLED)
18
+ # Use a placeholder "no-op" patch command.
19
+ set(cmd "${CMAKE_COMMAND}" "-E" "true")
20
+ elseif(GIT_EXECUTABLE)
21
+ # git ...
22
+ set(cmd ${GIT_EXECUTABLE})
23
+
24
+ if(patch_DIRECTORY)
25
+ # git --work-tree=...
26
+ list(APPEND cmd --work-tree=${patch_DIRECTORY})
27
+ endif()
28
+ # git ... apply ...
29
+ list(APPEND cmd apply)
30
+ # git ... apply -pN ...
31
+ if(patch_STRIP_COMPONENTS)
32
+ list(APPEND cmd -p${patch_STRIP_COMPONENTS})
33
+ endif()
34
+ # Ignore whitespace errors to fix patch errors on Windows: The patch file may be converted to \r\n by git, but libbson fetched with \n.
35
+ list(APPEND cmd "--ignore-whitespace")
36
+ # git accepts patch filepaths as positional arguments
37
+ list(APPEND cmd ${patch_PATCHES})
38
+ else()
39
+ # patch ...
40
+ set(cmd ${PATCH_EXECUTABLE})
41
+ if(patch_DIRECTORY)
42
+ # patch --dir=...
43
+ list(APPEND cmd --dir=${patch_DIRECTORY})
44
+ endif()
45
+ # patch ... -pN ...
46
+ if(patch_STRIP_COMPONENTS)
47
+ list(APPEND cmd -p${patch_STRIP_COMPONENTS})
48
+ endif()
49
+ # Prepend "--input=" to each patch filepath and add them to the argv
50
+ list(TRANSFORM patch_PATCHES PREPEND "--input=")
51
+ list(APPEND cmd ${patch_PATCHES})
52
+ endif()
53
+ set("${out}" "${cmd}" PARENT_SCOPE)
54
+ endfunction()
@@ -0,0 +1,153 @@
1
+ # Releasing libmongocrypt
2
+
3
+ These steps describe releasing the libmongocrypt C library (not the language bindings).
4
+
5
+ ## Version number scheme ##
6
+ Version numbers of libmongocrypt must follow the format 1.[0-9].[0-9] for releases and 1.[0-9].[0-9]-(alpha|beta|rc)[0-9] for pre-releases. This ensures that Linux distribution packages built from each commit are published to the correct location.
7
+
8
+ ## Steps to release ##
9
+
10
+ ### Check for Vulnerabilities
11
+
12
+ Snyk and Silk are used to satisfy vulnerability scanning requirements of [DRIVERS-714](https://jira.mongodb.org/browse/DRIVERS-714). Prior to releasing, ensure necessary reported vulnerabilities meet requirements described in: [MongoDB Software Security Development Lifecycle Policy](https://docs.google.com/document/d/1u0m4Kj2Ny30zU74KoEFCN4L6D_FbEYCaJ3CQdCYXTMc/edit?tab=t.0#bookmark=id.l09k96qt24jm).
13
+
14
+ #### Check Snyk
15
+
16
+ Go to [Snyk](https://app.snyk.io/) and select the `dev-prod` organization. If access is needed, see [Snyk Onboarding](https://docs.google.com/document/d/1A38HvDvVFOwLtJQfQwIGcy5amAIpDwHUkNInwezLwXY/edit#heading=h.9ayipd2nt7xg). Check the CLI target named `mongodb/libmongocrypt`. The CLI targets may be identified by this icon: ![CLI icon](img/cli-icon.png). There are reference targets for each tracked branch:
17
+
18
+ ![Reference Targets](img/reference-targets.png)
19
+
20
+ Copy the organization ID from [Snyk settings](https://app.snyk.io/org/dev-prod/manage/settings).
21
+
22
+ ##### Update Snyk
23
+
24
+ Update the Snyk reference target tracking the to-be-released branch. For a patch release (e.g. x.y.z), check-out the `rx.y` branch and update the `rx.y` reference target. For a minor release (e.g. x.y.0), check out the `master` branch update the `master` reference target.
25
+
26
+ Run `cmake` to ensure generated source files are present:
27
+ ```bash
28
+ cmake -S. -Bcmake-build -D BUILD_TESTING=OFF
29
+ cmake --build cmake-build --target mongocrypt
30
+ ```
31
+
32
+ Print dependencies found by Snyk and verify libbson is found:
33
+ ```bash
34
+ snyk test --unmanaged --print-dep-paths
35
+ ```
36
+
37
+ Copy the organization ID from [Snyk settings](https://app.snyk.io/org/dev-prod/manage/settings). Create the new Snyk reference target to track the newly created release branch:
38
+ ```bash
39
+ snyk auth
40
+ snyk monitor \
41
+ --org=$ORGANIZATION_ID \
42
+ --target-reference="<rx.y or master>" \
43
+ --unmanaged \
44
+ --remote-repo-url=https://github.com/mongodb/libmongocrypt.git
45
+ ```
46
+
47
+ ```bash
48
+ snyk auth
49
+ snyk monitor \
50
+ --org=$ORGANIZATION_ID \
51
+ --target-reference=<rx.y or master> \
52
+ --unmanaged \
53
+ --remote-repo-url=https://github.com/mongodb/libmongocrypt.git
54
+ ```
55
+
56
+ Check the updated reference targets in Snyk for detected vulnerabilities.
57
+
58
+ #### Check Silk
59
+
60
+ Get credentials for Silk from the `drivers/libmongocrypt` vault in [AWS Secrets Manager](https://wiki.corp.mongodb.com/display/DRIVERS/Using+AWS+Secrets+Manager+to+Store+Testing+Secrets).
61
+
62
+ Download the Augmented SBOM using:
63
+ ```bash
64
+ ./.evergreen/earthly.sh \
65
+ --secret silk_client_id=${silk_client_id} \
66
+ --secret silk_client_secret=${silk_client_secret} \
67
+ +sbom-download \
68
+ --out cyclonedx.augmented.sbom.json \
69
+ --branch <branch>
70
+ ```
71
+
72
+ Check the contents of the "vulnerabilities" field (if present) in the Augmented SBOM.
73
+
74
+ ### Release
75
+
76
+ Do the following when releasing:
77
+ - If this is a feature release (e.g. `x.y.0` or `x.0.0`), follow these steps: [Creating SSDLC static analysis reports](https://docs.google.com/document/d/1rkFL8ymbkc0k8Apky9w5pTPbvKRm68wj17mPJt2_0yo/edit).
78
+ - Check out the release branch. For a release `x.y.z`, the release branch is `rx.y`. If this is a new minor release (`x.y.0`), create the release branch.
79
+ - Update CHANGELOG.md with the version being released.
80
+ - Ensure `etc/purls.txt` is up-to-date.
81
+ - Update `etc/third_party_vulnerabilities.md` with any updates to new or known vulnerabilities for third party dependencies that must be reported.
82
+ - If this is a new minor release (e.g. `x.y.0`):
83
+ - Update the Linux distribution package installation instructions in the below sections to refer to the new version `x.y`.
84
+ - Update the [libmongocrypt-release](https://spruce.mongodb.com/project/libmongocrypt-release/settings/general) Evergreen project (requires auth) to set `Branch Name` to `rx.y`.
85
+ - Commit the changes on the `rx.y` branch with a message like "Update CHANGELOG.md for x.y.z".
86
+ - Tag the commit with `git tag -a <tag>`.
87
+ - Push both the branch ref and tag ref in the same command: `git push origin master 1.8.0-alpha0` or `git push origin r1.8 1.8.4`
88
+ - Pushing the branch ref and the tag ref in the same command eliminates the possibility of a race condition in Evergreen (for building resources based on the presence of a release tag)
89
+ - Note that in the future (e.g., if we move to a PR-based workflow for releases, or if we simply want to take better advantage of advanced Evergreen features), it is possible to use Evergreen's "Trigger Versions With Git Tags" feature by updating both `config.yml` and the project's settings in Evergreen
90
+ - Ensure the version on Evergreen with the tagged commit is scheduled. The following tasks must pass to complete the release:
91
+ - `upload-all`
92
+ - `windows-upload-release`
93
+ - All `publish-packages` tasks.
94
+ - If the `publish-packages` tasks fail with an error like `[curator] 2024/01/02 13:56:17 [p=emergency]: problem submitting repobuilder job: 404 (Not Found)`, this suggests the published path does not yet exist. Barque (the Linux package publishing service) has protection to avoid unintentional publishes. File a DEVPROD ticket ([example](https://jira.mongodb.org/browse/DEVPROD-4053)) and assign to the team called Release Infrastructure to request the path be created. Then re-run the failing `publish-packages` task. Ask in the slack channel `#devprod-release-tools` for further help with `Barque` or `curator`.
95
+ - Create the release from the GitHub releases page from the new tag.
96
+ - Attach the tarball and signature file from the Files tab of the `windows-upload-release` task. [Example](https://github.com/mongodb/libmongocrypt/releases/tag/1.10.0).
97
+ - Attach the Augmented SBOM file. Download the Augmented SBOM using:
98
+ ```bash
99
+ ./.evergreen/earthly.sh \
100
+ --secret silk_client_id=${silk_client_id} \
101
+ --secret silk_client_secret=${silk_client_secret} \
102
+ +sbom-download \
103
+ --out cyclonedx.augmented.sbom.json \
104
+ --branch <branch>
105
+ ```
106
+ For a new minor release, use `master` for `--branch`. For a patch release, use the release branch (e.g. `rx.y`).
107
+ Secrets can be obtained from [AWS Secrets Manager](https://wiki.corp.mongodb.com/display/DRIVERS/Using+AWS+Secrets+Manager+to+Store+Testing+Secrets) under `drivers/libmongocrypt`.
108
+ - Attach `etc/third_party_vulnerabilities.md` to the release.
109
+ - Attach `ssdlc_compliance_report.md` to the release.
110
+
111
+ - If this is a new minor release (e.g. `x.y.0`):
112
+ - File a DOCSP ticket to update the installation instructions on [Install libmongocrypt](https://www.mongodb.com/docs/manual/core/csfle/reference/libmongocrypt/). ([Example](https://jira.mongodb.org/browse/DOCSP-36863))
113
+ - Create a new Silk asset group. Use the newly created release branch (e.g. `rx.y`) as the `--branch` argument:
114
+ ```bash
115
+ ./.evergreen/earthly.sh \
116
+ --secret silk_client_id=${silk_client_id} \
117
+ --secret silk_client_secret=${silk_client_secret} \
118
+ +silk-create-asset-group \
119
+ --branch <branch>
120
+ ```
121
+ - Create a new Snyk reference target. The following instructions use the example branch `rx.y`:
122
+
123
+ Run `cmake` to ensure generated source files are present:
124
+ ```bash
125
+ cmake -S. -Bcmake-build -D BUILD_TESTING=OFF
126
+ cmake --build cmake-build --target mongocrypt
127
+ ```
128
+
129
+ Print dependencies found by Snyk and verify libbson is found:
130
+ ```bash
131
+ snyk test --unmanaged --print-dep-paths
132
+ ```
133
+
134
+ Copy the organization ID from [Snyk settings](https://app.snyk.io/org/dev-prod/manage/settings). Create the new Snyk reference target to track the newly created release branch:
135
+ ```bash
136
+ snyk auth
137
+ snyk monitor \
138
+ --org=$ORGANIZATION_ID \
139
+ --target-reference=rx.y \
140
+ --unmanaged \
141
+ --remote-repo-url=https://github.com/mongodb/libmongocrypt.git
142
+ ```
143
+ Snyk reference targets for older release branches may be removed if no further releases are expected on the branch.
144
+ - Make a PR to apply the "Update CHANGELOG.md for x.y.z" commit to the `master` branch.
145
+ - Update the release on the [Jira releases page](https://jira.mongodb.org/projects/MONGOCRYPT/versions).
146
+ - Record the release on [C/C++ Release Info](https://docs.google.com/spreadsheets/d/1yHfGmDnbA5-Qt8FX4tKWC5xk9AhzYZx1SKF4AD36ecY/edit?usp=sharing). This is done to meet SSDLC reporting requirements.
147
+ - Add a link to the Evergreen waterfall for the tagged commit to [libmongocrypt Security Testing Summary](https://docs.google.com/document/d/1dc7uvBzu3okAIsA8LSW5sVQGkYIvwpBVdg5v4wb4c4s/edit#heading=h.5t79jwe4p0ss).
148
+
149
+ ## Homebrew steps ##
150
+ Submit a PR to update the Homebrew package https://github.com/mongodb/homebrew-brew/blob/master/Formula/libmongocrypt.rb. ([Example](https://github.com/mongodb/homebrew-brew/pull/208)). If not on macOS, request a team member to do this step.
151
+
152
+ ## Debian steps ##
153
+ Refer to the [Debian](https://github.com/mongodb/mongo-c-driver/blob/master/docs/dev/debian.rst) steps. If you are not a Debian maintainer on the team, request a team member to do this step.