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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/ext/libmongocrypt/extconf.rb +70 -0
- data/ext/libmongocrypt/libmongocrypt/CHANGELOG.md +164 -0
- data/ext/libmongocrypt/libmongocrypt/CMakeLists.txt +699 -0
- data/ext/libmongocrypt/libmongocrypt/CODEOWNERS +13 -0
- data/ext/libmongocrypt/libmongocrypt/LICENSE +201 -0
- data/ext/libmongocrypt/libmongocrypt/README.md +250 -0
- data/ext/libmongocrypt/libmongocrypt/VERSION_CURRENT +1 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/CMakeLists.txt +16 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/AssemblyInfo.cs +4 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/Binary.cs +131 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/BinarySafeHandle.cs +60 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CheckableSafeHandle.cs +46 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CipherCallbacks.cs +168 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/ContextSafeHandle.cs +48 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptClient.cs +238 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptClientFactory.cs +134 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptContext.cs +214 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptException.cs +37 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptOptions.cs +67 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/HashCallback.cs +59 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/HmacShaCallbacks.cs +96 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/IStatus.cs +26 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/KmsCredentials.cs +53 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/KmsKeyId.cs +91 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/KmsRequest.cs +125 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/KmsRequestCollection.cs +60 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/Library.cs +652 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/LibraryLoader.cs +252 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/LibraryLoadingException.cs +34 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/License.txt +14 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/LogLevel.cs +26 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/MongoCryptSafeHandle.cs +48 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/MongoDB.Libmongocrypt.csproj +106 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/MongoDB.Libmongocrypt.ruleset +85 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/MongoDB.Libmongocrypt.targets +21 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/OperatingSystemHelper.cs +59 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/Package.include.template.csproj +38 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/PinnedBinary.cs +49 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/SecureRandomCallback.cs +51 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/SigningRSAESPKCSCallback.cs +74 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/Status.cs +94 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/StatusSafeHandle.cs +60 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/StyleCop.ruleset +11 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/stylecop.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Example/MongoDB.Libmongocrypt.Example.csproj +23 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Example/Package.include.template.csproj +11 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Example/Program.cs +442 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/BasicTests.cs +748 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/BsonUtil.cs +82 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/CallbackUtils.cs +37 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/CipherCallbacksTests.cs +46 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/HashCallbackTests.cs +37 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/HmacShaCallbacksTests.cs +37 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/MongoDB.Libmongocrypt.Test.csproj +35 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/Package.include.template.csproj +23 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/SigningRSAESPKCSCallbackTests.cs +64 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/collection-info.json +37 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/command-reply.json +13 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/encrypted-command-reply.json +16 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/encrypted-command.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/encrypted-value.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/key-document.json +36 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/key-filter.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/list-collections-filter.json +3 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/mongocryptd-command.json +22 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/xunit.runner.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test32/BasicTests.cs +54 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test32/MongoDB.Libmongocrypt.Test32.csproj +42 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test32/Package.include.template.csproj +23 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/README.md +66 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.cake +219 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.ps1 +275 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.sh +77 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/README.md +36 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/build.gradle.kts +339 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradle/wrapper/gradle-wrapper.jar +0 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradle/wrapper/gradle-wrapper.properties +5 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradlew +188 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradlew.bat +100 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/BinaryHolder.java +45 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/CAPI.java +1130 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/CAPIHelper.java +96 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/CipherCallback.java +66 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/DisposableMemory.java +31 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/JULLogger.java +130 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/Logger.java +144 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/Loggers.java +50 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MacCallback.java +60 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MessageDigestCallback.java +55 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoAwsKmsProviderOptions.java +104 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCrypt.java +100 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCryptContext.java +137 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCryptContextImpl.java +164 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCryptException.java +67 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCryptImpl.java +408 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCryptOptions.java +284 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCrypts.java +38 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoDataKeyOptions.java +125 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoExplicitEncryptOptions.java +225 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoKeyDecryptor.java +76 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoKeyDecryptorImpl.java +105 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoLocalKmsProviderOptions.java +83 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoRewrapManyDataKeyOptions.java +104 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/SLF4JLogger.java +110 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/SecureRandomCallback.java +51 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/SigningRSAESPKCSCallback.java +76 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/package-info.java +18 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/java/com/mongodb/crypt/capi/MongoCryptTest.java +345 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/collection-info.json +37 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/command-reply.json +13 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/command.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/encrypted-command-reply.json +16 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/encrypted-command.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/encrypted-value.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit/int32/encrypted-payload.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit/int32/key-document.json +0 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit/int32/key-filter.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit/int32/rangeopts.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit/int32/value-to-encrypt.json +20 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/json-schema.json +15 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/key-document.json +36 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/key-filter-keyAltName.json +14 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/key-filter.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/keys/ABCDEFAB123498761234123456789012-local-document.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/kms-reply.txt +6 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/list-collections-filter.json +3 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/mongocryptd-command.json +22 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/mongocryptd-reply.json +18 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/CHANGELOG.md +81 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/LICENSE +201 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/README.md +773 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/binding.gyp +79 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/etc/README.hbs +44 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/etc/build-static.sh +39 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/index.d.ts +515 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/autoEncrypter.js +420 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/buffer_pool.js +123 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/clientEncryption.js +699 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/common.js +100 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/credentialsProvider.js +33 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/cryptoCallbacks.js +87 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/index.js +42 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/mongocryptdManager.js +66 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/stateMachine.js +487 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/package-lock.json +16051 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/package.json +81 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/src/mongocrypt.cc +929 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/src/mongocrypt.h +114 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/autoEncrypter.test.js +953 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/buffer_pool.test.js +91 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/clientEncryption.test.js +701 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/credentialsProvider.test.js +163 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/cryptoCallbacks.test.js +284 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/README.md +5 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/cmd.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/collection-info.json +37 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/encrypted-document-nested.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/encrypted-document.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/encryptedFields.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/key-document.json +32 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/key1-document.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/kms-decrypt-reply.txt +6 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/kms-encrypt-reply.txt +7 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/mongocryptd-reply.json +18 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/mongocryptdManager.test.js +48 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/release.test.js +59 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/requirements.helper.js +29 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/stateMachine.test.js +331 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/tools/mongodb_reporter.js +325 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/CHANGELOG.rst +121 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/LICENSE +201 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/README.rst +187 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/RELEASE.rst +107 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/build-manylinux-wheel.sh +16 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/__init__.py +16 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/auto_encrypter.py +61 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/binary.py +94 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/binding.py +1561 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/compat.py +61 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/credentials.py +136 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/crypto.py +162 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/errors.py +39 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/explicit_encrypter.py +248 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/mongocrypt.py +808 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/state_machine.py +156 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/version.py +17 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/release.sh +92 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/setup.py +84 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/strip_header.py +51 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/__init__.py +37 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/collection-info.json +39 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/command-reply.json +13 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/command.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/compact/success/cmd.json +1 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/compact/success/encrypted-field-config-map.json +47 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/compact/success/encrypted-payload.json +23 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/encrypted-command-reply.json +16 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/encrypted-command.json +13 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/encrypted-field-config-map.json +48 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/encrypted-value.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-range-explicit/int32/encrypted-payload.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-range-explicit/int32/rangeopts.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-range-explicit/int32/value-to-encrypt.json +20 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-document-azure.json +33 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-document-gcp.json +35 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-document.json +33 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-filter.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/keys/12345678123498761234123456789012-local-document.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/keys/12345678123498761234123456789013-local-document.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/keys/ABCDEFAB123498761234123456789012-local-document.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/kms-encrypt-reply.txt +7 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/kms-reply-azure.txt +6 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/kms-reply-gcp.txt +6 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/kms-reply.txt +6 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/list-collections-filter.json +3 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/mongocryptd-command.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/mongocryptd-reply.json +20 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/schema-map.json +40 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_binding.py +71 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_crypto.py +49 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_mongocrypt.py +825 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test-requirements.txt +12 -0
- data/ext/libmongocrypt/libmongocrypt/cmake/FetchMongoC.cmake +20 -0
- data/ext/libmongocrypt/libmongocrypt/cmake/ImportBSON.cmake +209 -0
- data/ext/libmongocrypt/libmongocrypt/cmake/ImportDFP.cmake +70 -0
- data/ext/libmongocrypt/libmongocrypt/cmake/IntelDFP.cmake +409 -0
- data/ext/libmongocrypt/libmongocrypt/cmake/LTO.cmake +57 -0
- data/ext/libmongocrypt/libmongocrypt/cmake/MongoC-Warnings.cmake +74 -0
- data/ext/libmongocrypt/libmongocrypt/cmake/libmongocrypt-hidden-symbols.map +8 -0
- data/ext/libmongocrypt/libmongocrypt/cmake/libmongocrypt-hidden-symbols.txt +5 -0
- data/ext/libmongocrypt/libmongocrypt/cmake/libmongocrypt-static.pc.in +9 -0
- data/ext/libmongocrypt/libmongocrypt/cmake/libmongocrypt.pc.in +10 -0
- data/ext/libmongocrypt/libmongocrypt/cmake/ltocheck-lib.c +6 -0
- data/ext/libmongocrypt/libmongocrypt/cmake/ltocheck-main.c +9 -0
- data/ext/libmongocrypt/libmongocrypt/cmake/mongocrypt-config.cmake +42 -0
- data/ext/libmongocrypt/libmongocrypt/debian/build_snapshot.sh +79 -0
- data/ext/libmongocrypt/libmongocrypt/debian/changelog +105 -0
- data/ext/libmongocrypt/libmongocrypt/debian/compat +1 -0
- data/ext/libmongocrypt/libmongocrypt/debian/control +41 -0
- data/ext/libmongocrypt/libmongocrypt/debian/copyright +129 -0
- data/ext/libmongocrypt/libmongocrypt/debian/gbp.conf +23 -0
- data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt-dev.dirs +2 -0
- data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt-dev.install +5 -0
- data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt0.dirs +1 -0
- data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt0.install +1 -0
- data/ext/libmongocrypt/libmongocrypt/debian/rules +46 -0
- data/ext/libmongocrypt/libmongocrypt/debian/source/format +1 -0
- data/ext/libmongocrypt/libmongocrypt/debian/source/lintian-overrides +3 -0
- data/ext/libmongocrypt/libmongocrypt/debian/source/options +1 -0
- data/ext/libmongocrypt/libmongocrypt/debian/watch +3 -0
- data/ext/libmongocrypt/libmongocrypt/doc/Doxygen +2474 -0
- data/ext/libmongocrypt/libmongocrypt/etc/calc_release_version.py +265 -0
- data/ext/libmongocrypt/libmongocrypt/etc/debian/control +33 -0
- data/ext/libmongocrypt/libmongocrypt/etc/debian/rules +41 -0
- data/ext/libmongocrypt/libmongocrypt/etc/debian/source/format +1 -0
- data/ext/libmongocrypt/libmongocrypt/etc/fle2_aead_generate_tests.py +41 -0
- data/ext/libmongocrypt/libmongocrypt/etc/fle2_crypto.py +105 -0
- data/ext/libmongocrypt/libmongocrypt/etc/fle2_crypto_selftest.py +52 -0
- data/ext/libmongocrypt/libmongocrypt/etc/fle2_generate_tests.py +34 -0
- data/ext/libmongocrypt/libmongocrypt/etc/generate-kek-tests.py +69 -0
- data/ext/libmongocrypt/libmongocrypt/etc/generate-test-data.py +141 -0
- data/ext/libmongocrypt/libmongocrypt/etc/list-compile-files.py +20 -0
- data/ext/libmongocrypt/libmongocrypt/etc/mongo-inteldfp-MONGOCRYPT-571.patch +25 -0
- data/ext/libmongocrypt/libmongocrypt/etc/mongo-inteldfp-s390x.patch +134 -0
- data/ext/libmongocrypt/libmongocrypt/etc/packager.py +854 -0
- data/ext/libmongocrypt/libmongocrypt/etc/print-marking.py +36 -0
- data/ext/libmongocrypt/libmongocrypt/etc/repo_config.yaml +257 -0
- data/ext/libmongocrypt/libmongocrypt/etc/requirements.txt +2 -0
- data/ext/libmongocrypt/libmongocrypt/etc/rewrite.py +16 -0
- data/ext/libmongocrypt/libmongocrypt/etc/rpm/libmongocrypt.spec +67 -0
- data/ext/libmongocrypt/libmongocrypt/etc/rpm/tweak.awk +19 -0
- data/ext/libmongocrypt/libmongocrypt/integrating.md +251 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/CMakeLists.txt +305 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/COPYING +177 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/README.md +41 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/THIRD_PARTY_NOTICES +42 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/LICENSE +202 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/NOTICE +2 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-key-duplicate/get-header-key-duplicate.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-key-duplicate/get-header-key-duplicate.creq +9 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-key-duplicate/get-header-key-duplicate.req +6 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-key-duplicate/get-header-key-duplicate.sreq +7 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-key-duplicate/get-header-key-duplicate.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-multiline/get-header-value-multiline.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-multiline/get-header-value-multiline.creq +9 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-multiline/get-header-value-multiline.req +6 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-multiline/get-header-value-multiline.sreq +7 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-multiline/get-header-value-multiline.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-order/get-header-value-order.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-order/get-header-value-order.creq +9 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-order/get-header-value-order.req +7 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-order/get-header-value-order.sreq +8 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-order/get-header-value-order.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-trim/get-header-value-trim.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-trim/get-header-value-trim.creq +10 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-trim/get-header-value-trim.req +5 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-trim/get-header-value-trim.sreq +6 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-header-value-trim/get-header-value-trim.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-unreserved/get-unreserved.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-unreserved/get-unreserved.creq +8 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-unreserved/get-unreserved.req +3 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-unreserved/get-unreserved.sreq +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-unreserved/get-unreserved.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-utf8/get-utf8.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-utf8/get-utf8.creq +8 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-utf8/get-utf8.req +3 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-utf8/get-utf8.sreq +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-utf8/get-utf8.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla/get-vanilla.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla/get-vanilla.creq +8 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla/get-vanilla.req +3 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla/get-vanilla.sreq +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla/get-vanilla.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-empty-query-key/get-vanilla-empty-query-key.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-empty-query-key/get-vanilla-empty-query-key.creq +8 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-empty-query-key/get-vanilla-empty-query-key.req +3 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-empty-query-key/get-vanilla-empty-query-key.sreq +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-empty-query-key/get-vanilla-empty-query-key.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query/get-vanilla-query.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query/get-vanilla-query.creq +8 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query/get-vanilla-query.req +3 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query/get-vanilla-query.sreq +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query/get-vanilla-query.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-key/get-vanilla-query-order-key.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-key/get-vanilla-query-order-key.creq +8 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-key/get-vanilla-query-order-key.req +3 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-key/get-vanilla-query-order-key.sreq +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-key/get-vanilla-query-order-key.sts +4 -0
- 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
- 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
- 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
- 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
- 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
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-value/get-vanilla-query-order-value.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-value/get-vanilla-query-order-value.creq +8 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-value/get-vanilla-query-order-value.req +3 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-value/get-vanilla-query-order-value.sreq +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-order-value/get-vanilla-query-order-value.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-unreserved/get-vanilla-query-unreserved.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-unreserved/get-vanilla-query-unreserved.creq +8 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-unreserved/get-vanilla-query-unreserved.req +3 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-unreserved/get-vanilla-query-unreserved.sreq +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-query-unreserved/get-vanilla-query-unreserved.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-utf8-query/get-vanilla-utf8-query.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-utf8-query/get-vanilla-utf8-query.creq +8 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-utf8-query/get-vanilla-utf8-query.req +3 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-utf8-query/get-vanilla-utf8-query.sreq +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/get-vanilla-utf8-query/get-vanilla-utf8-query.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-relative/get-relative.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-relative/get-relative.creq +8 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-relative/get-relative.req +3 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-relative/get-relative.sreq +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-relative/get-relative.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-relative-relative/get-relative-relative.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-relative-relative/get-relative-relative.creq +8 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-relative-relative/get-relative-relative.req +3 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-relative-relative/get-relative-relative.sreq +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-relative-relative/get-relative-relative.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash/get-slash.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash/get-slash.creq +8 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash/get-slash.req +3 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash/get-slash.sreq +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash/get-slash.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash-dot-slash/get-slash-dot-slash.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash-dot-slash/get-slash-dot-slash.creq +8 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash-dot-slash/get-slash-dot-slash.req +3 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash-dot-slash/get-slash-dot-slash.sreq +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash-dot-slash/get-slash-dot-slash.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash-pointless-dot/get-slash-pointless-dot.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash-pointless-dot/get-slash-pointless-dot.creq +8 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash-pointless-dot/get-slash-pointless-dot.req +3 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash-pointless-dot/get-slash-pointless-dot.sreq +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slash-pointless-dot/get-slash-pointless-dot.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slashes/get-slashes.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slashes/get-slashes.creq +8 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slashes/get-slashes.req +3 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slashes/get-slashes.sreq +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-slashes/get-slashes.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-space/get-space.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-space/get-space.creq +8 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-space/get-space.req +3 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-space/get-space.sreq +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/get-space/get-space.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/normalize-path/normalize-path.txt +3 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-key-case/post-header-key-case.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-key-case/post-header-key-case.creq +8 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-key-case/post-header-key-case.req +3 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-key-case/post-header-key-case.sreq +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-key-case/post-header-key-case.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-key-sort/post-header-key-sort.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-key-sort/post-header-key-sort.creq +9 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-key-sort/post-header-key-sort.req +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-key-sort/post-header-key-sort.sreq +5 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-key-sort/post-header-key-sort.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-value-case/post-header-value-case.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-value-case/post-header-value-case.creq +9 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-value-case/post-header-value-case.req +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-value-case/post-header-value-case.sreq +5 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-header-value-case/post-header-value-case.sts +4 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-sts-token/readme.txt +15 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla/post-vanilla.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla/post-vanilla.creq +8 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla/post-vanilla.req +3 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla/post-vanilla.sreq +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla/post-vanilla.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla-empty-query-value/post-vanilla-empty-query-value.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla-empty-query-value/post-vanilla-empty-query-value.creq +8 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla-empty-query-value/post-vanilla-empty-query-value.req +3 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla-empty-query-value/post-vanilla-empty-query-value.sreq +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla-empty-query-value/post-vanilla-empty-query-value.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla-query/post-vanilla-query.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla-query/post-vanilla-query.creq +8 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla-query/post-vanilla-query.req +3 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla-query/post-vanilla-query.sreq +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-vanilla-query/post-vanilla-query.sts +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-x-www-form-urlencoded/post-x-www-form-urlencoded.authz +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-x-www-form-urlencoded/post-x-www-form-urlencoded.creq +9 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-x-www-form-urlencoded/post-x-www-form-urlencoded.req +6 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-x-www-form-urlencoded/post-x-www-form-urlencoded.sreq +7 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/aws-sig-v4-test-suite/post-x-www-form-urlencoded/post-x-www-form-urlencoded.sts +4 -0
- 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
- 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
- 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
- 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
- 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
- data/ext/libmongocrypt/libmongocrypt/kms-message/cmake/kms_message-config.cmake +1 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/cmake/libkms_message.pc.in +9 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/hexlify.c +67 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/hexlify.h +24 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_azure_request.c +219 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_b64.c +654 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_caller_identity_request.c +52 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_crypto.h +70 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_crypto_apple.c +159 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_crypto_libcrypto.c +142 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_crypto_none.c +65 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_crypto_windows.c +268 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_decrypt_request.c +72 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_encrypt_request.c +73 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_endian_private.h +165 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_gcp_request.c +286 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_item_type_private.h +59 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_reader_writer.c +502 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_reader_writer_private.h +150 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_request.c +256 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_response.c +323 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_response_parser.c +148 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_response_parser_private.h +55 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_result_reason_private.h +77 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_result_status_private.h +54 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_tag_type_private.h +343 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kv_list.c +149 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kv_list.h +56 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_azure_request.h +110 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_b64.h +70 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_caller_identity_request.h +36 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_decrypt_request.h +37 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_encrypt_request.h +39 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_gcp_request.h +124 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_kmip_request.h +58 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_kmip_response.h +40 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_kmip_response_parser.h +26 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_message.h +34 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_message_defines.h +72 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_request.h +103 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_request_opt.h +80 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_response.h +43 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_response_parser.h +64 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message.c +47 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message_private.h +142 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_port.c +33 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_port.h +34 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request.c +925 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request_opt.c +88 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request_opt_private.h +32 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request_str.c +520 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request_str.h +89 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_response.c +54 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_response_parser.c +408 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/sort.c +74 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/sort.h +21 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/connection_close/connection_close.sreq +5 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/content_length/content_length.sreq +7 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/decrypt/decrypt.creq +11 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/decrypt/decrypt.sreq +9 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/encrypt/encrypt.creq +11 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/encrypt/encrypt.sreq +9 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/example-chunked-response.bin +20 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/example-multi-chunked-response.bin +22 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/example-response.bin +6 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/host/host.sreq +4 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/multibyte/multibyte.creq +10 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/multibyte/multibyte.sreq +8 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kmip_reader_writer.c +485 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_assert.h +147 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_azure_online.c +260 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_gcp_online.c +250 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_kmip_request.c +223 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_kmip_response.c +214 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_kmip_response_parser.c +197 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_online_util.c +120 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_online_util.h +35 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_request.c +1302 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_util.c +92 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_util.h +45 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/windows/dirent.h +1224 -0
- data/ext/libmongocrypt/libmongocrypt/src/crypto/cng.c +640 -0
- data/ext/libmongocrypt/libmongocrypt/src/crypto/commoncrypto.c +326 -0
- data/ext/libmongocrypt/libmongocrypt/src/crypto/libcrypto.c +341 -0
- data/ext/libmongocrypt/libmongocrypt/src/crypto/none.c +97 -0
- data/ext/libmongocrypt/libmongocrypt/src/csfle-markup.cpp +237 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-array-private.h +54 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-array.c +102 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-check-conversions-private.h +36 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-dec128.h +743 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-dec128.test.cpp +86 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-efc-private.h +48 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-efc.c +127 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle-blob-subtype-private.h +40 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder-private.h +152 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder.c +487 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-private.h +47 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload.c +156 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-private.h +95 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload.c +158 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-private.h +124 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload.c +316 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev-private.h +179 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev.c +385 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-private.h +93 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev.c +269 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-range-operator-private.h +29 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-rfds-private.h +91 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-rfds.c +658 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-optional-private.h +124 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-edge-generation-private.h +161 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-edge-generation.c +242 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-encoding-private.h +128 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-encoding.c +620 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover-generator.template.h +308 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover-private.h +112 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover.c +341 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts-private.h +99 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts.c +382 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-reader-private.h +130 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-reader.c +235 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-tokens-private.h +118 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-tokens.c +151 -0
- data/ext/libmongocrypt/libmongocrypt/src/mlib/check.hpp +89 -0
- data/ext/libmongocrypt/libmongocrypt/src/mlib/endian.h +42 -0
- data/ext/libmongocrypt/libmongocrypt/src/mlib/error.h +59 -0
- data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.h +685 -0
- data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.test.c +3 -0
- data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.test.cpp +407 -0
- data/ext/libmongocrypt/libmongocrypt/src/mlib/macros.h +53 -0
- data/ext/libmongocrypt/libmongocrypt/src/mlib/path.h +381 -0
- data/ext/libmongocrypt/libmongocrypt/src/mlib/path.test.c +93 -0
- data/ext/libmongocrypt/libmongocrypt/src/mlib/str.h +1028 -0
- data/ext/libmongocrypt/libmongocrypt/src/mlib/str.test.c +137 -0
- data/ext/libmongocrypt/libmongocrypt/src/mlib/thread.h +88 -0
- data/ext/libmongocrypt/libmongocrypt/src/mlib/user-check.h +4 -0
- data/ext/libmongocrypt/libmongocrypt/src/mlib/windows-lean.h +19 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongo_crypt-v1.h +320 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-binary-private.h +34 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-binary.c +87 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-buffer-private.h +236 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-buffer.c +691 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-collinfo-private.h +24 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-collinfo.c +82 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-key-private.h +55 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-key.c +190 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-oauth-private.h +46 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-oauth.c +126 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-private.h +96 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache.c +341 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ciphertext-private.h +64 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ciphertext.c +212 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-compat.h +44 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-config.h.in +87 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-crypto-private.h +303 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-crypto.c +1850 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-datakey.c +534 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-decrypt.c +773 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-encrypt.c +3005 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-private.h +269 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-rewrap-many-datakey.c +415 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx.c +1283 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-dll-private.h +97 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-endian-private.h +168 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-endpoint-private.h +64 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-endpoint.c +212 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kek-private.h +109 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kek.c +325 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-broker-private.h +209 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-broker.c +1189 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-private.h +87 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key.c +473 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kms-ctx-private.h +154 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kms-ctx.c +1785 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-log-private.h +111 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-log.c +123 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking-private.h +74 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking.c +1624 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-mutex-private.h +46 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts-private.h +231 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts.c +493 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-private.h +197 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-status-private.h +39 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-status.c +169 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-traverse-util-private.h +59 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-traverse-util.c +234 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-util-private.h +84 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-util.c +203 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt.c +1605 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt.h +1610 -0
- data/ext/libmongocrypt/libmongocrypt/src/os_posix/os_dll.c +132 -0
- data/ext/libmongocrypt/libmongocrypt/src/os_posix/os_mutex.c +57 -0
- data/ext/libmongocrypt/libmongocrypt/src/os_win/os_dll.c +92 -0
- data/ext/libmongocrypt/libmongocrypt/src/os_win/os_mutex.c +45 -0
- data/ext/libmongocrypt/libmongocrypt/test/crypt_shared-stub.cpp +155 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/NIST-CAVP.cstructs +1350 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/aes-ctr.cstructs +359 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/cache-tests.json +197 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/collection-info-no-schema.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/collection-info-no-validator.json +13 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/collection-info-view.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/collinfo-siblings.json +40 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/missing-key-id/collinfo.json +21 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/no-fields/collinfo.json +10 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/no-fields/encrypted-payload.json +4 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/cmd.json +1 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/collinfo.json +49 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/encrypted-field-config-map.json +47 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/encrypted-payload.json +23 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/mongocryptd-reply.json +72 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/omitted/cmd-to-mongocryptd.json +34 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/omitted/cmd.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/omitted/collinfo.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/omitted/encrypted-payload.json +39 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/omitted/mongocryptd-reply.json +45 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved/cmd-to-mongocryptd.json +34 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved/cmd.json +7 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved/collinfo.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved/encrypted-payload.json +40 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved/mongocryptd-reply.json +45 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_empty/cmd-to-mongocryptd.json +17 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_empty/cmd.json +7 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_empty/collinfo.json +10 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_empty/encrypted-payload.json +7 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_empty/mongocryptd-reply.json +23 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_fle1/cmd-to-mongocryptd.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_fle1/cmd.json +7 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_fle1/collinfo.json +25 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_fle1/encrypted-payload.json +14 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_fle1/mongocryptd-reply.json +15 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/efc/efc-extraField.json +24 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/efc/efc-missingKeyId.json +17 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/efc/efc-oneField.json +23 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/efc/efc-twoFields.json +39 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/encrypted-cmd.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/encrypted-field-config-map.json +48 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decryption-input.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/find-with-encryptionInformation.json +16 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-collMod/cmd-to-mongocryptd.json +12 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-collMod/cmd.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-collMod/insert/cmd.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-collMod/insert/collinfo.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-collMod/mongocryptd-reply.json +14 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/old-mongocryptd/cmd.json +3 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/old-mongocryptd/encrypted-payload.json +3 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/old-mongocryptd/ismaster-to-mongocryptd.json +3 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/old-mongocryptd/mongocryptd-ismaster.json +12 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-cmd-schema/cmd-to-mongocryptd.json +20 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-cmd-schema/cmd.json +12 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-cmd-schema/encrypted-payload.json +12 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-cmd-schema/ismaster-to-mongocryptd.json +3 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-cmd-schema/mongocryptd-ismaster.json +12 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-cmd-schema/mongocryptd-reply.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-schema/cmd-to-mongocryptd.json +7 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-schema/cmd.json +3 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-schema/encrypted-payload.json +3 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-schema/ismaster-to-mongocryptd.json +3 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-schema/mongocryptd-ismaster.json +12 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-schema/mongocryptd-reply.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/with-schema/schema-map.json +5 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/without-schema/cmd-to-mongocryptd.json +5 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/without-schema/cmd.json +3 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/without-schema/encrypted-payload.json +3 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/without-schema/ismaster-to-mongocryptd.json +3 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/without-schema/mongocryptd-ismaster.json +12 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-create/without-schema/mongocryptd-reply.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-explain/with-csfle/cmd.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-explain/with-csfle/collinfo.json +7 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-explain/with-csfle/encrypted-payload.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-explain/with-mongocryptd/cmd-to-mongocryptd.json +10 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-explain/with-mongocryptd/cmd.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-explain/with-mongocryptd/collinfo.json +7 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-explain/with-mongocryptd/encrypted-payload.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-explain/with-mongocryptd/mongocryptd-reply.json +14 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-aead.cstructs +109 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create/cmd-to-mongocryptd.json +14 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create/cmd.json +3 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create/encrypted-field-config-map.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create/encrypted-payload.json +3 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create/ismaster-to-mongocryptd.json +3 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create/mongocryptd-ismaster.json +12 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create/mongocryptd-reply.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-decrypt-ieev/first-filter.json +21 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-decrypt-ieev/second-filter.json +21 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/empty/cmd.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/empty/collinfo.json +49 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/empty/encrypted-field-config-map.json +47 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/empty/encrypted-payload.json +91 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/empty/mongocryptd-reply.json +66 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/success/cmd.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/success/collinfo.json +49 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/success/encrypted-field-config-map.json +47 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/success/encrypted-payload.json +98 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/success/mongocryptd-reply.json +72 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-csfle/cmd.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-csfle/collinfo.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-csfle/encrypted-payload.json +46 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-mongocryptd/cmd-to-mongocryptd.json +36 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-mongocryptd/cmd.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-mongocryptd/collinfo.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-mongocryptd/encrypted-payload.json +41 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-mongocryptd/mongocryptd-reply.json +47 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/find-indexed-contentionFactor1.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/find-indexed.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/insert-indexed-contentionFactor1.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/insert-indexed-same-user-and-index-key.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/insert-indexed.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality/cmd.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality/encrypted-field-map.json +23 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality/encrypted-payload.json +41 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality/mongocryptd-reply.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-explicit/cmd-to-mongocryptd.json +24 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-explicit/cmd-to-mongod.json +24 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-explicit/cmd.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-explicit/reply-from-mongocryptd.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/README.md +2 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date/cmd.json +10 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date/encrypted-field-map.json +28 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date/encrypted-payload.json +42 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date/mongocryptd-reply.json +50 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128/cmd.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128/encrypted-field-map.json +28 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128/encrypted-payload.json +42 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128/mongocryptd-reply.json +50 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision/cmd.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision/encrypted-field-map.json +31 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision/encrypted-payload.json +51 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision/mongocryptd-reply.json +59 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double/cmd.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double/encrypted-field-map.json +28 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double/encrypted-payload.json +42 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double/mongocryptd-reply.json +50 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision/cmd.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision/encrypted-field-map.json +31 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision/encrypted-payload.json +45 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision/mongocryptd-reply.json +53 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32/cmd.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32/encrypted-field-map.json +28 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32/encrypted-payload.json +42 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32/mongocryptd-reply.json +50 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64/cmd.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64/encrypted-field-map.json +28 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64/encrypted-payload.json +42 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64/mongocryptd-reply.json +50 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double/encrypted-payload.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double/rangeopts.json +5 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double/value-to-encrypt.json +20 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double-precision/encrypted-payload.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double-precision/rangeopts.json +14 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double-precision/value-to-encrypt.json +20 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32/encrypted-payload.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32/rangeopts.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32/value-to-encrypt.json +20 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/encrypted-payload.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/rangeopts.json +5 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/value-to-encrypt.json +20 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-openinterval/encrypted-payload.json +16 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-openinterval/rangeopts.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-openinterval/value-to-encrypt.json +13 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert/cmd.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert/encrypted-field-map.json +23 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert/encrypted-payload.json +40 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert/mongocryptd-reply.json +50 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/README.md +2 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date/RNG_DATA.h +67 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date/cmd.json +13 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date/encrypted-field-map.json +28 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date/encrypted-payload.json +45 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date/mongocryptd-reply.json +53 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128/RNG_DATA.h +134 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128/cmd.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128/encrypted-field-map.json +28 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128/encrypted-payload.json +45 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128/mongocryptd-reply.json +53 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision/RNG_DATA.h +73 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision/cmd.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision/encrypted-field-map.json +31 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision/encrypted-payload.json +54 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision/mongocryptd-reply.json +62 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double/RNG_DATA.h +70 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double/cmd.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double/encrypted-field-map.json +28 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double/encrypted-payload.json +45 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double/mongocryptd-reply.json +53 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision/RNG_DATA.h +21 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision/cmd.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision/encrypted-field-map.json +31 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision/encrypted-payload.json +48 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision/mongocryptd-reply.json +56 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32/RNG_DATA.h +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32/cmd.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32/encrypted-field-map.json +28 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32/encrypted-payload.json +45 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32/mongocryptd-reply.json +53 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64/RNG_DATA.h +67 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64/cmd.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64/encrypted-field-map.json +28 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64/encrypted-payload.json +45 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64/mongocryptd-reply.json +53 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double/RNG_DATA.h +70 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double/encrypted-payload.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double/rangeopts.json +5 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double/value-to-encrypt.json +5 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double-precision/RNG_DATA.h +21 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double-precision/encrypted-payload.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double-precision/rangeopts.json +14 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double-precision/value-to-encrypt.json +5 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32/RNG_DATA.h +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32/encrypted-payload.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32/rangeopts.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32/value-to-encrypt.json +5 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/RNG_DATA.h +70 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/encrypted-payload.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/rangeopts.json +5 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/value-to-encrypt.json +5 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/sparsity-2/RNG_DATA.h +17 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/sparsity-2/encrypted-payload.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/sparsity-2/rangeopts.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/sparsity-2/value-to-encrypt.json +5 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed/cmd.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed/encrypted-field-map.json +23 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed/encrypted-payload.json +14 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed/mongocryptd-reply.json +46 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2.cstructs +33 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/gcp-auth/decrypt-response.txt +5 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/gcp-auth/encrypt-response.txt +5 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/gcp-auth/oauth-response.txt +5 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/kek-tests.json +169 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/key-document-azure.json +33 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/key-document-full.json +36 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/key-document-gcp.json +35 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/key-document-kmip.json +34 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/key-document-local.json +18 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/key-document-no-region.json +31 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/key-document-with-alt-name-duplicate-id.json +36 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/key-document-with-alt-name.json +33 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/key-document-with-alt-name2.json +33 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/keys/12345678123498761234123456789012-aws-decrypt-reply.txt +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/keys/12345678123498761234123456789012-aws-document.json +32 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/keys/12345678123498761234123456789012-key-material.txt +1 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/keys/12345678123498761234123456789012-local-document.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/keys/12345678123498761234123456789013-aws-decrypt-reply.txt +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/keys/12345678123498761234123456789013-aws-document.json +32 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/keys/12345678123498761234123456789013-key-material.txt +1 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/keys/12345678123498761234123456789013-local-document.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/keys/12345678123498761234123456789014-key-material.txt +1 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/keys/12345678123498761234123456789014-local-document.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/keys/ABCDEFAB123498761234123456789012-aws-decrypt-reply.txt +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/keys/ABCDEFAB123498761234123456789012-aws-document.json +32 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/keys/ABCDEFAB123498761234123456789012-key-material.txt +1 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/keys/ABCDEFAB123498761234123456789012-local-document.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/keys/README.md +21 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/kms-encrypt-reply.txt +7 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/kms-tests.json +297 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/mongocryptd-cmd.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/mongocryptd-reply-existing-ciphertext.json +24 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/mongocryptd-reply-invalid.json +18 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/mongocryptd-reply-key-alt-name.json +18 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/mongocryptd-reply-key-alt-name2.json +18 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/mongocryptd-reply-no-encryption-needed.json +7 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/mongocryptd-reply-no-markings.json +7 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/mongocryptd-reply-random.json +18 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_decimal128.cstruct +14527 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_double.cstruct +7959 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_int32.cstruct +6906 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_int64.cstruct +9429 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_decimal128.cstruct +4565 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_decimal128_precision.cstruct +312 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_double.cstruct +3277 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_double_precision.cstruct +369 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_int32.cstruct +4612 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_int64.cstruct +3398 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/rmd/key-document-a.json +35 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/rmd/key-document-b.json +37 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/rmd/key-document-local.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/rmd/kms-decrypt-reply-a.txt +6 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/rmd/kms-decrypt-reply-b.txt +6 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/rmd/kms-encrypt-reply-a.txt +7 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/rmd/kms-encrypt-reply-b.txt +7 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/schema-map.json +40 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/schema.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/example/README.md +5 -0
- data/ext/libmongocrypt/libmongocrypt/test/example/cmd.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/test/example/collection-info.json +39 -0
- data/ext/libmongocrypt/libmongocrypt/test/example/encrypted-command.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/example/key-document-custom-endpoint.json +34 -0
- data/ext/libmongocrypt/libmongocrypt/test/example/key-document.json +33 -0
- data/ext/libmongocrypt/libmongocrypt/test/example/kms-decrypt-reply.txt +6 -0
- data/ext/libmongocrypt/libmongocrypt/test/example/mongocryptd-reply.json +18 -0
- data/ext/libmongocrypt/libmongocrypt/test/example-no-bson.c +23 -0
- data/ext/libmongocrypt/libmongocrypt/test/example-state-machine.c +368 -0
- data/ext/libmongocrypt/libmongocrypt/test/fuzz_kms.c +42 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-dll.cpp +22 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-gcp-auth.c +312 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-efc.c +104 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iev.c +443 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iup.c +184 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-uev.c +200 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-rfds.c +518 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-edge-generation.c +468 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-encoding.c +886 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-mincover.c +609 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-rangeopts.c +174 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-reader.c +251 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-tokens.c +245 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert-match-bson.c +1079 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert-match-bson.h +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert.h +218 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-buffer.c +266 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cache-oauth.c +57 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cache.c +264 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ciphertext.c +259 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-compact.c +478 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-hooks.c +917 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-std-hooks.c +177 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-std-hooks.h +110 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto.c +892 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-csfle-lib.c +208 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-decrypt.c +1134 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-encrypt.c +5096 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-rewrap-many-datakey.c +1061 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-setopt.c +1301 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-datakey.c +489 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-dll.c +48 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-endpoint.c +138 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kek.c +104 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key-broker.c +1174 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key-cache.c +475 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key.c +282 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kms-ctx.c +561 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kms-responses.c +206 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-local-kms.c +89 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-log.c +137 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-marking.c +738 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-status.c +88 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-traverse-util.c +548 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-util.c +105 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-util.h +42 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.c +1060 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.h +290 -0
- data/ext/libmongocrypt/libmongocrypt/test/util/HELP.autogen +102 -0
- data/ext/libmongocrypt/libmongocrypt/test/util/README.md +103 -0
- data/ext/libmongocrypt/libmongocrypt/test/util/csfle.c +612 -0
- data/ext/libmongocrypt/libmongocrypt/test/util/helpgen.py +7 -0
- data/ext/libmongocrypt/libmongocrypt/test/util/make_includes.py +845 -0
- data/ext/libmongocrypt/libmongocrypt/test/util/util.c +969 -0
- data/ext/libmongocrypt/libmongocrypt/test/util/util.h +96 -0
- data/ext/libmongocrypt/libmongocrypt/third-party/IntelRDFPMathLib20U2.tar.xz +0 -0
- data/lib/libmongocrypt_helper/version.rb +2 -2
- data/lib/libmongocrypt_helper.rb +15 -1
- data.tar.gz.sig +0 -0
- metadata +1019 -32
- metadata.gz.sig +0 -0
- data/so/libmongocrypt.so +0 -0
@@ -0,0 +1,1189 @@
|
|
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-key-broker-private.h"
|
18
|
+
#include "mongocrypt-private.h"
|
19
|
+
|
20
|
+
void
|
21
|
+
_mongocrypt_key_broker_init (_mongocrypt_key_broker_t *kb, mongocrypt_t *crypt)
|
22
|
+
{
|
23
|
+
BSON_ASSERT_PARAM (kb);
|
24
|
+
BSON_ASSERT_PARAM (crypt);
|
25
|
+
|
26
|
+
memset (kb, 0, sizeof (*kb));
|
27
|
+
kb->crypt = crypt;
|
28
|
+
kb->state = KB_REQUESTING;
|
29
|
+
kb->status = mongocrypt_status_new ();
|
30
|
+
}
|
31
|
+
|
32
|
+
/*
|
33
|
+
* Creates a new key_returned_t and prepends it to a list.
|
34
|
+
*
|
35
|
+
* Side effects:
|
36
|
+
* - updates *list to point to a new head.
|
37
|
+
*/
|
38
|
+
static key_returned_t *
|
39
|
+
_key_returned_prepend (_mongocrypt_key_broker_t *kb,
|
40
|
+
key_returned_t **list,
|
41
|
+
_mongocrypt_key_doc_t *key_doc)
|
42
|
+
{
|
43
|
+
key_returned_t *key_returned;
|
44
|
+
|
45
|
+
BSON_ASSERT_PARAM (kb);
|
46
|
+
BSON_ASSERT_PARAM (list);
|
47
|
+
BSON_ASSERT_PARAM (key_doc);
|
48
|
+
|
49
|
+
key_returned = bson_malloc0 (sizeof (*key_returned));
|
50
|
+
BSON_ASSERT (key_returned);
|
51
|
+
|
52
|
+
key_returned->doc = _mongocrypt_key_new ();
|
53
|
+
_mongocrypt_key_doc_copy_to (key_doc, key_returned->doc);
|
54
|
+
|
55
|
+
/* Prepend and update the head of the list. */
|
56
|
+
key_returned->next = *list;
|
57
|
+
*list = key_returned;
|
58
|
+
|
59
|
+
/* Update the head of the decrypting iter. */
|
60
|
+
kb->decryptor_iter = kb->keys_returned;
|
61
|
+
return key_returned;
|
62
|
+
}
|
63
|
+
|
64
|
+
/* Find the first (if any) key_returned_t matching either a key_id or a list of
|
65
|
+
* key_alt_names (both are NULLable) */
|
66
|
+
static key_returned_t *
|
67
|
+
_key_returned_find_one (key_returned_t *list,
|
68
|
+
_mongocrypt_buffer_t *key_id,
|
69
|
+
_mongocrypt_key_alt_name_t *key_alt_names)
|
70
|
+
{
|
71
|
+
key_returned_t *key_returned;
|
72
|
+
|
73
|
+
/* list can be NULL. */
|
74
|
+
/* key_id and key_alt_names are not dereferenced in this function and they
|
75
|
+
* are checked just before being passed on as parameters. */
|
76
|
+
|
77
|
+
for (key_returned = list; NULL != key_returned;
|
78
|
+
key_returned = key_returned->next) {
|
79
|
+
if (key_id) {
|
80
|
+
BSON_ASSERT (key_returned->doc);
|
81
|
+
if (0 == _mongocrypt_buffer_cmp (key_id, &key_returned->doc->id)) {
|
82
|
+
return key_returned;
|
83
|
+
}
|
84
|
+
}
|
85
|
+
if (key_alt_names) {
|
86
|
+
BSON_ASSERT (key_returned->doc);
|
87
|
+
if (_mongocrypt_key_alt_name_intersects (
|
88
|
+
key_alt_names, key_returned->doc->key_alt_names)) {
|
89
|
+
return key_returned;
|
90
|
+
}
|
91
|
+
}
|
92
|
+
}
|
93
|
+
|
94
|
+
return NULL;
|
95
|
+
}
|
96
|
+
|
97
|
+
/* Find the first (if any) key_request_t in the key broker matching either a
|
98
|
+
* key_id or a list of key_alt_names (both are NULLable) */
|
99
|
+
static key_request_t *
|
100
|
+
_key_request_find_one (_mongocrypt_key_broker_t *kb,
|
101
|
+
const _mongocrypt_buffer_t *key_id,
|
102
|
+
_mongocrypt_key_alt_name_t *key_alt_names)
|
103
|
+
{
|
104
|
+
key_request_t *key_request;
|
105
|
+
|
106
|
+
BSON_ASSERT_PARAM (kb);
|
107
|
+
/* key_id and key_alt_names are not dereferenced in this function and they
|
108
|
+
* are checked just before being passed on as parameters. */
|
109
|
+
|
110
|
+
for (key_request = kb->key_requests; NULL != key_request;
|
111
|
+
key_request = key_request->next) {
|
112
|
+
if (key_id) {
|
113
|
+
if (0 == _mongocrypt_buffer_cmp (key_id, &key_request->id)) {
|
114
|
+
return key_request;
|
115
|
+
}
|
116
|
+
}
|
117
|
+
if (key_alt_names) {
|
118
|
+
if (_mongocrypt_key_alt_name_intersects (key_alt_names,
|
119
|
+
key_request->alt_name)) {
|
120
|
+
return key_request;
|
121
|
+
}
|
122
|
+
}
|
123
|
+
}
|
124
|
+
|
125
|
+
return NULL;
|
126
|
+
}
|
127
|
+
|
128
|
+
static bool
|
129
|
+
_all_key_requests_satisfied (_mongocrypt_key_broker_t *kb)
|
130
|
+
{
|
131
|
+
key_request_t *key_request;
|
132
|
+
|
133
|
+
BSON_ASSERT_PARAM (kb);
|
134
|
+
|
135
|
+
for (key_request = kb->key_requests; NULL != key_request;
|
136
|
+
key_request = key_request->next) {
|
137
|
+
if (!key_request->satisfied) {
|
138
|
+
return false;
|
139
|
+
}
|
140
|
+
}
|
141
|
+
return true;
|
142
|
+
}
|
143
|
+
|
144
|
+
static bool
|
145
|
+
_key_broker_fail_w_msg (_mongocrypt_key_broker_t *kb, const char *msg)
|
146
|
+
{
|
147
|
+
mongocrypt_status_t *status;
|
148
|
+
|
149
|
+
BSON_ASSERT_PARAM (kb);
|
150
|
+
BSON_ASSERT_PARAM (msg);
|
151
|
+
|
152
|
+
kb->state = KB_ERROR;
|
153
|
+
status = kb->status;
|
154
|
+
CLIENT_ERR ("%s", msg);
|
155
|
+
return false;
|
156
|
+
}
|
157
|
+
|
158
|
+
static bool
|
159
|
+
_key_broker_fail (_mongocrypt_key_broker_t *kb)
|
160
|
+
{
|
161
|
+
BSON_ASSERT_PARAM (kb);
|
162
|
+
|
163
|
+
if (mongocrypt_status_ok (kb->status)) {
|
164
|
+
return _key_broker_fail_w_msg (
|
165
|
+
kb, "unexpected, failing but no error status set");
|
166
|
+
}
|
167
|
+
kb->state = KB_ERROR;
|
168
|
+
return false;
|
169
|
+
}
|
170
|
+
|
171
|
+
static bool
|
172
|
+
_try_satisfying_from_cache (_mongocrypt_key_broker_t *kb, key_request_t *req)
|
173
|
+
{
|
174
|
+
_mongocrypt_cache_key_attr_t *attr = NULL;
|
175
|
+
_mongocrypt_cache_key_value_t *value = NULL;
|
176
|
+
bool ret = false;
|
177
|
+
|
178
|
+
BSON_ASSERT_PARAM (kb);
|
179
|
+
BSON_ASSERT_PARAM (req);
|
180
|
+
|
181
|
+
if (kb->state != KB_REQUESTING && kb->state != KB_ADDING_DOCS_ANY) {
|
182
|
+
_key_broker_fail_w_msg (
|
183
|
+
kb, "trying to retrieve key from cache in invalid state");
|
184
|
+
goto cleanup;
|
185
|
+
}
|
186
|
+
|
187
|
+
attr = _mongocrypt_cache_key_attr_new (&req->id, req->alt_name);
|
188
|
+
if (!_mongocrypt_cache_get (&kb->crypt->cache_key, attr, (void **) &value)) {
|
189
|
+
_key_broker_fail_w_msg (kb, "failed to retrieve from cache");
|
190
|
+
goto cleanup;
|
191
|
+
}
|
192
|
+
|
193
|
+
if (value) {
|
194
|
+
key_returned_t *key_returned;
|
195
|
+
|
196
|
+
req->satisfied = true;
|
197
|
+
if (_mongocrypt_buffer_empty (&value->decrypted_key_material)) {
|
198
|
+
_key_broker_fail_w_msg (
|
199
|
+
kb, "cache entry does not have decrypted key material");
|
200
|
+
goto cleanup;
|
201
|
+
}
|
202
|
+
|
203
|
+
/* Add the cached key to our locally copied list.
|
204
|
+
* Note, we deduplicate requests, but *not* keys from the cache,
|
205
|
+
* because the state of the cache may change between each call to
|
206
|
+
* _mongocrypt_cache_get.
|
207
|
+
*/
|
208
|
+
key_returned =
|
209
|
+
_key_returned_prepend (kb, &kb->keys_cached, value->key_doc);
|
210
|
+
_mongocrypt_buffer_init (&key_returned->decrypted_key_material);
|
211
|
+
_mongocrypt_buffer_copy_to (&value->decrypted_key_material,
|
212
|
+
&key_returned->decrypted_key_material);
|
213
|
+
key_returned->decrypted = true;
|
214
|
+
}
|
215
|
+
|
216
|
+
ret = true;
|
217
|
+
cleanup:
|
218
|
+
_mongocrypt_cache_key_value_destroy (value);
|
219
|
+
_mongocrypt_cache_key_attr_destroy (attr);
|
220
|
+
return ret;
|
221
|
+
}
|
222
|
+
|
223
|
+
static bool
|
224
|
+
_store_to_cache (_mongocrypt_key_broker_t *kb, key_returned_t *key_returned)
|
225
|
+
{
|
226
|
+
_mongocrypt_cache_key_value_t *value;
|
227
|
+
_mongocrypt_cache_key_attr_t *attr;
|
228
|
+
bool ret;
|
229
|
+
|
230
|
+
BSON_ASSERT_PARAM (kb);
|
231
|
+
BSON_ASSERT_PARAM (key_returned);
|
232
|
+
|
233
|
+
if (!key_returned->decrypted) {
|
234
|
+
return _key_broker_fail_w_msg (kb, "cannot cache non-decrypted key");
|
235
|
+
}
|
236
|
+
|
237
|
+
attr = _mongocrypt_cache_key_attr_new (&key_returned->doc->id,
|
238
|
+
key_returned->doc->key_alt_names);
|
239
|
+
if (!attr) {
|
240
|
+
return _key_broker_fail_w_msg (kb,
|
241
|
+
"could not create key cache attribute");
|
242
|
+
}
|
243
|
+
value = _mongocrypt_cache_key_value_new (
|
244
|
+
key_returned->doc, &key_returned->decrypted_key_material);
|
245
|
+
ret = _mongocrypt_cache_add_stolen (
|
246
|
+
&kb->crypt->cache_key, attr, value, kb->status);
|
247
|
+
_mongocrypt_cache_key_attr_destroy (attr);
|
248
|
+
if (!ret) {
|
249
|
+
return _key_broker_fail (kb);
|
250
|
+
}
|
251
|
+
return true;
|
252
|
+
}
|
253
|
+
|
254
|
+
bool
|
255
|
+
_mongocrypt_key_broker_request_id (_mongocrypt_key_broker_t *kb,
|
256
|
+
const _mongocrypt_buffer_t *key_id)
|
257
|
+
{
|
258
|
+
key_request_t *req;
|
259
|
+
|
260
|
+
BSON_ASSERT_PARAM (kb);
|
261
|
+
BSON_ASSERT_PARAM (key_id);
|
262
|
+
|
263
|
+
if (kb->state != KB_REQUESTING) {
|
264
|
+
return _key_broker_fail_w_msg (
|
265
|
+
kb, "attempting to request a key id, but in wrong state");
|
266
|
+
}
|
267
|
+
|
268
|
+
if (!_mongocrypt_buffer_is_uuid ((_mongocrypt_buffer_t *) key_id)) {
|
269
|
+
return _key_broker_fail_w_msg (kb, "expected UUID for key id");
|
270
|
+
}
|
271
|
+
|
272
|
+
if (_key_request_find_one (kb, key_id, NULL)) {
|
273
|
+
return true;
|
274
|
+
}
|
275
|
+
|
276
|
+
req = bson_malloc0 (sizeof *req);
|
277
|
+
BSON_ASSERT (req);
|
278
|
+
|
279
|
+
_mongocrypt_buffer_copy_to (key_id, &req->id);
|
280
|
+
req->next = kb->key_requests;
|
281
|
+
kb->key_requests = req;
|
282
|
+
if (!_try_satisfying_from_cache (kb, req)) {
|
283
|
+
return false;
|
284
|
+
}
|
285
|
+
return true;
|
286
|
+
}
|
287
|
+
|
288
|
+
|
289
|
+
bool
|
290
|
+
_mongocrypt_key_broker_request_name (_mongocrypt_key_broker_t *kb,
|
291
|
+
const bson_value_t *key_alt_name_value)
|
292
|
+
{
|
293
|
+
key_request_t *req;
|
294
|
+
_mongocrypt_key_alt_name_t *key_alt_name;
|
295
|
+
|
296
|
+
BSON_ASSERT_PARAM (kb);
|
297
|
+
BSON_ASSERT_PARAM (key_alt_name_value);
|
298
|
+
|
299
|
+
if (kb->state != KB_REQUESTING) {
|
300
|
+
return _key_broker_fail_w_msg (
|
301
|
+
kb, "attempting to request a key name, but in wrong state");
|
302
|
+
}
|
303
|
+
|
304
|
+
key_alt_name = _mongocrypt_key_alt_name_new (key_alt_name_value);
|
305
|
+
|
306
|
+
/* Check if we already have a request for this key alt name. */
|
307
|
+
if (_key_request_find_one (kb, NULL /* key id */, key_alt_name)) {
|
308
|
+
_mongocrypt_key_alt_name_destroy_all (key_alt_name);
|
309
|
+
return true;
|
310
|
+
}
|
311
|
+
|
312
|
+
req = bson_malloc0 (sizeof *req);
|
313
|
+
BSON_ASSERT (req);
|
314
|
+
|
315
|
+
req->alt_name = key_alt_name /* takes ownership */;
|
316
|
+
req->next = kb->key_requests;
|
317
|
+
kb->key_requests = req;
|
318
|
+
if (!_try_satisfying_from_cache (kb, req)) {
|
319
|
+
return false;
|
320
|
+
}
|
321
|
+
return true;
|
322
|
+
}
|
323
|
+
|
324
|
+
bool
|
325
|
+
_mongocrypt_key_broker_request_any (_mongocrypt_key_broker_t *kb)
|
326
|
+
{
|
327
|
+
BSON_ASSERT_PARAM (kb);
|
328
|
+
|
329
|
+
if (kb->state != KB_REQUESTING) {
|
330
|
+
return _key_broker_fail_w_msg (
|
331
|
+
kb, "attempting to request any keys, but in wrong state");
|
332
|
+
}
|
333
|
+
|
334
|
+
if (kb->key_requests) {
|
335
|
+
return _key_broker_fail_w_msg (
|
336
|
+
kb, "attempting to request any keys, but requests already made");
|
337
|
+
}
|
338
|
+
|
339
|
+
kb->state = KB_ADDING_DOCS_ANY;
|
340
|
+
|
341
|
+
return true;
|
342
|
+
}
|
343
|
+
|
344
|
+
bool
|
345
|
+
_mongocrypt_key_broker_requests_done (_mongocrypt_key_broker_t *kb)
|
346
|
+
{
|
347
|
+
BSON_ASSERT_PARAM (kb);
|
348
|
+
|
349
|
+
if (kb->state != KB_REQUESTING) {
|
350
|
+
return _key_broker_fail_w_msg (
|
351
|
+
kb, "attempting to finish adding requests, but in wrong state");
|
352
|
+
}
|
353
|
+
|
354
|
+
if (kb->key_requests) {
|
355
|
+
if (_all_key_requests_satisfied (kb)) {
|
356
|
+
kb->state = KB_DONE;
|
357
|
+
} else {
|
358
|
+
kb->state = KB_ADDING_DOCS;
|
359
|
+
}
|
360
|
+
} else {
|
361
|
+
kb->state = KB_DONE;
|
362
|
+
}
|
363
|
+
return true;
|
364
|
+
}
|
365
|
+
|
366
|
+
bool
|
367
|
+
_mongocrypt_key_broker_filter (_mongocrypt_key_broker_t *kb,
|
368
|
+
mongocrypt_binary_t *out)
|
369
|
+
{
|
370
|
+
key_request_t *req;
|
371
|
+
_mongocrypt_key_alt_name_t *key_alt_name;
|
372
|
+
int name_index = 0;
|
373
|
+
int id_index = 0;
|
374
|
+
bson_t ids, names;
|
375
|
+
bson_t *filter;
|
376
|
+
|
377
|
+
BSON_ASSERT_PARAM (kb);
|
378
|
+
BSON_ASSERT_PARAM (out);
|
379
|
+
|
380
|
+
if (kb->state != KB_ADDING_DOCS) {
|
381
|
+
return _key_broker_fail_w_msg (
|
382
|
+
kb, "attempting to retrieve filter, but in wrong state");
|
383
|
+
}
|
384
|
+
|
385
|
+
if (!_mongocrypt_buffer_empty (&kb->filter)) {
|
386
|
+
_mongocrypt_buffer_to_binary (&kb->filter, out);
|
387
|
+
return true;
|
388
|
+
}
|
389
|
+
|
390
|
+
bson_init (&names);
|
391
|
+
bson_init (&ids);
|
392
|
+
|
393
|
+
for (req = kb->key_requests; NULL != req; req = req->next) {
|
394
|
+
if (req->satisfied) {
|
395
|
+
continue;
|
396
|
+
}
|
397
|
+
|
398
|
+
if (!_mongocrypt_buffer_empty (&req->id)) {
|
399
|
+
/* Collect key_ids in "ids" */
|
400
|
+
char *key_str;
|
401
|
+
|
402
|
+
key_str = bson_strdup_printf ("%d", id_index++);
|
403
|
+
if (!key_str ||
|
404
|
+
!_mongocrypt_buffer_append (&req->id, &ids, key_str, -1)) {
|
405
|
+
bson_destroy (&ids);
|
406
|
+
bson_destroy (&names);
|
407
|
+
bson_free (key_str);
|
408
|
+
return _key_broker_fail_w_msg (kb, "could not construct id list");
|
409
|
+
}
|
410
|
+
|
411
|
+
bson_free (key_str);
|
412
|
+
}
|
413
|
+
|
414
|
+
/* Collect key alt names in "names" */
|
415
|
+
for (key_alt_name = req->alt_name; NULL != key_alt_name;
|
416
|
+
key_alt_name = key_alt_name->next) {
|
417
|
+
char *key_str;
|
418
|
+
|
419
|
+
|
420
|
+
key_str = bson_strdup_printf ("%d", name_index++);
|
421
|
+
BSON_ASSERT (key_str);
|
422
|
+
if (!bson_append_value (&names,
|
423
|
+
key_str,
|
424
|
+
(int) strlen (key_str),
|
425
|
+
&key_alt_name->value)) {
|
426
|
+
bson_destroy (&ids);
|
427
|
+
bson_destroy (&names);
|
428
|
+
bson_free (key_str);
|
429
|
+
return _key_broker_fail_w_msg (
|
430
|
+
kb, "could not construct keyAltName list");
|
431
|
+
}
|
432
|
+
|
433
|
+
bson_free (key_str);
|
434
|
+
}
|
435
|
+
}
|
436
|
+
|
437
|
+
/*
|
438
|
+
* This is our final query:
|
439
|
+
* { $or: [ { _id: { $in : [ids] }},
|
440
|
+
* { keyAltName : { $in : [names] }} ] }
|
441
|
+
*/
|
442
|
+
filter = BCON_NEW ("$or",
|
443
|
+
"[",
|
444
|
+
"{",
|
445
|
+
"_id",
|
446
|
+
"{",
|
447
|
+
"$in",
|
448
|
+
BCON_ARRAY (&ids),
|
449
|
+
"}",
|
450
|
+
"}",
|
451
|
+
"{",
|
452
|
+
"keyAltNames",
|
453
|
+
"{",
|
454
|
+
"$in",
|
455
|
+
BCON_ARRAY (&names),
|
456
|
+
"}",
|
457
|
+
"}",
|
458
|
+
"]");
|
459
|
+
|
460
|
+
_mongocrypt_buffer_steal_from_bson (&kb->filter, filter);
|
461
|
+
_mongocrypt_buffer_to_binary (&kb->filter, out);
|
462
|
+
bson_destroy (&ids);
|
463
|
+
bson_destroy (&names);
|
464
|
+
|
465
|
+
return true;
|
466
|
+
}
|
467
|
+
|
468
|
+
bool
|
469
|
+
_mongocrypt_key_broker_add_doc (_mongocrypt_key_broker_t *kb,
|
470
|
+
_mongocrypt_opts_kms_providers_t *kms_providers,
|
471
|
+
const _mongocrypt_buffer_t *doc)
|
472
|
+
{
|
473
|
+
bool ret = false;
|
474
|
+
bson_t doc_bson;
|
475
|
+
_mongocrypt_key_doc_t *key_doc = NULL;
|
476
|
+
key_request_t *key_request;
|
477
|
+
key_returned_t *key_returned;
|
478
|
+
_mongocrypt_kms_provider_t kek_provider;
|
479
|
+
char *access_token = NULL;
|
480
|
+
|
481
|
+
BSON_ASSERT_PARAM (kb);
|
482
|
+
BSON_ASSERT_PARAM (kms_providers);
|
483
|
+
|
484
|
+
if (kb->state != KB_ADDING_DOCS && kb->state != KB_ADDING_DOCS_ANY) {
|
485
|
+
_key_broker_fail_w_msg (
|
486
|
+
kb, "attempting to add a key doc, but in wrong state");
|
487
|
+
goto done;
|
488
|
+
}
|
489
|
+
|
490
|
+
if (!doc) {
|
491
|
+
_key_broker_fail_w_msg (kb, "invalid key");
|
492
|
+
goto done;
|
493
|
+
}
|
494
|
+
|
495
|
+
/* First, parse the key document. */
|
496
|
+
key_doc = _mongocrypt_key_new ();
|
497
|
+
if (!_mongocrypt_buffer_to_bson (doc, &doc_bson)) {
|
498
|
+
_key_broker_fail_w_msg (kb, "malformed BSON for key document");
|
499
|
+
goto done;
|
500
|
+
}
|
501
|
+
|
502
|
+
if (!_mongocrypt_key_parse_owned (&doc_bson, key_doc, kb->status)) {
|
503
|
+
goto done;
|
504
|
+
}
|
505
|
+
|
506
|
+
if (!_key_request_find_one (kb, &key_doc->id, key_doc->key_alt_names)) {
|
507
|
+
/* If in normal mode, ensure that this document matches at least one
|
508
|
+
* existing request. */
|
509
|
+
if (kb->state == KB_ADDING_DOCS) {
|
510
|
+
_key_broker_fail_w_msg (
|
511
|
+
kb, "unexpected key returned, does not match any requests");
|
512
|
+
goto done;
|
513
|
+
}
|
514
|
+
|
515
|
+
/* If in any mode, add request for provided document now. */
|
516
|
+
if (kb->state == KB_ADDING_DOCS_ANY) {
|
517
|
+
key_request_t *const req = bson_malloc0 (sizeof (key_request_t));
|
518
|
+
|
519
|
+
BSON_ASSERT (req);
|
520
|
+
|
521
|
+
_mongocrypt_buffer_copy_to (&key_doc->id, &req->id);
|
522
|
+
req->alt_name =
|
523
|
+
_mongocrypt_key_alt_name_copy_all (key_doc->key_alt_names);
|
524
|
+
req->next = kb->key_requests;
|
525
|
+
kb->key_requests = req;
|
526
|
+
|
527
|
+
if (!_try_satisfying_from_cache (kb, req)) {
|
528
|
+
goto done;
|
529
|
+
}
|
530
|
+
|
531
|
+
/* Key is already cached; no work to be done. */
|
532
|
+
if (req->satisfied) {
|
533
|
+
ret = true;
|
534
|
+
goto done;
|
535
|
+
}
|
536
|
+
}
|
537
|
+
}
|
538
|
+
|
539
|
+
/* Check if there are other keys_returned with intersecting altnames or
|
540
|
+
* equal id. This is an error. Do *not* check cached keys. */
|
541
|
+
if (_key_returned_find_one (
|
542
|
+
kb->keys_returned, &key_doc->id, key_doc->key_alt_names)) {
|
543
|
+
_key_broker_fail_w_msg (
|
544
|
+
kb, "keys returned have duplicate keyAltNames or _id");
|
545
|
+
goto done;
|
546
|
+
}
|
547
|
+
|
548
|
+
key_returned = _key_returned_prepend (kb, &kb->keys_returned, key_doc);
|
549
|
+
|
550
|
+
/* Check that the returned key doc's provider matches. */
|
551
|
+
kek_provider = key_doc->kek.kms_provider;
|
552
|
+
if (0 == ((int) kek_provider & kms_providers->configured_providers)) {
|
553
|
+
_key_broker_fail_w_msg (
|
554
|
+
kb, "client not configured with KMS provider necessary to decrypt");
|
555
|
+
goto done;
|
556
|
+
}
|
557
|
+
|
558
|
+
/* If the KMS provider is local, decrypt immediately. Otherwise, create the
|
559
|
+
* HTTP KMS request. */
|
560
|
+
BSON_ASSERT (kb->crypt);
|
561
|
+
if (kek_provider == MONGOCRYPT_KMS_PROVIDER_LOCAL) {
|
562
|
+
if (!_mongocrypt_unwrap_key (kb->crypt->crypto,
|
563
|
+
&kms_providers->local.key,
|
564
|
+
&key_returned->doc->key_material,
|
565
|
+
&key_returned->decrypted_key_material,
|
566
|
+
kb->status)) {
|
567
|
+
_key_broker_fail (kb);
|
568
|
+
goto done;
|
569
|
+
}
|
570
|
+
key_returned->decrypted = true;
|
571
|
+
if (!_store_to_cache (kb, key_returned)) {
|
572
|
+
goto done;
|
573
|
+
}
|
574
|
+
} else if (kek_provider == MONGOCRYPT_KMS_PROVIDER_AWS) {
|
575
|
+
if (!_mongocrypt_kms_ctx_init_aws_decrypt (&key_returned->kms,
|
576
|
+
kms_providers,
|
577
|
+
key_doc,
|
578
|
+
&kb->crypt->log,
|
579
|
+
kb->crypt->crypto)) {
|
580
|
+
mongocrypt_kms_ctx_status (&key_returned->kms, kb->status);
|
581
|
+
_key_broker_fail (kb);
|
582
|
+
goto done;
|
583
|
+
}
|
584
|
+
} else if (kek_provider == MONGOCRYPT_KMS_PROVIDER_AZURE) {
|
585
|
+
if (kms_providers->azure.access_token) {
|
586
|
+
access_token = bson_strdup (kms_providers->azure.access_token);
|
587
|
+
} else {
|
588
|
+
access_token =
|
589
|
+
_mongocrypt_cache_oauth_get (kb->crypt->cache_oauth_azure);
|
590
|
+
}
|
591
|
+
if (!access_token) {
|
592
|
+
key_returned->needs_auth = true;
|
593
|
+
/* Create an oauth request if one does not exist. */
|
594
|
+
if (!kb->auth_request_azure.initialized) {
|
595
|
+
if (!_mongocrypt_kms_ctx_init_azure_auth (
|
596
|
+
&kb->auth_request_azure.kms,
|
597
|
+
&kb->crypt->log,
|
598
|
+
kms_providers,
|
599
|
+
/* The key vault endpoint is used to determine the scope. */
|
600
|
+
key_doc->kek.provider.azure.key_vault_endpoint)) {
|
601
|
+
mongocrypt_kms_ctx_status (&kb->auth_request_azure.kms,
|
602
|
+
kb->status);
|
603
|
+
_key_broker_fail (kb);
|
604
|
+
goto done;
|
605
|
+
}
|
606
|
+
kb->auth_request_azure.initialized = true;
|
607
|
+
}
|
608
|
+
} else {
|
609
|
+
if (!_mongocrypt_kms_ctx_init_azure_unwrapkey (&key_returned->kms,
|
610
|
+
kms_providers,
|
611
|
+
access_token,
|
612
|
+
key_doc,
|
613
|
+
&kb->crypt->log)) {
|
614
|
+
mongocrypt_kms_ctx_status (&key_returned->kms, kb->status);
|
615
|
+
_key_broker_fail (kb);
|
616
|
+
goto done;
|
617
|
+
}
|
618
|
+
}
|
619
|
+
} else if (kek_provider == MONGOCRYPT_KMS_PROVIDER_GCP) {
|
620
|
+
if (NULL != kms_providers->gcp.access_token) {
|
621
|
+
access_token = bson_strdup (kms_providers->gcp.access_token);
|
622
|
+
} else {
|
623
|
+
access_token =
|
624
|
+
_mongocrypt_cache_oauth_get (kb->crypt->cache_oauth_gcp);
|
625
|
+
}
|
626
|
+
if (!access_token) {
|
627
|
+
key_returned->needs_auth = true;
|
628
|
+
/* Create an oauth request if one does not exist. */
|
629
|
+
if (!kb->auth_request_gcp.initialized) {
|
630
|
+
if (!_mongocrypt_kms_ctx_init_gcp_auth (
|
631
|
+
&kb->auth_request_gcp.kms,
|
632
|
+
&kb->crypt->log,
|
633
|
+
&kb->crypt->opts,
|
634
|
+
kms_providers,
|
635
|
+
key_doc->kek.provider.gcp.endpoint)) {
|
636
|
+
mongocrypt_kms_ctx_status (&kb->auth_request_gcp.kms,
|
637
|
+
kb->status);
|
638
|
+
_key_broker_fail (kb);
|
639
|
+
goto done;
|
640
|
+
}
|
641
|
+
kb->auth_request_gcp.initialized = true;
|
642
|
+
}
|
643
|
+
} else {
|
644
|
+
if (!_mongocrypt_kms_ctx_init_gcp_decrypt (&key_returned->kms,
|
645
|
+
kms_providers,
|
646
|
+
access_token,
|
647
|
+
key_doc,
|
648
|
+
&kb->crypt->log)) {
|
649
|
+
mongocrypt_kms_ctx_status (&key_returned->kms, kb->status);
|
650
|
+
_key_broker_fail (kb);
|
651
|
+
goto done;
|
652
|
+
}
|
653
|
+
}
|
654
|
+
} else if (kek_provider == MONGOCRYPT_KMS_PROVIDER_KMIP) {
|
655
|
+
char *unique_identifier;
|
656
|
+
_mongocrypt_endpoint_t *endpoint;
|
657
|
+
|
658
|
+
if (!key_returned->doc->kek.provider.kmip.key_id) {
|
659
|
+
_key_broker_fail_w_msg (kb, "KMIP key malformed, no keyId present");
|
660
|
+
goto done;
|
661
|
+
}
|
662
|
+
|
663
|
+
unique_identifier = key_returned->doc->kek.provider.kmip.key_id;
|
664
|
+
|
665
|
+
if (key_returned->doc->kek.provider.kmip.endpoint) {
|
666
|
+
endpoint = key_returned->doc->kek.provider.kmip.endpoint;
|
667
|
+
} else if (kms_providers->kmip.endpoint) {
|
668
|
+
endpoint = kms_providers->kmip.endpoint;
|
669
|
+
} else {
|
670
|
+
_key_broker_fail_w_msg (kb, "endpoint not set for KMIP request");
|
671
|
+
goto done;
|
672
|
+
}
|
673
|
+
|
674
|
+
if (!_mongocrypt_kms_ctx_init_kmip_get (&key_returned->kms,
|
675
|
+
endpoint,
|
676
|
+
unique_identifier,
|
677
|
+
&kb->crypt->log)) {
|
678
|
+
mongocrypt_kms_ctx_status (&key_returned->kms, kb->status);
|
679
|
+
_key_broker_fail (kb);
|
680
|
+
goto done;
|
681
|
+
}
|
682
|
+
} else {
|
683
|
+
_key_broker_fail_w_msg (kb, "unrecognized kms provider");
|
684
|
+
goto done;
|
685
|
+
}
|
686
|
+
|
687
|
+
/* Mark all matching key requests as satisfied. */
|
688
|
+
for (key_request = kb->key_requests; NULL != key_request;
|
689
|
+
key_request = key_request->next) {
|
690
|
+
if (0 == _mongocrypt_buffer_cmp (&key_doc->id, &key_request->id)) {
|
691
|
+
key_request->satisfied = true;
|
692
|
+
}
|
693
|
+
if (_mongocrypt_key_alt_name_intersects (key_doc->key_alt_names,
|
694
|
+
key_request->alt_name)) {
|
695
|
+
key_request->satisfied = true;
|
696
|
+
}
|
697
|
+
}
|
698
|
+
|
699
|
+
ret = true;
|
700
|
+
done:
|
701
|
+
bson_free (access_token);
|
702
|
+
_mongocrypt_key_destroy (key_doc);
|
703
|
+
return ret;
|
704
|
+
}
|
705
|
+
|
706
|
+
bool
|
707
|
+
_mongocrypt_key_broker_docs_done (_mongocrypt_key_broker_t *kb)
|
708
|
+
{
|
709
|
+
key_returned_t *key_returned;
|
710
|
+
bool needs_decryption;
|
711
|
+
bool needs_auth;
|
712
|
+
|
713
|
+
BSON_ASSERT_PARAM (kb);
|
714
|
+
|
715
|
+
if (kb->state != KB_ADDING_DOCS && kb->state != KB_ADDING_DOCS_ANY) {
|
716
|
+
return _key_broker_fail_w_msg (
|
717
|
+
kb, "attempting to finish adding docs, but in wrong state");
|
718
|
+
}
|
719
|
+
|
720
|
+
/* If there are any requests left unsatisfied, error. */
|
721
|
+
if (!_all_key_requests_satisfied (kb)) {
|
722
|
+
return _key_broker_fail_w_msg (kb,
|
723
|
+
"not all keys requested were satisfied");
|
724
|
+
}
|
725
|
+
|
726
|
+
/* Transition to the next state.
|
727
|
+
* - If there are any Azure or GCP backed keys, and no oauth token is
|
728
|
+
* cached, transition to KB_AUTHENTICATING.
|
729
|
+
* - Otherwise, if there are keys that need to be decrypted, transition to
|
730
|
+
* KB_DECRYPTING_KEY_MATERIAL.
|
731
|
+
* - Otherwise, all keys were retrieved from the cache or decrypted locally,
|
732
|
+
* skip the decrypting state and go right to KB_DONE.
|
733
|
+
*/
|
734
|
+
needs_decryption = false;
|
735
|
+
needs_auth = false;
|
736
|
+
for (key_returned = kb->keys_returned; NULL != key_returned;
|
737
|
+
key_returned = key_returned->next) {
|
738
|
+
if (key_returned->needs_auth) {
|
739
|
+
needs_auth = true;
|
740
|
+
break;
|
741
|
+
}
|
742
|
+
if (!key_returned->decrypted) {
|
743
|
+
needs_decryption = true;
|
744
|
+
}
|
745
|
+
}
|
746
|
+
|
747
|
+
if (needs_auth) {
|
748
|
+
kb->state = KB_AUTHENTICATING;
|
749
|
+
} else if (needs_decryption) {
|
750
|
+
kb->state = KB_DECRYPTING_KEY_MATERIAL;
|
751
|
+
} else {
|
752
|
+
kb->state = KB_DONE;
|
753
|
+
}
|
754
|
+
return true;
|
755
|
+
}
|
756
|
+
|
757
|
+
mongocrypt_kms_ctx_t *
|
758
|
+
_mongocrypt_key_broker_next_kms (_mongocrypt_key_broker_t *kb)
|
759
|
+
{
|
760
|
+
BSON_ASSERT_PARAM (kb);
|
761
|
+
|
762
|
+
if (kb->state != KB_DECRYPTING_KEY_MATERIAL &&
|
763
|
+
kb->state != KB_AUTHENTICATING) {
|
764
|
+
_key_broker_fail_w_msg (
|
765
|
+
kb, "attempting to get KMS request, but in wrong state");
|
766
|
+
/* TODO (CDRIVER-3327) this breaks other expectations. If the caller only
|
767
|
+
* checks the return value they may mistake this NULL as indicating all
|
768
|
+
* KMS requests have been iterated. */
|
769
|
+
return NULL;
|
770
|
+
}
|
771
|
+
|
772
|
+
if (kb->state == KB_AUTHENTICATING) {
|
773
|
+
if (!kb->auth_request_azure.initialized &&
|
774
|
+
!kb->auth_request_gcp.initialized) {
|
775
|
+
_key_broker_fail_w_msg (kb,
|
776
|
+
"unexpected, attempting to authenticate but "
|
777
|
+
"KMS request not initialized");
|
778
|
+
return NULL;
|
779
|
+
}
|
780
|
+
if (kb->auth_request_azure.initialized &&
|
781
|
+
!kb->auth_request_azure.returned) {
|
782
|
+
kb->auth_request_azure.returned = true;
|
783
|
+
return &kb->auth_request_azure.kms;
|
784
|
+
}
|
785
|
+
|
786
|
+
if (kb->auth_request_gcp.initialized && !kb->auth_request_gcp.returned) {
|
787
|
+
kb->auth_request_gcp.returned = true;
|
788
|
+
return &kb->auth_request_gcp.kms;
|
789
|
+
}
|
790
|
+
|
791
|
+
return NULL;
|
792
|
+
}
|
793
|
+
|
794
|
+
while (kb->decryptor_iter) {
|
795
|
+
if (!kb->decryptor_iter->decrypted) {
|
796
|
+
key_returned_t *key_returned;
|
797
|
+
|
798
|
+
key_returned = kb->decryptor_iter;
|
799
|
+
/* iterate before returning, so next call starts at next entry */
|
800
|
+
kb->decryptor_iter = kb->decryptor_iter->next;
|
801
|
+
return &key_returned->kms;
|
802
|
+
}
|
803
|
+
kb->decryptor_iter = kb->decryptor_iter->next;
|
804
|
+
}
|
805
|
+
|
806
|
+
return NULL;
|
807
|
+
}
|
808
|
+
|
809
|
+
bool
|
810
|
+
_mongocrypt_key_broker_kms_done (
|
811
|
+
_mongocrypt_key_broker_t *kb,
|
812
|
+
_mongocrypt_opts_kms_providers_t *kms_providers)
|
813
|
+
{
|
814
|
+
key_returned_t *key_returned;
|
815
|
+
|
816
|
+
BSON_ASSERT_PARAM (kb);
|
817
|
+
BSON_ASSERT_PARAM (kms_providers);
|
818
|
+
|
819
|
+
if (kb->state != KB_DECRYPTING_KEY_MATERIAL &&
|
820
|
+
kb->state != KB_AUTHENTICATING) {
|
821
|
+
return _key_broker_fail_w_msg (
|
822
|
+
kb, "attempting to complete KMS requests, but in wrong state");
|
823
|
+
}
|
824
|
+
|
825
|
+
if (kb->state == KB_AUTHENTICATING) {
|
826
|
+
bson_t oauth_response;
|
827
|
+
_mongocrypt_buffer_t oauth_response_buf;
|
828
|
+
|
829
|
+
if (kb->auth_request_azure.initialized) {
|
830
|
+
if (!_mongocrypt_kms_ctx_result (&kb->auth_request_azure.kms,
|
831
|
+
&oauth_response_buf)) {
|
832
|
+
mongocrypt_kms_ctx_status (&kb->auth_request_azure.kms, kb->status);
|
833
|
+
return _key_broker_fail (kb);
|
834
|
+
}
|
835
|
+
|
836
|
+
/* Cache returned tokens. */
|
837
|
+
BSON_ASSERT (
|
838
|
+
_mongocrypt_buffer_to_bson (&oauth_response_buf, &oauth_response));
|
839
|
+
if (!_mongocrypt_cache_oauth_add (
|
840
|
+
kb->crypt->cache_oauth_azure, &oauth_response, kb->status)) {
|
841
|
+
return false;
|
842
|
+
}
|
843
|
+
}
|
844
|
+
|
845
|
+
if (kb->auth_request_gcp.initialized) {
|
846
|
+
if (!_mongocrypt_kms_ctx_result (&kb->auth_request_gcp.kms,
|
847
|
+
&oauth_response_buf)) {
|
848
|
+
mongocrypt_kms_ctx_status (&kb->auth_request_gcp.kms, kb->status);
|
849
|
+
return _key_broker_fail (kb);
|
850
|
+
}
|
851
|
+
|
852
|
+
/* Cache returned tokens. */
|
853
|
+
BSON_ASSERT (
|
854
|
+
_mongocrypt_buffer_to_bson (&oauth_response_buf, &oauth_response));
|
855
|
+
if (!_mongocrypt_cache_oauth_add (
|
856
|
+
kb->crypt->cache_oauth_gcp, &oauth_response, kb->status)) {
|
857
|
+
return false;
|
858
|
+
}
|
859
|
+
}
|
860
|
+
|
861
|
+
/* Auth should be finished, create any remaining KMS requests. */
|
862
|
+
for (key_returned = kb->keys_returned; NULL != key_returned;
|
863
|
+
key_returned = key_returned->next) {
|
864
|
+
char *access_token;
|
865
|
+
|
866
|
+
if (!key_returned->needs_auth) {
|
867
|
+
continue;
|
868
|
+
}
|
869
|
+
|
870
|
+
if (key_returned->doc->kek.kms_provider ==
|
871
|
+
MONGOCRYPT_KMS_PROVIDER_AZURE) {
|
872
|
+
if (kms_providers->azure.access_token) {
|
873
|
+
access_token = bson_strdup (kms_providers->azure.access_token);
|
874
|
+
} else {
|
875
|
+
access_token =
|
876
|
+
_mongocrypt_cache_oauth_get (kb->crypt->cache_oauth_azure);
|
877
|
+
}
|
878
|
+
|
879
|
+
if (!access_token) {
|
880
|
+
return _key_broker_fail_w_msg (
|
881
|
+
kb, "authentication failed, no oauth token");
|
882
|
+
}
|
883
|
+
|
884
|
+
if (!_mongocrypt_kms_ctx_init_azure_unwrapkey (&key_returned->kms,
|
885
|
+
kms_providers,
|
886
|
+
access_token,
|
887
|
+
key_returned->doc,
|
888
|
+
&kb->crypt->log)) {
|
889
|
+
mongocrypt_kms_ctx_status (&key_returned->kms, kb->status);
|
890
|
+
bson_free (access_token);
|
891
|
+
return _key_broker_fail (kb);
|
892
|
+
}
|
893
|
+
|
894
|
+
key_returned->needs_auth = false;
|
895
|
+
bson_free (access_token);
|
896
|
+
} else if (key_returned->doc->kek.kms_provider ==
|
897
|
+
MONGOCRYPT_KMS_PROVIDER_GCP) {
|
898
|
+
if (NULL != kms_providers->gcp.access_token) {
|
899
|
+
access_token = bson_strdup (kms_providers->gcp.access_token);
|
900
|
+
} else {
|
901
|
+
access_token =
|
902
|
+
_mongocrypt_cache_oauth_get (kb->crypt->cache_oauth_gcp);
|
903
|
+
}
|
904
|
+
|
905
|
+
if (!access_token) {
|
906
|
+
return _key_broker_fail_w_msg (
|
907
|
+
kb, "authentication failed, no oauth token");
|
908
|
+
}
|
909
|
+
|
910
|
+
if (!_mongocrypt_kms_ctx_init_gcp_decrypt (&key_returned->kms,
|
911
|
+
kms_providers,
|
912
|
+
access_token,
|
913
|
+
key_returned->doc,
|
914
|
+
&kb->crypt->log)) {
|
915
|
+
mongocrypt_kms_ctx_status (&key_returned->kms, kb->status);
|
916
|
+
bson_free (access_token);
|
917
|
+
return _key_broker_fail (kb);
|
918
|
+
}
|
919
|
+
|
920
|
+
key_returned->needs_auth = false;
|
921
|
+
bson_free (access_token);
|
922
|
+
} else {
|
923
|
+
return _key_broker_fail_w_msg (kb,
|
924
|
+
"unexpected, authenticating but "
|
925
|
+
"no requests require "
|
926
|
+
"authentication");
|
927
|
+
}
|
928
|
+
}
|
929
|
+
|
930
|
+
kb->state = KB_DECRYPTING_KEY_MATERIAL;
|
931
|
+
return true;
|
932
|
+
}
|
933
|
+
|
934
|
+
for (key_returned = kb->keys_returned; NULL != key_returned;
|
935
|
+
key_returned = key_returned->next) {
|
936
|
+
/* Local keys were already decrypted. */
|
937
|
+
if (key_returned->doc->kek.kms_provider == MONGOCRYPT_KMS_PROVIDER_AWS ||
|
938
|
+
key_returned->doc->kek.kms_provider ==
|
939
|
+
MONGOCRYPT_KMS_PROVIDER_AZURE ||
|
940
|
+
key_returned->doc->kek.kms_provider == MONGOCRYPT_KMS_PROVIDER_GCP) {
|
941
|
+
if (key_returned->decrypted) {
|
942
|
+
/* Non-local keys may have been decrypted previously if the key
|
943
|
+
* broker has been restarted. */
|
944
|
+
continue;
|
945
|
+
}
|
946
|
+
|
947
|
+
if (!key_returned->kms.req) {
|
948
|
+
return _key_broker_fail_w_msg (
|
949
|
+
kb, "unexpected, KMS not set on key returned");
|
950
|
+
}
|
951
|
+
|
952
|
+
if (!_mongocrypt_kms_ctx_result (
|
953
|
+
&key_returned->kms, &key_returned->decrypted_key_material)) {
|
954
|
+
/* Always fatal. Key attempted to decrypt but failed. */
|
955
|
+
mongocrypt_kms_ctx_status (&key_returned->kms, kb->status);
|
956
|
+
return _key_broker_fail (kb);
|
957
|
+
}
|
958
|
+
} else if (key_returned->doc->kek.kms_provider ==
|
959
|
+
MONGOCRYPT_KMS_PROVIDER_KMIP) {
|
960
|
+
_mongocrypt_buffer_t kek;
|
961
|
+
if (!_mongocrypt_kms_ctx_result (&key_returned->kms, &kek)) {
|
962
|
+
mongocrypt_kms_ctx_status (&key_returned->kms, kb->status);
|
963
|
+
return _key_broker_fail (kb);
|
964
|
+
}
|
965
|
+
|
966
|
+
if (!_mongocrypt_unwrap_key (kb->crypt->crypto,
|
967
|
+
&kek,
|
968
|
+
&key_returned->doc->key_material,
|
969
|
+
&key_returned->decrypted_key_material,
|
970
|
+
kb->status)) {
|
971
|
+
_key_broker_fail (kb);
|
972
|
+
_mongocrypt_buffer_cleanup (&kek);
|
973
|
+
return false;
|
974
|
+
}
|
975
|
+
_mongocrypt_buffer_cleanup (&kek);
|
976
|
+
} else if (key_returned->doc->kek.kms_provider !=
|
977
|
+
MONGOCRYPT_KMS_PROVIDER_LOCAL) {
|
978
|
+
return _key_broker_fail_w_msg (kb, "unrecognized kms provider");
|
979
|
+
}
|
980
|
+
|
981
|
+
if (key_returned->decrypted_key_material.len != MONGOCRYPT_KEY_LEN) {
|
982
|
+
return _key_broker_fail_w_msg (kb,
|
983
|
+
"decrypted key is incorrect length");
|
984
|
+
}
|
985
|
+
|
986
|
+
key_returned->decrypted = true;
|
987
|
+
if (!_store_to_cache (kb, key_returned)) {
|
988
|
+
return false;
|
989
|
+
}
|
990
|
+
}
|
991
|
+
|
992
|
+
kb->state = KB_DONE;
|
993
|
+
return true;
|
994
|
+
}
|
995
|
+
|
996
|
+
|
997
|
+
static bool
|
998
|
+
_get_decrypted_key_material (_mongocrypt_key_broker_t *kb,
|
999
|
+
_mongocrypt_buffer_t *key_id,
|
1000
|
+
_mongocrypt_key_alt_name_t *key_alt_name,
|
1001
|
+
_mongocrypt_buffer_t *out,
|
1002
|
+
_mongocrypt_buffer_t *key_id_out)
|
1003
|
+
{
|
1004
|
+
key_returned_t *key_returned;
|
1005
|
+
|
1006
|
+
BSON_ASSERT_PARAM (kb);
|
1007
|
+
/* key_id can be NULL */
|
1008
|
+
/* key_alt_name can be NULL */
|
1009
|
+
BSON_ASSERT_PARAM (out);
|
1010
|
+
/* key_id_out is checked before each use, so it can be NULL */
|
1011
|
+
|
1012
|
+
_mongocrypt_buffer_init (out);
|
1013
|
+
if (key_id_out) {
|
1014
|
+
_mongocrypt_buffer_init (key_id_out);
|
1015
|
+
}
|
1016
|
+
/* Search both keys_returned and keys_cached. */
|
1017
|
+
|
1018
|
+
key_returned =
|
1019
|
+
_key_returned_find_one (kb->keys_returned, key_id, key_alt_name);
|
1020
|
+
if (!key_returned) {
|
1021
|
+
/* Try the keys retrieved from the cache. */
|
1022
|
+
key_returned =
|
1023
|
+
_key_returned_find_one (kb->keys_cached, key_id, key_alt_name);
|
1024
|
+
}
|
1025
|
+
|
1026
|
+
if (!key_returned) {
|
1027
|
+
return _key_broker_fail_w_msg (kb, "could not find key");
|
1028
|
+
}
|
1029
|
+
|
1030
|
+
if (!key_returned->decrypted) {
|
1031
|
+
return _key_broker_fail_w_msg (kb, "unexpected, key not decrypted");
|
1032
|
+
}
|
1033
|
+
|
1034
|
+
_mongocrypt_buffer_copy_to (&key_returned->decrypted_key_material, out);
|
1035
|
+
if (key_id_out) {
|
1036
|
+
_mongocrypt_buffer_copy_to (&key_returned->doc->id, key_id_out);
|
1037
|
+
}
|
1038
|
+
return true;
|
1039
|
+
}
|
1040
|
+
|
1041
|
+
bool
|
1042
|
+
_mongocrypt_key_broker_decrypted_key_by_id (_mongocrypt_key_broker_t *kb,
|
1043
|
+
const _mongocrypt_buffer_t *key_id,
|
1044
|
+
_mongocrypt_buffer_t *out)
|
1045
|
+
{
|
1046
|
+
BSON_ASSERT_PARAM (kb);
|
1047
|
+
BSON_ASSERT_PARAM (key_id);
|
1048
|
+
BSON_ASSERT_PARAM (out);
|
1049
|
+
|
1050
|
+
if (kb->state != KB_DONE && kb->state != KB_REQUESTING) {
|
1051
|
+
return _key_broker_fail_w_msg (
|
1052
|
+
kb, "attempting retrieve decrypted key material, but in wrong state");
|
1053
|
+
}
|
1054
|
+
return _get_decrypted_key_material (kb,
|
1055
|
+
(_mongocrypt_buffer_t *) key_id,
|
1056
|
+
NULL /* key alt name */,
|
1057
|
+
out,
|
1058
|
+
NULL /* key id out */);
|
1059
|
+
}
|
1060
|
+
|
1061
|
+
bool
|
1062
|
+
_mongocrypt_key_broker_decrypted_key_by_name (
|
1063
|
+
_mongocrypt_key_broker_t *kb,
|
1064
|
+
const bson_value_t *key_alt_name_value,
|
1065
|
+
_mongocrypt_buffer_t *out,
|
1066
|
+
_mongocrypt_buffer_t *key_id_out)
|
1067
|
+
{
|
1068
|
+
bool ret;
|
1069
|
+
_mongocrypt_key_alt_name_t *key_alt_name;
|
1070
|
+
|
1071
|
+
BSON_ASSERT_PARAM (kb);
|
1072
|
+
BSON_ASSERT_PARAM (key_alt_name_value);
|
1073
|
+
BSON_ASSERT_PARAM (out);
|
1074
|
+
BSON_ASSERT_PARAM (key_id_out);
|
1075
|
+
|
1076
|
+
if (kb->state != KB_DONE) {
|
1077
|
+
return _key_broker_fail_w_msg (
|
1078
|
+
kb, "attempting retrieve decrypted key material, but in wrong state");
|
1079
|
+
}
|
1080
|
+
|
1081
|
+
key_alt_name = _mongocrypt_key_alt_name_new (key_alt_name_value);
|
1082
|
+
ret = _get_decrypted_key_material (kb, NULL, key_alt_name, out, key_id_out);
|
1083
|
+
_mongocrypt_key_alt_name_destroy_all (key_alt_name);
|
1084
|
+
return ret;
|
1085
|
+
}
|
1086
|
+
|
1087
|
+
bool
|
1088
|
+
_mongocrypt_key_broker_status (_mongocrypt_key_broker_t *kb,
|
1089
|
+
mongocrypt_status_t *out)
|
1090
|
+
{
|
1091
|
+
BSON_ASSERT_PARAM (kb);
|
1092
|
+
BSON_ASSERT_PARAM (out);
|
1093
|
+
|
1094
|
+
if (!mongocrypt_status_ok (kb->status)) {
|
1095
|
+
_mongocrypt_status_copy_to (kb->status, out);
|
1096
|
+
return false;
|
1097
|
+
}
|
1098
|
+
|
1099
|
+
return true;
|
1100
|
+
}
|
1101
|
+
|
1102
|
+
|
1103
|
+
static void
|
1104
|
+
_destroy_key_requests (key_request_t *head)
|
1105
|
+
{
|
1106
|
+
key_request_t *tmp;
|
1107
|
+
|
1108
|
+
while (head) {
|
1109
|
+
tmp = head->next;
|
1110
|
+
|
1111
|
+
_mongocrypt_buffer_cleanup (&head->id);
|
1112
|
+
_mongocrypt_key_alt_name_destroy_all (head->alt_name);
|
1113
|
+
|
1114
|
+
bson_free (head);
|
1115
|
+
head = tmp;
|
1116
|
+
}
|
1117
|
+
}
|
1118
|
+
|
1119
|
+
static void
|
1120
|
+
_destroy_keys_returned (key_returned_t *head)
|
1121
|
+
{
|
1122
|
+
key_returned_t *tmp;
|
1123
|
+
|
1124
|
+
while (head) {
|
1125
|
+
tmp = head->next;
|
1126
|
+
|
1127
|
+
_mongocrypt_key_destroy (head->doc);
|
1128
|
+
_mongocrypt_buffer_cleanup (&head->decrypted_key_material);
|
1129
|
+
_mongocrypt_kms_ctx_cleanup (&head->kms);
|
1130
|
+
|
1131
|
+
bson_free (head);
|
1132
|
+
head = tmp;
|
1133
|
+
}
|
1134
|
+
}
|
1135
|
+
|
1136
|
+
void
|
1137
|
+
_mongocrypt_key_broker_cleanup (_mongocrypt_key_broker_t *kb)
|
1138
|
+
{
|
1139
|
+
if (!kb) {
|
1140
|
+
return;
|
1141
|
+
}
|
1142
|
+
mongocrypt_status_destroy (kb->status);
|
1143
|
+
_mongocrypt_buffer_cleanup (&kb->filter);
|
1144
|
+
/* Delete all linked lists */
|
1145
|
+
_destroy_keys_returned (kb->keys_returned);
|
1146
|
+
_destroy_keys_returned (kb->keys_cached);
|
1147
|
+
_destroy_key_requests (kb->key_requests);
|
1148
|
+
_mongocrypt_kms_ctx_cleanup (&kb->auth_request_azure.kms);
|
1149
|
+
_mongocrypt_kms_ctx_cleanup (&kb->auth_request_gcp.kms);
|
1150
|
+
}
|
1151
|
+
|
1152
|
+
void
|
1153
|
+
_mongocrypt_key_broker_add_test_key (_mongocrypt_key_broker_t *kb,
|
1154
|
+
const _mongocrypt_buffer_t *key_id)
|
1155
|
+
{
|
1156
|
+
key_returned_t *key_returned;
|
1157
|
+
_mongocrypt_key_doc_t *key_doc;
|
1158
|
+
|
1159
|
+
BSON_ASSERT_PARAM (kb);
|
1160
|
+
BSON_ASSERT_PARAM (key_id);
|
1161
|
+
|
1162
|
+
key_doc = _mongocrypt_key_new ();
|
1163
|
+
_mongocrypt_buffer_copy_to (key_id, &key_doc->id);
|
1164
|
+
|
1165
|
+
key_returned = _key_returned_prepend (kb, &kb->keys_returned, key_doc);
|
1166
|
+
key_returned->decrypted = true;
|
1167
|
+
_mongocrypt_buffer_init (&key_returned->decrypted_key_material);
|
1168
|
+
_mongocrypt_buffer_resize (&key_returned->decrypted_key_material,
|
1169
|
+
MONGOCRYPT_KEY_LEN);
|
1170
|
+
memset (key_returned->decrypted_key_material.data, 0, MONGOCRYPT_KEY_LEN);
|
1171
|
+
_mongocrypt_key_destroy (key_doc);
|
1172
|
+
/* Hijack state and move directly to DONE. */
|
1173
|
+
kb->state = KB_DONE;
|
1174
|
+
}
|
1175
|
+
|
1176
|
+
|
1177
|
+
bool
|
1178
|
+
_mongocrypt_key_broker_restart (_mongocrypt_key_broker_t *kb)
|
1179
|
+
{
|
1180
|
+
BSON_ASSERT_PARAM (kb);
|
1181
|
+
if (kb->state != KB_DONE) {
|
1182
|
+
return _key_broker_fail_w_msg (
|
1183
|
+
kb, "_mongocrypt_key_broker_restart called in wrong state");
|
1184
|
+
}
|
1185
|
+
kb->state = KB_REQUESTING;
|
1186
|
+
_mongocrypt_buffer_cleanup (&kb->filter);
|
1187
|
+
_mongocrypt_buffer_init (&kb->filter);
|
1188
|
+
return true;
|
1189
|
+
}
|