libmongocrypt-helper 1.7.4.0.1002 → 1.8.0.0.1001

Sign up to get free protection for your applications and to get access to all the features.
Files changed (396) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/ext/libmongocrypt/libmongocrypt/CHANGELOG.md +9 -7
  4. data/ext/libmongocrypt/libmongocrypt/CMakeLists.txt +17 -23
  5. data/ext/libmongocrypt/libmongocrypt/Earthfile +374 -0
  6. data/ext/libmongocrypt/libmongocrypt/README.md +7 -7
  7. data/ext/libmongocrypt/libmongocrypt/VERSION_CURRENT +1 -1
  8. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptClient.cs +25 -6
  9. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/Library.cs +25 -3
  10. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Example/MongoDB.Libmongocrypt.Example.csproj +1 -1
  11. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/BasicTests.cs +1 -1
  12. data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.cake +3 -2
  13. data/ext/libmongocrypt/libmongocrypt/bindings/cs/cs.sln +79 -0
  14. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/build.gradle.kts +2 -2
  15. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/java/com/mongodb/crypt/capi/MongoCryptTest.java +6 -4
  16. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit-v2/int32/encrypted-payload.json +26 -0
  17. data/ext/libmongocrypt/libmongocrypt/bindings/node/CHANGELOG.md +24 -0
  18. data/ext/libmongocrypt/libmongocrypt/bindings/node/README.md +134 -5
  19. data/ext/libmongocrypt/libmongocrypt/bindings/node/etc/build-static.sh +3 -6
  20. data/ext/libmongocrypt/libmongocrypt/bindings/node/index.d.ts +203 -77
  21. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/autoEncrypter.js +1 -1
  22. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/clientEncryption.js +165 -43
  23. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/common.js +12 -14
  24. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/errors.js +75 -0
  25. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/index.js +34 -3
  26. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/aws.js +26 -0
  27. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/azure.js +178 -0
  28. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/gcp.js +24 -0
  29. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/index.js +54 -0
  30. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/utils.js +39 -0
  31. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/stateMachine.js +9 -4
  32. data/ext/libmongocrypt/libmongocrypt/bindings/node/package-lock.json +4440 -5189
  33. data/ext/libmongocrypt/libmongocrypt/bindings/node/package.json +27 -8
  34. data/ext/libmongocrypt/libmongocrypt/bindings/node/src/mongocrypt.cc +65 -38
  35. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/autoEncrypter.test.js +4 -7
  36. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/clientEncryption.test.js +434 -42
  37. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/common.test.js +94 -0
  38. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/cryptoCallbacks.test.js +1 -45
  39. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/index.test.js +45 -0
  40. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/mongocryptdManager.test.js +1 -1
  41. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/providers/credentialsProvider.test.js +551 -0
  42. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/release.test.js +10 -3
  43. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/requirements.helper.js +23 -1
  44. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/stateMachine.test.js +1 -1
  45. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/tools/chai-addons.js +8 -0
  46. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/types/index.test-d.ts +63 -0
  47. data/ext/libmongocrypt/libmongocrypt/bindings/python/CHANGELOG.rst +26 -0
  48. data/ext/libmongocrypt/libmongocrypt/bindings/python/README.rst +2 -2
  49. data/ext/libmongocrypt/libmongocrypt/bindings/python/build-manylinux-wheel.sh +1 -1
  50. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/binding.py +128 -238
  51. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/compat.py +0 -27
  52. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/explicit_encrypter.py +1 -1
  53. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/mongocrypt.py +5 -21
  54. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/version.py +2 -2
  55. data/ext/libmongocrypt/libmongocrypt/bindings/python/release.sh +5 -5
  56. data/ext/libmongocrypt/libmongocrypt/bindings/python/setup.py +14 -9
  57. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/__init__.py +1 -10
  58. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-range-explicit-v2/int32/encrypted-payload.json +26 -0
  59. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_mongocrypt.py +5 -5
  60. data/ext/libmongocrypt/libmongocrypt/bindings/python/test-requirements.txt +4 -12
  61. data/ext/libmongocrypt/libmongocrypt/cmake/ImportBSON.cmake +8 -6
  62. data/ext/libmongocrypt/libmongocrypt/cmake/IntelDFP.cmake +2 -1
  63. data/ext/libmongocrypt/libmongocrypt/cmake/Platform.cmake +50 -0
  64. data/ext/libmongocrypt/libmongocrypt/cmake/mongocrypt-config.cmake +21 -0
  65. data/ext/libmongocrypt/libmongocrypt/debian/gbp.conf +2 -2
  66. data/ext/libmongocrypt/libmongocrypt/etc/c6-vault.repo +39 -0
  67. data/ext/libmongocrypt/libmongocrypt/etc/fle2_aead_generate_tests.py +15 -24
  68. data/ext/libmongocrypt/libmongocrypt/etc/fle2_crypto.py +66 -54
  69. data/ext/libmongocrypt/libmongocrypt/etc/fle2_generate_tests.py +14 -23
  70. data/ext/libmongocrypt/libmongocrypt/etc/fle2v2_aead_generate_tests.py +32 -0
  71. data/ext/libmongocrypt/libmongocrypt/etc/format-all.sh +12 -0
  72. data/ext/libmongocrypt/libmongocrypt/etc/format.sh +16 -0
  73. data/ext/libmongocrypt/libmongocrypt/etc/install-package.sh +48 -0
  74. data/ext/libmongocrypt/libmongocrypt/etc/mongo-inteldfp-libmongocrypt-pr-625.patch +13 -0
  75. data/ext/libmongocrypt/libmongocrypt/src/crypto/cng.c +381 -436
  76. data/ext/libmongocrypt/libmongocrypt/src/crypto/commoncrypto.c +162 -227
  77. data/ext/libmongocrypt/libmongocrypt/src/crypto/libcrypto.c +180 -248
  78. data/ext/libmongocrypt/libmongocrypt/src/crypto/none.c +33 -55
  79. data/ext/libmongocrypt/libmongocrypt/src/csfle-markup.cpp +175 -205
  80. data/ext/libmongocrypt/libmongocrypt/src/mc-array-private.h +10 -21
  81. data/ext/libmongocrypt/libmongocrypt/src/mc-array.c +44 -56
  82. data/ext/libmongocrypt/libmongocrypt/src/mc-check-conversions-private.h +4 -8
  83. data/ext/libmongocrypt/libmongocrypt/src/mc-dec128.h +351 -463
  84. data/ext/libmongocrypt/libmongocrypt/src/mc-dec128.test.cpp +59 -66
  85. data/ext/libmongocrypt/libmongocrypt/src/mc-efc-private.h +7 -11
  86. data/ext/libmongocrypt/libmongocrypt/src/mc-efc.c +80 -92
  87. data/ext/libmongocrypt/libmongocrypt/src/mc-fle-blob-subtype-private.h +18 -10
  88. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder-private.h +59 -70
  89. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder.c +384 -439
  90. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-private-v2.h +41 -0
  91. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-private.h +11 -18
  92. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-v2.c +135 -0
  93. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload.c +109 -126
  94. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-private-v2.h +88 -0
  95. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-private.h +24 -27
  96. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-v2.c +137 -0
  97. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload.c +106 -125
  98. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-private-v2.h +117 -0
  99. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-private.h +28 -36
  100. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-v2.c +294 -0
  101. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload.c +237 -278
  102. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev-private-v2.h +133 -0
  103. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev-private.h +67 -56
  104. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev-v2.c +437 -0
  105. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev.c +476 -325
  106. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-common-private.h +69 -0
  107. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-common.c +182 -0
  108. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-private.h +23 -31
  109. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-v2-private.h +85 -0
  110. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-v2.c +142 -0
  111. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev.c +104 -231
  112. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-range-operator-private.h +8 -7
  113. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-rfds-private.h +55 -56
  114. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-rfds.c +517 -580
  115. data/ext/libmongocrypt/libmongocrypt/src/mc-optional-private.h +36 -66
  116. data/ext/libmongocrypt/libmongocrypt/src/mc-range-edge-generation-private.h +57 -76
  117. data/ext/libmongocrypt/libmongocrypt/src/mc-range-edge-generation.c +158 -189
  118. data/ext/libmongocrypt/libmongocrypt/src/mc-range-encoding-private.h +36 -42
  119. data/ext/libmongocrypt/libmongocrypt/src/mc-range-encoding.c +515 -558
  120. data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover-generator.template.h +155 -191
  121. data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover-private.h +43 -53
  122. data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover.c +170 -240
  123. data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts-private.h +29 -34
  124. data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts.c +289 -338
  125. data/ext/libmongocrypt/libmongocrypt/src/mc-reader-private.h +36 -71
  126. data/ext/libmongocrypt/libmongocrypt/src/mc-reader.c +111 -164
  127. data/ext/libmongocrypt/libmongocrypt/src/mc-tokens-private.h +55 -49
  128. data/ext/libmongocrypt/libmongocrypt/src/mc-tokens.c +109 -125
  129. data/ext/libmongocrypt/libmongocrypt/src/mc-writer-private.h +66 -0
  130. data/ext/libmongocrypt/libmongocrypt/src/mc-writer.c +141 -0
  131. data/ext/libmongocrypt/libmongocrypt/src/mlib/check.hpp +37 -55
  132. data/ext/libmongocrypt/libmongocrypt/src/mlib/endian.h +11 -11
  133. data/ext/libmongocrypt/libmongocrypt/src/mlib/error.h +27 -32
  134. data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.h +444 -499
  135. data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.test.cpp +251 -334
  136. data/ext/libmongocrypt/libmongocrypt/src/mlib/macros.h +4 -5
  137. data/ext/libmongocrypt/libmongocrypt/src/mlib/path.h +196 -231
  138. data/ext/libmongocrypt/libmongocrypt/src/mlib/path.test.c +56 -79
  139. data/ext/libmongocrypt/libmongocrypt/src/mlib/str.h +411 -530
  140. data/ext/libmongocrypt/libmongocrypt/src/mlib/str.test.c +116 -131
  141. data/ext/libmongocrypt/libmongocrypt/src/mlib/thread.h +17 -26
  142. data/ext/libmongocrypt/libmongocrypt/src/mlib/user-check.h +2 -2
  143. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-binary-private.h +3 -6
  144. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-binary.c +31 -48
  145. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-buffer-private.h +55 -131
  146. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-buffer.c +444 -565
  147. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-collinfo-private.h +1 -2
  148. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-collinfo.c +28 -45
  149. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-key-private.h +11 -17
  150. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-key.c +103 -132
  151. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-oauth-private.h +8 -14
  152. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-oauth.c +78 -90
  153. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-private.h +26 -45
  154. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache.c +220 -273
  155. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ciphertext-private.h +13 -25
  156. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ciphertext.c +147 -166
  157. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-compat.h +2 -2
  158. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-crypto-private.h +110 -204
  159. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-crypto.c +1137 -1565
  160. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-datakey.c +425 -472
  161. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-decrypt.c +817 -694
  162. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-encrypt.c +2394 -2697
  163. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-private.h +166 -186
  164. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-rewrap-many-datakey.c +308 -351
  165. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx.c +921 -1138
  166. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-dll-private.h +16 -24
  167. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-endian-private.h +44 -58
  168. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-endpoint-private.h +21 -25
  169. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-endpoint.c +167 -181
  170. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kek-private.h +37 -43
  171. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kek.c +215 -253
  172. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-broker-private.h +73 -108
  173. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-broker.c +889 -1034
  174. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-private.h +27 -44
  175. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key.c +349 -402
  176. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kms-ctx-private.h +92 -120
  177. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kms-ctx.c +1397 -1612
  178. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-log-private.h +35 -67
  179. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-log.c +49 -83
  180. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking-private.h +30 -36
  181. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking.c +1821 -1470
  182. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-mutex-private.h +7 -12
  183. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts-private.h +80 -108
  184. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts.c +354 -424
  185. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-private.h +101 -117
  186. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-status-private.h +3 -8
  187. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-status.c +92 -119
  188. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-traverse-util-private.h +19 -29
  189. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-traverse-util.c +136 -176
  190. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-util-private.h +11 -21
  191. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-util.c +96 -135
  192. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt.c +1092 -1320
  193. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt.h +130 -295
  194. data/ext/libmongocrypt/libmongocrypt/src/os_posix/os_dll.c +66 -78
  195. data/ext/libmongocrypt/libmongocrypt/src/os_posix/os_mutex.c +20 -28
  196. data/ext/libmongocrypt/libmongocrypt/src/os_win/os_dll.c +60 -73
  197. data/ext/libmongocrypt/libmongocrypt/src/os_win/os_mutex.c +8 -16
  198. data/ext/libmongocrypt/libmongocrypt/test/crypt_shared-stub.cpp +57 -87
  199. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/empty/encrypted-payload-v2.json +60 -0
  200. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/success/encrypted-payload-v2.json +67 -0
  201. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-csfle/encrypted-payload.json +2 -2
  202. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/find-indexed-contentionFactor1-v2.json +8 -0
  203. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/find-indexed-v2.json +8 -0
  204. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/insert-indexed-contentionFactor1-v2.json +8 -0
  205. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/insert-indexed-same-user-and-index-key-v2.json +8 -0
  206. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/insert-indexed-v2.json +8 -0
  207. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality-v2/cmd.json +6 -0
  208. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality-v2/encrypted-field-map.json +22 -0
  209. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality-v2/encrypted-payload.json +40 -0
  210. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality-v2/mongocryptd-reply.json +19 -0
  211. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/cmd.json +10 -0
  212. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/encrypted-field-map.json +27 -0
  213. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/encrypted-payload.json +41 -0
  214. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/mongocryptd-reply.json +49 -0
  215. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/cmd.json +6 -0
  216. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/encrypted-field-map.json +30 -0
  217. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/encrypted-payload.json +50 -0
  218. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/mongocryptd-reply.json +58 -0
  219. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/cmd.json +6 -0
  220. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/encrypted-field-map.json +27 -0
  221. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/encrypted-payload.json +41 -0
  222. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/mongocryptd-reply.json +49 -0
  223. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision-v2/cmd.json +8 -0
  224. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision-v2/encrypted-field-map.json +30 -0
  225. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision-v2/encrypted-payload.json +44 -0
  226. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision-v2/mongocryptd-reply.json +52 -0
  227. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/cmd.json +8 -0
  228. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/encrypted-field-map.json +27 -0
  229. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/encrypted-payload.json +41 -0
  230. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/mongocryptd-reply.json +49 -0
  231. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/cmd.json +8 -0
  232. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/encrypted-field-map.json +27 -0
  233. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/encrypted-payload.json +41 -0
  234. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/mongocryptd-reply.json +49 -0
  235. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/cmd.json +8 -0
  236. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/encrypted-field-map.json +27 -0
  237. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/encrypted-payload.json +41 -0
  238. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/mongocryptd-reply.json +49 -0
  239. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double/encrypted-payload-v2.json +26 -0
  240. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double-precision/encrypted-payload-v2.json +26 -0
  241. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32/encrypted-payload-v2.json +26 -0
  242. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/encrypted-payload-v2.json +26 -0
  243. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-openinterval/encrypted-payload-v2.json +16 -0
  244. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert/cmd.json +1 -1
  245. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date/RNG_DATA.h +65 -65
  246. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/cmd.json +13 -0
  247. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/encrypted-field-map.json +27 -0
  248. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/encrypted-payload.json +44 -0
  249. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/mongocryptd-reply.json +52 -0
  250. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128/RNG_DATA.h +132 -132
  251. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision/RNG_DATA.h +71 -71
  252. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/cmd.json +9 -0
  253. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/encrypted-field-map.json +30 -0
  254. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/encrypted-payload.json +53 -0
  255. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/mongocryptd-reply.json +61 -0
  256. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/cmd.json +9 -0
  257. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/encrypted-field-map.json +27 -0
  258. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/encrypted-payload.json +44 -0
  259. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/mongocryptd-reply.json +52 -0
  260. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double/RNG_DATA.h +68 -68
  261. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision/RNG_DATA.h +19 -19
  262. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision-v2/cmd.json +11 -0
  263. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision-v2/encrypted-field-map.json +30 -0
  264. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision-v2/encrypted-payload.json +47 -0
  265. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision-v2/mongocryptd-reply.json +55 -0
  266. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/cmd.json +11 -0
  267. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/encrypted-field-map.json +27 -0
  268. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/encrypted-payload.json +44 -0
  269. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/mongocryptd-reply.json +52 -0
  270. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32/RNG_DATA.h +25 -25
  271. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/cmd.json +11 -0
  272. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/encrypted-field-map.json +27 -0
  273. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/encrypted-payload.json +44 -0
  274. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/mongocryptd-reply.json +52 -0
  275. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64/RNG_DATA.h +65 -65
  276. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/cmd.json +11 -0
  277. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/encrypted-field-map.json +27 -0
  278. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/encrypted-payload.json +44 -0
  279. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/mongocryptd-reply.json +52 -0
  280. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double/RNG_DATA.h +68 -68
  281. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double/encrypted-payload-v2.json +8 -0
  282. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double-precision/RNG_DATA.h +19 -19
  283. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double-precision/encrypted-payload-v2.json +8 -0
  284. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32/RNG_DATA.h +25 -25
  285. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32/encrypted-payload-v2.json +8 -0
  286. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/encrypted-payload-v2.json +8 -0
  287. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/sparsity-2/RNG_DATA.h +15 -15
  288. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/sparsity-2/encrypted-payload-v2.json +8 -0
  289. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed-v2/cmd.json +9 -0
  290. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed-v2/encrypted-field-map.json +18 -0
  291. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed-v2/encrypted-payload.json +14 -0
  292. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed-v2/mongocryptd-reply.json +41 -0
  293. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-v2/cmd.json +9 -0
  294. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-v2/encrypted-field-map.json +22 -0
  295. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-v2/encrypted-payload.json +39 -0
  296. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-v2/mongocryptd-reply.json +49 -0
  297. data/ext/libmongocrypt/libmongocrypt/test/data/iev-v2/FLECrudTest-insertOneRangeV2.json +10 -0
  298. data/ext/libmongocrypt/libmongocrypt/test/data/iev-v2/FLECrudTest-insertOneV2.json +10 -0
  299. data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/README.md +17 -0
  300. data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/aes-ctr.json +29 -0
  301. data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2-fixed.json +10 -0
  302. data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2-generated.json +38 -0
  303. data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2aead-decrypt.json +35 -0
  304. data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2aead-fixed.json +29 -0
  305. data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2aead-generated.json +122 -0
  306. data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2v2-aead-fixed.json +29 -0
  307. data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2v2-aead-generated.json +122 -0
  308. data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/mcgrew.json +12 -0
  309. data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/nist.json +20 -0
  310. data/ext/libmongocrypt/libmongocrypt/test/data/tokens/README.md +27 -0
  311. data/ext/libmongocrypt/libmongocrypt/test/data/tokens/mc.json +21 -0
  312. data/ext/libmongocrypt/libmongocrypt/test/data/tokens/server.json +21 -0
  313. data/ext/libmongocrypt/libmongocrypt/test/example-no-bson.c +4 -4
  314. data/ext/libmongocrypt/libmongocrypt/test/example-state-machine.c +278 -323
  315. data/ext/libmongocrypt/libmongocrypt/test/fuzz_kms.c +8 -7
  316. data/ext/libmongocrypt/libmongocrypt/test/test-dll.cpp +6 -7
  317. data/ext/libmongocrypt/libmongocrypt/test/test-gcp-auth.c +221 -283
  318. data/ext/libmongocrypt/libmongocrypt/test/test-mc-efc.c +58 -73
  319. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-find-equality-payload-v2.c +78 -0
  320. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-find-range-payload-v2.c +89 -0
  321. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iev-v2.c +248 -0
  322. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iev.c +467 -414
  323. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iup-v2.c +172 -0
  324. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iup.c +141 -159
  325. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-uev-v2.c +338 -0
  326. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-uev.c +238 -176
  327. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-rfds.c +373 -474
  328. data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-edge-generation.c +346 -388
  329. data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-encoding.c +708 -825
  330. data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-mincover.c +417 -481
  331. data/ext/libmongocrypt/libmongocrypt/test/test-mc-rangeopts.c +110 -144
  332. data/ext/libmongocrypt/libmongocrypt/test/test-mc-reader.c +124 -207
  333. data/ext/libmongocrypt/libmongocrypt/test/test-mc-tokens.c +223 -213
  334. data/ext/libmongocrypt/libmongocrypt/test/test-mc-writer.c +176 -0
  335. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert-match-bson.c +634 -807
  336. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert-match-bson.h +1 -2
  337. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert.h +168 -189
  338. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-buffer.c +187 -211
  339. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cache-oauth.c +34 -36
  340. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cache.c +210 -233
  341. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ciphertext.c +185 -220
  342. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-compact.c +331 -445
  343. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-hooks.c +670 -814
  344. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-std-hooks.c +102 -135
  345. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-std-hooks.h +54 -71
  346. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto.c +394 -846
  347. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-csfle-lib.c +159 -183
  348. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-decrypt.c +867 -1045
  349. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-encrypt.c +4349 -4713
  350. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-rewrap-many-datakey.c +750 -964
  351. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-setopt.c +991 -1178
  352. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-datakey.c +342 -419
  353. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-dll.c +23 -30
  354. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-endpoint.c +98 -111
  355. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kek.c +49 -52
  356. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key-broker.c +770 -920
  357. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key-cache.c +354 -407
  358. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key.c +197 -245
  359. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kms-ctx.c +286 -370
  360. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kms-responses.c +147 -166
  361. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-local-kms.c +50 -61
  362. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-log.c +85 -100
  363. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-marking.c +656 -692
  364. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-status.c +46 -58
  365. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-traverse-util.c +377 -451
  366. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-util.c +48 -67
  367. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-util.h +4 -10
  368. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.c +827 -918
  369. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.h +111 -172
  370. data/ext/libmongocrypt/libmongocrypt/test/util/csfle.c +508 -559
  371. data/ext/libmongocrypt/libmongocrypt/test/util/util.c +735 -881
  372. data/ext/libmongocrypt/libmongocrypt/test/util/util.h +33 -55
  373. data/lib/libmongocrypt_helper/version.rb +2 -2
  374. data.tar.gz.sig +0 -0
  375. metadata +154 -26
  376. metadata.gz.sig +0 -0
  377. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit/int32/encrypted-payload.json +0 -26
  378. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit/int32/key-document.json +0 -0
  379. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/credentialsProvider.js +0 -33
  380. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/credentialsProvider.test.js +0 -163
  381. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-range-explicit/int32/encrypted-payload.json +0 -26
  382. data/ext/libmongocrypt/libmongocrypt/test/data/aes-ctr.cstructs +0 -359
  383. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-aead.cstructs +0 -109
  384. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/encrypted-payload.json +0 -26
  385. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/rangeopts.json +0 -5
  386. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/value-to-encrypt.json +0 -20
  387. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/RNG_DATA.h +0 -70
  388. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/encrypted-payload.json +0 -8
  389. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/rangeopts.json +0 -5
  390. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/value-to-encrypt.json +0 -5
  391. data/ext/libmongocrypt/libmongocrypt/test/data/fle2.cstructs +0 -33
  392. /data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/{fle2-find-range-explicit → fle2-find-range-explicit-v2}/int32/key-filter.json +0 -0
  393. /data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/{fle2-find-range-explicit → fle2-find-range-explicit-v2}/int32/rangeopts.json +0 -0
  394. /data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/{fle2-find-range-explicit → fle2-find-range-explicit-v2}/int32/value-to-encrypt.json +0 -0
  395. /data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/{fle2-find-range-explicit → fle2-find-range-explicit-v2}/int32/rangeopts.json +0 -0
  396. /data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/{fle2-find-range-explicit → fle2-find-range-explicit-v2}/int32/value-to-encrypt.json +0 -0
