libmongocrypt-helper 1.7.0.0.1001 → 1.7.4.0.1000

Sign up to get free protection for your applications and to get access to all the features.
Files changed (991) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/ext/libmongocrypt/extconf.rb +70 -0
  4. data/ext/libmongocrypt/libmongocrypt/CHANGELOG.md +164 -0
  5. data/ext/libmongocrypt/libmongocrypt/CMakeLists.txt +699 -0
  6. data/ext/libmongocrypt/libmongocrypt/CODEOWNERS +13 -0
  7. data/ext/libmongocrypt/libmongocrypt/LICENSE +201 -0
  8. data/ext/libmongocrypt/libmongocrypt/README.md +250 -0
  9. data/ext/libmongocrypt/libmongocrypt/VERSION_CURRENT +1 -0
  10. data/ext/libmongocrypt/libmongocrypt/bindings/cs/CMakeLists.txt +16 -0
  11. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/AssemblyInfo.cs +4 -0
  12. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/Binary.cs +131 -0
  13. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/BinarySafeHandle.cs +60 -0
  14. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CheckableSafeHandle.cs +46 -0
  15. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CipherCallbacks.cs +168 -0
  16. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/ContextSafeHandle.cs +48 -0
  17. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptClient.cs +238 -0
  18. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptClientFactory.cs +134 -0
  19. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptContext.cs +214 -0
  20. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptException.cs +37 -0
  21. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptOptions.cs +67 -0
  22. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/HashCallback.cs +59 -0
  23. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/HmacShaCallbacks.cs +96 -0
  24. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/IStatus.cs +26 -0
  25. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/KmsCredentials.cs +53 -0
  26. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/KmsKeyId.cs +91 -0
  27. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/KmsRequest.cs +125 -0
  28. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/KmsRequestCollection.cs +60 -0
  29. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/Library.cs +652 -0
  30. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/LibraryLoader.cs +252 -0
  31. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/LibraryLoadingException.cs +34 -0
  32. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/License.txt +14 -0
  33. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/LogLevel.cs +26 -0
  34. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/MongoCryptSafeHandle.cs +48 -0
  35. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/MongoDB.Libmongocrypt.csproj +106 -0
  36. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/MongoDB.Libmongocrypt.ruleset +85 -0
  37. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/MongoDB.Libmongocrypt.targets +21 -0
  38. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/OperatingSystemHelper.cs +59 -0
  39. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/Package.include.template.csproj +38 -0
  40. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/PinnedBinary.cs +49 -0
  41. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/SecureRandomCallback.cs +51 -0
  42. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/SigningRSAESPKCSCallback.cs +74 -0
  43. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/Status.cs +94 -0
  44. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/StatusSafeHandle.cs +60 -0
  45. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/StyleCop.ruleset +11 -0
  46. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/stylecop.json +8 -0
  47. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Example/MongoDB.Libmongocrypt.Example.csproj +23 -0
  48. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Example/Package.include.template.csproj +11 -0
  49. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Example/Program.cs +442 -0
  50. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/BasicTests.cs +748 -0
  51. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/BsonUtil.cs +82 -0
  52. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/CallbackUtils.cs +37 -0
  53. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/CipherCallbacksTests.cs +46 -0
  54. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/HashCallbackTests.cs +37 -0
  55. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/HmacShaCallbacksTests.cs +37 -0
  56. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/MongoDB.Libmongocrypt.Test.csproj +35 -0
  57. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/Package.include.template.csproj +23 -0
  58. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/SigningRSAESPKCSCallbackTests.cs +64 -0
  59. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/collection-info.json +37 -0
  60. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/command-reply.json +13 -0
  61. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/encrypted-command-reply.json +16 -0
  62. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/encrypted-command.json +11 -0
  63. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/encrypted-value.json +6 -0
  64. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/key-document.json +36 -0
  65. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/key-filter.json +19 -0
  66. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/list-collections-filter.json +3 -0
  67. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/mongocryptd-command.json +22 -0
  68. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/xunit.runner.json +6 -0
  69. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test32/BasicTests.cs +54 -0
  70. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test32/MongoDB.Libmongocrypt.Test32.csproj +42 -0
  71. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test32/Package.include.template.csproj +23 -0
  72. data/ext/libmongocrypt/libmongocrypt/bindings/cs/README.md +66 -0
  73. data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.cake +219 -0
  74. data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.ps1 +275 -0
  75. data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.sh +77 -0
  76. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/README.md +36 -0
  77. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/build.gradle.kts +339 -0
  78. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradle/wrapper/gradle-wrapper.jar +0 -0
  79. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradle/wrapper/gradle-wrapper.properties +5 -0
  80. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradlew +188 -0
  81. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradlew.bat +100 -0
  82. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/BinaryHolder.java +45 -0
  83. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/CAPI.java +1130 -0
  84. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/CAPIHelper.java +96 -0
  85. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/CipherCallback.java +66 -0
  86. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/DisposableMemory.java +31 -0
  87. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/JULLogger.java +130 -0
  88. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/Logger.java +144 -0
  89. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/Loggers.java +50 -0
  90. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MacCallback.java +60 -0
  91. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MessageDigestCallback.java +55 -0
  92. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoAwsKmsProviderOptions.java +104 -0
  93. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCrypt.java +100 -0
  94. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCryptContext.java +137 -0
  95. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCryptContextImpl.java +164 -0
  96. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCryptException.java +67 -0
  97. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCryptImpl.java +408 -0
  98. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCryptOptions.java +284 -0
  99. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCrypts.java +38 -0
  100. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoDataKeyOptions.java +125 -0
  101. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoExplicitEncryptOptions.java +225 -0
  102. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoKeyDecryptor.java +76 -0
  103. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoKeyDecryptorImpl.java +105 -0
  104. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoLocalKmsProviderOptions.java +83 -0
  105. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoRewrapManyDataKeyOptions.java +104 -0
  106. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/SLF4JLogger.java +110 -0
  107. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/SecureRandomCallback.java +51 -0
  108. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/SigningRSAESPKCSCallback.java +76 -0
  109. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/package-info.java +18 -0
  110. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/java/com/mongodb/crypt/capi/MongoCryptTest.java +345 -0
  111. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/collection-info.json +37 -0
  112. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/command-reply.json +13 -0
  113. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/command.json +6 -0
  114. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/encrypted-command-reply.json +16 -0
  115. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/encrypted-command.json +11 -0
  116. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/encrypted-value.json +6 -0
  117. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit/int32/encrypted-payload.json +26 -0
  118. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit/int32/key-document.json +0 -0
  119. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit/int32/key-filter.json +19 -0
  120. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit/int32/rangeopts.json +11 -0
  121. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit/int32/value-to-encrypt.json +20 -0
  122. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/json-schema.json +15 -0
  123. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/key-document.json +36 -0
  124. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/key-filter-keyAltName.json +14 -0
  125. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/key-filter.json +19 -0
  126. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/keys/ABCDEFAB123498761234123456789012-local-document.json +30 -0
  127. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/kms-reply.txt +6 -0
  128. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/list-collections-filter.json +3 -0
  129. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/mongocryptd-command.json +22 -0
  130. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/mongocryptd-reply.json +18 -0
  131. data/ext/libmongocrypt/libmongocrypt/bindings/node/CHANGELOG.md +81 -0
  132. data/ext/libmongocrypt/libmongocrypt/bindings/node/LICENSE +201 -0
  133. data/ext/libmongocrypt/libmongocrypt/bindings/node/README.md +773 -0
  134. data/ext/libmongocrypt/libmongocrypt/bindings/node/binding.gyp +79 -0
  135. data/ext/libmongocrypt/libmongocrypt/bindings/node/etc/README.hbs +44 -0
  136. data/ext/libmongocrypt/libmongocrypt/bindings/node/etc/build-static.sh +39 -0
  137. data/ext/libmongocrypt/libmongocrypt/bindings/node/index.d.ts +515 -0
  138. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/autoEncrypter.js +420 -0
  139. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/buffer_pool.js +123 -0
  140. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/clientEncryption.js +699 -0
  141. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/common.js +100 -0
  142. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/credentialsProvider.js +33 -0
  143. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/cryptoCallbacks.js +87 -0
  144. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/index.js +42 -0
  145. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/mongocryptdManager.js +66 -0
  146. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/stateMachine.js +487 -0
  147. data/ext/libmongocrypt/libmongocrypt/bindings/node/package-lock.json +16051 -0
  148. data/ext/libmongocrypt/libmongocrypt/bindings/node/package.json +81 -0
  149. data/ext/libmongocrypt/libmongocrypt/bindings/node/src/mongocrypt.cc +929 -0
  150. data/ext/libmongocrypt/libmongocrypt/bindings/node/src/mongocrypt.h +114 -0
  151. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/autoEncrypter.test.js +953 -0
  152. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/buffer_pool.test.js +91 -0
  153. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/clientEncryption.test.js +701 -0
  154. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/credentialsProvider.test.js +163 -0
  155. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/cryptoCallbacks.test.js +284 -0
  156. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/README.md +5 -0
  157. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/cmd.json +6 -0
  158. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/collection-info.json +37 -0
  159. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/encrypted-document-nested.json +8 -0
  160. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/encrypted-document.json +11 -0
  161. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/encryptedFields.json +30 -0
  162. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/key-document.json +32 -0
  163. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/key1-document.json +30 -0
  164. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/kms-decrypt-reply.txt +6 -0
  165. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/kms-encrypt-reply.txt +7 -0
  166. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/mongocryptd-reply.json +18 -0
  167. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/mongocryptdManager.test.js +48 -0
  168. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/release.test.js +59 -0
  169. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/requirements.helper.js +29 -0
  170. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/stateMachine.test.js +331 -0
  171. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/tools/mongodb_reporter.js +325 -0
  172. data/ext/libmongocrypt/libmongocrypt/bindings/python/CHANGELOG.rst +121 -0
  173. data/ext/libmongocrypt/libmongocrypt/bindings/python/LICENSE +201 -0
  174. data/ext/libmongocrypt/libmongocrypt/bindings/python/README.rst +187 -0
  175. data/ext/libmongocrypt/libmongocrypt/bindings/python/RELEASE.rst +107 -0
  176. data/ext/libmongocrypt/libmongocrypt/bindings/python/build-manylinux-wheel.sh +16 -0
  177. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/__init__.py +16 -0
  178. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/auto_encrypter.py +61 -0
  179. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/binary.py +94 -0
  180. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/binding.py +1561 -0
  181. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/compat.py +61 -0
  182. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/credentials.py +136 -0
  183. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/crypto.py +162 -0
  184. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/errors.py +39 -0
  185. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/explicit_encrypter.py +248 -0
  186. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/mongocrypt.py +808 -0
  187. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/state_machine.py +156 -0
  188. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/version.py +17 -0
  189. data/ext/libmongocrypt/libmongocrypt/bindings/python/release.sh +92 -0
  190. data/ext/libmongocrypt/libmongocrypt/bindings/python/setup.py +84 -0
  191. data/ext/libmongocrypt/libmongocrypt/bindings/python/strip_header.py +51 -0
  192. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/__init__.py +37 -0
  193. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/collection-info.json +39 -0
  194. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/command-reply.json +13 -0
  195. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/command.json +6 -0
  196. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/compact/success/cmd.json +1 -0
  197. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/compact/success/encrypted-field-config-map.json +47 -0
  198. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/compact/success/encrypted-payload.json +23 -0
  199. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/encrypted-command-reply.json +16 -0
  200. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/encrypted-command.json +13 -0
  201. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/encrypted-field-config-map.json +48 -0
  202. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/encrypted-value.json +6 -0
  203. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-range-explicit/int32/encrypted-payload.json +26 -0
  204. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-range-explicit/int32/rangeopts.json +11 -0
  205. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-range-explicit/int32/value-to-encrypt.json +20 -0
  206. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-document-azure.json +33 -0
  207. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-document-gcp.json +35 -0
  208. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-document.json +33 -0
  209. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-filter.json +19 -0
  210. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/keys/12345678123498761234123456789012-local-document.json +30 -0
  211. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/keys/12345678123498761234123456789013-local-document.json +30 -0
  212. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/keys/ABCDEFAB123498761234123456789012-local-document.json +30 -0
  213. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/kms-encrypt-reply.txt +7 -0
  214. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/kms-reply-azure.txt +6 -0
  215. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/kms-reply-gcp.txt +6 -0
  216. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/kms-reply.txt +6 -0
  217. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/list-collections-filter.json +3 -0
  218. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/mongocryptd-command.json +26 -0
  219. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/mongocryptd-reply.json +20 -0
  220. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/schema-map.json +40 -0
  221. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_binding.py +71 -0
  222. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_crypto.py +49 -0
  223. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_mongocrypt.py +825 -0
  224. data/ext/libmongocrypt/libmongocrypt/bindings/python/test-requirements.txt +12 -0
  225. data/ext/libmongocrypt/libmongocrypt/cmake/FetchMongoC.cmake +20 -0
  226. data/ext/libmongocrypt/libmongocrypt/cmake/ImportBSON.cmake +209 -0
  227. data/ext/libmongocrypt/libmongocrypt/cmake/ImportDFP.cmake +70 -0
  228. data/ext/libmongocrypt/libmongocrypt/cmake/IntelDFP.cmake +409 -0
  229. data/ext/libmongocrypt/libmongocrypt/cmake/LTO.cmake +57 -0
  230. data/ext/libmongocrypt/libmongocrypt/cmake/MongoC-Warnings.cmake +74 -0
  231. data/ext/libmongocrypt/libmongocrypt/cmake/libmongocrypt-hidden-symbols.map +8 -0
  232. data/ext/libmongocrypt/libmongocrypt/cmake/libmongocrypt-hidden-symbols.txt +5 -0
  233. data/ext/libmongocrypt/libmongocrypt/cmake/libmongocrypt-static.pc.in +9 -0
  234. data/ext/libmongocrypt/libmongocrypt/cmake/libmongocrypt.pc.in +10 -0
  235. data/ext/libmongocrypt/libmongocrypt/cmake/ltocheck-lib.c +6 -0
  236. data/ext/libmongocrypt/libmongocrypt/cmake/ltocheck-main.c +9 -0
  237. data/ext/libmongocrypt/libmongocrypt/cmake/mongocrypt-config.cmake +42 -0
  238. data/ext/libmongocrypt/libmongocrypt/debian/build_snapshot.sh +79 -0
  239. data/ext/libmongocrypt/libmongocrypt/debian/changelog +105 -0
  240. data/ext/libmongocrypt/libmongocrypt/debian/compat +1 -0
  241. data/ext/libmongocrypt/libmongocrypt/debian/control +41 -0
  242. data/ext/libmongocrypt/libmongocrypt/debian/copyright +129 -0
  243. data/ext/libmongocrypt/libmongocrypt/debian/gbp.conf +23 -0
  244. data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt-dev.dirs +2 -0
  245. data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt-dev.install +5 -0
  246. data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt0.dirs +1 -0
  247. data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt0.install +1 -0
  248. data/ext/libmongocrypt/libmongocrypt/debian/rules +46 -0
  249. data/ext/libmongocrypt/libmongocrypt/debian/source/format +1 -0
  250. data/ext/libmongocrypt/libmongocrypt/debian/source/lintian-overrides +3 -0
  251. data/ext/libmongocrypt/libmongocrypt/debian/source/options +1 -0
  252. data/ext/libmongocrypt/libmongocrypt/debian/watch +3 -0
  253. data/ext/libmongocrypt/libmongocrypt/doc/Doxygen +2474 -0
  254. data/ext/libmongocrypt/libmongocrypt/etc/calc_release_version.py +265 -0
  255. data/ext/libmongocrypt/libmongocrypt/etc/debian/control +33 -0
  256. data/ext/libmongocrypt/libmongocrypt/etc/debian/rules +41 -0
  257. data/ext/libmongocrypt/libmongocrypt/etc/debian/source/format +1 -0
  258. data/ext/libmongocrypt/libmongocrypt/etc/fle2_aead_generate_tests.py +41 -0
  259. data/ext/libmongocrypt/libmongocrypt/etc/fle2_crypto.py +105 -0
  260. data/ext/libmongocrypt/libmongocrypt/etc/fle2_crypto_selftest.py +52 -0
  261. data/ext/libmongocrypt/libmongocrypt/etc/fle2_generate_tests.py +34 -0
  262. data/ext/libmongocrypt/libmongocrypt/etc/generate-kek-tests.py +69 -0
  263. data/ext/libmongocrypt/libmongocrypt/etc/generate-test-data.py +141 -0
  264. data/ext/libmongocrypt/libmongocrypt/etc/list-compile-files.py +20 -0
  265. data/ext/libmongocrypt/libmongocrypt/etc/mongo-inteldfp-MONGOCRYPT-571.patch +25 -0
  266. data/ext/libmongocrypt/libmongocrypt/etc/mongo-inteldfp-s390x.patch +134 -0
  267. data/ext/libmongocrypt/libmongocrypt/etc/packager.py +854 -0
  268. data/ext/libmongocrypt/libmongocrypt/etc/print-marking.py +36 -0
  269. data/ext/libmongocrypt/libmongocrypt/etc/repo_config.yaml +257 -0
  270. data/ext/libmongocrypt/libmongocrypt/etc/requirements.txt +2 -0
  271. data/ext/libmongocrypt/libmongocrypt/etc/rewrite.py +16 -0
  272. data/ext/libmongocrypt/libmongocrypt/etc/rpm/libmongocrypt.spec +67 -0
  273. data/ext/libmongocrypt/libmongocrypt/etc/rpm/tweak.awk +19 -0
  274. data/ext/libmongocrypt/libmongocrypt/integrating.md +251 -0
  275. data/ext/libmongocrypt/libmongocrypt/kms-message/CMakeLists.txt +305 -0
  276. data/ext/libmongocrypt/libmongocrypt/kms-message/COPYING +177 -0
  277. data/ext/libmongocrypt/libmongocrypt/kms-message/README.md +41 -0
  278. data/ext/libmongocrypt/libmongocrypt/kms-message/THIRD_PARTY_NOTICES +42 -0
  279. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/LICENSE +202 -0
  280. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/NOTICE +2 -0
  281. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-key-duplicate/get-header-key-duplicate.authz +1 -0
  282. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-key-duplicate/get-header-key-duplicate.creq +9 -0
  283. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-key-duplicate/get-header-key-duplicate.req +6 -0
  284. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-key-duplicate/get-header-key-duplicate.sreq +7 -0
  285. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-key-duplicate/get-header-key-duplicate.sts +4 -0
  286. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-multiline/get-header-value-multiline.authz +1 -0
  287. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-multiline/get-header-value-multiline.creq +9 -0
  288. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-multiline/get-header-value-multiline.req +6 -0
  289. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-multiline/get-header-value-multiline.sreq +7 -0
  290. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-multiline/get-header-value-multiline.sts +4 -0
  291. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-order/get-header-value-order.authz +1 -0
  292. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-order/get-header-value-order.creq +9 -0
  293. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-order/get-header-value-order.req +7 -0
  294. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-order/get-header-value-order.sreq +8 -0
  295. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-order/get-header-value-order.sts +4 -0
  296. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-trim/get-header-value-trim.authz +1 -0
  297. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-trim/get-header-value-trim.creq +10 -0
  298. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-trim/get-header-value-trim.req +5 -0
  299. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-trim/get-header-value-trim.sreq +6 -0
  300. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-trim/get-header-value-trim.sts +4 -0
  301. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-unreserved/get-unreserved.authz +1 -0
  302. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-unreserved/get-unreserved.creq +8 -0
  303. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-unreserved/get-unreserved.req +3 -0
  304. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-unreserved/get-unreserved.sreq +4 -0
  305. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-unreserved/get-unreserved.sts +4 -0
  306. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-utf8/get-utf8.authz +1 -0
  307. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-utf8/get-utf8.creq +8 -0
  308. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-utf8/get-utf8.req +3 -0
  309. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-utf8/get-utf8.sreq +4 -0
  310. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-utf8/get-utf8.sts +4 -0
  311. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla/get-vanilla.authz +1 -0
  312. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla/get-vanilla.creq +8 -0
  313. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla/get-vanilla.req +3 -0
  314. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla/get-vanilla.sreq +4 -0
  315. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla/get-vanilla.sts +4 -0
  316. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-empty-query-key/get-vanilla-empty-query-key.authz +1 -0
  317. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-empty-query-key/get-vanilla-empty-query-key.creq +8 -0
  318. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-empty-query-key/get-vanilla-empty-query-key.req +3 -0
  319. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-empty-query-key/get-vanilla-empty-query-key.sreq +4 -0
  320. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-empty-query-key/get-vanilla-empty-query-key.sts +4 -0
  321. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query/get-vanilla-query.authz +1 -0
  322. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query/get-vanilla-query.creq +8 -0
  323. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query/get-vanilla-query.req +3 -0
  324. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query/get-vanilla-query.sreq +4 -0
  325. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query/get-vanilla-query.sts +4 -0
  326. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-key/get-vanilla-query-order-key.authz +1 -0
  327. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-key/get-vanilla-query-order-key.creq +8 -0
  328. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-key/get-vanilla-query-order-key.req +3 -0
  329. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-key/get-vanilla-query-order-key.sreq +4 -0
  330. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-key/get-vanilla-query-order-key.sts +4 -0
  331. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-key-case/get-vanilla-query-order-key-case.authz +1 -0
  332. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-key-case/get-vanilla-query-order-key-case.creq +8 -0
  333. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-key-case/get-vanilla-query-order-key-case.req +3 -0
  334. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-key-case/get-vanilla-query-order-key-case.sreq +4 -0
  335. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-key-case/get-vanilla-query-order-key-case.sts +4 -0
  336. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-value/get-vanilla-query-order-value.authz +1 -0
  337. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-value/get-vanilla-query-order-value.creq +8 -0
  338. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-value/get-vanilla-query-order-value.req +3 -0
  339. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-value/get-vanilla-query-order-value.sreq +4 -0
  340. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-value/get-vanilla-query-order-value.sts +4 -0
  341. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-unreserved/get-vanilla-query-unreserved.authz +1 -0
  342. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-unreserved/get-vanilla-query-unreserved.creq +8 -0
  343. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-unreserved/get-vanilla-query-unreserved.req +3 -0
  344. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-unreserved/get-vanilla-query-unreserved.sreq +4 -0
  345. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-unreserved/get-vanilla-query-unreserved.sts +4 -0
  346. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-utf8-query/get-vanilla-utf8-query.authz +1 -0
  347. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-utf8-query/get-vanilla-utf8-query.creq +8 -0
  348. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-utf8-query/get-vanilla-utf8-query.req +3 -0
  349. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-utf8-query/get-vanilla-utf8-query.sreq +4 -0
  350. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-utf8-query/get-vanilla-utf8-query.sts +4 -0
  351. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-relative/get-relative.authz +1 -0
  352. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-relative/get-relative.creq +8 -0
  353. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-relative/get-relative.req +3 -0
  354. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-relative/get-relative.sreq +4 -0
  355. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-relative/get-relative.sts +4 -0
  356. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-relative-relative/get-relative-relative.authz +1 -0
  357. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-relative-relative/get-relative-relative.creq +8 -0
  358. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-relative-relative/get-relative-relative.req +3 -0
  359. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-relative-relative/get-relative-relative.sreq +4 -0
  360. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-relative-relative/get-relative-relative.sts +4 -0
  361. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash/get-slash.authz +1 -0
  362. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash/get-slash.creq +8 -0
  363. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash/get-slash.req +3 -0
  364. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash/get-slash.sreq +4 -0
  365. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash/get-slash.sts +4 -0
  366. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash-dot-slash/get-slash-dot-slash.authz +1 -0
  367. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash-dot-slash/get-slash-dot-slash.creq +8 -0
  368. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash-dot-slash/get-slash-dot-slash.req +3 -0
  369. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash-dot-slash/get-slash-dot-slash.sreq +4 -0
  370. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash-dot-slash/get-slash-dot-slash.sts +4 -0
  371. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash-pointless-dot/get-slash-pointless-dot.authz +1 -0
  372. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash-pointless-dot/get-slash-pointless-dot.creq +8 -0
  373. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash-pointless-dot/get-slash-pointless-dot.req +3 -0
  374. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash-pointless-dot/get-slash-pointless-dot.sreq +4 -0
  375. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash-pointless-dot/get-slash-pointless-dot.sts +4 -0
  376. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slashes/get-slashes.authz +1 -0
  377. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slashes/get-slashes.creq +8 -0
  378. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slashes/get-slashes.req +3 -0
  379. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slashes/get-slashes.sreq +4 -0
  380. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slashes/get-slashes.sts +4 -0
  381. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-space/get-space.authz +1 -0
  382. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-space/get-space.creq +8 -0
  383. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-space/get-space.req +3 -0
  384. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-space/get-space.sreq +4 -0
  385. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-space/get-space.sts +4 -0
  386. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/normalize-path.txt +3 -0
  387. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-key-case/post-header-key-case.authz +1 -0
  388. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-key-case/post-header-key-case.creq +8 -0
  389. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-key-case/post-header-key-case.req +3 -0
  390. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-key-case/post-header-key-case.sreq +4 -0
  391. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-key-case/post-header-key-case.sts +4 -0
  392. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-key-sort/post-header-key-sort.authz +1 -0
  393. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-key-sort/post-header-key-sort.creq +9 -0
  394. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-key-sort/post-header-key-sort.req +4 -0
  395. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-key-sort/post-header-key-sort.sreq +5 -0
  396. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-key-sort/post-header-key-sort.sts +4 -0
  397. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-value-case/post-header-value-case.authz +1 -0
  398. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-value-case/post-header-value-case.creq +9 -0
  399. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-value-case/post-header-value-case.req +4 -0
  400. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-value-case/post-header-value-case.sreq +5 -0
  401. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-value-case/post-header-value-case.sts +4 -0
  402. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-sts-token/post-sts-header-after/post-sts-header-after.authz +1 -0
  403. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-sts-token/post-sts-header-after/post-sts-header-after.creq +8 -0
  404. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-sts-token/post-sts-header-after/post-sts-header-after.req +3 -0
  405. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-sts-token/post-sts-header-after/post-sts-header-after.sreq +5 -0
  406. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-sts-token/post-sts-header-after/post-sts-header-after.sts +4 -0
  407. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-sts-token/post-sts-header-before/post-sts-header-before.authz +1 -0
  408. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-sts-token/post-sts-header-before/post-sts-header-before.creq +9 -0
  409. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-sts-token/post-sts-header-before/post-sts-header-before.req +4 -0
  410. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-sts-token/post-sts-header-before/post-sts-header-before.sreq +5 -0
  411. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-sts-token/post-sts-header-before/post-sts-header-before.sts +4 -0
  412. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-sts-token/readme.txt +15 -0
  413. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla/post-vanilla.authz +1 -0
  414. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla/post-vanilla.creq +8 -0
  415. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla/post-vanilla.req +3 -0
  416. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla/post-vanilla.sreq +4 -0
  417. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla/post-vanilla.sts +4 -0
  418. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla-empty-query-value/post-vanilla-empty-query-value.authz +1 -0
  419. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla-empty-query-value/post-vanilla-empty-query-value.creq +8 -0
  420. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla-empty-query-value/post-vanilla-empty-query-value.req +3 -0
  421. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla-empty-query-value/post-vanilla-empty-query-value.sreq +4 -0
  422. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla-empty-query-value/post-vanilla-empty-query-value.sts +4 -0
  423. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla-query/post-vanilla-query.authz +1 -0
  424. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla-query/post-vanilla-query.creq +8 -0
  425. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla-query/post-vanilla-query.req +3 -0
  426. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla-query/post-vanilla-query.sreq +4 -0
  427. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla-query/post-vanilla-query.sts +4 -0
  428. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-x-www-form-urlencoded/post-x-www-form-urlencoded.authz +1 -0
  429. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-x-www-form-urlencoded/post-x-www-form-urlencoded.creq +9 -0
  430. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-x-www-form-urlencoded/post-x-www-form-urlencoded.req +6 -0
  431. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-x-www-form-urlencoded/post-x-www-form-urlencoded.sreq +7 -0
  432. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-x-www-form-urlencoded/post-x-www-form-urlencoded.sts +4 -0
  433. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-x-www-form-urlencoded-parameters/post-x-www-form-urlencoded-parameters.authz +1 -0
  434. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-x-www-form-urlencoded-parameters/post-x-www-form-urlencoded-parameters.creq +9 -0
  435. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-x-www-form-urlencoded-parameters/post-x-www-form-urlencoded-parameters.req +6 -0
  436. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-x-www-form-urlencoded-parameters/post-x-www-form-urlencoded-parameters.sreq +7 -0
  437. data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-x-www-form-urlencoded-parameters/post-x-www-form-urlencoded-parameters.sts +4 -0
  438. data/ext/libmongocrypt/libmongocrypt/kms-message/cmake/kms_message-config.cmake +1 -0
  439. data/ext/libmongocrypt/libmongocrypt/kms-message/cmake/libkms_message.pc.in +9 -0
  440. data/ext/libmongocrypt/libmongocrypt/kms-message/src/hexlify.c +67 -0
  441. data/ext/libmongocrypt/libmongocrypt/kms-message/src/hexlify.h +24 -0
  442. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_azure_request.c +219 -0
  443. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_b64.c +654 -0
  444. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_caller_identity_request.c +52 -0
  445. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_crypto.h +70 -0
  446. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_crypto_apple.c +159 -0
  447. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_crypto_libcrypto.c +142 -0
  448. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_crypto_none.c +65 -0
  449. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_crypto_windows.c +268 -0
  450. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_decrypt_request.c +72 -0
  451. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_encrypt_request.c +73 -0
  452. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_endian_private.h +165 -0
  453. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_gcp_request.c +286 -0
  454. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_item_type_private.h +59 -0
  455. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_reader_writer.c +502 -0
  456. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_reader_writer_private.h +150 -0
  457. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_request.c +256 -0
  458. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_response.c +323 -0
  459. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_response_parser.c +148 -0
  460. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_response_parser_private.h +55 -0
  461. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_result_reason_private.h +77 -0
  462. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_result_status_private.h +54 -0
  463. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_tag_type_private.h +343 -0
  464. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kv_list.c +149 -0
  465. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kv_list.h +56 -0
  466. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_azure_request.h +110 -0
  467. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_b64.h +70 -0
  468. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_caller_identity_request.h +36 -0
  469. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_decrypt_request.h +37 -0
  470. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_encrypt_request.h +39 -0
  471. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_gcp_request.h +124 -0
  472. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_kmip_request.h +58 -0
  473. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_kmip_response.h +40 -0
  474. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_kmip_response_parser.h +26 -0
  475. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_message.h +34 -0
  476. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_message_defines.h +72 -0
  477. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_request.h +103 -0
  478. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_request_opt.h +80 -0
  479. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_response.h +43 -0
  480. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_response_parser.h +64 -0
  481. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message.c +47 -0
  482. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message_private.h +142 -0
  483. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_port.c +33 -0
  484. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_port.h +34 -0
  485. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request.c +925 -0
  486. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request_opt.c +88 -0
  487. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request_opt_private.h +32 -0
  488. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request_str.c +520 -0
  489. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request_str.h +89 -0
  490. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_response.c +54 -0
  491. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_response_parser.c +408 -0
  492. data/ext/libmongocrypt/libmongocrypt/kms-message/src/sort.c +74 -0
  493. data/ext/libmongocrypt/libmongocrypt/kms-message/src/sort.h +21 -0
  494. data/ext/libmongocrypt/libmongocrypt/kms-message/test/connection_close/connection_close.sreq +5 -0
  495. data/ext/libmongocrypt/libmongocrypt/kms-message/test/content_length/content_length.sreq +7 -0
  496. data/ext/libmongocrypt/libmongocrypt/kms-message/test/decrypt/decrypt.creq +11 -0
  497. data/ext/libmongocrypt/libmongocrypt/kms-message/test/decrypt/decrypt.sreq +9 -0
  498. data/ext/libmongocrypt/libmongocrypt/kms-message/test/encrypt/encrypt.creq +11 -0
  499. data/ext/libmongocrypt/libmongocrypt/kms-message/test/encrypt/encrypt.sreq +9 -0
  500. data/ext/libmongocrypt/libmongocrypt/kms-message/test/example-chunked-response.bin +20 -0
  501. data/ext/libmongocrypt/libmongocrypt/kms-message/test/example-multi-chunked-response.bin +22 -0
  502. data/ext/libmongocrypt/libmongocrypt/kms-message/test/example-response.bin +6 -0
  503. data/ext/libmongocrypt/libmongocrypt/kms-message/test/host/host.sreq +4 -0
  504. data/ext/libmongocrypt/libmongocrypt/kms-message/test/multibyte/multibyte.creq +10 -0
  505. data/ext/libmongocrypt/libmongocrypt/kms-message/test/multibyte/multibyte.sreq +8 -0
  506. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kmip_reader_writer.c +485 -0
  507. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_assert.h +147 -0
  508. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_azure_online.c +260 -0
  509. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_gcp_online.c +250 -0
  510. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_kmip_request.c +223 -0
  511. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_kmip_response.c +214 -0
  512. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_kmip_response_parser.c +197 -0
  513. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_online_util.c +120 -0
  514. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_online_util.h +35 -0
  515. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_request.c +1302 -0
  516. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_util.c +92 -0
  517. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_util.h +45 -0
  518. data/ext/libmongocrypt/libmongocrypt/kms-message/test/windows/dirent.h +1224 -0
  519. data/ext/libmongocrypt/libmongocrypt/src/crypto/cng.c +640 -0
  520. data/ext/libmongocrypt/libmongocrypt/src/crypto/commoncrypto.c +326 -0
  521. data/ext/libmongocrypt/libmongocrypt/src/crypto/libcrypto.c +341 -0
  522. data/ext/libmongocrypt/libmongocrypt/src/crypto/none.c +97 -0
  523. data/ext/libmongocrypt/libmongocrypt/src/csfle-markup.cpp +237 -0
  524. data/ext/libmongocrypt/libmongocrypt/src/mc-array-private.h +54 -0
  525. data/ext/libmongocrypt/libmongocrypt/src/mc-array.c +102 -0
  526. data/ext/libmongocrypt/libmongocrypt/src/mc-check-conversions-private.h +36 -0
  527. data/ext/libmongocrypt/libmongocrypt/src/mc-dec128.h +743 -0
  528. data/ext/libmongocrypt/libmongocrypt/src/mc-dec128.test.cpp +86 -0
  529. data/ext/libmongocrypt/libmongocrypt/src/mc-efc-private.h +48 -0
  530. data/ext/libmongocrypt/libmongocrypt/src/mc-efc.c +127 -0
  531. data/ext/libmongocrypt/libmongocrypt/src/mc-fle-blob-subtype-private.h +40 -0
  532. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder-private.h +152 -0
  533. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder.c +487 -0
  534. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-private.h +47 -0
  535. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload.c +156 -0
  536. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-private.h +95 -0
  537. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload.c +158 -0
  538. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-private.h +124 -0
  539. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload.c +316 -0
  540. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev-private.h +179 -0
  541. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev.c +385 -0
  542. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-private.h +93 -0
  543. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev.c +269 -0
  544. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-range-operator-private.h +29 -0
  545. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-rfds-private.h +91 -0
  546. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-rfds.c +658 -0
  547. data/ext/libmongocrypt/libmongocrypt/src/mc-optional-private.h +124 -0
  548. data/ext/libmongocrypt/libmongocrypt/src/mc-range-edge-generation-private.h +161 -0
  549. data/ext/libmongocrypt/libmongocrypt/src/mc-range-edge-generation.c +242 -0
  550. data/ext/libmongocrypt/libmongocrypt/src/mc-range-encoding-private.h +128 -0
  551. data/ext/libmongocrypt/libmongocrypt/src/mc-range-encoding.c +620 -0
  552. data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover-generator.template.h +308 -0
  553. data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover-private.h +112 -0
  554. data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover.c +341 -0
  555. data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts-private.h +99 -0
  556. data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts.c +382 -0
  557. data/ext/libmongocrypt/libmongocrypt/src/mc-reader-private.h +130 -0
  558. data/ext/libmongocrypt/libmongocrypt/src/mc-reader.c +235 -0
  559. data/ext/libmongocrypt/libmongocrypt/src/mc-tokens-private.h +118 -0
  560. data/ext/libmongocrypt/libmongocrypt/src/mc-tokens.c +151 -0
  561. data/ext/libmongocrypt/libmongocrypt/src/mlib/check.hpp +89 -0
  562. data/ext/libmongocrypt/libmongocrypt/src/mlib/endian.h +42 -0
  563. data/ext/libmongocrypt/libmongocrypt/src/mlib/error.h +59 -0
  564. data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.h +685 -0
  565. data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.test.c +3 -0
  566. data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.test.cpp +407 -0
  567. data/ext/libmongocrypt/libmongocrypt/src/mlib/macros.h +53 -0
  568. data/ext/libmongocrypt/libmongocrypt/src/mlib/path.h +381 -0
  569. data/ext/libmongocrypt/libmongocrypt/src/mlib/path.test.c +93 -0
  570. data/ext/libmongocrypt/libmongocrypt/src/mlib/str.h +1028 -0
  571. data/ext/libmongocrypt/libmongocrypt/src/mlib/str.test.c +137 -0
  572. data/ext/libmongocrypt/libmongocrypt/src/mlib/thread.h +88 -0
  573. data/ext/libmongocrypt/libmongocrypt/src/mlib/user-check.h +4 -0
  574. data/ext/libmongocrypt/libmongocrypt/src/mlib/windows-lean.h +19 -0
  575. data/ext/libmongocrypt/libmongocrypt/src/mongo_crypt-v1.h +320 -0
  576. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-binary-private.h +34 -0
  577. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-binary.c +87 -0
  578. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-buffer-private.h +236 -0
  579. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-buffer.c +691 -0
  580. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-collinfo-private.h +24 -0
  581. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-collinfo.c +82 -0
  582. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-key-private.h +55 -0
  583. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-key.c +190 -0
  584. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-oauth-private.h +46 -0
  585. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-oauth.c +126 -0
  586. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-private.h +96 -0
  587. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache.c +341 -0
  588. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ciphertext-private.h +64 -0
  589. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ciphertext.c +212 -0
  590. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-compat.h +44 -0
  591. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-config.h.in +87 -0
  592. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-crypto-private.h +303 -0
  593. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-crypto.c +1850 -0
  594. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-datakey.c +534 -0
  595. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-decrypt.c +773 -0
  596. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-encrypt.c +3005 -0
  597. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-private.h +269 -0
  598. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-rewrap-many-datakey.c +415 -0
  599. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx.c +1283 -0
  600. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-dll-private.h +97 -0
  601. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-endian-private.h +168 -0
  602. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-endpoint-private.h +64 -0
  603. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-endpoint.c +212 -0
  604. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kek-private.h +109 -0
  605. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kek.c +325 -0
  606. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-broker-private.h +209 -0
  607. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-broker.c +1189 -0
  608. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-private.h +87 -0
  609. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key.c +473 -0
  610. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kms-ctx-private.h +154 -0
  611. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kms-ctx.c +1785 -0
  612. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-log-private.h +111 -0
  613. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-log.c +123 -0
  614. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking-private.h +74 -0
  615. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking.c +1624 -0
  616. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-mutex-private.h +46 -0
  617. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts-private.h +231 -0
  618. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts.c +493 -0
  619. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-private.h +197 -0
  620. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-status-private.h +39 -0
  621. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-status.c +169 -0
  622. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-traverse-util-private.h +59 -0
  623. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-traverse-util.c +234 -0
  624. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-util-private.h +84 -0
  625. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-util.c +203 -0
  626. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt.c +1605 -0
  627. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt.h +1610 -0
  628. data/ext/libmongocrypt/libmongocrypt/src/os_posix/os_dll.c +132 -0
  629. data/ext/libmongocrypt/libmongocrypt/src/os_posix/os_mutex.c +57 -0
  630. data/ext/libmongocrypt/libmongocrypt/src/os_win/os_dll.c +92 -0
  631. data/ext/libmongocrypt/libmongocrypt/src/os_win/os_mutex.c +45 -0
  632. data/ext/libmongocrypt/libmongocrypt/test/crypt_shared-stub.cpp +155 -0
  633. data/ext/libmongocrypt/libmongocrypt/test/data/NIST-CAVP.cstructs +1350 -0
  634. data/ext/libmongocrypt/libmongocrypt/test/data/aes-ctr.cstructs +359 -0
  635. data/ext/libmongocrypt/libmongocrypt/test/data/cache-tests.json +197 -0
  636. data/ext/libmongocrypt/libmongocrypt/test/data/collection-info-no-schema.json +19 -0
  637. data/ext/libmongocrypt/libmongocrypt/test/data/collection-info-no-validator.json +13 -0
  638. data/ext/libmongocrypt/libmongocrypt/test/data/collection-info-view.json +11 -0
  639. data/ext/libmongocrypt/libmongocrypt/test/data/collinfo-siblings.json +40 -0
  640. data/ext/libmongocrypt/libmongocrypt/test/data/compact/missing-key-id/collinfo.json +21 -0
  641. data/ext/libmongocrypt/libmongocrypt/test/data/compact/no-fields/collinfo.json +10 -0
  642. data/ext/libmongocrypt/libmongocrypt/test/data/compact/no-fields/encrypted-payload.json +4 -0
  643. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/cmd.json +1 -0
  644. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/collinfo.json +49 -0
  645. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/encrypted-field-config-map.json +47 -0
  646. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/encrypted-payload.json +23 -0
  647. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/mongocryptd-reply.json +72 -0
  648. data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/omitted/cmd-to-mongocryptd.json +34 -0
  649. data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/omitted/cmd.json +6 -0
  650. data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/omitted/collinfo.json +27 -0
  651. data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/omitted/encrypted-payload.json +39 -0
  652. data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/omitted/mongocryptd-reply.json +45 -0
  653. data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved/cmd-to-mongocryptd.json +34 -0
  654. data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved/cmd.json +7 -0
  655. data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved/collinfo.json +27 -0
  656. data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved/encrypted-payload.json +40 -0
  657. data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved/mongocryptd-reply.json +45 -0
  658. data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_empty/cmd-to-mongocryptd.json +17 -0
  659. data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_empty/cmd.json +7 -0
  660. data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_empty/collinfo.json +10 -0
  661. data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_empty/encrypted-payload.json +7 -0
  662. data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_empty/mongocryptd-reply.json +23 -0
  663. data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_fle1/cmd-to-mongocryptd.json +26 -0
  664. data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_fle1/cmd.json +7 -0
  665. data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_fle1/collinfo.json +25 -0
  666. data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_fle1/encrypted-payload.json +14 -0
  667. data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_fle1/mongocryptd-reply.json +15 -0
  668. data/ext/libmongocrypt/libmongocrypt/test/data/efc/efc-extraField.json +24 -0
  669. data/ext/libmongocrypt/libmongocrypt/test/data/efc/efc-missingKeyId.json +17 -0
  670. data/ext/libmongocrypt/libmongocrypt/test/data/efc/efc-oneField.json +23 -0
  671. data/ext/libmongocrypt/libmongocrypt/test/data/efc/efc-twoFields.json +39 -0
  672. data/ext/libmongocrypt/libmongocrypt/test/data/encrypted-cmd.json +11 -0
  673. data/ext/libmongocrypt/libmongocrypt/test/data/encrypted-field-config-map.json +48 -0
  674. data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decryption-input.json +8 -0
  675. data/ext/libmongocrypt/libmongocrypt/test/data/find-with-encryptionInformation.json +16 -0
  676. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-collMod/cmd-to-mongocryptd.json +12 -0
  677. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-collMod/cmd.json +8 -0
  678. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-collMod/insert/cmd.json +8 -0
  679. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-collMod/insert/collinfo.json +9 -0
  680. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-collMod/mongocryptd-reply.json +14 -0
  681. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/old-mongocryptd/cmd.json +3 -0
  682. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/old-mongocryptd/encrypted-payload.json +3 -0
  683. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/old-mongocryptd/ismaster-to-mongocryptd.json +3 -0
  684. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/old-mongocryptd/mongocryptd-ismaster.json +12 -0
  685. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-cmd-schema/cmd-to-mongocryptd.json +20 -0
  686. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-cmd-schema/cmd.json +12 -0
  687. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-cmd-schema/encrypted-payload.json +12 -0
  688. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-cmd-schema/ismaster-to-mongocryptd.json +3 -0
  689. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-cmd-schema/mongocryptd-ismaster.json +12 -0
  690. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-cmd-schema/mongocryptd-reply.json +9 -0
  691. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-schema/cmd-to-mongocryptd.json +7 -0
  692. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-schema/cmd.json +3 -0
  693. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-schema/encrypted-payload.json +3 -0
  694. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-schema/ismaster-to-mongocryptd.json +3 -0
  695. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-schema/mongocryptd-ismaster.json +12 -0
  696. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-schema/mongocryptd-reply.json +9 -0
  697. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-schema/schema-map.json +5 -0
  698. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/without-schema/cmd-to-mongocryptd.json +5 -0
  699. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/without-schema/cmd.json +3 -0
  700. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/without-schema/encrypted-payload.json +3 -0
  701. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/without-schema/ismaster-to-mongocryptd.json +3 -0
  702. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/without-schema/mongocryptd-ismaster.json +12 -0
  703. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/without-schema/mongocryptd-reply.json +9 -0
  704. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-explain/with-csfle/cmd.json +8 -0
  705. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-explain/with-csfle/collinfo.json +7 -0
  706. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-explain/with-csfle/encrypted-payload.json +8 -0
  707. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-explain/with-mongocryptd/cmd-to-mongocryptd.json +10 -0
  708. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-explain/with-mongocryptd/cmd.json +8 -0
  709. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-explain/with-mongocryptd/collinfo.json +7 -0
  710. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-explain/with-mongocryptd/encrypted-payload.json +8 -0
  711. data/ext/libmongocrypt/libmongocrypt/test/data/fle1-explain/with-mongocryptd/mongocryptd-reply.json +14 -0
  712. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-aead.cstructs +109 -0
  713. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create/cmd-to-mongocryptd.json +14 -0
  714. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create/cmd.json +3 -0
  715. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create/encrypted-field-config-map.json +8 -0
  716. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create/encrypted-payload.json +3 -0
  717. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create/ismaster-to-mongocryptd.json +3 -0
  718. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create/mongocryptd-ismaster.json +12 -0
  719. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create/mongocryptd-reply.json +9 -0
  720. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-decrypt-ieev/first-filter.json +21 -0
  721. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-decrypt-ieev/second-filter.json +21 -0
  722. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/empty/cmd.json +6 -0
  723. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/empty/collinfo.json +49 -0
  724. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/empty/encrypted-field-config-map.json +47 -0
  725. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/empty/encrypted-payload.json +91 -0
  726. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/empty/mongocryptd-reply.json +66 -0
  727. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/success/cmd.json +6 -0
  728. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/success/collinfo.json +49 -0
  729. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/success/encrypted-field-config-map.json +47 -0
  730. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/success/encrypted-payload.json +98 -0
  731. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/success/mongocryptd-reply.json +72 -0
  732. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-csfle/cmd.json +8 -0
  733. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-csfle/collinfo.json +27 -0
  734. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-csfle/encrypted-payload.json +46 -0
  735. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-mongocryptd/cmd-to-mongocryptd.json +36 -0
  736. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-mongocryptd/cmd.json +8 -0
  737. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-mongocryptd/collinfo.json +27 -0
  738. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-mongocryptd/encrypted-payload.json +41 -0
  739. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-mongocryptd/mongocryptd-reply.json +47 -0
  740. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/find-indexed-contentionFactor1.json +8 -0
  741. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/find-indexed.json +8 -0
  742. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/insert-indexed-contentionFactor1.json +8 -0
  743. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/insert-indexed-same-user-and-index-key.json +8 -0
  744. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/insert-indexed.json +8 -0
  745. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality/cmd.json +6 -0
  746. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality/encrypted-field-map.json +23 -0
  747. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality/encrypted-payload.json +41 -0
  748. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality/mongocryptd-reply.json +19 -0
  749. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-explicit/cmd-to-mongocryptd.json +24 -0
  750. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-explicit/cmd-to-mongod.json +24 -0
  751. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-explicit/cmd.json +11 -0
  752. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-explicit/reply-from-mongocryptd.json +27 -0
  753. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/README.md +2 -0
  754. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date/cmd.json +10 -0
  755. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date/encrypted-field-map.json +28 -0
  756. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date/encrypted-payload.json +42 -0
  757. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date/mongocryptd-reply.json +50 -0
  758. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128/cmd.json +6 -0
  759. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128/encrypted-field-map.json +28 -0
  760. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128/encrypted-payload.json +42 -0
  761. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128/mongocryptd-reply.json +50 -0
  762. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision/cmd.json +6 -0
  763. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision/encrypted-field-map.json +31 -0
  764. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision/encrypted-payload.json +51 -0
  765. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision/mongocryptd-reply.json +59 -0
  766. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double/cmd.json +8 -0
  767. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double/encrypted-field-map.json +28 -0
  768. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double/encrypted-payload.json +42 -0
  769. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double/mongocryptd-reply.json +50 -0
  770. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision/cmd.json +8 -0
  771. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision/encrypted-field-map.json +31 -0
  772. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision/encrypted-payload.json +45 -0
  773. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision/mongocryptd-reply.json +53 -0
  774. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32/cmd.json +8 -0
  775. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32/encrypted-field-map.json +28 -0
  776. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32/encrypted-payload.json +42 -0
  777. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32/mongocryptd-reply.json +50 -0
  778. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64/cmd.json +8 -0
  779. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64/encrypted-field-map.json +28 -0
  780. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64/encrypted-payload.json +42 -0
  781. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64/mongocryptd-reply.json +50 -0
  782. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double/encrypted-payload.json +26 -0
  783. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double/rangeopts.json +5 -0
  784. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double/value-to-encrypt.json +20 -0
  785. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double-precision/encrypted-payload.json +26 -0
  786. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double-precision/rangeopts.json +14 -0
  787. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double-precision/value-to-encrypt.json +20 -0
  788. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32/encrypted-payload.json +26 -0
  789. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32/rangeopts.json +11 -0
  790. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32/value-to-encrypt.json +20 -0
  791. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/encrypted-payload.json +26 -0
  792. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/rangeopts.json +5 -0
  793. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/value-to-encrypt.json +20 -0
  794. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-openinterval/encrypted-payload.json +16 -0
  795. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-openinterval/rangeopts.json +11 -0
  796. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-openinterval/value-to-encrypt.json +13 -0
  797. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert/cmd.json +9 -0
  798. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert/encrypted-field-map.json +23 -0
  799. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert/encrypted-payload.json +40 -0
  800. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert/mongocryptd-reply.json +50 -0
  801. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/README.md +2 -0
  802. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date/RNG_DATA.h +67 -0
  803. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date/cmd.json +13 -0
  804. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date/encrypted-field-map.json +28 -0
  805. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date/encrypted-payload.json +45 -0
  806. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date/mongocryptd-reply.json +53 -0
  807. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128/RNG_DATA.h +134 -0
  808. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128/cmd.json +9 -0
  809. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128/encrypted-field-map.json +28 -0
  810. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128/encrypted-payload.json +45 -0
  811. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128/mongocryptd-reply.json +53 -0
  812. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision/RNG_DATA.h +73 -0
  813. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision/cmd.json +9 -0
  814. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision/encrypted-field-map.json +31 -0
  815. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision/encrypted-payload.json +54 -0
  816. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision/mongocryptd-reply.json +62 -0
  817. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double/RNG_DATA.h +70 -0
  818. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double/cmd.json +11 -0
  819. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double/encrypted-field-map.json +28 -0
  820. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double/encrypted-payload.json +45 -0
  821. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double/mongocryptd-reply.json +53 -0
  822. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision/RNG_DATA.h +21 -0
  823. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision/cmd.json +11 -0
  824. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision/encrypted-field-map.json +31 -0
  825. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision/encrypted-payload.json +48 -0
  826. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision/mongocryptd-reply.json +56 -0
  827. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32/RNG_DATA.h +27 -0
  828. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32/cmd.json +11 -0
  829. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32/encrypted-field-map.json +28 -0
  830. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32/encrypted-payload.json +45 -0
  831. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32/mongocryptd-reply.json +53 -0
  832. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64/RNG_DATA.h +67 -0
  833. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64/cmd.json +11 -0
  834. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64/encrypted-field-map.json +28 -0
  835. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64/encrypted-payload.json +45 -0
  836. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64/mongocryptd-reply.json +53 -0
  837. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double/RNG_DATA.h +70 -0
  838. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double/encrypted-payload.json +8 -0
  839. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double/rangeopts.json +5 -0
  840. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double/value-to-encrypt.json +5 -0
  841. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double-precision/RNG_DATA.h +21 -0
  842. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double-precision/encrypted-payload.json +8 -0
  843. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double-precision/rangeopts.json +14 -0
  844. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double-precision/value-to-encrypt.json +5 -0
  845. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32/RNG_DATA.h +27 -0
  846. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32/encrypted-payload.json +8 -0
  847. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32/rangeopts.json +11 -0
  848. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32/value-to-encrypt.json +5 -0
  849. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/RNG_DATA.h +70 -0
  850. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/encrypted-payload.json +8 -0
  851. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/rangeopts.json +5 -0
  852. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/value-to-encrypt.json +5 -0
  853. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/sparsity-2/RNG_DATA.h +17 -0
  854. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/sparsity-2/encrypted-payload.json +8 -0
  855. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/sparsity-2/rangeopts.json +11 -0
  856. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/sparsity-2/value-to-encrypt.json +5 -0
  857. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed/cmd.json +9 -0
  858. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed/encrypted-field-map.json +23 -0
  859. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed/encrypted-payload.json +14 -0
  860. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed/mongocryptd-reply.json +46 -0
  861. data/ext/libmongocrypt/libmongocrypt/test/data/fle2.cstructs +33 -0
  862. data/ext/libmongocrypt/libmongocrypt/test/data/gcp-auth/decrypt-response.txt +5 -0
  863. data/ext/libmongocrypt/libmongocrypt/test/data/gcp-auth/encrypt-response.txt +5 -0
  864. data/ext/libmongocrypt/libmongocrypt/test/data/gcp-auth/oauth-response.txt +5 -0
  865. data/ext/libmongocrypt/libmongocrypt/test/data/kek-tests.json +169 -0
  866. data/ext/libmongocrypt/libmongocrypt/test/data/key-document-azure.json +33 -0
  867. data/ext/libmongocrypt/libmongocrypt/test/data/key-document-full.json +36 -0
  868. data/ext/libmongocrypt/libmongocrypt/test/data/key-document-gcp.json +35 -0
  869. data/ext/libmongocrypt/libmongocrypt/test/data/key-document-kmip.json +34 -0
  870. data/ext/libmongocrypt/libmongocrypt/test/data/key-document-local.json +18 -0
  871. data/ext/libmongocrypt/libmongocrypt/test/data/key-document-no-region.json +31 -0
  872. data/ext/libmongocrypt/libmongocrypt/test/data/key-document-with-alt-name-duplicate-id.json +36 -0
  873. data/ext/libmongocrypt/libmongocrypt/test/data/key-document-with-alt-name.json +33 -0
  874. data/ext/libmongocrypt/libmongocrypt/test/data/key-document-with-alt-name2.json +33 -0
  875. data/ext/libmongocrypt/libmongocrypt/test/data/keys/12345678123498761234123456789012-aws-decrypt-reply.txt +11 -0
  876. data/ext/libmongocrypt/libmongocrypt/test/data/keys/12345678123498761234123456789012-aws-document.json +32 -0
  877. data/ext/libmongocrypt/libmongocrypt/test/data/keys/12345678123498761234123456789012-key-material.txt +1 -0
  878. data/ext/libmongocrypt/libmongocrypt/test/data/keys/12345678123498761234123456789012-local-document.json +30 -0
  879. data/ext/libmongocrypt/libmongocrypt/test/data/keys/12345678123498761234123456789013-aws-decrypt-reply.txt +11 -0
  880. data/ext/libmongocrypt/libmongocrypt/test/data/keys/12345678123498761234123456789013-aws-document.json +32 -0
  881. data/ext/libmongocrypt/libmongocrypt/test/data/keys/12345678123498761234123456789013-key-material.txt +1 -0
  882. data/ext/libmongocrypt/libmongocrypt/test/data/keys/12345678123498761234123456789013-local-document.json +30 -0
  883. data/ext/libmongocrypt/libmongocrypt/test/data/keys/12345678123498761234123456789014-key-material.txt +1 -0
  884. data/ext/libmongocrypt/libmongocrypt/test/data/keys/12345678123498761234123456789014-local-document.json +30 -0
  885. data/ext/libmongocrypt/libmongocrypt/test/data/keys/ABCDEFAB123498761234123456789012-aws-decrypt-reply.txt +11 -0
  886. data/ext/libmongocrypt/libmongocrypt/test/data/keys/ABCDEFAB123498761234123456789012-aws-document.json +32 -0
  887. data/ext/libmongocrypt/libmongocrypt/test/data/keys/ABCDEFAB123498761234123456789012-key-material.txt +1 -0
  888. data/ext/libmongocrypt/libmongocrypt/test/data/keys/ABCDEFAB123498761234123456789012-local-document.json +30 -0
  889. data/ext/libmongocrypt/libmongocrypt/test/data/keys/README.md +21 -0
  890. data/ext/libmongocrypt/libmongocrypt/test/data/kms-encrypt-reply.txt +7 -0
  891. data/ext/libmongocrypt/libmongocrypt/test/data/kms-tests.json +297 -0
  892. data/ext/libmongocrypt/libmongocrypt/test/data/mongocryptd-cmd.json +26 -0
  893. data/ext/libmongocrypt/libmongocrypt/test/data/mongocryptd-reply-existing-ciphertext.json +24 -0
  894. data/ext/libmongocrypt/libmongocrypt/test/data/mongocryptd-reply-invalid.json +18 -0
  895. data/ext/libmongocrypt/libmongocrypt/test/data/mongocryptd-reply-key-alt-name.json +18 -0
  896. data/ext/libmongocrypt/libmongocrypt/test/data/mongocryptd-reply-key-alt-name2.json +18 -0
  897. data/ext/libmongocrypt/libmongocrypt/test/data/mongocryptd-reply-no-encryption-needed.json +7 -0
  898. data/ext/libmongocrypt/libmongocrypt/test/data/mongocryptd-reply-no-markings.json +7 -0
  899. data/ext/libmongocrypt/libmongocrypt/test/data/mongocryptd-reply-random.json +18 -0
  900. data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_decimal128.cstruct +14527 -0
  901. data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_double.cstruct +7959 -0
  902. data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_int32.cstruct +6906 -0
  903. data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_int64.cstruct +9429 -0
  904. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_decimal128.cstruct +4565 -0
  905. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_decimal128_precision.cstruct +312 -0
  906. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_double.cstruct +3277 -0
  907. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_double_precision.cstruct +369 -0
  908. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_int32.cstruct +4612 -0
  909. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_int64.cstruct +3398 -0
  910. data/ext/libmongocrypt/libmongocrypt/test/data/rmd/key-document-a.json +35 -0
  911. data/ext/libmongocrypt/libmongocrypt/test/data/rmd/key-document-b.json +37 -0
  912. data/ext/libmongocrypt/libmongocrypt/test/data/rmd/key-document-local.json +30 -0
  913. data/ext/libmongocrypt/libmongocrypt/test/data/rmd/kms-decrypt-reply-a.txt +6 -0
  914. data/ext/libmongocrypt/libmongocrypt/test/data/rmd/kms-decrypt-reply-b.txt +6 -0
  915. data/ext/libmongocrypt/libmongocrypt/test/data/rmd/kms-encrypt-reply-a.txt +7 -0
  916. data/ext/libmongocrypt/libmongocrypt/test/data/rmd/kms-encrypt-reply-b.txt +7 -0
  917. data/ext/libmongocrypt/libmongocrypt/test/data/schema-map.json +40 -0
  918. data/ext/libmongocrypt/libmongocrypt/test/data/schema.json +19 -0
  919. data/ext/libmongocrypt/libmongocrypt/test/example/README.md +5 -0
  920. data/ext/libmongocrypt/libmongocrypt/test/example/cmd.json +6 -0
  921. data/ext/libmongocrypt/libmongocrypt/test/example/collection-info.json +39 -0
  922. data/ext/libmongocrypt/libmongocrypt/test/example/encrypted-command.json +9 -0
  923. data/ext/libmongocrypt/libmongocrypt/test/example/key-document-custom-endpoint.json +34 -0
  924. data/ext/libmongocrypt/libmongocrypt/test/example/key-document.json +33 -0
  925. data/ext/libmongocrypt/libmongocrypt/test/example/kms-decrypt-reply.txt +6 -0
  926. data/ext/libmongocrypt/libmongocrypt/test/example/mongocryptd-reply.json +18 -0
  927. data/ext/libmongocrypt/libmongocrypt/test/example-no-bson.c +23 -0
  928. data/ext/libmongocrypt/libmongocrypt/test/example-state-machine.c +368 -0
  929. data/ext/libmongocrypt/libmongocrypt/test/fuzz_kms.c +42 -0
  930. data/ext/libmongocrypt/libmongocrypt/test/test-dll.cpp +22 -0
  931. data/ext/libmongocrypt/libmongocrypt/test/test-gcp-auth.c +312 -0
  932. data/ext/libmongocrypt/libmongocrypt/test/test-mc-efc.c +104 -0
  933. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iev.c +443 -0
  934. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iup.c +184 -0
  935. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-uev.c +200 -0
  936. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-rfds.c +518 -0
  937. data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-edge-generation.c +468 -0
  938. data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-encoding.c +886 -0
  939. data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-mincover.c +609 -0
  940. data/ext/libmongocrypt/libmongocrypt/test/test-mc-rangeopts.c +174 -0
  941. data/ext/libmongocrypt/libmongocrypt/test/test-mc-reader.c +251 -0
  942. data/ext/libmongocrypt/libmongocrypt/test/test-mc-tokens.c +245 -0
  943. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert-match-bson.c +1079 -0
  944. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert-match-bson.h +26 -0
  945. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert.h +218 -0
  946. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-buffer.c +266 -0
  947. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cache-oauth.c +57 -0
  948. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cache.c +264 -0
  949. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ciphertext.c +259 -0
  950. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-compact.c +478 -0
  951. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-hooks.c +917 -0
  952. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-std-hooks.c +177 -0
  953. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-std-hooks.h +110 -0
  954. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto.c +892 -0
  955. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-csfle-lib.c +208 -0
  956. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-decrypt.c +1134 -0
  957. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-encrypt.c +5096 -0
  958. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-rewrap-many-datakey.c +1061 -0
  959. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-setopt.c +1301 -0
  960. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-datakey.c +489 -0
  961. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-dll.c +48 -0
  962. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-endpoint.c +138 -0
  963. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kek.c +104 -0
  964. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key-broker.c +1174 -0
  965. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key-cache.c +475 -0
  966. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key.c +282 -0
  967. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kms-ctx.c +561 -0
  968. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kms-responses.c +206 -0
  969. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-local-kms.c +89 -0
  970. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-log.c +137 -0
  971. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-marking.c +738 -0
  972. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-status.c +88 -0
  973. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-traverse-util.c +548 -0
  974. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-util.c +105 -0
  975. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-util.h +42 -0
  976. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.c +1060 -0
  977. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.h +290 -0
  978. data/ext/libmongocrypt/libmongocrypt/test/util/HELP.autogen +102 -0
  979. data/ext/libmongocrypt/libmongocrypt/test/util/README.md +103 -0
  980. data/ext/libmongocrypt/libmongocrypt/test/util/csfle.c +612 -0
  981. data/ext/libmongocrypt/libmongocrypt/test/util/helpgen.py +7 -0
  982. data/ext/libmongocrypt/libmongocrypt/test/util/make_includes.py +845 -0
  983. data/ext/libmongocrypt/libmongocrypt/test/util/util.c +969 -0
  984. data/ext/libmongocrypt/libmongocrypt/test/util/util.h +96 -0
  985. data/ext/libmongocrypt/libmongocrypt/third-party/IntelRDFPMathLib20U2.tar.xz +0 -0
  986. data/lib/libmongocrypt_helper/version.rb +2 -2
  987. data/lib/libmongocrypt_helper.rb +13 -1
  988. data.tar.gz.sig +0 -0
  989. metadata +988 -6
  990. metadata.gz.sig +0 -0
  991. data/so/libmongocrypt.so +0 -0
