libmongocrypt-helper 1.6.1.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 +15 -1
  988. data.tar.gz.sig +0 -0
  989. metadata +1019 -32
  990. metadata.gz.sig +0 -0
  991. data/so/libmongocrypt.so +0 -0
@@ -0,0 +1,1174 @@
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.h"
18
+ #include "mongocrypt-key-broker-private.h"
19
+ #include "mongocrypt-key-private.h"
20
+ #include "test-mongocrypt.h"
21
+
22
+ /* Given a string, populate a bson_value_t for that string */
23
+ static void
24
+ _bson_value_from_string (char *string, bson_value_t *value)
25
+ {
26
+ bson_t *bson;
27
+ bson_iter_t iter;
28
+
29
+ bson = BCON_NEW ("key", string);
30
+ BSON_ASSERT (bson_iter_init_find (&iter, bson, "key"));
31
+ bson_value_copy (bson_iter_value (&iter), value);
32
+
33
+ bson_destroy (bson);
34
+ }
35
+
36
+ static void
37
+ _key_broker_add_name (_mongocrypt_key_broker_t *kb, char *string)
38
+ {
39
+ bson_value_t key_name;
40
+
41
+ _bson_value_from_string (string, &key_name);
42
+ ASSERT_OK (_mongocrypt_key_broker_request_name (kb, (void *) &key_name), kb);
43
+ bson_value_destroy (&key_name);
44
+ }
45
+
46
+ /* Create an example 16 byte UUID. Use first_byte to distinguish. */
47
+ static void
48
+ _gen_uuid (uint8_t first_byte, _mongocrypt_buffer_t *out)
49
+ {
50
+ _mongocrypt_tester_fill_buffer (out, 16);
51
+ out->subtype = BSON_SUBTYPE_UUID;
52
+ out->data[0] = first_byte;
53
+ }
54
+
55
+
56
+ /* Create an example 16 byte UUID and a corresponding key document with the same
57
+ * _id as the UUID. */
58
+ static void
59
+ _gen_uuid_and_key_and_altname (_mongocrypt_tester_t *tester,
60
+ char *altname,
61
+ uint8_t first_byte,
62
+ _mongocrypt_buffer_t *id,
63
+ _mongocrypt_buffer_t *doc)
64
+ {
65
+ bson_t as_bson, copied;
66
+
67
+ _gen_uuid (first_byte, id);
68
+ BSON_ASSERT (_mongocrypt_binary_to_bson (
69
+ TEST_FILE ("./test/example/key-document.json"), &as_bson));
70
+ bson_init (&copied);
71
+ bson_copy_to_excluding_noinit (
72
+ &as_bson, &copied, "_id", "keyAltNames", NULL);
73
+ BSON_ASSERT (_mongocrypt_buffer_append (id, &copied, "_id", 3));
74
+ if (altname) {
75
+ bson_t child;
76
+ bson_append_array_begin (&copied, "keyAltNames", -1, &child);
77
+ bson_append_utf8 (&child, "0", -1, altname, -1);
78
+ bson_append_array_end (&copied, &child);
79
+ }
80
+ _mongocrypt_buffer_steal_from_bson (doc, &copied);
81
+ }
82
+
83
+ static void
84
+ _gen_uuid_and_key (_mongocrypt_tester_t *tester,
85
+ uint8_t first_byte,
86
+ _mongocrypt_buffer_t *id,
87
+ _mongocrypt_buffer_t *doc)
88
+ {
89
+ _gen_uuid_and_key_and_altname (tester, NULL, first_byte, id, doc);
90
+ }
91
+
92
+
93
+ static uint32_t
94
+ _key_broker_num_satisfied (_mongocrypt_key_broker_t *kb)
95
+ {
96
+ key_request_t *req;
97
+ uint32_t count;
98
+
99
+ count = 0;
100
+ for (req = kb->key_requests; NULL != req; req = req->next) {
101
+ if (req->satisfied) {
102
+ count++;
103
+ }
104
+ }
105
+ return count;
106
+ }
107
+
108
+ static void
109
+ _test_key_broker_get_key_filter (_mongocrypt_tester_t *tester)
110
+ {
111
+ mongocrypt_t *crypt;
112
+ mongocrypt_status_t *status;
113
+ _mongocrypt_buffer_t key_id1, key_id2;
114
+ mongocrypt_binary_t *filter;
115
+ _mongocrypt_key_broker_t key_broker;
116
+ bson_t as_bson;
117
+ bson_t *expected;
118
+
119
+ status = mongocrypt_status_new ();
120
+ crypt = _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
121
+ _gen_uuid (1, &key_id1);
122
+ _gen_uuid (2, &key_id2);
123
+
124
+ /* Multiple different key ids. */
125
+ _mongocrypt_key_broker_init (&key_broker, crypt);
126
+ ASSERT_OK (_mongocrypt_key_broker_request_id (&key_broker, &key_id1),
127
+ &key_broker);
128
+ ASSERT_OK (_mongocrypt_key_broker_request_id (&key_broker, &key_id2),
129
+ &key_broker);
130
+ filter = mongocrypt_binary_new ();
131
+ ASSERT_OK (_mongocrypt_key_broker_requests_done (&key_broker), &key_broker);
132
+ ASSERT_OK (_mongocrypt_key_broker_filter (&key_broker, filter), &key_broker);
133
+ BSON_ASSERT (_mongocrypt_binary_to_bson (filter, &as_bson));
134
+
135
+ expected = BCON_NEW ("$or",
136
+ "[",
137
+ "{",
138
+ "_id",
139
+ "{",
140
+ "$in",
141
+ "[",
142
+ BCON_BIN (BSON_SUBTYPE_UUID, key_id2.data, key_id2.len),
143
+ BCON_BIN (BSON_SUBTYPE_UUID, key_id1.data, key_id1.len),
144
+ "]",
145
+ "}",
146
+ "}",
147
+ "{",
148
+ "keyAltNames",
149
+ "{",
150
+ "$in",
151
+ "[",
152
+ "]",
153
+ "}",
154
+ "}",
155
+ "]");
156
+
157
+ BSON_ASSERT (0 == bson_compare (expected, &as_bson));
158
+ bson_destroy (expected);
159
+ _mongocrypt_key_broker_cleanup (&key_broker);
160
+ mongocrypt_binary_destroy (filter);
161
+
162
+ /* Duplicate key ids. */
163
+ _mongocrypt_key_broker_init (&key_broker, crypt);
164
+ ASSERT_OK (_mongocrypt_key_broker_request_id (&key_broker, &key_id1),
165
+ &key_broker);
166
+ ASSERT_OK (_mongocrypt_key_broker_request_id (&key_broker, &key_id1),
167
+ &key_broker);
168
+ ASSERT_OK (_mongocrypt_key_broker_requests_done (&key_broker), &key_broker);
169
+ filter = mongocrypt_binary_new ();
170
+ ASSERT_OK (_mongocrypt_key_broker_filter (&key_broker, filter), &key_broker);
171
+ BSON_ASSERT (_mongocrypt_binary_to_bson (filter, &as_bson));
172
+
173
+ expected = BCON_NEW ("$or",
174
+ "[",
175
+ "{",
176
+ "_id",
177
+ "{",
178
+ "$in",
179
+ "[",
180
+ BCON_BIN (BSON_SUBTYPE_UUID, key_id1.data, key_id1.len),
181
+ "]",
182
+ "}",
183
+ "}",
184
+ "{",
185
+ "keyAltNames",
186
+ "{",
187
+ "$in",
188
+ "[",
189
+ "]",
190
+ "}",
191
+ "}",
192
+ "]");
193
+
194
+ BSON_ASSERT (0 == bson_compare (expected, &as_bson));
195
+ bson_destroy (expected);
196
+ _mongocrypt_key_broker_cleanup (&key_broker);
197
+ mongocrypt_binary_destroy (filter);
198
+
199
+ /* No key requests made. */
200
+ _mongocrypt_key_broker_init (&key_broker, crypt);
201
+ filter = mongocrypt_binary_new ();
202
+ ASSERT_FAILS (_mongocrypt_key_broker_filter (&key_broker, filter),
203
+ &key_broker,
204
+ "in wrong state");
205
+ mongocrypt_binary_destroy (filter);
206
+ _mongocrypt_key_broker_cleanup (&key_broker);
207
+
208
+ /* Both key ids and keyAltName */
209
+ _mongocrypt_key_broker_init (&key_broker, crypt);
210
+ _key_broker_add_name (&key_broker, "Miriam");
211
+ ASSERT_OK (_mongocrypt_key_broker_request_id (&key_broker, &key_id1),
212
+ &key_broker);
213
+ ASSERT_OK (_mongocrypt_key_broker_requests_done (&key_broker), &key_broker);
214
+ filter = mongocrypt_binary_new ();
215
+ ASSERT_OK (_mongocrypt_key_broker_filter (&key_broker, filter), &key_broker);
216
+ BSON_ASSERT (_mongocrypt_binary_to_bson (filter, &as_bson));
217
+
218
+ expected = BCON_NEW ("$or",
219
+ "[",
220
+ "{",
221
+ "_id",
222
+ "{",
223
+ "$in",
224
+ "[",
225
+ BCON_BIN (BSON_SUBTYPE_UUID, key_id1.data, key_id1.len),
226
+ "]",
227
+ "}",
228
+ "}",
229
+ "{",
230
+ "keyAltNames",
231
+ "{",
232
+ "$in",
233
+ "[",
234
+ BCON_UTF8 ("Miriam"),
235
+ "]",
236
+ "}",
237
+ "}",
238
+ "]");
239
+
240
+ BSON_ASSERT (0 == bson_compare (expected, &as_bson));
241
+ bson_destroy (expected);
242
+ _mongocrypt_key_broker_cleanup (&key_broker);
243
+ mongocrypt_binary_destroy (filter);
244
+
245
+ /* Keys with only keyAltName */
246
+ _mongocrypt_key_broker_init (&key_broker, crypt);
247
+ _key_broker_add_name (&key_broker, "Sharlene");
248
+ _key_broker_add_name (&key_broker, "Emily");
249
+ ASSERT_OK (_mongocrypt_key_broker_requests_done (&key_broker), &key_broker);
250
+ filter = mongocrypt_binary_new ();
251
+ ASSERT_OK (_mongocrypt_key_broker_filter (&key_broker, filter), &key_broker);
252
+ BSON_ASSERT (_mongocrypt_binary_to_bson (filter, &as_bson));
253
+
254
+ expected = BCON_NEW ("$or",
255
+ "[",
256
+ "{",
257
+ "_id",
258
+ "{",
259
+ "$in",
260
+ "[",
261
+ "]",
262
+ "}",
263
+ "}",
264
+ "{",
265
+ "keyAltNames",
266
+ "{",
267
+ "$in",
268
+ "[",
269
+ BCON_UTF8 ("Emily"),
270
+ BCON_UTF8 ("Sharlene"),
271
+ "]",
272
+ "}",
273
+ "}",
274
+ "]");
275
+
276
+ BSON_ASSERT (0 == bson_compare (expected, &as_bson));
277
+ bson_destroy (expected);
278
+ _mongocrypt_key_broker_cleanup (&key_broker);
279
+ mongocrypt_binary_destroy (filter);
280
+
281
+ /* Duplicate alt names */
282
+ _mongocrypt_key_broker_init (&key_broker, crypt);
283
+ _key_broker_add_name (&key_broker, "Jackie");
284
+ _key_broker_add_name (&key_broker, "Jackie");
285
+ _key_broker_add_name (&key_broker, "Jackie");
286
+ ASSERT_OK (_mongocrypt_key_broker_requests_done (&key_broker), &key_broker);
287
+ filter = mongocrypt_binary_new ();
288
+ ASSERT_OK (_mongocrypt_key_broker_filter (&key_broker, filter), &key_broker);
289
+ BSON_ASSERT (_mongocrypt_binary_to_bson (filter, &as_bson));
290
+
291
+ expected = BCON_NEW ("$or",
292
+ "[",
293
+ "{",
294
+ "_id",
295
+ "{",
296
+ "$in",
297
+ "[",
298
+ "]",
299
+ "}",
300
+ "}",
301
+ "{",
302
+ "keyAltNames",
303
+ "{",
304
+ "$in",
305
+ "[",
306
+ BCON_UTF8 ("Jackie"),
307
+ "]",
308
+ "}",
309
+ "}",
310
+ "]");
311
+
312
+ BSON_ASSERT (0 == bson_compare (expected, &as_bson));
313
+ bson_destroy (expected);
314
+ _mongocrypt_key_broker_cleanup (&key_broker);
315
+ mongocrypt_binary_destroy (filter);
316
+
317
+ _mongocrypt_buffer_cleanup (&key_id1);
318
+ _mongocrypt_buffer_cleanup (&key_id2);
319
+ mongocrypt_status_destroy (status);
320
+ mongocrypt_destroy (crypt);
321
+ }
322
+
323
+
324
+ static void
325
+ _test_key_broker_add_key (_mongocrypt_tester_t *tester)
326
+ {
327
+ mongocrypt_t *crypt;
328
+ mongocrypt_status_t *status;
329
+ _mongocrypt_buffer_t key_id1, key_id2, key_doc1, key_doc2, malformed_buf,
330
+ key_buf_x, key_buf_y, key_doc_names;
331
+ _mongocrypt_buffer_t *id_x;
332
+ _mongocrypt_key_doc_t *key_x;
333
+ bson_t key_bson_x;
334
+ bson_t *malformed;
335
+ _mongocrypt_opts_kms_providers_t *kms_providers;
336
+ _mongocrypt_key_broker_t key_broker;
337
+
338
+ status = mongocrypt_status_new ();
339
+ crypt = _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
340
+ kms_providers = &crypt->opts.kms_providers;
341
+ _gen_uuid_and_key (tester, 1, &key_id1, &key_doc1);
342
+ _gen_uuid_and_key (tester, 2, &key_id2, &key_doc2);
343
+
344
+ /* Valid key documents. */
345
+ _mongocrypt_key_broker_init (&key_broker, crypt);
346
+ ASSERT_OK (_mongocrypt_key_broker_request_id (&key_broker, &key_id1),
347
+ &key_broker);
348
+ ASSERT_OK (_mongocrypt_key_broker_request_id (&key_broker, &key_id2),
349
+ &key_broker);
350
+ ASSERT_OK (_mongocrypt_key_broker_requests_done (&key_broker), &key_broker);
351
+ ASSERT_OK (
352
+ _mongocrypt_key_broker_add_doc (&key_broker, kms_providers, &key_doc2),
353
+ &key_broker);
354
+ ASSERT_OK (
355
+ _mongocrypt_key_broker_add_doc (&key_broker, kms_providers, &key_doc1),
356
+ &key_broker);
357
+ ASSERT_OK (_mongocrypt_key_broker_docs_done (&key_broker), &key_broker);
358
+ _mongocrypt_key_broker_cleanup (&key_broker);
359
+
360
+ /* Valid document with a key name. */
361
+ _mongocrypt_key_broker_init (&key_broker, crypt);
362
+ _key_broker_add_name (&key_broker, "Kasey");
363
+ _mongocrypt_buffer_from_binary (
364
+ &key_doc_names,
365
+ TEST_FILE ("./test/data/key-document-with-alt-name.json"));
366
+ ASSERT_OK (_mongocrypt_key_broker_requests_done (&key_broker), &key_broker);
367
+ ASSERT_OK (_mongocrypt_key_broker_add_doc (
368
+ &key_broker, kms_providers, &key_doc_names),
369
+ &key_broker);
370
+ _mongocrypt_key_broker_cleanup (&key_broker);
371
+
372
+ /* Malformed key document. */
373
+ malformed = BCON_NEW ("abc", BCON_INT32 (123));
374
+ _mongocrypt_key_broker_init (&key_broker, crypt);
375
+ ASSERT_OK (_mongocrypt_key_broker_request_id (&key_broker, &key_id1),
376
+ &key_broker);
377
+ ASSERT_OK (_mongocrypt_key_broker_requests_done (&key_broker), &key_broker);
378
+ _mongocrypt_buffer_from_bson (&malformed_buf, malformed);
379
+ ASSERT_FAILS (_mongocrypt_key_broker_add_doc (
380
+ &key_broker, kms_providers, &malformed_buf),
381
+ &key_broker,
382
+ "unrecognized field");
383
+ _mongocrypt_key_broker_cleanup (&key_broker);
384
+ bson_destroy (malformed);
385
+
386
+ /* NULL key document. */
387
+ _mongocrypt_key_broker_init (&key_broker, crypt);
388
+ BSON_ASSERT (_mongocrypt_key_broker_request_id (&key_broker, &key_id1));
389
+ ASSERT_OK (_mongocrypt_key_broker_requests_done (&key_broker), &key_broker);
390
+ ASSERT_FAILS (
391
+ _mongocrypt_key_broker_add_doc (&key_broker, kms_providers, NULL),
392
+ &key_broker,
393
+ "invalid key");
394
+ _mongocrypt_key_broker_cleanup (&key_broker);
395
+
396
+ /* Unmatched key document. */
397
+ _mongocrypt_key_broker_init (&key_broker, crypt);
398
+ ASSERT_OK (_mongocrypt_key_broker_request_id (&key_broker, &key_id1),
399
+ &key_broker);
400
+ ASSERT_OK (_mongocrypt_key_broker_requests_done (&key_broker), &key_broker);
401
+ ASSERT_FAILS (
402
+ _mongocrypt_key_broker_add_doc (&key_broker, kms_providers, &key_doc2),
403
+ &key_broker,
404
+ "unexpected key returned");
405
+ _mongocrypt_key_broker_cleanup (&key_broker);
406
+
407
+ /* Two key documents with the same keyAltName and
408
+ different key ids. In order to test this, we need
409
+ to add a name X and an id Y to the broker, then
410
+ add a document with name X and id Z (succeeds) and
411
+ afterwards add a doc with name X and id Y (fails). */
412
+ key_x = _mongocrypt_key_new ();
413
+ _mongocrypt_key_broker_init (&key_broker, crypt);
414
+
415
+ _mongocrypt_buffer_from_binary (
416
+ &key_buf_x, TEST_FILE ("./test/data/key-document-with-alt-name.json"));
417
+ _mongocrypt_buffer_from_binary (
418
+ &key_buf_y,
419
+ TEST_FILE ("./test/data/key-document-with-alt-name-duplicate-id.json"));
420
+
421
+ BSON_ASSERT (_mongocrypt_buffer_to_bson (&key_buf_x, &key_bson_x));
422
+ ASSERT_OR_PRINT (_mongocrypt_key_parse_owned (&key_bson_x, key_x, status),
423
+ status);
424
+ id_x = &key_x->id;
425
+
426
+ /* Configure the key broker so it contains:
427
+ - { id : X }
428
+ - { name : "Sharlene" } */
429
+ ASSERT_OK (_mongocrypt_key_broker_request_id (&key_broker, id_x),
430
+ &key_broker);
431
+ _key_broker_add_name (&key_broker, "Sharlene");
432
+ ASSERT_OK (_mongocrypt_key_broker_requests_done (&key_broker), &key_broker);
433
+
434
+ /* Add { id : Y, name : "Sharlene" }, should pass. */
435
+ ASSERT_OK (
436
+ _mongocrypt_key_broker_add_doc (&key_broker, kms_providers, &key_buf_y),
437
+ &key_broker);
438
+
439
+ /* Add { id : X, name : "Sharlene" }, should fail, it shares an alt name. */
440
+ ASSERT_FAILS (
441
+ _mongocrypt_key_broker_add_doc (&key_broker, kms_providers, &key_buf_x),
442
+ &key_broker,
443
+ "duplicate keyAltNames");
444
+
445
+ _mongocrypt_key_broker_cleanup (&key_broker);
446
+
447
+ /* Calling done before supplying all keys. */
448
+ _mongocrypt_key_broker_init (&key_broker, crypt);
449
+ ASSERT_OK (_mongocrypt_key_broker_request_id (&key_broker, &key_id1),
450
+ &key_broker);
451
+ _mongocrypt_key_broker_cleanup (&key_broker);
452
+
453
+ bson_destroy (&key_bson_x);
454
+ _mongocrypt_key_destroy (key_x);
455
+ _mongocrypt_buffer_cleanup (&key_doc_names);
456
+ _mongocrypt_buffer_cleanup (&key_id1);
457
+ _mongocrypt_buffer_cleanup (&key_id2);
458
+ _mongocrypt_buffer_cleanup (&key_doc1);
459
+ _mongocrypt_buffer_cleanup (&key_doc2);
460
+ _mongocrypt_buffer_cleanup (&key_buf_x);
461
+ _mongocrypt_buffer_cleanup (&key_buf_y);
462
+ mongocrypt_status_destroy (status);
463
+ mongocrypt_destroy (crypt);
464
+ }
465
+
466
+ static void
467
+ _test_key_broker_add_decrypted_key (_mongocrypt_tester_t *tester)
468
+ {
469
+ mongocrypt_t *crypt;
470
+ mongocrypt_status_t *status;
471
+ _mongocrypt_buffer_t key_id1, key_id2, key_doc1, key_doc2, key_doc_names,
472
+ key_id_names;
473
+ _mongocrypt_key_broker_t key_broker;
474
+ mongocrypt_kms_ctx_t *kms;
475
+ _mongocrypt_opts_kms_providers_t *kms_providers;
476
+ bson_iter_t iter;
477
+ bson_t key_doc_names_bson;
478
+
479
+ status = mongocrypt_status_new ();
480
+ _gen_uuid_and_key (tester, 1, &key_id1, &key_doc1);
481
+ _gen_uuid_and_key (tester, 2, &key_id2, &key_doc2);
482
+
483
+ /* Success. With key ids. */
484
+ crypt = _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
485
+ kms_providers = &crypt->opts.kms_providers;
486
+ _mongocrypt_key_broker_init (&key_broker, crypt);
487
+ ASSERT_OK (_mongocrypt_key_broker_request_id (&key_broker, &key_id1),
488
+ &key_broker);
489
+ ASSERT_OK (_mongocrypt_key_broker_request_id (&key_broker, &key_id2),
490
+ &key_broker);
491
+ ASSERT_OK (_mongocrypt_key_broker_requests_done (&key_broker), &key_broker);
492
+ ASSERT_OK (
493
+ _mongocrypt_key_broker_add_doc (&key_broker, kms_providers, &key_doc2),
494
+ &key_broker);
495
+ ASSERT_OK (
496
+ _mongocrypt_key_broker_add_doc (&key_broker, kms_providers, &key_doc1),
497
+ &key_broker);
498
+ ASSERT_OK (_mongocrypt_key_broker_docs_done (&key_broker), &key_broker);
499
+ kms = _mongocrypt_key_broker_next_kms (&key_broker);
500
+ BSON_ASSERT (kms);
501
+ _mongocrypt_tester_satisfy_kms (tester, kms);
502
+ kms = _mongocrypt_key_broker_next_kms (&key_broker);
503
+ BSON_ASSERT (kms);
504
+ _mongocrypt_tester_satisfy_kms (tester, kms);
505
+ BSON_ASSERT (!_mongocrypt_key_broker_next_kms (&key_broker));
506
+ ASSERT_OK (_mongocrypt_key_broker_kms_done (&key_broker, kms_providers),
507
+ &key_broker);
508
+ _mongocrypt_key_broker_cleanup (&key_broker);
509
+ mongocrypt_destroy (crypt); /* destroy crypt to reset cache. */
510
+
511
+ /* Success. With key alt names. */
512
+ crypt = _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
513
+ kms_providers = &crypt->opts.kms_providers;
514
+ _mongocrypt_key_broker_init (&key_broker, crypt);
515
+ _key_broker_add_name (&key_broker, "Sharlene");
516
+ ASSERT_OK (_mongocrypt_key_broker_requests_done (&key_broker), &key_broker);
517
+
518
+ _mongocrypt_buffer_from_binary (
519
+ &key_doc_names,
520
+ TEST_FILE ("./test/data/key-document-with-alt-name.json"));
521
+ ASSERT_OK (_mongocrypt_key_broker_add_doc (
522
+ &key_broker, kms_providers, &key_doc_names),
523
+ &key_broker);
524
+ ASSERT_OK (_mongocrypt_key_broker_docs_done (&key_broker), &key_broker);
525
+ kms = _mongocrypt_key_broker_next_kms (&key_broker);
526
+ BSON_ASSERT (kms);
527
+
528
+ _mongocrypt_tester_satisfy_kms (tester, kms);
529
+ BSON_ASSERT (!_mongocrypt_key_broker_next_kms (&key_broker));
530
+ ASSERT_OK (_mongocrypt_key_broker_kms_done (&key_broker, kms_providers),
531
+ &key_broker);
532
+ _mongocrypt_key_broker_cleanup (&key_broker);
533
+ mongocrypt_destroy (crypt); /* destroy crypt to reset cache. */
534
+
535
+ /* With both key ids and key alt names, some referring to the same key */
536
+ crypt = _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
537
+ kms_providers = &crypt->opts.kms_providers;
538
+ _mongocrypt_key_broker_init (&key_broker, crypt);
539
+ BSON_ASSERT (
540
+ _mongocrypt_buffer_to_bson (&key_doc_names, &key_doc_names_bson));
541
+ BSON_ASSERT (bson_iter_init_find (&iter, &key_doc_names_bson, "_id"));
542
+ BSON_ASSERT (_mongocrypt_buffer_from_binary_iter (&key_id_names, &iter));
543
+ BSON_ASSERT (key_id_names.subtype == BSON_SUBTYPE_UUID);
544
+ ASSERT_OK (_mongocrypt_key_broker_request_id (&key_broker, &key_id_names),
545
+ &key_broker);
546
+ _key_broker_add_name (&key_broker, "Sharlene");
547
+ _key_broker_add_name (&key_broker, "Kasey");
548
+ ASSERT_OK (_mongocrypt_key_broker_requests_done (&key_broker), &key_broker);
549
+ ASSERT_OK (_mongocrypt_key_broker_add_doc (
550
+ &key_broker, kms_providers, &key_doc_names),
551
+ &key_broker);
552
+ ASSERT_OK (_mongocrypt_key_broker_docs_done (&key_broker), &key_broker);
553
+ kms = _mongocrypt_key_broker_next_kms (&key_broker);
554
+ BSON_ASSERT (kms);
555
+ _mongocrypt_tester_satisfy_kms (tester, kms);
556
+ BSON_ASSERT (!_mongocrypt_key_broker_next_kms (&key_broker));
557
+ ASSERT_OK (_mongocrypt_key_broker_kms_done (&key_broker, kms_providers),
558
+ &key_broker);
559
+ _mongocrypt_key_broker_cleanup (&key_broker);
560
+
561
+ bson_destroy (&key_doc_names_bson);
562
+ _mongocrypt_buffer_cleanup (&key_id_names);
563
+ _mongocrypt_buffer_cleanup (&key_id1);
564
+ _mongocrypt_buffer_cleanup (&key_id2);
565
+ _mongocrypt_buffer_cleanup (&key_doc1);
566
+ _mongocrypt_buffer_cleanup (&key_doc2);
567
+ mongocrypt_status_destroy (status);
568
+ mongocrypt_destroy (crypt);
569
+ }
570
+
571
+
572
+ static void
573
+ _test_key_broker_wrong_subtype (_mongocrypt_tester_t *tester)
574
+ {
575
+ mongocrypt_t *crypt;
576
+ mongocrypt_status_t *status;
577
+ _mongocrypt_buffer_t key_id, key_doc;
578
+ _mongocrypt_key_broker_t key_broker;
579
+
580
+ status = mongocrypt_status_new ();
581
+ crypt = _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
582
+ _gen_uuid_and_key (tester, 1, &key_id, &key_doc);
583
+
584
+ /* Valid key documents. */
585
+ _mongocrypt_key_broker_init (&key_broker, crypt);
586
+ key_id.subtype = 0;
587
+ ASSERT_FAILS (_mongocrypt_key_broker_request_id (&key_broker, &key_id),
588
+ &key_broker,
589
+ "expected UUID");
590
+
591
+ _mongocrypt_buffer_cleanup (&key_id);
592
+ _mongocrypt_buffer_cleanup (&key_doc);
593
+ _mongocrypt_key_broker_cleanup (&key_broker);
594
+ mongocrypt_status_destroy (status);
595
+ mongocrypt_destroy (crypt);
596
+ }
597
+
598
+
599
+ static void
600
+ _test_key_broker_multi_match (_mongocrypt_tester_t *tester)
601
+ {
602
+ mongocrypt_t *crypt;
603
+ mongocrypt_status_t *status;
604
+ _mongocrypt_opts_kms_providers_t *kms_providers;
605
+ _mongocrypt_key_broker_t key_broker;
606
+ status = mongocrypt_status_new ();
607
+ _mongocrypt_buffer_t key_id1, key_id2, key_doc1, key_doc2;
608
+
609
+ _gen_uuid_and_key_and_altname (tester, "alt1", 1, &key_id1, &key_doc1);
610
+ _gen_uuid_and_key_and_altname (tester, "alt2", 2, &key_id2, &key_doc2);
611
+
612
+
613
+ crypt = _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
614
+ kms_providers = &crypt->opts.kms_providers;
615
+ _mongocrypt_key_broker_init (&key_broker, crypt);
616
+
617
+ /* Add two ids and two alt names */
618
+ BSON_ASSERT (_mongocrypt_key_broker_request_id (&key_broker, &key_id1));
619
+ _key_broker_add_name (&key_broker, "alt1");
620
+ BSON_ASSERT (_mongocrypt_key_broker_request_id (&key_broker, &key_id2));
621
+ _key_broker_add_name (&key_broker, "alt2");
622
+ ASSERT_OK (_mongocrypt_key_broker_requests_done (&key_broker), &key_broker);
623
+
624
+ /* Should be zero satisfied */
625
+ BSON_ASSERT (0 == _key_broker_num_satisfied (&key_broker));
626
+
627
+ /* Add one doc, should satisfy two requests. */
628
+ BSON_ASSERT (
629
+ _mongocrypt_key_broker_add_doc (&key_broker, kms_providers, &key_doc1));
630
+ BSON_ASSERT (2 == _key_broker_num_satisfied (&key_broker));
631
+
632
+ /* Add other doc, should satisfy all. */
633
+ BSON_ASSERT (
634
+ _mongocrypt_key_broker_add_doc (&key_broker, kms_providers, &key_doc2));
635
+ BSON_ASSERT (4 == _key_broker_num_satisfied (&key_broker));
636
+
637
+ _mongocrypt_buffer_cleanup (&key_id1);
638
+ _mongocrypt_buffer_cleanup (&key_doc1);
639
+ _mongocrypt_buffer_cleanup (&key_id2);
640
+ _mongocrypt_buffer_cleanup (&key_doc2);
641
+ _mongocrypt_key_broker_cleanup (&key_broker);
642
+ mongocrypt_destroy (crypt);
643
+ mongocrypt_status_destroy (status);
644
+ }
645
+
646
+
647
+ /*
648
+ <RequestMessage tag="0x420078" type="Structure">
649
+ <RequestHeader tag="0x420077" type="Structure">
650
+ <ProtocolVersion tag="0x420069" type="Structure">
651
+ <ProtocolVersionMajor tag="0x42006a" type="Integer" value="1"/>
652
+ <ProtocolVersionMinor tag="0x42006b" type="Integer" value="0"/>
653
+ </ProtocolVersion>
654
+ <BatchCount tag="0x42000d" type="Integer" value="1"/>
655
+ </RequestHeader>
656
+ <BatchItem tag="0x42000f" type="Structure">
657
+ <Operation tag="0x42005c" type="Enumeration" value="10"/>
658
+ <RequestPayload tag="0x420079" type="Structure">
659
+ <UniqueIdentifier tag="0x420094" type="TextString"
660
+ value="ywxrSj5TLjswd1G4oGFJ6hwWgtTsQip0"/>
661
+ </RequestPayload>
662
+ </BatchItem>
663
+ </RequestMessage>
664
+ */
665
+ static const uint8_t EXPECTED_GET_REQUEST[] = {
666
+ 0x42, 0x00, 0x78, 0x01, 0x00, 0x00, 0x00, 0x88, 0x42, 0x00, 0x77, 0x01,
667
+ 0x00, 0x00, 0x00, 0x38, 0x42, 0x00, 0x69, 0x01, 0x00, 0x00, 0x00, 0x20,
668
+ 0x42, 0x00, 0x6a, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01,
669
+ 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x6b, 0x02, 0x00, 0x00, 0x00, 0x04,
670
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x0d, 0x02,
671
+ 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
672
+ 0x42, 0x00, 0x0f, 0x01, 0x00, 0x00, 0x00, 0x40, 0x42, 0x00, 0x5c, 0x05,
673
+ 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00,
674
+ 0x42, 0x00, 0x79, 0x01, 0x00, 0x00, 0x00, 0x28, 0x42, 0x00, 0x94, 0x07,
675
+ 0x00, 0x00, 0x00, 0x20, 0x79, 0x77, 0x78, 0x72, 0x53, 0x6a, 0x35, 0x54,
676
+ 0x4c, 0x6a, 0x73, 0x77, 0x64, 0x31, 0x47, 0x34, 0x6f, 0x47, 0x46, 0x4a,
677
+ 0x36, 0x68, 0x77, 0x57, 0x67, 0x74, 0x54, 0x73, 0x51, 0x69, 0x70, 0x30};
678
+
679
+ /*
680
+ <ResponseMessage tag="0x42007b" type="Structure">
681
+ <ResponseHeader tag="0x42007a" type="Structure">
682
+ <ProtocolVersion tag="0x420069" type="Structure">
683
+ <ProtocolVersionMajor tag="0x42006a" type="Integer" value="1"/>
684
+ <ProtocolVersionMinor tag="0x42006b" type="Integer" value="4"/>
685
+ </ProtocolVersion>
686
+ <TimeStamp tag="0x420092" type="DateTime" value="2021-10-03T17:39:52-0500"/>
687
+ <BatchCount tag="0x42000d" type="Integer" value="1"/>
688
+ </ResponseHeader>
689
+ <BatchItem tag="0x42000f" type="Structure">
690
+ <Operation tag="0x42005c" type="Enumeration" value="10"/>
691
+ <ResultStatus tag="0x42007f" type="Enumeration" value="0"/>
692
+ <ResponsePayload tag="0x42007c" type="Structure">
693
+ <ObjectType tag="0x420057" type="Enumeration" value="7"/>
694
+ <UniqueIdentifier tag="0x420094" type="TextString"
695
+ value="ywxrSj5TLjswd1G4oGFJ6hwWgtTsQip0"/>
696
+ <SecretData tag="0x420085" type="Structure">
697
+ <SecretDataType tag="0x420086" type="Enumeration" value="2"/>
698
+ <KeyBlock tag="0x420040" type="Structure">
699
+ <KeyFormatType tag="0x420042" type="Enumeration" value="1"/>
700
+ <KeyValue tag="0x420045" type="Structure">
701
+ <KeyMaterial tag="0x420043" type="ByteString"
702
+ value="0c2ea7297180f82a984b2fd47d6327ce226f62e9017b91dc6e5d6dfd98747d97e89f17bf0926cfcc0afb24e69b7c00121dda12d0158c4375c31084abf7f2e6044edc2f92802ba3f676d470d2cbc4e33a2a8e53dced7828dd8a35f268437ff141"/>
703
+ </KeyValue>
704
+ </KeyBlock>
705
+ </SecretData>
706
+ </ResponsePayload>
707
+ </BatchItem>
708
+ </ResponseMessage>
709
+ */
710
+ static const uint8_t SUCCESS_GET_RESPONSE[] = {
711
+ 0x42, 0x00, 0x7b, 0x01, 0x00, 0x00, 0x01, 0x58, 0x42, 0x00, 0x7a, 0x01, 0x00,
712
+ 0x00, 0x00, 0x48, 0x42, 0x00, 0x69, 0x01, 0x00, 0x00, 0x00, 0x20, 0x42, 0x00,
713
+ 0x6a, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
714
+ 0x00, 0x42, 0x00, 0x6b, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04,
715
+ 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x92, 0x09, 0x00, 0x00, 0x00, 0x08, 0x00,
716
+ 0x00, 0x00, 0x00, 0x61, 0x59, 0xea, 0xe8, 0x42, 0x00, 0x0d, 0x02, 0x00, 0x00,
717
+ 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x0f,
718
+ 0x01, 0x00, 0x00, 0x01, 0x00, 0x42, 0x00, 0x5c, 0x05, 0x00, 0x00, 0x00, 0x04,
719
+ 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x7f, 0x05, 0x00,
720
+ 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00,
721
+ 0x7c, 0x01, 0x00, 0x00, 0x00, 0xd8, 0x42, 0x00, 0x57, 0x05, 0x00, 0x00, 0x00,
722
+ 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x94, 0x07,
723
+ 0x00, 0x00, 0x00, 0x20, 0x79, 0x77, 0x78, 0x72, 0x53, 0x6a, 0x35, 0x54, 0x4c,
724
+ 0x6a, 0x73, 0x77, 0x64, 0x31, 0x47, 0x34, 0x6f, 0x47, 0x46, 0x4a, 0x36, 0x68,
725
+ 0x77, 0x57, 0x67, 0x74, 0x54, 0x73, 0x51, 0x69, 0x70, 0x30, 0x42, 0x00, 0x85,
726
+ 0x01, 0x00, 0x00, 0x00, 0x98, 0x42, 0x00, 0x86, 0x05, 0x00, 0x00, 0x00, 0x04,
727
+ 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x40, 0x01, 0x00,
728
+ 0x00, 0x00, 0x80, 0x42, 0x00, 0x42, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
729
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x45, 0x01, 0x00, 0x00, 0x00,
730
+ 0x68, 0x42, 0x00, 0x43, 0x08, 0x00, 0x00, 0x00, 0x60, 0x0c, 0x2e, 0xa7, 0x29,
731
+ 0x71, 0x80, 0xf8, 0x2a, 0x98, 0x4b, 0x2f, 0xd4, 0x7d, 0x63, 0x27, 0xce, 0x22,
732
+ 0x6f, 0x62, 0xe9, 0x01, 0x7b, 0x91, 0xdc, 0x6e, 0x5d, 0x6d, 0xfd, 0x98, 0x74,
733
+ 0x7d, 0x97, 0xe8, 0x9f, 0x17, 0xbf, 0x09, 0x26, 0xcf, 0xcc, 0x0a, 0xfb, 0x24,
734
+ 0xe6, 0x9b, 0x7c, 0x00, 0x12, 0x1d, 0xda, 0x12, 0xd0, 0x15, 0x8c, 0x43, 0x75,
735
+ 0xc3, 0x10, 0x84, 0xab, 0xf7, 0xf2, 0xe6, 0x04, 0x4e, 0xdc, 0x2f, 0x92, 0x80,
736
+ 0x2b, 0xa3, 0xf6, 0x76, 0xd4, 0x70, 0xd2, 0xcb, 0xc4, 0xe3, 0x3a, 0x2a, 0x8e,
737
+ 0x53, 0xdc, 0xed, 0x78, 0x28, 0xdd, 0x8a, 0x35, 0xf2, 0x68, 0x43, 0x7f, 0xf1,
738
+ 0x41};
739
+
740
+ static const uint8_t EXPECTED_SECRETDATA[] = {
741
+ 0x94, 0x82, 0x4f, 0x44, 0xbe, 0xb2, 0x20, 0x73, 0x14, 0xad, 0x8b, 0x36,
742
+ 0x38, 0xaf, 0x01, 0x45, 0xa5, 0x13, 0x80, 0x84, 0x44, 0x57, 0xdf, 0xde,
743
+ 0x9f, 0xb6, 0x7b, 0xfb, 0xf9, 0x21, 0xf9, 0x00, 0xb2, 0x00, 0x9e, 0x07,
744
+ 0xcf, 0x04, 0xc3, 0x5b, 0x9a, 0x98, 0x3b, 0xa9, 0x22, 0x83, 0x3d, 0x7a,
745
+ 0x07, 0xc5, 0x90, 0x84, 0xe7, 0x63, 0xf0, 0x47, 0xf0, 0x1a, 0x4b, 0xfe,
746
+ 0x03, 0xbc, 0xe3, 0x82, 0x96, 0x95, 0x88, 0xb8, 0x18, 0x63, 0x33, 0x15,
747
+ 0x73, 0x95, 0xe2, 0xb1, 0x38, 0xde, 0x6c, 0x13, 0xf8, 0x98, 0x43, 0xbe,
748
+ 0x3f, 0x85, 0x83, 0xd0, 0x11, 0x88, 0xb8, 0x0f, 0xb5, 0x8c, 0x2a, 0x1c};
749
+
750
+ static void
751
+ _test_key_broker_kmip (_mongocrypt_tester_t *tester)
752
+ {
753
+ mongocrypt_t *crypt;
754
+ mongocrypt_status_t *status;
755
+ _mongocrypt_key_broker_t kb;
756
+ bson_t keydoc_bson;
757
+ bson_iter_t iter;
758
+ _mongocrypt_buffer_t id;
759
+ _mongocrypt_buffer_t keydoc;
760
+ mongocrypt_kms_ctx_t *kms;
761
+ mongocrypt_binary_t *msg;
762
+ _mongocrypt_opts_kms_providers_t *kms_providers;
763
+ _mongocrypt_buffer_t secretdata;
764
+
765
+ crypt = _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
766
+ status = mongocrypt_status_new ();
767
+ kms_providers = &crypt->opts.kms_providers;
768
+ _mongocrypt_key_broker_init (&kb, crypt);
769
+ _load_json_as_bson ("./test/data/key-document-kmip.json", &keydoc_bson);
770
+
771
+ ASSERT_OR_PRINT_MSG (bson_iter_init_find (&iter, &keydoc_bson, "_id"),
772
+ "could not find _id in key-document-kmip.json");
773
+ BSON_ASSERT (_mongocrypt_buffer_from_binary_iter (&id, &iter));
774
+ ASSERT_OK (_mongocrypt_key_broker_request_id (&kb, &id), &kb);
775
+ ASSERT_OK (_mongocrypt_key_broker_requests_done (&kb), &kb);
776
+
777
+ /* Add the key document. */
778
+ _mongocrypt_buffer_from_bson (&keydoc, &keydoc_bson);
779
+ ASSERT_OK (_mongocrypt_key_broker_add_doc (&kb, kms_providers, &keydoc),
780
+ &kb);
781
+ ASSERT_OK (_mongocrypt_key_broker_docs_done (&kb), &kb);
782
+
783
+ /* There should be exactly one KMS request for KMIP. */
784
+ kms = _mongocrypt_key_broker_next_kms (&kb);
785
+ ASSERT_OR_PRINT_MSG (kms, "expected KMS context returned, got none");
786
+
787
+ msg = mongocrypt_binary_new ();
788
+ mongocrypt_kms_ctx_message (kms, msg);
789
+ ASSERT_CMPBYTES (EXPECTED_GET_REQUEST,
790
+ sizeof (EXPECTED_GET_REQUEST),
791
+ mongocrypt_binary_data (msg),
792
+ mongocrypt_binary_len (msg));
793
+
794
+ ASSERT_OK (kms_ctx_feed_all (
795
+ kms, SUCCESS_GET_RESPONSE, sizeof (SUCCESS_GET_RESPONSE)),
796
+ kms);
797
+ ASSERT_OK (_mongocrypt_key_broker_kms_done (&kb, kms_providers), &kb);
798
+
799
+ BSON_ASSERT (
800
+ _mongocrypt_key_broker_decrypted_key_by_id (&kb, &id, &secretdata));
801
+ ASSERT_CMPBYTES (secretdata.data,
802
+ secretdata.len,
803
+ EXPECTED_SECRETDATA,
804
+ sizeof (EXPECTED_SECRETDATA));
805
+
806
+ _mongocrypt_buffer_cleanup (&secretdata);
807
+ mongocrypt_binary_destroy (msg);
808
+ _mongocrypt_buffer_cleanup (&keydoc);
809
+ _mongocrypt_buffer_cleanup (&id);
810
+ bson_destroy (&keydoc_bson);
811
+ _mongocrypt_key_broker_cleanup (&kb);
812
+ mongocrypt_status_destroy (status);
813
+ mongocrypt_destroy (crypt);
814
+ }
815
+
816
+ /*
817
+ <ResponseMessage tag="0x42007b" type="Structure">
818
+ <ResponseHeader tag="0x42007a" type="Structure">
819
+ <ProtocolVersion tag="0x420069" type="Structure">
820
+ <ProtocolVersionMajor tag="0x42006a" type="Integer" value="1"/>
821
+ <ProtocolVersionMinor tag="0x42006b" type="Integer" value="4"/>
822
+ </ProtocolVersion>
823
+ <TimeStamp tag="0x420092" type="DateTime" value="2021-10-01T14:43:13-0500"/>
824
+ <BatchCount tag="0x42000d" type="Integer" value="1"/>
825
+ </ResponseHeader>
826
+ <BatchItem tag="0x42000f" type="Structure">
827
+ <Operation tag="0x42005c" type="Enumeration" value="10"/>
828
+ <ResultStatus tag="0x42007f" type="Enumeration" value="1"/>
829
+ <ResultReason tag="0x42007e" type="Enumeration" value="1"/>
830
+ <ResultMessage tag="0x42007d" type="TextString"
831
+ value="ResultReasonItemNotFound"/>
832
+ </BatchItem>
833
+ </ResponseMessage>
834
+ */
835
+ static const uint8_t ERROR_GET_RESPOSE_NOTFOUND[] = {
836
+ 0x42, 0x00, 0x7b, 0x01, 0x00, 0x00, 0x00, 0xa8, 0x42, 0x00, 0x7a, 0x01, 0x00,
837
+ 0x00, 0x00, 0x48, 0x42, 0x00, 0x69, 0x01, 0x00, 0x00, 0x00, 0x20, 0x42, 0x00,
838
+ 0x6a, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
839
+ 0x00, 0x42, 0x00, 0x6b, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04,
840
+ 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x92, 0x09, 0x00, 0x00, 0x00, 0x08, 0x00,
841
+ 0x00, 0x00, 0x00, 0x61, 0x57, 0x1e, 0x81, 0x42, 0x00, 0x0d, 0x02, 0x00, 0x00,
842
+ 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x0f,
843
+ 0x01, 0x00, 0x00, 0x00, 0x50, 0x42, 0x00, 0x5c, 0x05, 0x00, 0x00, 0x00, 0x04,
844
+ 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x7f, 0x05, 0x00,
845
+ 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00,
846
+ 0x7e, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
847
+ 0x00, 0x42, 0x00, 0x7d, 0x07, 0x00, 0x00, 0x00, 0x18, 0x52, 0x65, 0x73, 0x75,
848
+ 0x6c, 0x74, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x4e,
849
+ 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64};
850
+
851
+ static void
852
+ _test_key_broker_kmip_notfound (_mongocrypt_tester_t *tester)
853
+ {
854
+ mongocrypt_t *crypt;
855
+ mongocrypt_status_t *status;
856
+ _mongocrypt_key_broker_t kb;
857
+ bson_t keydoc_bson;
858
+ bson_iter_t iter;
859
+ _mongocrypt_buffer_t id;
860
+ _mongocrypt_buffer_t keydoc;
861
+ mongocrypt_kms_ctx_t *kms;
862
+ _mongocrypt_opts_kms_providers_t *kms_providers;
863
+ mongocrypt_binary_t *msg;
864
+
865
+ crypt = _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
866
+ status = mongocrypt_status_new ();
867
+ kms_providers = &crypt->opts.kms_providers;
868
+ _mongocrypt_key_broker_init (&kb, crypt);
869
+ _load_json_as_bson ("./test/data/key-document-kmip.json", &keydoc_bson);
870
+
871
+ ASSERT_OR_PRINT_MSG (bson_iter_init_find (&iter, &keydoc_bson, "_id"),
872
+ "could not find _id in key-document-kmip.json");
873
+ BSON_ASSERT (_mongocrypt_buffer_from_binary_iter (&id, &iter));
874
+ ASSERT_OK (_mongocrypt_key_broker_request_id (&kb, &id), &kb);
875
+ ASSERT_OK (_mongocrypt_key_broker_requests_done (&kb), &kb);
876
+
877
+ /* Add the key document. */
878
+ _mongocrypt_buffer_from_bson (&keydoc, &keydoc_bson);
879
+ ASSERT_OK (_mongocrypt_key_broker_add_doc (&kb, kms_providers, &keydoc),
880
+ &kb);
881
+ ASSERT_OK (_mongocrypt_key_broker_docs_done (&kb), &kb);
882
+
883
+ /* There should be exactly one KMS request for KMIP. */
884
+ kms = _mongocrypt_key_broker_next_kms (&kb);
885
+ ASSERT_OR_PRINT_MSG (kms, "expected KMS context returned, got none");
886
+
887
+ msg = mongocrypt_binary_new ();
888
+ mongocrypt_kms_ctx_message (kms, msg);
889
+ ASSERT_CMPBYTES (EXPECTED_GET_REQUEST,
890
+ sizeof (EXPECTED_GET_REQUEST),
891
+ mongocrypt_binary_data (msg),
892
+ mongocrypt_binary_len (msg));
893
+
894
+ ASSERT_FAILS (kms_ctx_feed_all (kms,
895
+ ERROR_GET_RESPOSE_NOTFOUND,
896
+ sizeof (ERROR_GET_RESPOSE_NOTFOUND)),
897
+ kms,
898
+ "ResultReasonItemNotFound");
899
+
900
+ mongocrypt_binary_destroy (msg);
901
+ _mongocrypt_buffer_cleanup (&keydoc);
902
+ _mongocrypt_buffer_cleanup (&id);
903
+ bson_destroy (&keydoc_bson);
904
+ _mongocrypt_key_broker_cleanup (&kb);
905
+ mongocrypt_status_destroy (status);
906
+ mongocrypt_destroy (crypt);
907
+ }
908
+
909
+
910
+ static void
911
+ _test_key_broker_request_any (_mongocrypt_tester_t *tester)
912
+ {
913
+ mongocrypt_t *const crypt =
914
+ _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
915
+ _mongocrypt_key_broker_t kb;
916
+
917
+ /* Can switch to any mode before any keys are requested. */
918
+ _mongocrypt_key_broker_init (&kb, crypt);
919
+ ASSERT_OK (_mongocrypt_key_broker_request_any (&kb), &kb);
920
+ _mongocrypt_key_broker_cleanup (&kb);
921
+
922
+ /* If keys have already been requested, cannot switch to any mode.*/
923
+ _mongocrypt_key_broker_init (&kb, crypt);
924
+ _key_broker_add_name (&kb, "test");
925
+ ASSERT_FAILS (_mongocrypt_key_broker_request_any (&kb),
926
+ &kb,
927
+ "attempting to request any keys, but requests already made");
928
+ _mongocrypt_key_broker_cleanup (&kb);
929
+
930
+ mongocrypt_destroy (crypt);
931
+ }
932
+
933
+
934
+ static void
935
+ _test_key_broker_add_any (_mongocrypt_tester_t *tester)
936
+ {
937
+ mongocrypt_t *const crypt =
938
+ _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
939
+ _mongocrypt_opts_kms_providers_t *const kms_providers =
940
+ &crypt->opts.kms_providers;
941
+ _mongocrypt_key_broker_t kb;
942
+ _mongocrypt_buffer_t key_id, key_doc;
943
+
944
+ _gen_uuid_and_key (tester, 1, &key_id, &key_doc);
945
+
946
+ /* Can add valid documents. */
947
+ _mongocrypt_key_broker_init (&kb, crypt);
948
+ ASSERT_OK (_mongocrypt_key_broker_request_any (&kb), &kb);
949
+ ASSERT_OK (_mongocrypt_key_broker_add_doc (&kb, kms_providers, &key_doc),
950
+ &kb);
951
+ ASSERT (_key_broker_num_satisfied (&kb) == 1);
952
+ ASSERT_OK (_mongocrypt_key_broker_docs_done (&kb), &kb);
953
+ _mongocrypt_key_broker_cleanup (&kb);
954
+
955
+ /* Still validates no duplicate/incompatible keys. */
956
+ _mongocrypt_key_broker_init (&kb, crypt);
957
+ ASSERT_OK (_mongocrypt_key_broker_request_any (&kb), &kb);
958
+ ASSERT_OK (_mongocrypt_key_broker_add_doc (&kb, kms_providers, &key_doc),
959
+ &kb);
960
+ ASSERT (_key_broker_num_satisfied (&kb) == 1);
961
+ ASSERT_FAILS (_mongocrypt_key_broker_add_doc (&kb, kms_providers, &key_doc),
962
+ &kb,
963
+ "keys returned have duplicate keyAltNames or _id");
964
+ ASSERT (_key_broker_num_satisfied (&kb) == 1);
965
+ _mongocrypt_key_broker_cleanup (&kb);
966
+
967
+ /* Still requests KMS as needed. */
968
+ _mongocrypt_key_broker_init (&kb, crypt);
969
+ ASSERT_OK (_mongocrypt_key_broker_request_any (&kb), &kb);
970
+ ASSERT_OK (_mongocrypt_key_broker_add_doc (&kb, kms_providers, &key_doc),
971
+ &kb);
972
+ ASSERT (_key_broker_num_satisfied (&kb) == 1);
973
+ ASSERT_OK (_mongocrypt_key_broker_docs_done (&kb), &kb);
974
+ {
975
+ mongocrypt_kms_ctx_t *kms;
976
+ kms = _mongocrypt_key_broker_next_kms (&kb);
977
+ ASSERT_OK (kms, &kb);
978
+ /* Key material should should be cached here. */
979
+ _mongocrypt_tester_satisfy_kms (tester, kms);
980
+ ASSERT_OK (!_mongocrypt_key_broker_next_kms (&kb), &kb);
981
+ ASSERT_OK (_mongocrypt_key_broker_kms_done (&kb, kms_providers), &kb);
982
+ }
983
+ _mongocrypt_key_broker_cleanup (&kb);
984
+ _mongocrypt_key_broker_init (&kb, crypt);
985
+ ASSERT_OK (_mongocrypt_key_broker_request_any (&kb), &kb);
986
+ ASSERT_OK (_mongocrypt_key_broker_add_doc (&kb, kms_providers, &key_doc),
987
+ &kb);
988
+ ASSERT (_key_broker_num_satisfied (&kb) == 1);
989
+ ASSERT_OK (_mongocrypt_key_broker_docs_done (&kb), &kb);
990
+ /* Cached key material, should skip straight to done. */
991
+ ASSERT (kb.state == KB_DONE);
992
+
993
+ _mongocrypt_key_broker_cleanup (&kb);
994
+
995
+ _mongocrypt_buffer_cleanup (&key_doc);
996
+ _mongocrypt_buffer_cleanup (&key_id);
997
+ mongocrypt_destroy (crypt);
998
+ }
999
+
1000
+ /* assert_filter_requests_id asserts that filter contains exactly one request
1001
+ * for a key ID of expect. */
1002
+ static void
1003
+ assert_filter_requests_id (mongocrypt_binary_t *filter,
1004
+ const _mongocrypt_buffer_t *expect)
1005
+ {
1006
+ bson_t filter_bson;
1007
+ ASSERT (_mongocrypt_binary_to_bson (filter, &filter_bson));
1008
+ bson_iter_t iter;
1009
+ ASSERT (bson_iter_init (&iter, &filter_bson));
1010
+ ASSERT (bson_iter_find_descendant (&iter, "$or.0._id.$in", &iter));
1011
+ ASSERT (bson_iter_recurse (&iter, &iter));
1012
+ ASSERT (bson_iter_next (&iter));
1013
+ ASSERT (BSON_ITER_HOLDS_BINARY (&iter));
1014
+
1015
+ _mongocrypt_buffer_t actual;
1016
+ ASSERT (_mongocrypt_buffer_from_binary_iter (&actual, &iter));
1017
+ ASSERT_CMPBUF (*expect, actual);
1018
+
1019
+ /* Check that there are no additional _id's requested. */
1020
+ ASSERT (!bson_iter_next (&iter));
1021
+
1022
+ /* Check that there are no keyAltName requests. */
1023
+ ASSERT (bson_iter_init (&iter, &filter_bson));
1024
+ ASSERT (bson_iter_find_descendant (&iter, "$or.1.keyAltNames.$in", &iter));
1025
+ ASSERT (bson_iter_recurse (&iter, &iter));
1026
+ ASSERT (!bson_iter_next (&iter));
1027
+ }
1028
+
1029
+ /* Test that key requests can be added again after transitioning to DONE and
1030
+ * calling _mongocrypt_key_broker_restart. */
1031
+ static void
1032
+ _test_key_broker_restart (_mongocrypt_tester_t *tester)
1033
+ {
1034
+ mongocrypt_t *crypt;
1035
+ mongocrypt_status_t *status;
1036
+ _mongocrypt_buffer_t key_id1, key_id2, key_doc1, key_doc2;
1037
+ _mongocrypt_key_broker_t kb;
1038
+ _mongocrypt_opts_kms_providers_t *kms_providers;
1039
+ mongocrypt_kms_ctx_t *kms;
1040
+ mongocrypt_binary_t *filter;
1041
+
1042
+ status = mongocrypt_status_new ();
1043
+ crypt = _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
1044
+ kms_providers = &crypt->opts.kms_providers;
1045
+ _gen_uuid_and_key (tester, 1, &key_id1, &key_doc1);
1046
+ _gen_uuid_and_key (tester, 2, &key_id2, &key_doc2);
1047
+ _mongocrypt_key_broker_init (&kb, crypt);
1048
+
1049
+ ASSERT (kb.state == KB_REQUESTING);
1050
+ ASSERT_OK (_mongocrypt_key_broker_request_id (&kb, &key_id1), &kb);
1051
+ ASSERT_OK (_mongocrypt_key_broker_requests_done (&kb), &kb);
1052
+
1053
+ filter = mongocrypt_binary_new ();
1054
+ ASSERT_OK (_mongocrypt_key_broker_filter (&kb, filter), &kb);
1055
+ assert_filter_requests_id (filter, &key_id1);
1056
+ mongocrypt_binary_destroy (filter);
1057
+
1058
+ ASSERT (kb.state == KB_ADDING_DOCS);
1059
+ ASSERT_OK (_mongocrypt_key_broker_add_doc (&kb, kms_providers, &key_doc1),
1060
+ &kb);
1061
+ ASSERT_OK (_mongocrypt_key_broker_docs_done (&kb), &kb);
1062
+
1063
+ ASSERT (kb.state == KB_DECRYPTING_KEY_MATERIAL);
1064
+ kms = _mongocrypt_key_broker_next_kms (&kb);
1065
+ ASSERT (kms);
1066
+ _mongocrypt_tester_satisfy_kms (tester, kms);
1067
+ ASSERT_OK (_mongocrypt_key_broker_kms_done (&kb, kms_providers), &kb);
1068
+
1069
+ /* Restart, and add request for key_id2. */
1070
+ ASSERT (kb.state == KB_DONE);
1071
+ ASSERT_OK (_mongocrypt_key_broker_restart (&kb), &kb);
1072
+
1073
+ ASSERT (kb.state == KB_REQUESTING);
1074
+ ASSERT_OK (_mongocrypt_key_broker_request_id (&kb, &key_id2), &kb);
1075
+ ASSERT_OK (_mongocrypt_key_broker_requests_done (&kb), &kb);
1076
+
1077
+ filter = mongocrypt_binary_new ();
1078
+ ASSERT_OK (_mongocrypt_key_broker_filter (&kb, filter), &kb);
1079
+ assert_filter_requests_id (filter, &key_id2);
1080
+ mongocrypt_binary_destroy (filter);
1081
+
1082
+ ASSERT (kb.state == KB_ADDING_DOCS);
1083
+ ASSERT_OK (_mongocrypt_key_broker_add_doc (&kb, kms_providers, &key_doc2),
1084
+ &kb);
1085
+ ASSERT_OK (_mongocrypt_key_broker_docs_done (&kb), &kb);
1086
+
1087
+ ASSERT (kb.state == KB_DECRYPTING_KEY_MATERIAL);
1088
+ kms = _mongocrypt_key_broker_next_kms (&kb);
1089
+ ASSERT (kms);
1090
+ _mongocrypt_tester_satisfy_kms (tester, kms);
1091
+ ASSERT_OK (_mongocrypt_key_broker_kms_done (&kb, kms_providers), &kb);
1092
+ ASSERT (kb.state == KB_DONE);
1093
+
1094
+ _mongocrypt_key_broker_cleanup (&kb);
1095
+ _mongocrypt_buffer_cleanup (&key_doc2);
1096
+ _mongocrypt_buffer_cleanup (&key_id2);
1097
+ _mongocrypt_buffer_cleanup (&key_doc1);
1098
+ _mongocrypt_buffer_cleanup (&key_id1);
1099
+ mongocrypt_destroy (crypt);
1100
+ mongocrypt_status_destroy (status);
1101
+ }
1102
+
1103
+ /* Test that a decrypted key can be returned while in the KB_REQUESTING state.
1104
+ */
1105
+ static void
1106
+ _test_key_broker_get_decrypted_key_while_requesting (
1107
+ _mongocrypt_tester_t *tester)
1108
+ {
1109
+ mongocrypt_t *crypt;
1110
+ mongocrypt_status_t *status;
1111
+ _mongocrypt_buffer_t key_id1, key_doc1, key_decrypted1, key_decrypted1_copy;
1112
+ _mongocrypt_key_broker_t kb;
1113
+ _mongocrypt_opts_kms_providers_t *kms_providers;
1114
+ mongocrypt_kms_ctx_t *kms;
1115
+
1116
+ status = mongocrypt_status_new ();
1117
+ crypt = _mongocrypt_tester_mongocrypt (TESTER_MONGOCRYPT_DEFAULT);
1118
+ kms_providers = &crypt->opts.kms_providers;
1119
+ _gen_uuid_and_key (tester, 1, &key_id1, &key_doc1);
1120
+ _mongocrypt_key_broker_init (&kb, crypt);
1121
+
1122
+ ASSERT (kb.state == KB_REQUESTING);
1123
+ ASSERT_OK (_mongocrypt_key_broker_request_id (&kb, &key_id1), &kb);
1124
+ ASSERT_OK (_mongocrypt_key_broker_requests_done (&kb), &kb);
1125
+
1126
+ ASSERT (kb.state == KB_ADDING_DOCS);
1127
+ ASSERT_OK (_mongocrypt_key_broker_add_doc (&kb, kms_providers, &key_doc1),
1128
+ &kb);
1129
+ ASSERT_OK (_mongocrypt_key_broker_docs_done (&kb), &kb);
1130
+
1131
+ ASSERT (kb.state == KB_DECRYPTING_KEY_MATERIAL);
1132
+ kms = _mongocrypt_key_broker_next_kms (&kb);
1133
+ ASSERT (kms);
1134
+ _mongocrypt_tester_satisfy_kms (tester, kms);
1135
+ ASSERT_OK (_mongocrypt_key_broker_kms_done (&kb, kms_providers), &kb);
1136
+
1137
+ ASSERT (kb.state == KB_DONE);
1138
+ ASSERT_OK (_mongocrypt_key_broker_decrypted_key_by_id (
1139
+ &kb, &key_id1, &key_decrypted1),
1140
+ &kb);
1141
+
1142
+ /* Restart. */
1143
+ ASSERT_OK (_mongocrypt_key_broker_restart (&kb), &kb);
1144
+ ASSERT (kb.state == KB_REQUESTING);
1145
+ ASSERT_OK (_mongocrypt_key_broker_decrypted_key_by_id (
1146
+ &kb, &key_id1, &key_decrypted1_copy),
1147
+ &kb);
1148
+
1149
+ ASSERT_CMPBUF (key_decrypted1, key_decrypted1_copy);
1150
+
1151
+ _mongocrypt_buffer_cleanup (&key_decrypted1_copy);
1152
+ _mongocrypt_buffer_cleanup (&key_decrypted1);
1153
+ _mongocrypt_key_broker_cleanup (&kb);
1154
+ _mongocrypt_buffer_cleanup (&key_doc1);
1155
+ _mongocrypt_buffer_cleanup (&key_id1);
1156
+ mongocrypt_destroy (crypt);
1157
+ mongocrypt_status_destroy (status);
1158
+ }
1159
+
1160
+ void
1161
+ _mongocrypt_tester_install_key_broker (_mongocrypt_tester_t *tester)
1162
+ {
1163
+ INSTALL_TEST (_test_key_broker_get_key_filter);
1164
+ INSTALL_TEST (_test_key_broker_add_key);
1165
+ INSTALL_TEST (_test_key_broker_add_decrypted_key);
1166
+ INSTALL_TEST (_test_key_broker_wrong_subtype);
1167
+ INSTALL_TEST (_test_key_broker_multi_match);
1168
+ INSTALL_TEST (_test_key_broker_kmip);
1169
+ INSTALL_TEST (_test_key_broker_kmip_notfound);
1170
+ INSTALL_TEST (_test_key_broker_request_any);
1171
+ INSTALL_TEST (_test_key_broker_add_any);
1172
+ INSTALL_TEST (_test_key_broker_restart);
1173
+ INSTALL_TEST (_test_key_broker_get_decrypted_key_while_requesting);
1174
+ }