@@ -15,8 +15,8 @@
15
15
  */
16
16
 
17
17
  #include "mongocrypt-kek-private.h"
18
- #include "mongocrypt-private.h"
19
18
  #include "mongocrypt-opts-private.h"
19
+ #include "mongocrypt-private.h"
20
20
 
21
21
  /* Possible documents to parse:
22
22
  * AWS
@@ -44,282 +44,244 @@
44
44
  * keyId: <optional string>
45
45
  * endpoint: <optional string>
46
46
  */
47
- bool
48
- _mongocrypt_kek_parse_owned (const bson_t *bson,
49
- _mongocrypt_kek_t *kek,
50
- mongocrypt_status_t *status)
51
- {
52
- char *kms_provider = NULL;
53
- bool ret = false;
47
+ bool _mongocrypt_kek_parse_owned(const bson_t *bson, _mongocrypt_kek_t *kek, mongocrypt_status_t *status) {
48
+ char *kms_provider = NULL;
49
+ bool ret = false;
54
50
 
55
- BSON_ASSERT_PARAM (bson);
56
- BSON_ASSERT_PARAM (kek);
51
+ BSON_ASSERT_PARAM(bson);
52
+ BSON_ASSERT_PARAM(kek);
57
53
 
58
- if (!_mongocrypt_parse_required_utf8 (
59
- bson, "provider", &kms_provider, status)) {
60
- goto done;
61
- }
54
+ if (!_mongocrypt_parse_required_utf8(bson, "provider", &kms_provider, status)) {
55
+ goto done;
56
+ }
62
57
 
63
- if (0 == strcmp (kms_provider, "aws")) {
64
- kek->kms_provider = MONGOCRYPT_KMS_PROVIDER_AWS;
65
- if (!_mongocrypt_parse_required_utf8 (
66
- bson, "key", &kek->provider.aws.cmk, status)) {
67
- goto done;
68
- }
69
- if (!_mongocrypt_parse_required_utf8 (
70
- bson, "region", &kek->provider.aws.region, status)) {
71
- goto done;
72
- }
73
- if (!_mongocrypt_parse_optional_endpoint (bson,
74
- "endpoint",
75
- &kek->provider.aws.endpoint,
76
- NULL /* opts */,
77
- status)) {
78
- goto done;
79
- }
80
- if (!_mongocrypt_check_allowed_fields (
81
- bson, NULL, status, "provider", "key", "region", "endpoint")) {
82
- goto done;
83
- }
84
- } else if (0 == strcmp (kms_provider, "local")) {
85
- kek->kms_provider = MONGOCRYPT_KMS_PROVIDER_LOCAL;
86
- if (!_mongocrypt_check_allowed_fields (bson, NULL, status, "provider")) {
87
- goto done;
88
- }
89
- } else if (0 == strcmp (kms_provider, "azure")) {
90
- kek->kms_provider = MONGOCRYPT_KMS_PROVIDER_AZURE;
91
- if (!_mongocrypt_parse_required_endpoint (
92
- bson,
93
- "keyVaultEndpoint",
94
- &kek->provider.azure.key_vault_endpoint,
95
- NULL /* opts */,
96
- status)) {
97
- goto done;
98
- }
58
+ if (0 == strcmp(kms_provider, "aws")) {
59
+ kek->kms_provider = MONGOCRYPT_KMS_PROVIDER_AWS;
60
+ if (!_mongocrypt_parse_required_utf8(bson, "key", &kek->provider.aws.cmk, status)) {
61
+ goto done;
62
+ }
63
+ if (!_mongocrypt_parse_required_utf8(bson, "region", &kek->provider.aws.region, status)) {
64
+ goto done;
65
+ }
66
+ if (!_mongocrypt_parse_optional_endpoint(bson,
67
+ "endpoint",
68
+ &kek->provider.aws.endpoint,
69
+ NULL /* opts */,
70
+ status)) {
71
+ goto done;
72
+ }
73
+ if (!_mongocrypt_check_allowed_fields(bson, NULL, status, "provider", "key", "region", "endpoint")) {
74
+ goto done;
75
+ }
76
+ } else if (0 == strcmp(kms_provider, "local")) {
77
+ kek->kms_provider = MONGOCRYPT_KMS_PROVIDER_LOCAL;
78
+ if (!_mongocrypt_check_allowed_fields(bson, NULL, status, "provider")) {
79
+ goto done;
80
+ }
81
+ } else if (0 == strcmp(kms_provider, "azure")) {
82
+ kek->kms_provider = MONGOCRYPT_KMS_PROVIDER_AZURE;
83
+ if (!_mongocrypt_parse_required_endpoint(bson,
84
+ "keyVaultEndpoint",
85
+ &kek->provider.azure.key_vault_endpoint,
86
+ NULL /* opts */,
87
+ status)) {
88
+ goto done;
89
+ }
99
90
 
100
- if (!_mongocrypt_parse_required_utf8 (
101
- bson, "keyName", &kek->provider.azure.key_name, status)) {
102
- goto done;
103
- }
91
+ if (!_mongocrypt_parse_required_utf8(bson, "keyName", &kek->provider.azure.key_name, status)) {
92
+ goto done;
93
+ }
104
94
 
105
- if (!_mongocrypt_parse_optional_utf8 (
106
- bson, "keyVersion", &kek->provider.azure.key_version, status)) {
107
- goto done;
108
- }
95
+ if (!_mongocrypt_parse_optional_utf8(bson, "keyVersion", &kek->provider.azure.key_version, status)) {
96
+ goto done;
97
+ }
109
98
 
110
- if (!_mongocrypt_check_allowed_fields (bson,
111
- NULL,
112
- status,
113
- "provider",
114
- "keyVaultEndpoint",
115
- "keyName",
116
- "keyVersion")) {
117
- goto done;
118
- }
119
- } else if (0 == strcmp (kms_provider, "gcp")) {
120
- kek->kms_provider = MONGOCRYPT_KMS_PROVIDER_GCP;
121
- if (!_mongocrypt_parse_optional_endpoint (bson,
122
- "endpoint",
123
- &kek->provider.gcp.endpoint,
124
- NULL /* opts */,
125
- status)) {
126
- goto done;
127
- }
99
+ if (!_mongocrypt_check_allowed_fields(bson,
100
+ NULL,
101
+ status,
102
+ "provider",
103
+ "keyVaultEndpoint",
104
+ "keyName",
105
+ "keyVersion")) {
106
+ goto done;
107
+ }
108
+ } else if (0 == strcmp(kms_provider, "gcp")) {
109
+ kek->kms_provider = MONGOCRYPT_KMS_PROVIDER_GCP;
110
+ if (!_mongocrypt_parse_optional_endpoint(bson,
111
+ "endpoint",
112
+ &kek->provider.gcp.endpoint,
113
+ NULL /* opts */,
114
+ status)) {
115
+ goto done;
116
+ }
128
117
 
129
- if (!_mongocrypt_parse_required_utf8 (
130
- bson, "projectId", &kek->provider.gcp.project_id, status)) {
131
- goto done;
132
- }
118
+ if (!_mongocrypt_parse_required_utf8(bson, "projectId", &kek->provider.gcp.project_id, status)) {
119
+ goto done;
120
+ }
133
121
 
134
- if (!_mongocrypt_parse_required_utf8 (
135
- bson, "location", &kek->provider.gcp.location, status)) {
136
- goto done;
137
- }
122
+ if (!_mongocrypt_parse_required_utf8(bson, "location", &kek->provider.gcp.location, status)) {
123
+ goto done;
124
+ }
138
125
 
139
- if (!_mongocrypt_parse_required_utf8 (
140
- bson, "keyRing", &kek->provider.gcp.key_ring, status)) {
141
- goto done;
142
- }
126
+ if (!_mongocrypt_parse_required_utf8(bson, "keyRing", &kek->provider.gcp.key_ring, status)) {
127
+ goto done;
128
+ }
143
129
 
144
- if (!_mongocrypt_parse_required_utf8 (
145
- bson, "keyName", &kek->provider.gcp.key_name, status)) {
146
- goto done;
147
- }
130
+ if (!_mongocrypt_parse_required_utf8(bson, "keyName", &kek->provider.gcp.key_name, status)) {
131
+ goto done;
132
+ }
148
133
 
149
- if (!_mongocrypt_parse_optional_utf8 (
150
- bson, "keyVersion", &kek->provider.gcp.key_version, status)) {
151
- goto done;
152
- }
153
- if (!_mongocrypt_check_allowed_fields (bson,
154
- NULL,
155
- status,
156
- "provider",
157
- "endpoint",
158
- "projectId",
159
- "location",
160
- "keyRing",
161
- "keyName",
162
- "keyVersion")) {
163
- goto done;
164
- }
165
- } else if (0 == strcmp (kms_provider, "kmip")) {
166
- kek->kms_provider = MONGOCRYPT_KMS_PROVIDER_KMIP;
167
- _mongocrypt_endpoint_parse_opts_t opts = {0};
134
+ if (!_mongocrypt_parse_optional_utf8(bson, "keyVersion", &kek->provider.gcp.key_version, status)) {
135
+ goto done;
136
+ }
137
+ if (!_mongocrypt_check_allowed_fields(bson,
138
+ NULL,
139
+ status,
140
+ "provider",
141
+ "endpoint",
142
+ "projectId",
143
+ "location",
144
+ "keyRing",
145
+ "keyName",
146
+ "keyVersion")) {
147
+ goto done;
148
+ }
149
+ } else if (0 == strcmp(kms_provider, "kmip")) {
150
+ kek->kms_provider = MONGOCRYPT_KMS_PROVIDER_KMIP;
151
+ _mongocrypt_endpoint_parse_opts_t opts = {0};
168
152
 
169
- opts.allow_empty_subdomain = true;
170
- if (!_mongocrypt_parse_optional_endpoint (
171
- bson, "endpoint", &kek->provider.kmip.endpoint, &opts, status)) {
172
- goto done;
173
- }
153
+ opts.allow_empty_subdomain = true;
154
+ if (!_mongocrypt_parse_optional_endpoint(bson, "endpoint", &kek->provider.kmip.endpoint, &opts, status)) {
155
+ goto done;
156
+ }
174
157
 
175
- if (!_mongocrypt_parse_optional_utf8 (
176
- bson, "keyId", &kek->provider.kmip.key_id, status)) {
177
- goto done;
178
- }
158
+ if (!_mongocrypt_parse_optional_utf8(bson, "keyId", &kek->provider.kmip.key_id, status)) {
159
+ goto done;
160
+ }
179
161
 
180
- if (!_mongocrypt_check_allowed_fields (
181
- bson, NULL, status, "provider", "endpoint", "keyId")) {
182
- goto done;
183
- }
184
- } else {
185
- CLIENT_ERR ("unrecognized KMS provider: %s", kms_provider);
186
- goto done;
187
- }
162
+ if (!_mongocrypt_check_allowed_fields(bson, NULL, status, "provider", "endpoint", "keyId")) {
163
+ goto done;
164
+ }
165
+ } else {
166
+ CLIENT_ERR("unrecognized KMS provider: %s", kms_provider);
167
+ goto done;
168
+ }
188
169
 
189
- ret = true;
170
+ ret = true;
190
171
  done:
191
- bson_free (kms_provider);
192
- return ret;
172
+ bson_free(kms_provider);
173
+ return ret;
193
174
  }
194
175
 
195
- bool
196
- _mongocrypt_kek_append (const _mongocrypt_kek_t *kek,
197
- bson_t *bson,
198
- mongocrypt_status_t *status)
199
- {
200
- BSON_ASSERT_PARAM (kek);
201
- BSON_ASSERT_PARAM (bson);
176
+ bool _mongocrypt_kek_append(const _mongocrypt_kek_t *kek, bson_t *bson, mongocrypt_status_t *status) {
177
+ BSON_ASSERT_PARAM(kek);
178
+ BSON_ASSERT_PARAM(bson);
202
179
 
203
- if (kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_AWS) {
204
- BSON_APPEND_UTF8 (bson, "provider", "aws");
205
- BSON_APPEND_UTF8 (bson, "region", kek->provider.aws.region);
206
- BSON_APPEND_UTF8 (bson, "key", kek->provider.aws.cmk);
207
- if (kek->provider.aws.endpoint) {
208
- BSON_APPEND_UTF8 (
209
- bson, "endpoint", kek->provider.aws.endpoint->host_and_port);
210
- }
211
- } else if (kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_LOCAL) {
212
- BSON_APPEND_UTF8 (bson, "provider", "local");
213
- } else if (kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_AZURE) {
214
- BSON_APPEND_UTF8 (bson, "provider", "azure");
215
- BSON_APPEND_UTF8 (bson,
216
- "keyVaultEndpoint",
217
- kek->provider.azure.key_vault_endpoint->host_and_port);
218
- BSON_APPEND_UTF8 (bson, "keyName", kek->provider.azure.key_name);
219
- if (kek->provider.azure.key_version) {
220
- BSON_APPEND_UTF8 (bson, "keyVersion", kek->provider.azure.key_version);
221
- }
222
- } else if (kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_GCP) {
223
- BSON_APPEND_UTF8 (bson, "provider", "gcp");
224
- BSON_APPEND_UTF8 (bson, "projectId", kek->provider.gcp.project_id);
225
- BSON_APPEND_UTF8 (bson, "location", kek->provider.gcp.location);
226
- BSON_APPEND_UTF8 (bson, "keyRing", kek->provider.gcp.key_ring);
227
- BSON_APPEND_UTF8 (bson, "keyName", kek->provider.gcp.key_name);
228
- if (kek->provider.gcp.key_version) {
229
- BSON_APPEND_UTF8 (bson, "keyVersion", kek->provider.gcp.key_version);
230
- }
231
- if (kek->provider.gcp.endpoint) {
232
- BSON_APPEND_UTF8 (
233
- bson, "endpoint", kek->provider.gcp.endpoint->host_and_port);
234
- }
235
- } else if (kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_KMIP) {
236
- BSON_APPEND_UTF8 (bson, "provider", "kmip");
237
- if (kek->provider.kmip.endpoint) {
238
- BSON_APPEND_UTF8 (
239
- bson, "endpoint", kek->provider.kmip.endpoint->host_and_port);
240
- }
180
+ if (kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_AWS) {
181
+ BSON_APPEND_UTF8(bson, "provider", "aws");
182
+ BSON_APPEND_UTF8(bson, "region", kek->provider.aws.region);
183
+ BSON_APPEND_UTF8(bson, "key", kek->provider.aws.cmk);
184
+ if (kek->provider.aws.endpoint) {
185
+ BSON_APPEND_UTF8(bson, "endpoint", kek->provider.aws.endpoint->host_and_port);
186
+ }
187
+ } else if (kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_LOCAL) {
188
+ BSON_APPEND_UTF8(bson, "provider", "local");
189
+ } else if (kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_AZURE) {
190
+ BSON_APPEND_UTF8(bson, "provider", "azure");
191
+ BSON_APPEND_UTF8(bson, "keyVaultEndpoint", kek->provider.azure.key_vault_endpoint->host_and_port);
192
+ BSON_APPEND_UTF8(bson, "keyName", kek->provider.azure.key_name);
193
+ if (kek->provider.azure.key_version) {
194
+ BSON_APPEND_UTF8(bson, "keyVersion", kek->provider.azure.key_version);
195
+ }
196
+ } else if (kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_GCP) {
197
+ BSON_APPEND_UTF8(bson, "provider", "gcp");
198
+ BSON_APPEND_UTF8(bson, "projectId", kek->provider.gcp.project_id);
199
+ BSON_APPEND_UTF8(bson, "location", kek->provider.gcp.location);
200
+ BSON_APPEND_UTF8(bson, "keyRing", kek->provider.gcp.key_ring);
201
+ BSON_APPEND_UTF8(bson, "keyName", kek->provider.gcp.key_name);
202
+ if (kek->provider.gcp.key_version) {
203
+ BSON_APPEND_UTF8(bson, "keyVersion", kek->provider.gcp.key_version);
204
+ }
205
+ if (kek->provider.gcp.endpoint) {
206
+ BSON_APPEND_UTF8(bson, "endpoint", kek->provider.gcp.endpoint->host_and_port);
207
+ }
208
+ } else if (kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_KMIP) {
209
+ BSON_APPEND_UTF8(bson, "provider", "kmip");
210
+ if (kek->provider.kmip.endpoint) {
211
+ BSON_APPEND_UTF8(bson, "endpoint", kek->provider.kmip.endpoint->host_and_port);
212
+ }
241
213
 
242
- /* "keyId" is required in the final data key document for the "kmip" KMS
243
- * provider. It may be set from the "kmip.keyId" in the BSON document set
244
- * in mongocrypt_ctx_setopt_key_encryption_key, Otherwise, libmongocrypt
245
- * is expected to set "keyId". */
246
- if (kek->provider.kmip.key_id) {
247
- BSON_APPEND_UTF8 (bson, "keyId", kek->provider.kmip.key_id);
248
- } else {
249
- CLIENT_ERR ("keyId required for KMIP");
250
- return false;
251
- }
252
- } else {
253
- BSON_ASSERT (kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_NONE);
254
- }
255
- return true;
214
+ /* "keyId" is required in the final data key document for the "kmip" KMS
215
+ * provider. It may be set from the "kmip.keyId" in the BSON document set
216
+ * in mongocrypt_ctx_setopt_key_encryption_key, Otherwise, libmongocrypt
217
+ * is expected to set "keyId". */
218
+ if (kek->provider.kmip.key_id) {
219
+ BSON_APPEND_UTF8(bson, "keyId", kek->provider.kmip.key_id);
220
+ } else {
221
+ CLIENT_ERR("keyId required for KMIP");
222
+ return false;
223
+ }
224
+ } else {
225
+ BSON_ASSERT(kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_NONE);
226
+ }
227
+ return true;
256
228
  }
257
229
 
258
- void
259
- _mongocrypt_kek_copy_to (const _mongocrypt_kek_t *src, _mongocrypt_kek_t *dst)
260
- {
261
- BSON_ASSERT_PARAM (src);
262
- BSON_ASSERT_PARAM (dst);
230
+ void _mongocrypt_kek_copy_to(const _mongocrypt_kek_t *src, _mongocrypt_kek_t *dst) {
231
+ BSON_ASSERT_PARAM(src);
232
+ BSON_ASSERT_PARAM(dst);
263
233
 
264
- if (src->kms_provider == MONGOCRYPT_KMS_PROVIDER_AWS) {
265
- dst->provider.aws.cmk = bson_strdup (src->provider.aws.cmk);
266
- dst->provider.aws.region = bson_strdup (src->provider.aws.region);
267
- dst->provider.aws.endpoint =
268
- _mongocrypt_endpoint_copy (src->provider.aws.endpoint);
269
- } else if (src->kms_provider == MONGOCRYPT_KMS_PROVIDER_AZURE) {
270
- dst->provider.azure.key_vault_endpoint =
271
- _mongocrypt_endpoint_copy (src->provider.azure.key_vault_endpoint);
272
- dst->provider.azure.key_name = bson_strdup (src->provider.azure.key_name);
273
- dst->provider.azure.key_version =
274
- bson_strdup (src->provider.azure.key_version);
275
- } else if (src->kms_provider == MONGOCRYPT_KMS_PROVIDER_GCP) {
276
- dst->provider.gcp.project_id = bson_strdup (src->provider.gcp.project_id);
277
- dst->provider.gcp.location = bson_strdup (src->provider.gcp.location);
278
- dst->provider.gcp.key_ring = bson_strdup (src->provider.gcp.key_ring);
279
- dst->provider.gcp.key_name = bson_strdup (src->provider.gcp.key_name);
280
- dst->provider.gcp.key_version =
281
- bson_strdup (src->provider.gcp.key_version);
282
- dst->provider.gcp.endpoint =
283
- _mongocrypt_endpoint_copy (src->provider.gcp.endpoint);
284
- } else if (src->kms_provider == MONGOCRYPT_KMS_PROVIDER_KMIP) {
285
- dst->provider.kmip.endpoint =
286
- _mongocrypt_endpoint_copy (src->provider.kmip.endpoint);
287
- dst->provider.kmip.key_id = bson_strdup (src->provider.kmip.key_id);
288
- } else {
289
- BSON_ASSERT (src->kms_provider == MONGOCRYPT_KMS_PROVIDER_NONE ||
290
- src->kms_provider == MONGOCRYPT_KMS_PROVIDER_LOCAL);
291
- }
292
- dst->kms_provider = src->kms_provider;
234
+ if (src->kms_provider == MONGOCRYPT_KMS_PROVIDER_AWS) {
235
+ dst->provider.aws.cmk = bson_strdup(src->provider.aws.cmk);
236
+ dst->provider.aws.region = bson_strdup(src->provider.aws.region);
237
+ dst->provider.aws.endpoint = _mongocrypt_endpoint_copy(src->provider.aws.endpoint);
238
+ } else if (src->kms_provider == MONGOCRYPT_KMS_PROVIDER_AZURE) {
239
+ dst->provider.azure.key_vault_endpoint = _mongocrypt_endpoint_copy(src->provider.azure.key_vault_endpoint);
240
+ dst->provider.azure.key_name = bson_strdup(src->provider.azure.key_name);
241
+ dst->provider.azure.key_version = bson_strdup(src->provider.azure.key_version);
242
+ } else if (src->kms_provider == MONGOCRYPT_KMS_PROVIDER_GCP) {
243
+ dst->provider.gcp.project_id = bson_strdup(src->provider.gcp.project_id);
244
+ dst->provider.gcp.location = bson_strdup(src->provider.gcp.location);
245
+ dst->provider.gcp.key_ring = bson_strdup(src->provider.gcp.key_ring);
246
+ dst->provider.gcp.key_name = bson_strdup(src->provider.gcp.key_name);
247
+ dst->provider.gcp.key_version = bson_strdup(src->provider.gcp.key_version);
248
+ dst->provider.gcp.endpoint = _mongocrypt_endpoint_copy(src->provider.gcp.endpoint);
249
+ } else if (src->kms_provider == MONGOCRYPT_KMS_PROVIDER_KMIP) {
250
+ dst->provider.kmip.endpoint = _mongocrypt_endpoint_copy(src->provider.kmip.endpoint);
251
+ dst->provider.kmip.key_id = bson_strdup(src->provider.kmip.key_id);
252
+ } else {
253
+ BSON_ASSERT(src->kms_provider == MONGOCRYPT_KMS_PROVIDER_NONE
254
+ || src->kms_provider == MONGOCRYPT_KMS_PROVIDER_LOCAL);
255
+ }
256
+ dst->kms_provider = src->kms_provider;
293
257
  }
294
258
 
295
- void
296
- _mongocrypt_kek_cleanup (_mongocrypt_kek_t *kek)
297
- {
298
- if (!kek) {
299
- return;
300
- }
259
+ void _mongocrypt_kek_cleanup(_mongocrypt_kek_t *kek) {
260
+ if (!kek) {
261
+ return;
262
+ }
301
263
 
302
- if (kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_AWS) {
303
- bson_free (kek->provider.aws.cmk);
304
- bson_free (kek->provider.aws.region);
305
- _mongocrypt_endpoint_destroy (kek->provider.aws.endpoint);
306
- } else if (kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_AZURE) {
307
- _mongocrypt_endpoint_destroy (kek->provider.azure.key_vault_endpoint);
308
- bson_free (kek->provider.azure.key_name);
309
- bson_free (kek->provider.azure.key_version);
310
- } else if (kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_GCP) {
311
- bson_free (kek->provider.gcp.project_id);
312
- bson_free (kek->provider.gcp.location);
313
- bson_free (kek->provider.gcp.key_ring);
314
- bson_free (kek->provider.gcp.key_name);
315
- bson_free (kek->provider.gcp.key_version);
316
- _mongocrypt_endpoint_destroy (kek->provider.gcp.endpoint);
317
- } else if (kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_KMIP) {
318
- bson_free (kek->provider.kmip.key_id);
319
- _mongocrypt_endpoint_destroy (kek->provider.kmip.endpoint);
320
- } else {
321
- BSON_ASSERT (kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_NONE ||
322
- kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_LOCAL);
323
- }
324
- return;
264
+ if (kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_AWS) {
265
+ bson_free(kek->provider.aws.cmk);
266
+ bson_free(kek->provider.aws.region);
267
+ _mongocrypt_endpoint_destroy(kek->provider.aws.endpoint);
268
+ } else if (kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_AZURE) {
269
+ _mongocrypt_endpoint_destroy(kek->provider.azure.key_vault_endpoint);
270
+ bson_free(kek->provider.azure.key_name);
271
+ bson_free(kek->provider.azure.key_version);
272
+ } else if (kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_GCP) {
273
+ bson_free(kek->provider.gcp.project_id);
274
+ bson_free(kek->provider.gcp.location);
275
+ bson_free(kek->provider.gcp.key_ring);
276
+ bson_free(kek->provider.gcp.key_name);
277
+ bson_free(kek->provider.gcp.key_version);
278
+ _mongocrypt_endpoint_destroy(kek->provider.gcp.endpoint);
279
+ } else if (kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_KMIP) {
280
+ bson_free(kek->provider.kmip.key_id);
281
+ _mongocrypt_endpoint_destroy(kek->provider.kmip.endpoint);
282
+ } else {
283
+ BSON_ASSERT(kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_NONE
284
+ || kek->kms_provider == MONGOCRYPT_KMS_PROVIDER_LOCAL);
285
+ }
286
+ return;
325
287
  }