@@ -0,0 +1,1134 @@
1
+ /*
2
+ * Copyright 2019-present MongoDB, Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ #include "mongocrypt-ctx-private.h"
18
+ #include "mongocrypt.h"
19
+ #include "test-mongocrypt.h"
20
+ #include "test-mongocrypt-assert-match-bson.h"
21
+
22
+ static void
23
+ _test_explicit_decrypt_init (_mongocrypt_tester_t *tester)
24
+ {
25
+ mongocrypt_t *crypt;
26
+ mongocrypt_ctx_t *ctx;
27
+ mongocrypt_binary_t *msg;
28
+ crypt = _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
29
+
30
+ msg = TEST_BSON ("{ 'v': { '$binary': { 'subType': '06', 'base64': "
31
+ "'AWFhYWFhYWFhYWFhYWFhYWECRTOW9yZzNDn5dGwuqsrJQNLtgMEKaujhs"
32
+ "9aRWRp+7Yo3JK8N8jC8P0Xjll6C1CwLsE/"
33
+ "iP5wjOMhVv1KMMyOCSCrHorXRsb2IKPtzl2lKTqQ=' } } }");
34
+
35
+ /* NULL document. */
36
+ ctx = mongocrypt_ctx_new (crypt);
37
+ ASSERT_FAILS (
38
+ mongocrypt_ctx_explicit_decrypt_init (ctx, NULL), ctx, "invalid msg");
39
+ BSON_ASSERT (mongocrypt_ctx_state (ctx) == MONGOCRYPT_CTX_ERROR);
40
+ mongocrypt_ctx_destroy (ctx);
41
+
42
+ /* Success. */
43
+ ctx = mongocrypt_ctx_new (crypt);
44
+ ASSERT_OK (mongocrypt_ctx_explicit_decrypt_init (ctx, msg), ctx);
45
+ BSON_ASSERT (mongocrypt_ctx_state (ctx) == MONGOCRYPT_CTX_NEED_MONGO_KEYS);
46
+ mongocrypt_ctx_destroy (ctx);
47
+
48
+ mongocrypt_destroy (crypt);
49
+ }
50
+
51
+
52
+ /* Test individual ctx states. */
53
+ static void
54
+ _test_decrypt_init (_mongocrypt_tester_t *tester)
55
+ {
56
+ mongocrypt_t *crypt;
57
+ mongocrypt_ctx_t *ctx;
58
+ mongocrypt_binary_t *encrypted;
59
+
60
+ crypt = _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
61
+
62
+ encrypted = _mongocrypt_tester_encrypted_doc (tester);
63
+
64
+ /* Success. */
65
+ ctx = mongocrypt_ctx_new (crypt);
66
+ ASSERT_OK (mongocrypt_ctx_decrypt_init (ctx, encrypted), ctx);
67
+ BSON_ASSERT (mongocrypt_ctx_state (ctx) == MONGOCRYPT_CTX_NEED_MONGO_KEYS);
68
+ mongocrypt_ctx_destroy (ctx);
69
+
70
+ /* NULL document. */
71
+ ctx = mongocrypt_ctx_new (crypt);
72
+ ASSERT_FAILS (mongocrypt_ctx_decrypt_init (ctx, NULL), ctx, "invalid doc");
73
+ BSON_ASSERT (mongocrypt_ctx_state (ctx) == MONGOCRYPT_CTX_ERROR);
74
+ mongocrypt_ctx_destroy (ctx);
75
+
76
+ mongocrypt_binary_destroy (encrypted);
77
+ mongocrypt_destroy (crypt);
78
+ }
79
+
80
+
81
+ static void
82
+ _test_decrypt_need_keys (_mongocrypt_tester_t *tester)
83
+ {
84
+ mongocrypt_t *crypt;
85
+ mongocrypt_ctx_t *ctx;
86
+ mongocrypt_binary_t *encrypted;
87
+
88
+ encrypted = _mongocrypt_tester_encrypted_doc (tester);
89
+
90
+ /* Success. */
91
+ crypt = _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
92
+ ctx = mongocrypt_ctx_new (crypt);
93
+ ASSERT_OK (mongocrypt_ctx_decrypt_init (ctx, encrypted), ctx);
94
+ ASSERT_OK (mongocrypt_ctx_mongo_feed (
95
+ ctx, TEST_FILE ("./test/example/key-document.json")),
96
+ ctx);
97
+ ASSERT_OK (mongocrypt_ctx_mongo_done (ctx), ctx);
98
+ BSON_ASSERT (mongocrypt_ctx_state (ctx) == MONGOCRYPT_CTX_NEED_KMS);
99
+ mongocrypt_ctx_destroy (ctx);
100
+ mongocrypt_destroy (crypt); /* recreate crypt because of caching. */
101
+
102
+ /* TODO: CDRIVER-3044 test that decryption warns when keys are not
103
+ * found/inactive. */
104
+
105
+ mongocrypt_binary_destroy (encrypted);
106
+ }
107
+
108
+
109
+ static void
110
+ _test_decrypt_ready (_mongocrypt_tester_t *tester)
111
+ {
112
+ mongocrypt_t *crypt;
113
+ mongocrypt_ctx_t *ctx;
114
+ mongocrypt_binary_t *encrypted, *decrypted;
115
+ bson_t as_bson;
116
+ bson_iter_t iter;
117
+
118
+ encrypted = _mongocrypt_tester_encrypted_doc (tester);
119
+ decrypted = mongocrypt_binary_new ();
120
+ crypt = _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
121
+
122
+ /* Success. */
123
+ ctx = mongocrypt_ctx_new (crypt);
124
+ ASSERT_OK (mongocrypt_ctx_decrypt_init (ctx, encrypted), ctx);
125
+ _mongocrypt_tester_run_ctx_to (tester, ctx, MONGOCRYPT_CTX_READY);
126
+ ASSERT_OK (mongocrypt_ctx_finalize (ctx, decrypted), ctx);
127
+ BSON_ASSERT (_mongocrypt_binary_to_bson (decrypted, &as_bson));
128
+ bson_iter_init (&iter, &as_bson);
129
+ bson_iter_find_descendant (&iter, "filter.ssn", &iter);
130
+ BSON_ASSERT (BSON_ITER_HOLDS_UTF8 (&iter));
131
+ BSON_ASSERT (0 == strcmp (bson_iter_utf8 (&iter, NULL),
132
+ _mongocrypt_tester_plaintext (tester)));
133
+ mongocrypt_binary_destroy (decrypted);
134
+ mongocrypt_ctx_destroy (ctx);
135
+ mongocrypt_destroy (crypt);
136
+ mongocrypt_binary_destroy (encrypted);
137
+ }
138
+
139
+
140
+ /* Test with empty AWS credentials. */
141
+ void
142
+ _test_decrypt_empty_aws (_mongocrypt_tester_t *tester)
143
+ {
144
+ mongocrypt_t *crypt;
145
+ mongocrypt_ctx_t *ctx;
146
+
147
+ crypt = mongocrypt_new ();
148
+ ASSERT_OK (mongocrypt_setopt_kms_provider_aws (crypt, "", -1, "", -1),
149
+ crypt);
150
+ ASSERT_OK (mongocrypt_init (crypt), crypt);
151
+
152
+ ctx = mongocrypt_ctx_new (crypt);
153
+ ASSERT_OK (mongocrypt_ctx_decrypt_init (
154
+ ctx, TEST_FILE ("./test/data/encrypted-cmd.json")),
155
+ ctx);
156
+ _mongocrypt_tester_run_ctx_to (tester, ctx, MONGOCRYPT_CTX_NEED_MONGO_KEYS);
157
+ ASSERT_FAILS (mongocrypt_ctx_mongo_feed (
158
+ ctx, TEST_FILE ("./test/example/key-document.json")),
159
+ ctx,
160
+ "failed to create KMS message");
161
+
162
+ mongocrypt_ctx_destroy (ctx);
163
+ mongocrypt_destroy (crypt);
164
+ }
165
+
166
+ static void
167
+ _test_decrypt_empty_binary (_mongocrypt_tester_t *tester)
168
+ {
169
+ mongocrypt_t *crypt;
170
+ mongocrypt_ctx_t *ctx;
171
+ mongocrypt_binary_t *bin;
172
+ _mongocrypt_buffer_t encrypted;
173
+
174
+ bin = mongocrypt_binary_new ();
175
+ crypt = _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
176
+ ctx = mongocrypt_ctx_new (crypt);
177
+
178
+ /* Encrypt an empty binary value. */
179
+ mongocrypt_ctx_setopt_key_alt_name (
180
+ ctx, TEST_BSON ("{'keyAltName': 'keyDocumentName'}"));
181
+ mongocrypt_ctx_setopt_algorithm (
182
+ ctx, MONGOCRYPT_ALGORITHM_DETERMINISTIC_STR, -1);
183
+ mongocrypt_ctx_explicit_encrypt_init (
184
+ ctx,
185
+ TEST_BSON ("{'v': { '$binary': { 'base64': '', 'subType': '00' } } }"));
186
+ _mongocrypt_tester_run_ctx_to (tester, ctx, MONGOCRYPT_CTX_READY);
187
+ mongocrypt_ctx_finalize (ctx, bin);
188
+ /* Copy the encrypted ciphertext since it is tied to the lifetime of ctx. */
189
+ _mongocrypt_buffer_copy_from_binary (&encrypted, bin);
190
+ mongocrypt_ctx_destroy (ctx);
191
+
192
+ /* Decrypt it back. */
193
+ ctx = mongocrypt_ctx_new (crypt);
194
+ mongocrypt_ctx_explicit_decrypt_init (
195
+ ctx, _mongocrypt_buffer_as_binary (&encrypted));
196
+ _mongocrypt_tester_run_ctx_to (tester, ctx, MONGOCRYPT_CTX_READY);
197
+ mongocrypt_ctx_finalize (ctx, bin);
198
+
199
+ mongocrypt_binary_destroy (bin);
200
+ mongocrypt_ctx_destroy (ctx);
201
+ _mongocrypt_buffer_cleanup (&encrypted);
202
+ mongocrypt_destroy (crypt);
203
+ }
204
+
205
+ static void
206
+ _test_decrypt_per_ctx_credentials (_mongocrypt_tester_t *tester)
207
+ {
208
+ mongocrypt_t *crypt;
209
+ mongocrypt_ctx_t *ctx;
210
+ mongocrypt_binary_t *bin;
211
+ _mongocrypt_buffer_t encrypted;
212
+
213
+ bin = mongocrypt_binary_new ();
214
+ crypt = mongocrypt_new ();
215
+ mongocrypt_setopt_use_need_kms_credentials_state (crypt);
216
+ mongocrypt_setopt_kms_providers (crypt, TEST_BSON ("{'aws': {}}"));
217
+ ASSERT_OK (mongocrypt_init (crypt), crypt);
218
+ ctx = mongocrypt_ctx_new (crypt);
219
+
220
+ /* Encrypt an empty binary value. */
221
+ mongocrypt_ctx_setopt_key_alt_name (
222
+ ctx, TEST_BSON ("{'keyAltName': 'keyDocumentName'}"));
223
+ mongocrypt_ctx_setopt_algorithm (
224
+ ctx, MONGOCRYPT_ALGORITHM_DETERMINISTIC_STR, -1);
225
+ mongocrypt_ctx_explicit_encrypt_init (
226
+ ctx,
227
+ TEST_BSON ("{'v': { '$binary': { 'base64': '', 'subType': '00' } } }"));
228
+ _mongocrypt_tester_run_ctx_to (
229
+ tester, ctx, MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS);
230
+ ASSERT_OK (mongocrypt_ctx_provide_kms_providers (
231
+ ctx,
232
+ TEST_BSON ("{'aws':{'accessKeyId': 'example',"
233
+ "'secretAccessKey': 'example'}}")),
234
+ ctx);
235
+ _mongocrypt_tester_run_ctx_to (tester, ctx, MONGOCRYPT_CTX_READY);
236
+ mongocrypt_ctx_finalize (ctx, bin);
237
+ /* Copy the encrypted ciphertext since it is tied to the lifetime of ctx. */
238
+ _mongocrypt_buffer_copy_from_binary (&encrypted, bin);
239
+ mongocrypt_ctx_destroy (ctx);
240
+
241
+ /* Decrypt it back. */
242
+ ctx = mongocrypt_ctx_new (crypt);
243
+ mongocrypt_ctx_explicit_decrypt_init (
244
+ ctx, _mongocrypt_buffer_as_binary (&encrypted));
245
+ _mongocrypt_tester_run_ctx_to (tester, ctx, MONGOCRYPT_CTX_READY);
246
+ mongocrypt_ctx_finalize (ctx, bin);
247
+
248
+ mongocrypt_binary_destroy (bin);
249
+ mongocrypt_ctx_destroy (ctx);
250
+ _mongocrypt_buffer_cleanup (&encrypted);
251
+ mongocrypt_destroy (crypt);
252
+ }
253
+
254
+ static void
255
+ _test_decrypt_per_ctx_credentials_local (_mongocrypt_tester_t *tester)
256
+ {
257
+ mongocrypt_t *crypt;
258
+ mongocrypt_ctx_t *ctx;
259
+ mongocrypt_binary_t *bin;
260
+ _mongocrypt_buffer_t encrypted;
261
+ /* local_kek is the KEK used to encrypt the keyMaterial in
262
+ * ./test/data/key-document-local.json */
263
+ const char *local_kek =
264
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
265
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
266
+ /* local_uuid is the hex of the UUID of the key in
267
+ * ./test/data/key-document-local.json */
268
+ const char *local_uuid = "61616161616161616161616161616161";
269
+ _mongocrypt_buffer_t local_uuid_buf;
270
+
271
+ bin = mongocrypt_binary_new ();
272
+ crypt = mongocrypt_new ();
273
+ mongocrypt_setopt_use_need_kms_credentials_state (crypt);
274
+ mongocrypt_setopt_kms_providers (crypt, TEST_BSON ("{'local': {}}"));
275
+ ASSERT_OK (mongocrypt_init (crypt), crypt);
276
+ ctx = mongocrypt_ctx_new (crypt);
277
+
278
+ /* Encrypt an empty binary value. */
279
+ _mongocrypt_buffer_copy_from_hex (&local_uuid_buf, local_uuid);
280
+ mongocrypt_ctx_setopt_key_id (
281
+ ctx, _mongocrypt_buffer_as_binary (&local_uuid_buf));
282
+ mongocrypt_ctx_setopt_algorithm (
283
+ ctx, MONGOCRYPT_ALGORITHM_DETERMINISTIC_STR, -1);
284
+ mongocrypt_ctx_explicit_encrypt_init (
285
+ ctx,
286
+ TEST_BSON ("{'v': { '$binary': { 'base64': '', 'subType': '00' } } }"));
287
+ _mongocrypt_tester_run_ctx_to (
288
+ tester, ctx, MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS);
289
+ ASSERT_OK (mongocrypt_ctx_provide_kms_providers (
290
+ ctx,
291
+ TEST_BSON ("{'local':{'key': { '$binary': {'base64': '%s', "
292
+ "'subType': '00'}}}}",
293
+ local_kek)),
294
+ ctx);
295
+ _mongocrypt_tester_run_ctx_to (tester, ctx, MONGOCRYPT_CTX_NEED_MONGO_KEYS);
296
+ ASSERT_OK (mongocrypt_ctx_mongo_feed (
297
+ ctx, TEST_FILE ("./test/data/key-document-local.json")),
298
+ ctx);
299
+ ASSERT_OK (mongocrypt_ctx_mongo_done (ctx), ctx);
300
+ _mongocrypt_tester_run_ctx_to (tester, ctx, MONGOCRYPT_CTX_READY);
301
+ mongocrypt_ctx_finalize (ctx, bin);
302
+ /* Copy the encrypted ciphertext since it is tied to the lifetime of ctx. */
303
+ _mongocrypt_buffer_copy_from_binary (&encrypted, bin);
304
+ mongocrypt_ctx_destroy (ctx);
305
+
306
+ /* Decrypt it back. */
307
+ ctx = mongocrypt_ctx_new (crypt);
308
+ mongocrypt_ctx_explicit_decrypt_init (
309
+ ctx, _mongocrypt_buffer_as_binary (&encrypted));
310
+ _mongocrypt_tester_run_ctx_to (tester, ctx, MONGOCRYPT_CTX_READY);
311
+ mongocrypt_ctx_finalize (ctx, bin);
312
+
313
+ _mongocrypt_buffer_cleanup (&local_uuid_buf);
314
+ mongocrypt_binary_destroy (bin);
315
+ mongocrypt_ctx_destroy (ctx);
316
+ _mongocrypt_buffer_cleanup (&encrypted);
317
+ mongocrypt_destroy (crypt);
318
+ }
319
+
320
+ static void
321
+ _test_decrypt_fle2 (_mongocrypt_tester_t *tester)
322
+ {
323
+ _mongocrypt_buffer_t S_KeyId;
324
+ _mongocrypt_buffer_t K_KeyId;
325
+
326
+ if (!_aes_ctr_is_supported_by_os) {
327
+ printf ("Common Crypto with no CTR support detected. Skipping.");
328
+ return;
329
+ }
330
+
331
+ #define TEST_IEEV_BASE64 \
332
+ "BxI0VngSNJh2EjQSNFZ4kBICQ7uhTd9C2oI8M1afRon0ZaYG0s6oTmt0aBZ9kO4S4mm5vId01" \
333
+ "BsW7tBHytA8pDJ2IiWBCmah3OGH2M4ET7PSqekQD4gkUCo4JeEttx4yj05Ou4D6yZUmYfVKmE" \
334
+ "ljge16NCxKm7Ir9gvmQsp8x1wqGBzpndA6gkqFxsxfvQ/" \
335
+ "cIqOwMW9dGTTWsfKge+jYkCUIFMfms+XyC/8evQhjjA+qR6eEmV+N/" \
336
+ "kwpR7Q7TJe0lwU5kw2kSe3/KiPKRZZTbn8znadvycfJ0cCWGad9SQ=="
337
+
338
+ _mongocrypt_buffer_copy_from_hex (&S_KeyId,
339
+ "12345678123498761234123456789012");
340
+ _mongocrypt_buffer_copy_from_hex (&K_KeyId,
341
+ "ABCDEFAB123498761234123456789012");
342
+
343
+ /* Test success with an FLE2IndexedEqualityEncryptedValue payload. */
344
+ {
345
+ mongocrypt_t *crypt =
346
+ _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
347
+ mongocrypt_ctx_t *ctx;
348
+ mongocrypt_binary_t *out;
349
+ bson_t out_bson;
350
+
351
+ ctx = mongocrypt_ctx_new (crypt);
352
+ ASSERT_OK (
353
+ mongocrypt_ctx_decrypt_init (
354
+ ctx,
355
+ TEST_BSON ("{'plainText':'sample','encrypted':{'$binary':{'base64':"
356
+ "'" TEST_IEEV_BASE64 "','subType':'6'}}}")),
357
+ ctx);
358
+ /* The first transition to MONGOCRYPT_CTX_NEED_MONGO_KEYS requests S_Key.
359
+ */
360
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx),
361
+ MONGOCRYPT_CTX_NEED_MONGO_KEYS);
362
+ {
363
+ mongocrypt_binary_t *filter = mongocrypt_binary_new ();
364
+ ASSERT_OK (mongocrypt_ctx_mongo_op (ctx, filter), ctx);
365
+ ASSERT_MONGOCRYPT_BINARY_EQUAL_BSON (
366
+ TEST_FILE ("./test/data/fle2-decrypt-ieev/first-filter.json"),
367
+ filter);
368
+ mongocrypt_binary_destroy (filter);
369
+ }
370
+ ASSERT_OK (mongocrypt_ctx_mongo_feed (
371
+ ctx,
372
+ TEST_FILE ("./test/data/keys/"
373
+ "12345678123498761234123456789012-local-"
374
+ "document.json")),
375
+ ctx);
376
+ ASSERT_OK (mongocrypt_ctx_mongo_done (ctx), ctx);
377
+ /* The second transition to MONGOCRYPT_CTX_NEED_MONGO_KEYS requests K_Key.
378
+ */
379
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx),
380
+ MONGOCRYPT_CTX_NEED_MONGO_KEYS);
381
+ {
382
+ mongocrypt_binary_t *filter = mongocrypt_binary_new ();
383
+ ASSERT_OK (mongocrypt_ctx_mongo_op (ctx, filter), ctx);
384
+ ASSERT_MONGOCRYPT_BINARY_EQUAL_BSON (
385
+ TEST_FILE ("./test/data/fle2-decrypt-ieev/second-filter.json"),
386
+ filter);
387
+ mongocrypt_binary_destroy (filter);
388
+ }
389
+ ASSERT_OK (mongocrypt_ctx_mongo_feed (
390
+ ctx,
391
+ TEST_FILE ("./test/data/keys/"
392
+ "ABCDEFAB123498761234123456789012-local-"
393
+ "document.json")),
394
+ ctx);
395
+ ASSERT_OK (mongocrypt_ctx_mongo_done (ctx), ctx);
396
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx), MONGOCRYPT_CTX_READY);
397
+ out = mongocrypt_binary_new ();
398
+ ASSERT_OK (mongocrypt_ctx_finalize (ctx, out), ctx);
399
+ ASSERT (_mongocrypt_binary_to_bson (out, &out_bson));
400
+ _assert_match_bson (
401
+ &out_bson,
402
+ TMP_BSON ("{'plainText': 'sample', 'encrypted': 'value123'}"));
403
+ mongocrypt_binary_destroy (out);
404
+ mongocrypt_ctx_destroy (ctx);
405
+ mongocrypt_destroy (crypt);
406
+ }
407
+
408
+ /* Test success with a non-local KMS provider. */
409
+ {
410
+ mongocrypt_t *crypt =
411
+ _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
412
+ mongocrypt_ctx_t *ctx;
413
+ mongocrypt_binary_t *out;
414
+ bson_t out_bson;
415
+
416
+ ctx = mongocrypt_ctx_new (crypt);
417
+ ASSERT_OK (
418
+ mongocrypt_ctx_decrypt_init (
419
+ ctx,
420
+ TEST_BSON ("{'plainText':'sample','encrypted':{'$binary':{'base64':"
421
+ "'" TEST_IEEV_BASE64 "','subType':'6'}}}")),
422
+ ctx);
423
+ /* The first transition to MONGOCRYPT_CTX_NEED_MONGO_KEYS requests S_Key.
424
+ */
425
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx),
426
+ MONGOCRYPT_CTX_NEED_MONGO_KEYS);
427
+ ASSERT_OK (mongocrypt_ctx_mongo_feed (
428
+ ctx,
429
+ TEST_FILE ("./test/data/keys/"
430
+ "12345678123498761234123456789012-aws-"
431
+ "document.json")),
432
+ ctx);
433
+ ASSERT_OK (mongocrypt_ctx_mongo_done (ctx), ctx);
434
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx), MONGOCRYPT_CTX_NEED_KMS);
435
+ {
436
+ mongocrypt_kms_ctx_t *kms_ctx = mongocrypt_ctx_next_kms_ctx (ctx);
437
+ ASSERT (kms_ctx);
438
+ ASSERT_OK (mongocrypt_kms_ctx_feed (
439
+ kms_ctx,
440
+ TEST_FILE ("./test/data/keys/"
441
+ "12345678123498761234123456789012-"
442
+ "aws-decrypt-reply.txt")),
443
+ kms_ctx);
444
+ ASSERT (!mongocrypt_ctx_next_kms_ctx (ctx));
445
+ ASSERT_OK (mongocrypt_ctx_kms_done (ctx), ctx);
446
+ }
447
+ /* The second transition to MONGOCRYPT_CTX_NEED_MONGO_KEYS requests K_Key.
448
+ */
449
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx),
450
+ MONGOCRYPT_CTX_NEED_MONGO_KEYS);
451
+ ASSERT_OK (mongocrypt_ctx_mongo_feed (
452
+ ctx,
453
+ TEST_FILE ("./test/data/keys/"
454
+ "ABCDEFAB123498761234123456789012-aws-"
455
+ "document.json")),
456
+ ctx);
457
+ ASSERT_OK (mongocrypt_ctx_mongo_done (ctx), ctx);
458
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx), MONGOCRYPT_CTX_NEED_KMS);
459
+ {
460
+ mongocrypt_kms_ctx_t *kms_ctx = mongocrypt_ctx_next_kms_ctx (ctx);
461
+ ASSERT (kms_ctx);
462
+ ASSERT_OK (mongocrypt_kms_ctx_feed (
463
+ kms_ctx,
464
+ TEST_FILE ("./test/data/keys/"
465
+ "ABCDEFAB123498761234123456789012-"
466
+ "aws-decrypt-reply.txt")),
467
+ kms_ctx);
468
+ ASSERT (!mongocrypt_ctx_next_kms_ctx (ctx));
469
+ ASSERT_OK (mongocrypt_ctx_kms_done (ctx), ctx);
470
+ }
471
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx), MONGOCRYPT_CTX_READY);
472
+ out = mongocrypt_binary_new ();
473
+ ASSERT_OK (mongocrypt_ctx_finalize (ctx, out), ctx);
474
+ ASSERT (_mongocrypt_binary_to_bson (out, &out_bson));
475
+ _assert_match_bson (
476
+ &out_bson,
477
+ TMP_BSON ("{'plainText': 'sample', 'encrypted': 'value123'}"));
478
+ mongocrypt_binary_destroy (out);
479
+ mongocrypt_ctx_destroy (ctx);
480
+ mongocrypt_destroy (crypt);
481
+ }
482
+
483
+ /* Test success with two FLE2IndexedEqualityEncryptedValue payloads. */
484
+ {
485
+ mongocrypt_t *crypt =
486
+ _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
487
+ mongocrypt_ctx_t *ctx;
488
+ mongocrypt_binary_t *out;
489
+ bson_t out_bson;
490
+
491
+ ctx = mongocrypt_ctx_new (crypt);
492
+ ASSERT_OK (
493
+ mongocrypt_ctx_decrypt_init (
494
+ ctx,
495
+ TEST_BSON ("{'plainText':'sample','encrypted1':{'$binary':{'base64'"
496
+ ":'" TEST_IEEV_BASE64 "','subType':'6'}}, "
497
+ "'encrypted2':{'$binary':{'base64':'" TEST_IEEV_BASE64
498
+ "','subType':'6'}}}")),
499
+ ctx);
500
+ /* The first transition to MONGOCRYPT_CTX_NEED_MONGO_KEYS requests S_Key.
501
+ */
502
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx),
503
+ MONGOCRYPT_CTX_NEED_MONGO_KEYS);
504
+ ASSERT_OK (mongocrypt_ctx_mongo_feed (
505
+ ctx,
506
+ TEST_FILE ("./test/data/keys/"
507
+ "12345678123498761234123456789012-local-"
508
+ "document.json")),
509
+ ctx);
510
+ ASSERT_OK (mongocrypt_ctx_mongo_done (ctx), ctx);
511
+ /* The second transition to MONGOCRYPT_CTX_NEED_MONGO_KEYS requests K_Key.
512
+ */
513
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx),
514
+ MONGOCRYPT_CTX_NEED_MONGO_KEYS);
515
+ ASSERT_OK (mongocrypt_ctx_mongo_feed (
516
+ ctx,
517
+ TEST_FILE ("./test/data/keys/"
518
+ "ABCDEFAB123498761234123456789012-local-"
519
+ "document.json")),
520
+ ctx);
521
+ ASSERT_OK (mongocrypt_ctx_mongo_done (ctx), ctx);
522
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx), MONGOCRYPT_CTX_READY);
523
+ out = mongocrypt_binary_new ();
524
+ ASSERT_OK (mongocrypt_ctx_finalize (ctx, out), ctx);
525
+ ASSERT (_mongocrypt_binary_to_bson (out, &out_bson));
526
+ _assert_match_bson (&out_bson,
527
+ TMP_BSON ("{'plainText': 'sample', 'encrypted1': "
528
+ "'value123', 'encrypted2': 'value123'}"));
529
+ mongocrypt_binary_destroy (out);
530
+ mongocrypt_ctx_destroy (ctx);
531
+ mongocrypt_destroy (crypt);
532
+ }
533
+
534
+ /* Test success when S_Key is cached, K_Key is not cached. */
535
+ {
536
+ mongocrypt_t *crypt =
537
+ _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
538
+ mongocrypt_ctx_t *ctx;
539
+ mongocrypt_binary_t *out;
540
+ bson_t out_bson;
541
+
542
+ ctx = mongocrypt_ctx_new (crypt);
543
+ ASSERT_OK (
544
+ mongocrypt_ctx_decrypt_init (
545
+ ctx,
546
+ TEST_BSON ("{'plainText':'sample','encrypted':{'$binary':{'base64':"
547
+ "' " TEST_IEEV_BASE64 "','subType':'6'}}}")),
548
+ ctx);
549
+ /* The first transition to MONGOCRYPT_CTX_NEED_MONGO_KEYS requests S_Key.
550
+ */
551
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx),
552
+ MONGOCRYPT_CTX_NEED_MONGO_KEYS);
553
+ ASSERT_OK (mongocrypt_ctx_mongo_feed (
554
+ ctx,
555
+ TEST_FILE ("./test/data/keys/"
556
+ "12345678123498761234123456789012-local-"
557
+ "document.json")),
558
+ ctx);
559
+ ASSERT_OK (mongocrypt_ctx_mongo_done (ctx), ctx);
560
+ mongocrypt_ctx_destroy (ctx);
561
+
562
+ /* Create a new context. S_Key is cached in crypt. */
563
+ ctx = mongocrypt_ctx_new (crypt);
564
+ ASSERT_OK (
565
+ mongocrypt_ctx_decrypt_init (
566
+ ctx,
567
+ TEST_BSON ("{'plainText':'sample','encrypted':{'$binary':{'base64':"
568
+ "'" TEST_IEEV_BASE64 "','subType':'6'}}}")),
569
+ ctx);
570
+ /* The first transition to MONGOCRYPT_CTX_NEED_MONGO_KEYS requests K_Key.
571
+ */
572
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx),
573
+ MONGOCRYPT_CTX_NEED_MONGO_KEYS);
574
+ ASSERT_OK (mongocrypt_ctx_mongo_feed (
575
+ ctx,
576
+ TEST_FILE ("./test/data/keys/"
577
+ "ABCDEFAB123498761234123456789012-local-"
578
+ "document.json")),
579
+ ctx);
580
+ ASSERT_OK (mongocrypt_ctx_mongo_done (ctx), ctx);
581
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx), MONGOCRYPT_CTX_READY);
582
+ out = mongocrypt_binary_new ();
583
+ ASSERT_OK (mongocrypt_ctx_finalize (ctx, out), ctx);
584
+ ASSERT (_mongocrypt_binary_to_bson (out, &out_bson));
585
+ _assert_match_bson (
586
+ &out_bson,
587
+ TMP_BSON ("{'plainText': 'sample', 'encrypted': 'value123' }"));
588
+ mongocrypt_binary_destroy (out);
589
+ mongocrypt_ctx_destroy (ctx);
590
+ mongocrypt_destroy (crypt);
591
+ }
592
+
593
+ /* Test success when S_Key is cached, K_Key is cached. */
594
+ {
595
+ mongocrypt_t *crypt =
596
+ _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
597
+ mongocrypt_ctx_t *ctx;
598
+ mongocrypt_binary_t *out;
599
+ bson_t out_bson;
600
+
601
+ ctx = mongocrypt_ctx_new (crypt);
602
+ ASSERT_OK (
603
+ mongocrypt_ctx_decrypt_init (
604
+ ctx,
605
+ TEST_BSON ("{'plainText':'sample','encrypted':{'$binary':{'base64':"
606
+ "'" TEST_IEEV_BASE64 "','subType':'6'}}}")),
607
+ ctx);
608
+ /* The first transition to MONGOCRYPT_CTX_NEED_MONGO_KEYS requests S_Key.
609
+ */
610
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx),
611
+ MONGOCRYPT_CTX_NEED_MONGO_KEYS);
612
+ ASSERT_OK (mongocrypt_ctx_mongo_feed (
613
+ ctx,
614
+ TEST_FILE ("./test/data/keys/"
615
+ "12345678123498761234123456789012-local-"
616
+ "document.json")),
617
+ ctx);
618
+ ASSERT_OK (mongocrypt_ctx_mongo_done (ctx), ctx);
619
+ /* The second transition to MONGOCRYPT_CTX_NEED_MONGO_KEYS requests K_Key.
620
+ */
621
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx),
622
+ MONGOCRYPT_CTX_NEED_MONGO_KEYS);
623
+ ASSERT_OK (mongocrypt_ctx_mongo_feed (
624
+ ctx,
625
+ TEST_FILE ("./test/data/keys/"
626
+ "ABCDEFAB123498761234123456789012-local-"
627
+ "document.json")),
628
+ ctx);
629
+ ASSERT_OK (mongocrypt_ctx_mongo_done (ctx), ctx);
630
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx), MONGOCRYPT_CTX_READY);
631
+ mongocrypt_ctx_destroy (ctx);
632
+
633
+ /* Create a new ctx. S_Key and K_Key are cached in crypt. */
634
+ ctx = mongocrypt_ctx_new (crypt);
635
+ ASSERT_OK (
636
+ mongocrypt_ctx_decrypt_init (
637
+ ctx,
638
+ TEST_BSON ("{'plainText':'sample','encrypted':{'$binary':{'base64':"
639
+ "'" TEST_IEEV_BASE64 "','subType':'6'}}}")),
640
+ ctx);
641
+ out = mongocrypt_binary_new ();
642
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx), MONGOCRYPT_CTX_READY);
643
+ ASSERT_OK (mongocrypt_ctx_finalize (ctx, out), ctx);
644
+ ASSERT (_mongocrypt_binary_to_bson (out, &out_bson));
645
+ _assert_match_bson (
646
+ &out_bson,
647
+ TMP_BSON ("{'plainText': 'sample', 'encrypted': 'value123'}"));
648
+ mongocrypt_binary_destroy (out);
649
+ mongocrypt_ctx_destroy (ctx);
650
+ mongocrypt_destroy (crypt);
651
+ }
652
+
653
+ /* Test error when S_Key is not provided. */
654
+ {
655
+ mongocrypt_t *crypt =
656
+ _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
657
+ mongocrypt_ctx_t *ctx;
658
+
659
+ ctx = mongocrypt_ctx_new (crypt);
660
+ ASSERT_OK (
661
+ mongocrypt_ctx_decrypt_init (
662
+ ctx,
663
+ TEST_BSON ("{'plainText':'sample','encrypted':{'$binary':{'base64':"
664
+ "'" TEST_IEEV_BASE64 "','subType':'6'}}}")),
665
+ ctx);
666
+ /* The first transition to MONGOCRYPT_CTX_NEED_MONGO_KEYS requests S_Key.
667
+ */
668
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx),
669
+ MONGOCRYPT_CTX_NEED_MONGO_KEYS);
670
+ ASSERT_FAILS (mongocrypt_ctx_mongo_done (ctx),
671
+ ctx,
672
+ "not all keys requested were satisfied");
673
+ mongocrypt_ctx_destroy (ctx);
674
+ mongocrypt_destroy (crypt);
675
+ }
676
+
677
+ /* Test error when K_Key is not provided. */
678
+ {
679
+ mongocrypt_t *crypt =
680
+ _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
681
+ mongocrypt_ctx_t *ctx;
682
+
683
+ ctx = mongocrypt_ctx_new (crypt);
684
+ ASSERT_OK (
685
+ mongocrypt_ctx_decrypt_init (
686
+ ctx,
687
+ TEST_BSON ("{'plainText':'sample','encrypted':{'$binary':{'base64':"
688
+ "'" TEST_IEEV_BASE64 "','subType':'6'}}}")),
689
+ ctx);
690
+ /* The first transition to MONGOCRYPT_CTX_NEED_MONGO_KEYS requests S_Key.
691
+ */
692
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx),
693
+ MONGOCRYPT_CTX_NEED_MONGO_KEYS);
694
+ ASSERT_OK (mongocrypt_ctx_mongo_feed (
695
+ ctx,
696
+ TEST_FILE ("./test/data/keys/"
697
+ "12345678123498761234123456789012-local-"
698
+ "document.json")),
699
+ ctx);
700
+ ASSERT_OK (mongocrypt_ctx_mongo_done (ctx), ctx);
701
+ /* The second transition to MONGOCRYPT_CTX_NEED_MONGO_KEYS requests K_Key.
702
+ */
703
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx),
704
+ MONGOCRYPT_CTX_NEED_MONGO_KEYS);
705
+ ASSERT_FAILS (mongocrypt_ctx_mongo_done (ctx),
706
+ ctx,
707
+ "not all keys requested were satisfied");
708
+ mongocrypt_ctx_destroy (ctx);
709
+ mongocrypt_destroy (crypt);
710
+ }
711
+
712
+ _mongocrypt_buffer_cleanup (&K_KeyId);
713
+ _mongocrypt_buffer_cleanup (&S_KeyId);
714
+
715
+ #undef TEST_IEEV_BASE64
716
+ }
717
+
718
+ static void
719
+ _test_explicit_decrypt_fle2_ieev (_mongocrypt_tester_t *tester)
720
+ {
721
+ _mongocrypt_buffer_t S_KeyId;
722
+ _mongocrypt_buffer_t K_KeyId;
723
+
724
+ if (!_aes_ctr_is_supported_by_os) {
725
+ printf ("Common Crypto with no CTR support detected. Skipping.");
726
+ return;
727
+ }
728
+
729
+ #define TEST_IEEV_BASE64 \
730
+ "BxI0VngSNJh2EjQSNFZ4kBICQ7uhTd9C2oI8M1afRon0ZaYG0s6oTmt0aBZ9kO4S4mm5vId01" \
731
+ "BsW7tBHytA8pDJ2IiWBCmah3OGH2M4ET7PSqekQD4gkUCo4JeEttx4yj05Ou4D6yZUmYfVKmE" \
732
+ "ljge16NCxKm7Ir9gvmQsp8x1wqGBzpndA6gkqFxsxfvQ/" \
733
+ "cIqOwMW9dGTTWsfKge+jYkCUIFMfms+XyC/8evQhjjA+qR6eEmV+N/" \
734
+ "kwpR7Q7TJe0lwU5kw2kSe3/KiPKRZZTbn8znadvycfJ0cCWGad9SQ=="
735
+
736
+ _mongocrypt_buffer_copy_from_hex (&S_KeyId,
737
+ "12345678123498761234123456789012");
738
+ _mongocrypt_buffer_copy_from_hex (&K_KeyId,
739
+ "ABCDEFAB123498761234123456789012");
740
+
741
+ /* Test success with an FLE2IndexedEqualityEncryptedValue payload. */
742
+ {
743
+ mongocrypt_t *crypt =
744
+ _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
745
+ mongocrypt_ctx_t *ctx;
746
+ mongocrypt_binary_t *out;
747
+ bson_t out_bson;
748
+
749
+ ctx = mongocrypt_ctx_new (crypt);
750
+ ASSERT_OK (mongocrypt_ctx_explicit_decrypt_init (
751
+ ctx,
752
+ TEST_BSON ("{'v':{'$binary':{'base64': '" TEST_IEEV_BASE64
753
+ "','subType':'6'}}}")),
754
+ ctx);
755
+ /* The first transition to MONGOCRYPT_CTX_NEED_MONGO_KEYS requests S_Key.
756
+ */
757
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx),
758
+ MONGOCRYPT_CTX_NEED_MONGO_KEYS);
759
+ ASSERT_OK (mongocrypt_ctx_mongo_feed (
760
+ ctx,
761
+ TEST_FILE ("./test/data/keys/"
762
+ "12345678123498761234123456789012-local-"
763
+ "document.json")),
764
+ ctx);
765
+ ASSERT_OK (mongocrypt_ctx_mongo_done (ctx), ctx);
766
+ /* The second transition to MONGOCRYPT_CTX_NEED_MONGO_KEYS requests K_Key.
767
+ */
768
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx),
769
+ MONGOCRYPT_CTX_NEED_MONGO_KEYS);
770
+ ASSERT_OK (mongocrypt_ctx_mongo_feed (
771
+ ctx,
772
+ TEST_FILE ("./test/data/keys/"
773
+ "ABCDEFAB123498761234123456789012-local-"
774
+ "document.json")),
775
+ ctx);
776
+ ASSERT_OK (mongocrypt_ctx_mongo_done (ctx), ctx);
777
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx), MONGOCRYPT_CTX_READY);
778
+ out = mongocrypt_binary_new ();
779
+ ASSERT_OK (mongocrypt_ctx_finalize (ctx, out), ctx);
780
+ ASSERT (_mongocrypt_binary_to_bson (out, &out_bson));
781
+ _assert_match_bson (&out_bson, TMP_BSON ("{'v': 'value123'}"));
782
+ mongocrypt_binary_destroy (out);
783
+ mongocrypt_ctx_destroy (ctx);
784
+ mongocrypt_destroy (crypt);
785
+ }
786
+ _mongocrypt_buffer_cleanup (&K_KeyId);
787
+ _mongocrypt_buffer_cleanup (&S_KeyId);
788
+
789
+ #undef TEST_IEEV_BASE64
790
+ }
791
+
792
+ #define TEST_IUP_BASE64 \
793
+ "BHEBAAAFZAAgAAAAAHb62aV7+mqmaGcotPLdG3KP7S8diFwWMLM/" \
794
+ "5rYtqLrEBXMAIAAAAAAVJ6OWHRv3OtCozHpt3ZzfBhaxZirLv3B+" \
795
+ "G8PuaaO4EgVjACAAAAAAsZXWOWA+UiCBbrJNB6bHflB/" \
796
+ "cn7pWSvwWN2jw4FPeIUFcABQAAAAAMdD1nV2nqeI1eXEQNskDflCy8I7/" \
797
+ "HvvqDKJ6XxjhrPQWdLqjz+8GosGUsB7A8ee/uG9/" \
798
+ "guENuL25XD+" \
799
+ "Fxxkv1LLXtavHOlLF7iW0u9yabqqBXUAEAAAAAQSNFZ4EjSYdhI0EjRWeJASEHQAAgAAAAV2A" \
800
+ "E0AAAAAq83vqxI0mHYSNBI0VniQEkzZZBBDgeZh+h+gXEmOrSFtVvkUcnHWj/" \
801
+ "rfPW7iJ0G3UJ8zpuBmUM/VjOMJCY4+eDqdTiPIwX+/vNXegc8FZQAgAAAAAOuac/" \
802
+ "eRLYakKX6B0vZ1r3QodOQFfjqJD+xlGiPu4/PsAA=="
803
+
804
+ static void
805
+ _test_decrypt_fle2_iup (_mongocrypt_tester_t *tester)
806
+ {
807
+ if (!_aes_ctr_is_supported_by_os) {
808
+ printf ("Common Crypto with no CTR support detected. Skipping.");
809
+ return;
810
+ }
811
+
812
+ /* Test success with an FLE2InsertUpdatePayload. */
813
+ {
814
+ mongocrypt_t *crypt =
815
+ _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
816
+ mongocrypt_ctx_t *ctx;
817
+ mongocrypt_binary_t *out;
818
+ bson_t out_bson;
819
+
820
+ ctx = mongocrypt_ctx_new (crypt);
821
+ ASSERT_OK (
822
+ mongocrypt_ctx_decrypt_init (
823
+ ctx,
824
+ TEST_BSON ("{'plainText':'sample','encrypted':{'$binary':{'base64':"
825
+ "'" TEST_IUP_BASE64 "','subType':'6'}}}")),
826
+ ctx);
827
+
828
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx),
829
+ MONGOCRYPT_CTX_NEED_MONGO_KEYS);
830
+ ASSERT_OK (
831
+ mongocrypt_ctx_mongo_feed (
832
+ ctx,
833
+ TEST_FILE ("./test/data/keys/"
834
+ "ABCDEFAB123498761234123456789012-local-document.json")),
835
+ ctx);
836
+ ASSERT_OK (mongocrypt_ctx_mongo_done (ctx), ctx);
837
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx), MONGOCRYPT_CTX_READY);
838
+ out = mongocrypt_binary_new ();
839
+ ASSERT_OK (mongocrypt_ctx_finalize (ctx, out), ctx);
840
+ ASSERT (_mongocrypt_binary_to_bson (out, &out_bson));
841
+ _assert_match_bson (
842
+ &out_bson,
843
+ TMP_BSON ("{'plainText': 'sample', 'encrypted': 'value123'}"));
844
+ mongocrypt_binary_destroy (out);
845
+ mongocrypt_ctx_destroy (ctx);
846
+ mongocrypt_destroy (crypt);
847
+ }
848
+ }
849
+ #undef TEST_IUP_BASE64
850
+
851
+ /* Test decrypting a BSON binary non-subtype 6 is an error. */
852
+ static void
853
+ _test_decrypt_wrong_binary_subtype (_mongocrypt_tester_t *tester)
854
+ {
855
+ mongocrypt_t *crypt =
856
+ _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
857
+ mongocrypt_ctx_t *ctx = mongocrypt_ctx_new (crypt);
858
+ /* Use subtype 0. */
859
+ ASSERT_FAILS (
860
+ mongocrypt_ctx_explicit_decrypt_init (
861
+ ctx,
862
+ TEST_BSON (
863
+ "{'v': { '$binary': { 'base64': 'AAAA', 'subType': '00' }}}")),
864
+ ctx,
865
+ "decryption expected BSON binary subtype 6, got 0");
866
+ mongocrypt_ctx_destroy (ctx);
867
+ mongocrypt_destroy (crypt);
868
+ }
869
+
870
+ #define TEST_IREV_BASE64 \
871
+ "CRI0VngSNJh2EjQSNFZ4kBIQsPF0Ii0Hfv7ZMhnNt/yt+mviydF8EUw0YlO+amC3IF8dX2J/" \
872
+ "GmRZRnihW3VqJYoLMk0BIit0x9YQiQEEQPxPcTXnCx4t1fquOY7cRGqIAWTDHuQ9AdUw94EY1" \
873
+ "J55mq9UhwD7flh0ySR/SbkTwjIU32U1iM6Bv4AriE4smI87Yd0V7Z7kDoDx7afx9vM/" \
874
+ "+h9NWZvpfYcZ+P32sfILb3BdXT5zLrkyc5Xb3myDxE9abTrR8ePG0YuEmeqwGE4bZ6QHKzd/" \
875
+ "RLmHciWstKOtER5uRpo3p570wGO8QE9QtQoJp/7N7Su30dK/" \
876
+ "bk59hVvlNO6i3nUPwqMd13DePobNGn84q3Fag5O4Kw8P4EGfomFWzxydlVQ0SppGVfan9tIj1" \
877
+ "CFu5doYYT4adzX7L9HinKsTWE5ctD9Qxhhzb2cVs5JO96j4mpwOaloF/" \
878
+ "4qJhyqlzTEpoCXGQ0X9aeEplibFxQ7FJkaFfYzIDIxA2d6lzwVel3j+VwQ7zOP/" \
879
+ "bCnaFu6EP1OQw3ZarsaWGENf45DFuK5RsKX198vZTlqtH24YhAL1+noQTMtpTOp/" \
880
+ "6vrczOXkr7dJGQ6RAfliq1maD18PN5yjdyNhr7BXsrK6f01DX2Xr4s51AARxQ/" \
881
+ "0U5hmb4HjKg8Sbno4Th+Wza3I0RMgM0YzhRUJz+BXzx2l9NPdeyuECdQ1Q2wP1MNOCBy/" \
882
+ "QBJmc+" \
883
+ "RWYK57oWCuv5vmkpN8IlriyRv0PGRhYr4ZcLkDdzmuyfK6SGAvIPD4veDJRj3cXEazyMh6g+" \
884
+ "rvwt70laxo2IOhvUXDc89WvarthTOzlFt5FNrA8uXhUYyL1q1XSWYCiCu5vRv77BvRUJjf2B6" \
885
+ "5kaIKUAGDhYuhch2yU6O9VsHLik3xOGSwIUZJbdMyHY+eA8ZlWZeKJbpjz7a/" \
886
+ "TyBQU6VNG4+Z5SXJjURogkODNkx21QS0Z1+b7ZnCSXf1OQceomkDrREB7vyD2HX5rN2/" \
887
+ "KIBMgH3J7DnG2VpNhYJ9Ve1hMDGcrQggjkCpdP7lloc6QiH837tD/81gYmr95IbuIHe/" \
888
+ "x20oHh9heGHUELnCQ6hXYWOBvSFlGcqZs/" \
889
+ "f0qxn5Fe2OfQPRzEstxoW99IdPvgotDnL2vaz2JNFvFqiofc2pIP7XvpFKIoQO7q8LX9z7ah1" \
890
+ "Yh8cbi6us8g5y9WzOfh882jU7vQT+31a1ZaeDMbFV1Cemc+/" \
891
+ "d0HNksi1qMJtcjrH2MQgXJ3BTyAuJH9OFK8iGqSzHhop9hp5z8mvx834PPjgBfZGt4w/" \
892
+ "7qeie+T4sooGVVqA6F3jl8YfFdIUAwkxe5GBQVVvaRLYm/" \
893
+ "4SLGBf54Dexi7e0+rL2sG5DeKygNdFzMc6lRO+" \
894
+ "gvmAMmDucRm4bxmu7ycNZCQUcuSKoMUWWu6A6eUiyBCQUxrrlX/" \
895
+ "3CkRXkQQ6JCwZZMvTgBokYx3WQR6LpW70xWLXyQhav4ZnHKzgITSOe7mUkMJ35NDMD+" \
896
+ "qsxXY7sWbGz+b60DWF7yaMVzDPzIGjWLpckMRMxgN3bQ5SE/mFxdjoZD5yYb84q/" \
897
+ "O7EjwGA9MSTp9MFEZt7VV3f5TDWiNUZKmjUgOdjBoTSAkVzAO2nqqQNg23x6Z6FQDBeefRkfc" \
898
+ "9FoUiBqHuN4fU/zc4Hkthp1McwIkYwRdlgPceD/" \
899
+ "BSNbkNRNAnzghBhCquIqpXd8AptBX2qO67rfT7COhpn/" \
900
+ "fzVo3ueCRTaM2DtjD3uuH4rMNb3LDjyJFX1DZ5eEWkGq9UE/" \
901
+ "AFivfeia4cA0a8Z1LzZcW7WvE5Y1WIZN4gy9SZcNgHEQq8Ad8Q4fAbxe8XJ6/" \
902
+ "tNvG+AvAuLEvNJtbhC/4Ei/" \
903
+ "JoXplvutDlW5d6g4KEWj4GICqggM5ZSv0TCkbfFkLdaJrOHrn+oI++" \
904
+ "krv1U4yQk6P18Mg2bE18ibe+LdWNsqn01V7yDmS+" \
905
+ "VAvqQF8f2p4rOOyWsGc7CoyXSrq9LCuGq9eMPR6auo+" \
906
+ "tyS1Nek2t6SgpOpzBBDdQnC5sHC1OWTW3ui7w4H0NKCuZOiMncbSDOlegn8C0zZa6Z5iYAce8" \
907
+ "a8Ow3jryBEnKBaguhjjOMG8iX/eka8XP+UTxvso4fKVVOXQwobZMdYbf/" \
908
+ "sXNJbMbWrFc1S9rdlXL/" \
909
+ "nnYvYrRMnOBJ27Mz5vvtOpd4fyQ+wi1q+" \
910
+ "5VvuLDM8u51B4oaYqpGUZZ3qVS5BBYm9cDxgMtcdoXjOSopHasdAhron+" \
911
+ "NdbGFBxyrUGKnnVXYocEuvsvwhBEA3HUUVV94m3C0agh2eVpmCIyWrs+" \
912
+ "grkpAaNLZwXVuzegttJ0GoTxzQnDIWkvlvkS3ZGo25spfPp+/Nda4SZAYRNmtnGfB2TRl0Wx/" \
913
+ "o/" \
914
+ "V2vx+9qnGyDq52CSkMftpfnsMXAnAv6ps7U+" \
915
+ "mgbgNPUFjv1Y0xKaeJdshu1HyEmq5aYqHJSfF2EzvPfH4d0Ijz1lsxMxL4IsqB7kufcOR4FFn" \
916
+ "aYXKIXLjRwM5VZNAK/3dvCb3l9H7QMOiJPbdoxAd123aymjz9N/" \
917
+ "2O33wMaG6OE8pXp0iYEaW7DOr0FfT913JeUnPNPcqqsA9YXod2UuNWZElTW/" \
918
+ "saL32v9akNwA4Jd7Y5VgI4y+XyDH3kAU0Uc8g6YCx/hqcn4pd2+ryH+/" \
919
+ "5nVQhnCE0KNOjjrFS92RNLD71GUhWR+VXMw2tKXBUSKnt9Ai4LLJrdvFbwrdqK+" \
920
+ "AjBUVqI3MgylNxRw2395ppAbheE1pAcoqLoDOGyOs66Y8kJGpaqs0AmdmZHw2OA26btw+" \
921
+ "ceBN+UgScsB5P5wNIup1AvU5J7h1vlFBNygg3WO/MJGCz48xgJ/" \
922
+ "klg9wCLQ+vXtrhYJz15RgguADFLBrTcV/Miel20KulnprI+/" \
923
+ "lXtRvEAoGJSc0UZ8J7UVTf8kvYzT3hF7XzZzlhKxPYebjdnp2la4o2PkyZXcc/" \
924
+ "gFLa7ickR28ZPUigwpW0lK5sJIwWbnZmP5wbQNhiGO8QL9gVpFOnu0xHpu8MqBvfZGf2HiE+" \
925
+ "qBUSR89v88gz6u/TVP9zVH1dnk9PE54Uw3yPdxL/" \
926
+ "feukvF71sEI6WWd2fdupgRlDGzASrKSAsFbaZobwUViEIFbWo7zPYVZyMglCrD1Xoxdd6EBeU" \
927
+ "SJDkS1nhiHOR/7FpIhae8fggAD+StXR7725vzcwIOX21ozRcE2iWw6OP99vDoqLQ8VYzYS0/" \
928
+ "f3WMME6b5ndYz25uC0AiULXYI="
929
+
930
+ /* Test decrypting FLE2IndexedRangeEncryptedValue */
931
+ static void
932
+ _test_decrypt_fle2_irev (_mongocrypt_tester_t *tester)
933
+ {
934
+ if (!_aes_ctr_is_supported_by_os) {
935
+ printf ("Common Crypto with no CTR support detected. Skipping.");
936
+ return;
937
+ }
938
+
939
+ /* Test success with an FLE2IndexedEqualityEncryptedValue payload. */
940
+ {
941
+ mongocrypt_t *crypt =
942
+ _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
943
+ mongocrypt_ctx_t *ctx;
944
+ mongocrypt_binary_t *out;
945
+ bson_t out_bson;
946
+
947
+ ctx = mongocrypt_ctx_new (crypt);
948
+ ASSERT_OK (
949
+ mongocrypt_ctx_decrypt_init (
950
+ ctx,
951
+ TEST_BSON ("{'plainText':'sample','encrypted':{'$binary':{'base64':"
952
+ "'" TEST_IREV_BASE64 "','subType':'6'}}}")),
953
+ ctx);
954
+ /* The first transition to MONGOCRYPT_CTX_NEED_MONGO_KEYS requests S_Key.
955
+ */
956
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx),
957
+ MONGOCRYPT_CTX_NEED_MONGO_KEYS);
958
+ {
959
+ mongocrypt_binary_t *filter = mongocrypt_binary_new ();
960
+ ASSERT_OK (mongocrypt_ctx_mongo_op (ctx, filter), ctx);
961
+ ASSERT_MONGOCRYPT_BINARY_EQUAL_BSON (
962
+ TEST_FILE ("./test/data/fle2-decrypt-ieev/first-filter.json"),
963
+ filter);
964
+ mongocrypt_binary_destroy (filter);
965
+ }
966
+ ASSERT_OK (mongocrypt_ctx_mongo_feed (
967
+ ctx,
968
+ TEST_FILE ("./test/data/keys/"
969
+ "12345678123498761234123456789012-local-"
970
+ "document.json")),
971
+ ctx);
972
+ ASSERT_OK (mongocrypt_ctx_mongo_done (ctx), ctx);
973
+ /* The second transition to MONGOCRYPT_CTX_NEED_MONGO_KEYS requests K_Key.
974
+ */
975
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx),
976
+ MONGOCRYPT_CTX_NEED_MONGO_KEYS);
977
+ {
978
+ mongocrypt_binary_t *filter = mongocrypt_binary_new ();
979
+ ASSERT_OK (mongocrypt_ctx_mongo_op (ctx, filter), ctx);
980
+ ASSERT_MONGOCRYPT_BINARY_EQUAL_BSON (
981
+ TEST_FILE ("./test/data/fle2-decrypt-ieev/second-filter.json"),
982
+ filter);
983
+ mongocrypt_binary_destroy (filter);
984
+ }
985
+ ASSERT_OK (mongocrypt_ctx_mongo_feed (
986
+ ctx,
987
+ TEST_FILE ("./test/data/keys/"
988
+ "ABCDEFAB123498761234123456789012-local-"
989
+ "document.json")),
990
+ ctx);
991
+ ASSERT_OK (mongocrypt_ctx_mongo_done (ctx), ctx);
992
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx), MONGOCRYPT_CTX_READY);
993
+ out = mongocrypt_binary_new ();
994
+ ASSERT_OK (mongocrypt_ctx_finalize (ctx, out), ctx);
995
+ ASSERT (_mongocrypt_binary_to_bson (out, &out_bson));
996
+ _assert_match_bson (
997
+ &out_bson, TMP_BSON ("{'plainText': 'sample', 'encrypted': 123456}"));
998
+ mongocrypt_binary_destroy (out);
999
+ mongocrypt_ctx_destroy (ctx);
1000
+ mongocrypt_destroy (crypt);
1001
+ }
1002
+ }
1003
+
1004
+ // Test explicitly decrypting an FLE2IndexedRangeEncryptedValue.
1005
+ static void
1006
+ _test_explicit_decrypt_fle2_irev (_mongocrypt_tester_t *tester)
1007
+ {
1008
+ if (!_aes_ctr_is_supported_by_os) {
1009
+ printf ("Common Crypto with no CTR support detected. Skipping.");
1010
+ return;
1011
+ }
1012
+
1013
+ mongocrypt_t *crypt =
1014
+ _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
1015
+ mongocrypt_ctx_t *ctx;
1016
+ mongocrypt_binary_t *out;
1017
+ bson_t out_bson;
1018
+
1019
+ ctx = mongocrypt_ctx_new (crypt);
1020
+ ASSERT_OK (mongocrypt_ctx_explicit_decrypt_init (
1021
+ ctx,
1022
+ TEST_BSON ("{'v': {'$binary':{'base64':'" TEST_IREV_BASE64
1023
+ "','subType':'6'}}}")),
1024
+ ctx);
1025
+ /* The first transition to MONGOCRYPT_CTX_NEED_MONGO_KEYS requests S_Key.
1026
+ */
1027
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx),
1028
+ MONGOCRYPT_CTX_NEED_MONGO_KEYS);
1029
+ {
1030
+ mongocrypt_binary_t *filter = mongocrypt_binary_new ();
1031
+ ASSERT_OK (mongocrypt_ctx_mongo_op (ctx, filter), ctx);
1032
+ ASSERT_MONGOCRYPT_BINARY_EQUAL_BSON (
1033
+ TEST_FILE ("./test/data/fle2-decrypt-ieev/first-filter.json"), filter);
1034
+ mongocrypt_binary_destroy (filter);
1035
+ }
1036
+ ASSERT_OK (mongocrypt_ctx_mongo_feed (
1037
+ ctx,
1038
+ TEST_FILE ("./test/data/keys/"
1039
+ "12345678123498761234123456789012-local-"
1040
+ "document.json")),
1041
+ ctx);
1042
+ ASSERT_OK (mongocrypt_ctx_mongo_done (ctx), ctx);
1043
+ /* The second transition to MONGOCRYPT_CTX_NEED_MONGO_KEYS requests K_Key.
1044
+ */
1045
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx),
1046
+ MONGOCRYPT_CTX_NEED_MONGO_KEYS);
1047
+ {
1048
+ mongocrypt_binary_t *filter = mongocrypt_binary_new ();
1049
+ ASSERT_OK (mongocrypt_ctx_mongo_op (ctx, filter), ctx);
1050
+ ASSERT_MONGOCRYPT_BINARY_EQUAL_BSON (
1051
+ TEST_FILE ("./test/data/fle2-decrypt-ieev/second-filter.json"),
1052
+ filter);
1053
+ mongocrypt_binary_destroy (filter);
1054
+ }
1055
+ ASSERT_OK (mongocrypt_ctx_mongo_feed (
1056
+ ctx,
1057
+ TEST_FILE ("./test/data/keys/"
1058
+ "ABCDEFAB123498761234123456789012-local-"
1059
+ "document.json")),
1060
+ ctx);
1061
+ ASSERT_OK (mongocrypt_ctx_mongo_done (ctx), ctx);
1062
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx), MONGOCRYPT_CTX_READY);
1063
+ out = mongocrypt_binary_new ();
1064
+ ASSERT_OK (mongocrypt_ctx_finalize (ctx, out), ctx);
1065
+ ASSERT (_mongocrypt_binary_to_bson (out, &out_bson));
1066
+ _assert_match_bson (&out_bson, TMP_BSON ("{'v': 123456}"));
1067
+ mongocrypt_binary_destroy (out);
1068
+ mongocrypt_ctx_destroy (ctx);
1069
+ mongocrypt_destroy (crypt);
1070
+ }
1071
+
1072
+ #undef TEST_IREV_BASE64
1073
+
1074
+ // Test explicitly decrypting an FLE2InsertUpdatePayload with edges.
1075
+ static void
1076
+ _test_explicit_decrypt_fle2_iup_with_edges (_mongocrypt_tester_t *tester)
1077
+ {
1078
+ if (!_aes_ctr_is_supported_by_os) {
1079
+ printf ("Common Crypto with no CTR support detected. Skipping.");
1080
+ return;
1081
+ }
1082
+
1083
+ /* Test success with an FLE2IndexedEqualityEncryptedValue payload. */
1084
+ mongocrypt_t *crypt =
1085
+ _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
1086
+ mongocrypt_ctx_t *ctx;
1087
+ mongocrypt_binary_t *out;
1088
+ bson_t out_bson;
1089
+
1090
+ ctx = mongocrypt_ctx_new (crypt);
1091
+ ASSERT_OK (mongocrypt_ctx_explicit_decrypt_init (
1092
+ ctx,
1093
+ TEST_FILE ("./test/data/fle2-insert-range-explicit/int32/"
1094
+ "encrypted-payload.json")),
1095
+ ctx);
1096
+
1097
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx),
1098
+ MONGOCRYPT_CTX_NEED_MONGO_KEYS);
1099
+ ASSERT_OK (mongocrypt_ctx_mongo_feed (
1100
+ ctx,
1101
+ TEST_FILE ("./test/data/keys/"
1102
+ "ABCDEFAB123498761234123456789012-local-"
1103
+ "document.json")),
1104
+ ctx);
1105
+ ASSERT_OK (mongocrypt_ctx_mongo_done (ctx), ctx);
1106
+ ASSERT_STATE_EQUAL (mongocrypt_ctx_state (ctx), MONGOCRYPT_CTX_READY);
1107
+ out = mongocrypt_binary_new ();
1108
+ ASSERT_OK (mongocrypt_ctx_finalize (ctx, out), ctx);
1109
+ ASSERT (_mongocrypt_binary_to_bson (out, &out_bson));
1110
+ _assert_match_bson (&out_bson, TMP_BSON ("{'v': 123456}"));
1111
+ mongocrypt_binary_destroy (out);
1112
+ mongocrypt_ctx_destroy (ctx);
1113
+ mongocrypt_destroy (crypt);
1114
+ }
1115
+
1116
+ void
1117
+ _mongocrypt_tester_install_ctx_decrypt (_mongocrypt_tester_t *tester)
1118
+ {
1119
+ INSTALL_TEST (_test_explicit_decrypt_init);
1120
+ INSTALL_TEST (_test_decrypt_init);
1121
+ INSTALL_TEST (_test_decrypt_need_keys);
1122
+ INSTALL_TEST (_test_decrypt_ready);
1123
+ INSTALL_TEST (_test_decrypt_empty_aws);
1124
+ INSTALL_TEST (_test_decrypt_empty_binary);
1125
+ INSTALL_TEST (_test_decrypt_per_ctx_credentials);
1126
+ INSTALL_TEST (_test_decrypt_per_ctx_credentials_local);
1127
+ INSTALL_TEST (_test_decrypt_fle2);
1128
+ INSTALL_TEST (_test_explicit_decrypt_fle2_ieev);
1129
+ INSTALL_TEST (_test_decrypt_fle2_iup);
1130
+ INSTALL_TEST (_test_decrypt_wrong_binary_subtype);
1131
+ INSTALL_TEST (_test_decrypt_fle2_irev);
1132
+ INSTALL_TEST (_test_explicit_decrypt_fle2_irev);
1133
+ INSTALL_TEST (_test_explicit_decrypt_fle2_iup_with_edges);
1134
+ }