libmongocrypt-helper 1.7.0.0.1001 → 1.7.4.0.1000
Sign up to get free protection for your applications and to get access to all the features.
- 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 +13 -1
- data.tar.gz.sig +0 -0
- metadata +988 -6
- metadata.gz.sig +0 -0
- data/so/libmongocrypt.so +0 -0
@@ -0,0 +1,1561 @@
|
|
1
|
+
# Copyright 2019-present MongoDB, Inc.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
import os
|
16
|
+
import os.path
|
17
|
+
import sys
|
18
|
+
|
19
|
+
import cffi
|
20
|
+
|
21
|
+
from pymongocrypt.compat import PY3
|
22
|
+
from pymongocrypt.version import _MIN_LIBMONGOCRYPT_VERSION
|
23
|
+
|
24
|
+
try:
|
25
|
+
from pkg_resources import parse_version as _parse_version
|
26
|
+
except ImportError:
|
27
|
+
from distutils.version import LooseVersion as _LooseVersion
|
28
|
+
|
29
|
+
def _parse_version(version):
|
30
|
+
return _LooseVersion(version)
|
31
|
+
|
32
|
+
|
33
|
+
ffi = cffi.FFI()
|
34
|
+
|
35
|
+
# Generated with strip_header.py
|
36
|
+
ffi.cdef("""/*
|
37
|
+
* Copyright 2019-present MongoDB, Inc.
|
38
|
+
*
|
39
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
40
|
+
* you may not use this file except in compliance with the License.
|
41
|
+
* You may obtain a copy of the License at
|
42
|
+
*
|
43
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
44
|
+
*
|
45
|
+
* Unless required by applicable law or agreed to in writing, software
|
46
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
47
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
48
|
+
* See the License for the specific language governing permissions and
|
49
|
+
* limitations under the License.
|
50
|
+
*/
|
51
|
+
|
52
|
+
/** @file mongocrypt.h The top-level handle to libmongocrypt. */
|
53
|
+
|
54
|
+
/**
|
55
|
+
* @mainpage libmongocrypt
|
56
|
+
* See all public API documentation in: @ref mongocrypt.h
|
57
|
+
*/
|
58
|
+
|
59
|
+
/* clang-format off */
|
60
|
+
/* clang-format on */
|
61
|
+
|
62
|
+
/**
|
63
|
+
* Returns the version string for libmongocrypt.
|
64
|
+
*
|
65
|
+
* @param[out] len An optional length of the returned string. May be NULL.
|
66
|
+
* @returns a NULL terminated version string for libmongocrypt.
|
67
|
+
*/
|
68
|
+
const char *
|
69
|
+
mongocrypt_version (uint32_t *len);
|
70
|
+
|
71
|
+
/**
|
72
|
+
* A non-owning view of a byte buffer.
|
73
|
+
*
|
74
|
+
* When constructing a mongocrypt_binary_t it is the responsibility of the
|
75
|
+
* caller to maintain the lifetime of the viewed data. However, all public
|
76
|
+
* functions that take a mongocrypt_binary_t as an argument will make a copy of
|
77
|
+
* the viewed data. For example, the following is valid:
|
78
|
+
*
|
79
|
+
* @code{.c}
|
80
|
+
* mongocrypt_binary_t bin = mongocrypt_binary_new_from_data(mydata, mylen);
|
81
|
+
* assert (mongocrypt_setopt_kms_provider_local (crypt), bin);
|
82
|
+
* // The viewed data of bin has been copied. Ok to free the view and the data.
|
83
|
+
* mongocrypt_binary_destroy (bin);
|
84
|
+
* my_free_fn (mydata);
|
85
|
+
* @endcode
|
86
|
+
*
|
87
|
+
* Functions with a mongocrypt_binary_t* out guarantee the lifetime of the
|
88
|
+
* viewed data to live as long as the parent object. For example, @ref
|
89
|
+
* mongocrypt_ctx_mongo_op guarantees that the viewed data of
|
90
|
+
* mongocrypt_binary_t is valid until the parent ctx is destroyed with @ref
|
91
|
+
* mongocrypt_ctx_destroy.
|
92
|
+
*/
|
93
|
+
typedef struct _mongocrypt_binary_t mongocrypt_binary_t;
|
94
|
+
|
95
|
+
/**
|
96
|
+
* Create a new non-owning view of a buffer (data + length).
|
97
|
+
*
|
98
|
+
* Use this to create a mongocrypt_binary_t used for output parameters.
|
99
|
+
*
|
100
|
+
* @returns A new mongocrypt_binary_t.
|
101
|
+
*/
|
102
|
+
mongocrypt_binary_t *
|
103
|
+
mongocrypt_binary_new (void);
|
104
|
+
|
105
|
+
/**
|
106
|
+
* Create a new non-owning view of a buffer (data + length).
|
107
|
+
*
|
108
|
+
* @param[in] data A pointer to an array of bytes. This data is not copied. @p
|
109
|
+
* data must outlive the binary object.
|
110
|
+
* @param[in] len The length of the @p data byte array.
|
111
|
+
*
|
112
|
+
* @returns A new @ref mongocrypt_binary_t.
|
113
|
+
*/
|
114
|
+
mongocrypt_binary_t *
|
115
|
+
mongocrypt_binary_new_from_data (uint8_t *data, uint32_t len);
|
116
|
+
|
117
|
+
/**
|
118
|
+
* Get a pointer to the viewed data.
|
119
|
+
*
|
120
|
+
* @param[in] binary The @ref mongocrypt_binary_t.
|
121
|
+
*
|
122
|
+
* @returns A pointer to the viewed data.
|
123
|
+
*/
|
124
|
+
uint8_t *
|
125
|
+
mongocrypt_binary_data (const mongocrypt_binary_t *binary);
|
126
|
+
|
127
|
+
/**
|
128
|
+
* Get the length of the viewed data.
|
129
|
+
*
|
130
|
+
* @param[in] binary The @ref mongocrypt_binary_t.
|
131
|
+
*
|
132
|
+
* @returns The length of the viewed data.
|
133
|
+
*/
|
134
|
+
uint32_t
|
135
|
+
mongocrypt_binary_len (const mongocrypt_binary_t *binary);
|
136
|
+
|
137
|
+
/**
|
138
|
+
* Free the @ref mongocrypt_binary_t.
|
139
|
+
*
|
140
|
+
* This does not free the viewed data.
|
141
|
+
*
|
142
|
+
* @param[in] binary The mongocrypt_binary_t destroy.
|
143
|
+
*/
|
144
|
+
void
|
145
|
+
mongocrypt_binary_destroy (mongocrypt_binary_t *binary);
|
146
|
+
|
147
|
+
/**
|
148
|
+
* Indicates success or contains error information.
|
149
|
+
*
|
150
|
+
* Functions like @ref mongocrypt_ctx_encrypt_init follow a pattern to expose a
|
151
|
+
* status. A boolean is returned. True indicates success, and false indicates
|
152
|
+
* failure. On failure a status on the handle is set, and is accessible with a
|
153
|
+
* corresponding (handle)_status function. E.g. @ref mongocrypt_ctx_status.
|
154
|
+
*/
|
155
|
+
typedef struct _mongocrypt_status_t mongocrypt_status_t;
|
156
|
+
|
157
|
+
/**
|
158
|
+
* Indicates the type of error.
|
159
|
+
*/
|
160
|
+
typedef enum {
|
161
|
+
MONGOCRYPT_STATUS_OK = 0,
|
162
|
+
MONGOCRYPT_STATUS_ERROR_CLIENT = 1,
|
163
|
+
MONGOCRYPT_STATUS_ERROR_KMS = 2,
|
164
|
+
MONGOCRYPT_STATUS_ERROR_CRYPT_SHARED = 3,
|
165
|
+
} mongocrypt_status_type_t;
|
166
|
+
|
167
|
+
/**
|
168
|
+
* Create a new status object.
|
169
|
+
*
|
170
|
+
* Use a new status object to retrieve the status from a handle by passing
|
171
|
+
* this as an out-parameter to functions like @ref mongocrypt_ctx_status.
|
172
|
+
* When done, destroy it with @ref mongocrypt_status_destroy.
|
173
|
+
*
|
174
|
+
* @returns A new status object.
|
175
|
+
*/
|
176
|
+
mongocrypt_status_t *
|
177
|
+
mongocrypt_status_new (void);
|
178
|
+
|
179
|
+
/**
|
180
|
+
* Set a status object with message, type, and code.
|
181
|
+
*
|
182
|
+
* Use this to set the @ref mongocrypt_status_t given in the crypto hooks.
|
183
|
+
*
|
184
|
+
* @param[in] type The status type.
|
185
|
+
* @param[in] code The status code.
|
186
|
+
* @param[in] message The message.
|
187
|
+
* @param[in] message_len Due to historical behavior, pass 1 + the string length
|
188
|
+
* of @p message (which differs from other functions accepting string
|
189
|
+
* arguments).
|
190
|
+
* Alternatively, if message is NULL terminated this may be -1 to tell
|
191
|
+
* mongocrypt
|
192
|
+
* to determine the string's length with strlen.
|
193
|
+
*
|
194
|
+
*/
|
195
|
+
void
|
196
|
+
mongocrypt_status_set (mongocrypt_status_t *status,
|
197
|
+
mongocrypt_status_type_t type,
|
198
|
+
uint32_t code,
|
199
|
+
const char *message,
|
200
|
+
int32_t message_len);
|
201
|
+
|
202
|
+
/**
|
203
|
+
* Indicates success or the type of error.
|
204
|
+
*
|
205
|
+
* @param[in] status The status object.
|
206
|
+
*
|
207
|
+
* @returns A @ref mongocrypt_status_type_t.
|
208
|
+
*/
|
209
|
+
mongocrypt_status_type_t
|
210
|
+
mongocrypt_status_type (mongocrypt_status_t *status);
|
211
|
+
|
212
|
+
/**
|
213
|
+
* Get an error code or 0.
|
214
|
+
*
|
215
|
+
* @param[in] status The status object.
|
216
|
+
*
|
217
|
+
* @returns An error code.
|
218
|
+
*/
|
219
|
+
uint32_t
|
220
|
+
mongocrypt_status_code (mongocrypt_status_t *status);
|
221
|
+
|
222
|
+
/**
|
223
|
+
* Get the error message associated with a status or NULL.
|
224
|
+
*
|
225
|
+
* @param[in] status The status object.
|
226
|
+
* @param[out] len An optional length of the returned string (excluding the
|
227
|
+
* trailing NULL byte). May be NULL.
|
228
|
+
*
|
229
|
+
* @returns A NULL terminated error message or NULL.
|
230
|
+
*/
|
231
|
+
const char *
|
232
|
+
mongocrypt_status_message (mongocrypt_status_t *status, uint32_t *len);
|
233
|
+
|
234
|
+
/**
|
235
|
+
* Returns true if the status indicates success.
|
236
|
+
*
|
237
|
+
* @param[in] status The status to check.
|
238
|
+
*
|
239
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
240
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
241
|
+
*/
|
242
|
+
bool
|
243
|
+
mongocrypt_status_ok (mongocrypt_status_t *status);
|
244
|
+
|
245
|
+
/**
|
246
|
+
* Free the memory for a status object.
|
247
|
+
*
|
248
|
+
* @param[in] status The status to destroy.
|
249
|
+
*/
|
250
|
+
void
|
251
|
+
mongocrypt_status_destroy (mongocrypt_status_t *status);
|
252
|
+
|
253
|
+
/**
|
254
|
+
* Indicates the type of log message.
|
255
|
+
*/
|
256
|
+
typedef enum {
|
257
|
+
MONGOCRYPT_LOG_LEVEL_FATAL = 0,
|
258
|
+
MONGOCRYPT_LOG_LEVEL_ERROR = 1,
|
259
|
+
MONGOCRYPT_LOG_LEVEL_WARNING = 2,
|
260
|
+
MONGOCRYPT_LOG_LEVEL_INFO = 3,
|
261
|
+
MONGOCRYPT_LOG_LEVEL_TRACE = 4
|
262
|
+
} mongocrypt_log_level_t;
|
263
|
+
|
264
|
+
/**
|
265
|
+
* A log callback function. Set a custom log callback with @ref
|
266
|
+
* mongocrypt_setopt_log_handler.
|
267
|
+
*
|
268
|
+
* @param[in] message A NULL terminated message.
|
269
|
+
* @param[in] message_len The length of message.
|
270
|
+
* @param[in] ctx A context provided by the caller of @ref
|
271
|
+
* mongocrypt_setopt_log_handler.
|
272
|
+
*/
|
273
|
+
typedef void (*mongocrypt_log_fn_t) (mongocrypt_log_level_t level,
|
274
|
+
const char *message,
|
275
|
+
uint32_t message_len,
|
276
|
+
void *ctx);
|
277
|
+
|
278
|
+
/**
|
279
|
+
* The top-level handle to libmongocrypt.
|
280
|
+
*
|
281
|
+
* Create a mongocrypt_t handle to perform operations within libmongocrypt:
|
282
|
+
* encryption, decryption, registering log callbacks, etc.
|
283
|
+
*
|
284
|
+
* Functions on a mongocrypt_t are thread safe, though functions on derived
|
285
|
+
* handles (e.g. mongocrypt_ctx_t) are not and must be owned by a single
|
286
|
+
* thread. See each handle's documentation for thread-safety considerations.
|
287
|
+
*
|
288
|
+
* Multiple mongocrypt_t handles may be created.
|
289
|
+
*/
|
290
|
+
typedef struct _mongocrypt_t mongocrypt_t;
|
291
|
+
|
292
|
+
/**
|
293
|
+
* Allocate a new @ref mongocrypt_t object.
|
294
|
+
*
|
295
|
+
* Set options using mongocrypt_setopt_* functions, then initialize with @ref
|
296
|
+
* mongocrypt_init. When done with the @ref mongocrypt_t, free with @ref
|
297
|
+
* mongocrypt_destroy.
|
298
|
+
*
|
299
|
+
* @returns A new @ref mongocrypt_t object.
|
300
|
+
*/
|
301
|
+
mongocrypt_t *
|
302
|
+
mongocrypt_new (void);
|
303
|
+
|
304
|
+
/**
|
305
|
+
* Set a handler on the @ref mongocrypt_t object to get called on every log
|
306
|
+
* message.
|
307
|
+
*
|
308
|
+
* @param[in] crypt The @ref mongocrypt_t object.
|
309
|
+
* @param[in] log_fn The log callback.
|
310
|
+
* @param[in] log_ctx A context passed as an argument to the log callback every
|
311
|
+
* invocation.
|
312
|
+
* @pre @ref mongocrypt_init has not been called on @p crypt.
|
313
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
314
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
315
|
+
*/
|
316
|
+
bool
|
317
|
+
mongocrypt_setopt_log_handler (mongocrypt_t *crypt,
|
318
|
+
mongocrypt_log_fn_t log_fn,
|
319
|
+
void *log_ctx);
|
320
|
+
|
321
|
+
/**
|
322
|
+
* Configure an AWS KMS provider on the @ref mongocrypt_t object.
|
323
|
+
*
|
324
|
+
* This has been superseded by the more flexible:
|
325
|
+
* @ref mongocrypt_setopt_kms_providers
|
326
|
+
*
|
327
|
+
* @param[in] crypt The @ref mongocrypt_t object.
|
328
|
+
* @param[in] aws_access_key_id The AWS access key ID used to generate KMS
|
329
|
+
* messages.
|
330
|
+
* @param[in] aws_access_key_id_len The string length (in bytes) of @p
|
331
|
+
* aws_access_key_id. Pass -1 to determine the string length with strlen (must
|
332
|
+
* be NULL terminated).
|
333
|
+
* @param[in] aws_secret_access_key The AWS secret access key used to generate
|
334
|
+
* KMS messages.
|
335
|
+
* @param[in] aws_secret_access_key_len The string length (in bytes) of @p
|
336
|
+
* aws_secret_access_key. Pass -1 to determine the string length with strlen
|
337
|
+
* (must be NULL terminated).
|
338
|
+
* @pre @ref mongocrypt_init has not been called on @p crypt.
|
339
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
340
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
341
|
+
*/
|
342
|
+
bool
|
343
|
+
mongocrypt_setopt_kms_provider_aws (mongocrypt_t *crypt,
|
344
|
+
const char *aws_access_key_id,
|
345
|
+
int32_t aws_access_key_id_len,
|
346
|
+
const char *aws_secret_access_key,
|
347
|
+
int32_t aws_secret_access_key_len);
|
348
|
+
|
349
|
+
/**
|
350
|
+
* Configure a local KMS provider on the @ref mongocrypt_t object.
|
351
|
+
*
|
352
|
+
* This has been superseded by the more flexible:
|
353
|
+
* @ref mongocrypt_setopt_kms_providers
|
354
|
+
*
|
355
|
+
* @param[in] crypt The @ref mongocrypt_t object.
|
356
|
+
* @param[in] key A 96 byte master key used to encrypt and decrypt key vault
|
357
|
+
* keys. The viewed data is copied. It is valid to destroy @p key with @ref
|
358
|
+
* mongocrypt_binary_destroy immediately after.
|
359
|
+
* @pre @ref mongocrypt_init has not been called on @p crypt.
|
360
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
361
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
362
|
+
*/
|
363
|
+
bool
|
364
|
+
mongocrypt_setopt_kms_provider_local (mongocrypt_t *crypt,
|
365
|
+
mongocrypt_binary_t *key);
|
366
|
+
|
367
|
+
/**
|
368
|
+
* Configure KMS providers with a BSON document.
|
369
|
+
*
|
370
|
+
* @param[in] crypt The @ref mongocrypt_t object.
|
371
|
+
* @param[in] kms_providers A BSON document mapping the KMS provider names
|
372
|
+
* to credentials. Set a KMS provider value to an empty document to supply
|
373
|
+
* credentials on-demand with @ref mongocrypt_ctx_provide_kms_providers.
|
374
|
+
* @pre @ref mongocrypt_init has not been called on @p crypt.
|
375
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
376
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
377
|
+
*/
|
378
|
+
bool
|
379
|
+
mongocrypt_setopt_kms_providers (mongocrypt_t *crypt,
|
380
|
+
mongocrypt_binary_t *kms_providers);
|
381
|
+
|
382
|
+
/**
|
383
|
+
* Set a local schema map for encryption.
|
384
|
+
*
|
385
|
+
* @param[in] crypt The @ref mongocrypt_t object.
|
386
|
+
* @param[in] schema_map A BSON document representing the schema map supplied by
|
387
|
+
* the user. The keys are collection namespaces and values are JSON schemas. The
|
388
|
+
* viewed data copied. It is valid to destroy @p schema_map with @ref
|
389
|
+
* mongocrypt_binary_destroy immediately after.
|
390
|
+
* @pre @p crypt has not been initialized.
|
391
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
392
|
+
* Retrieve it with @ref mongocrypt_status
|
393
|
+
*/
|
394
|
+
bool
|
395
|
+
mongocrypt_setopt_schema_map (mongocrypt_t *crypt,
|
396
|
+
mongocrypt_binary_t *schema_map);
|
397
|
+
|
398
|
+
/**
|
399
|
+
* Set a local EncryptedFieldConfigMap for encryption.
|
400
|
+
*
|
401
|
+
* @param[in] crypt The @ref mongocrypt_t object.
|
402
|
+
* @param[in] efc_map A BSON document representing the EncryptedFieldConfigMap
|
403
|
+
* supplied by the user. The keys are collection namespaces and values are
|
404
|
+
* EncryptedFieldConfigMap documents. The viewed data copied. It is valid to
|
405
|
+
* destroy @p efc_map with @ref mongocrypt_binary_destroy immediately after.
|
406
|
+
* @pre @p crypt has not been initialized.
|
407
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
408
|
+
* Retrieve it with @ref mongocrypt_status
|
409
|
+
*/
|
410
|
+
bool
|
411
|
+
mongocrypt_setopt_encrypted_field_config_map (mongocrypt_t *crypt,
|
412
|
+
mongocrypt_binary_t *efc_map);
|
413
|
+
|
414
|
+
/**
|
415
|
+
* @brief Append an additional search directory to the search path for loading
|
416
|
+
* the crypt_shared dynamic library.
|
417
|
+
*
|
418
|
+
* @param[in] crypt The @ref mongocrypt_t object to update
|
419
|
+
* @param[in] path A null-terminated sequence of bytes for the search path. On
|
420
|
+
* some filesystems, this may be arbitrary bytes. On other filesystems, this may
|
421
|
+
* be required to be a valid UTF-8 code unit sequence. If the leading element of
|
422
|
+
* the path is the literal string "$ORIGIN", that substring will be replaced
|
423
|
+
* with the directory path containing the executable libmongocrypt module. If
|
424
|
+
* the path string is literal "$SYSTEM", then libmongocrypt will defer to the
|
425
|
+
* system's library resolution mechanism to find the crypt_shared library.
|
426
|
+
*
|
427
|
+
* @note If no crypt_shared dynamic library is found in any of the directories
|
428
|
+
* specified by the search paths loaded here, @ref mongocrypt_init() will still
|
429
|
+
* succeed and continue to operate without crypt_shared.
|
430
|
+
*
|
431
|
+
* @note The search paths are searched in the order that they are appended. This
|
432
|
+
* allows one to provide a precedence in how the library will be discovered. For
|
433
|
+
* example, appending known directories before appending "$SYSTEM" will allow
|
434
|
+
* one to supersede the system's installed library, but still fall-back to it if
|
435
|
+
* the library wasn't found otherwise. If one does not ever append "$SYSTEM",
|
436
|
+
* then the system's library-search mechanism will never be consulted.
|
437
|
+
*
|
438
|
+
* @note If an absolute path to the library is specified using
|
439
|
+
* @ref mongocrypt_setopt_set_crypt_shared_lib_path_override, then paths
|
440
|
+
* appended here will have no effect.
|
441
|
+
*/
|
442
|
+
void
|
443
|
+
mongocrypt_setopt_append_crypt_shared_lib_search_path (mongocrypt_t *crypt,
|
444
|
+
const char *path);
|
445
|
+
|
446
|
+
/**
|
447
|
+
* @brief Set a single override path for loading the crypt_shared dynamic
|
448
|
+
* library.
|
449
|
+
*
|
450
|
+
* @param[in] crypt The @ref mongocrypt_t object to update
|
451
|
+
* @param[in] path A null-terminated sequence of bytes for a path to the
|
452
|
+
* crypt_shared dynamic library. On some filesystems, this may be arbitrary
|
453
|
+
* bytes. On other filesystems, this may be required to be a valid UTF-8 code
|
454
|
+
* unit sequence. If the leading element of the path is the literal string
|
455
|
+
* `$ORIGIN`, that substring will be replaced with the directory path containing
|
456
|
+
* the executable libmongocrypt module.
|
457
|
+
*
|
458
|
+
* @note This function will do no IO nor path validation. All validation will
|
459
|
+
* occur during the call to @ref mongocrypt_init.
|
460
|
+
*
|
461
|
+
* @note If a crypt_shared library path override is specified here, then no
|
462
|
+
* paths given to @ref mongocrypt_setopt_append_crypt_shared_lib_search_path
|
463
|
+
* will be consulted when opening the crypt_shared library.
|
464
|
+
*
|
465
|
+
* @note If a path is provided via this API and @ref mongocrypt_init fails to
|
466
|
+
* initialize a valid crypt_shared library instance for the path specified, then
|
467
|
+
* the initialization of mongocrypt_t will fail with an error.
|
468
|
+
*/
|
469
|
+
void
|
470
|
+
mongocrypt_setopt_set_crypt_shared_lib_path_override (mongocrypt_t *crypt,
|
471
|
+
const char *path);
|
472
|
+
|
473
|
+
/**
|
474
|
+
* @brief Opt-into handling the MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS state.
|
475
|
+
*
|
476
|
+
* If set, before entering the MONGOCRYPT_CTX_NEED_KMS state,
|
477
|
+
* contexts may enter the MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS state
|
478
|
+
* and then wait for credentials to be supplied through
|
479
|
+
* @ref mongocrypt_ctx_provide_kms_providers.
|
480
|
+
*
|
481
|
+
* A context will only enter MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS
|
482
|
+
* if an empty document was set for a KMS provider in @ref
|
483
|
+
* mongocrypt_setopt_kms_providers.
|
484
|
+
*
|
485
|
+
* @param[in] crypt The @ref mongocrypt_t object to update
|
486
|
+
*/
|
487
|
+
void
|
488
|
+
mongocrypt_setopt_use_need_kms_credentials_state (mongocrypt_t *crypt);
|
489
|
+
|
490
|
+
/**
|
491
|
+
* Initialize new @ref mongocrypt_t object.
|
492
|
+
*
|
493
|
+
* Set options before using @ref mongocrypt_setopt_kms_provider_local, @ref
|
494
|
+
* mongocrypt_setopt_kms_provider_aws, or @ref mongocrypt_setopt_log_handler.
|
495
|
+
*
|
496
|
+
* @param[in] crypt The @ref mongocrypt_t object.
|
497
|
+
*
|
498
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
499
|
+
* Retrieve it with @ref mongocrypt_ctx_status Failure may occur if previously
|
500
|
+
* set
|
501
|
+
* options are invalid.
|
502
|
+
*/
|
503
|
+
bool
|
504
|
+
mongocrypt_init (mongocrypt_t *crypt);
|
505
|
+
|
506
|
+
/**
|
507
|
+
* Get the status associated with a @ref mongocrypt_t object.
|
508
|
+
*
|
509
|
+
* @param[in] crypt The @ref mongocrypt_t object.
|
510
|
+
* @param[out] status Receives the status.
|
511
|
+
*
|
512
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
513
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
514
|
+
*/
|
515
|
+
bool
|
516
|
+
mongocrypt_status (mongocrypt_t *crypt, mongocrypt_status_t *status);
|
517
|
+
|
518
|
+
/**
|
519
|
+
* Destroy the @ref mongocrypt_t object.
|
520
|
+
*
|
521
|
+
* @param[in] crypt The @ref mongocrypt_t object to destroy.
|
522
|
+
*/
|
523
|
+
void
|
524
|
+
mongocrypt_destroy (mongocrypt_t *crypt);
|
525
|
+
|
526
|
+
/**
|
527
|
+
* Obtain a nul-terminated version string of the loaded crypt_shared dynamic
|
528
|
+
* library, if available.
|
529
|
+
*
|
530
|
+
* If no crypt_shared was successfully loaded, this function returns NULL.
|
531
|
+
*
|
532
|
+
* @param[in] crypt The mongocrypt_t object after a successful call to
|
533
|
+
* mongocrypt_init.
|
534
|
+
* @param[out] len An optional output parameter to which the length of the
|
535
|
+
* returned string is written. If provided and no crypt_shared library was
|
536
|
+
* loaded, zero is written to *len.
|
537
|
+
*
|
538
|
+
* @return A nul-terminated string of the dynamically loaded crypt_shared
|
539
|
+
* library.
|
540
|
+
*
|
541
|
+
* @note For a numeric value that can be compared against, use
|
542
|
+
* @ref mongocrypt_crypt_shared_lib_version.
|
543
|
+
*/
|
544
|
+
const char *
|
545
|
+
mongocrypt_crypt_shared_lib_version_string (const mongocrypt_t *crypt,
|
546
|
+
uint32_t *len);
|
547
|
+
|
548
|
+
/**
|
549
|
+
* @brief Obtain a 64-bit constant encoding the version of the loaded
|
550
|
+
* crypt_shared library, if available.
|
551
|
+
*
|
552
|
+
* @param[in] crypt The mongocrypt_t object after a successul call to
|
553
|
+
* mongocrypt_init.
|
554
|
+
*
|
555
|
+
* @return A 64-bit encoded version number, with the version encoded as four
|
556
|
+
* sixteen-bit integers, or zero if no crypt_shared library was loaded.
|
557
|
+
*
|
558
|
+
* The version is encoded as four 16-bit numbers, from high to low:
|
559
|
+
*
|
560
|
+
* - Major version
|
561
|
+
* - Minor version
|
562
|
+
* - Revision
|
563
|
+
* - Reserved
|
564
|
+
*
|
565
|
+
* For example, version 6.2.1 would be encoded as: 0x0006'0002'0001'0000
|
566
|
+
*/
|
567
|
+
uint64_t
|
568
|
+
mongocrypt_crypt_shared_lib_version (const mongocrypt_t *crypt);
|
569
|
+
|
570
|
+
/**
|
571
|
+
* Manages the state machine for encryption or decryption.
|
572
|
+
*/
|
573
|
+
typedef struct _mongocrypt_ctx_t mongocrypt_ctx_t;
|
574
|
+
|
575
|
+
/**
|
576
|
+
* Create a new uninitialized @ref mongocrypt_ctx_t.
|
577
|
+
*
|
578
|
+
* Initialize the context with functions like @ref mongocrypt_ctx_encrypt_init.
|
579
|
+
* When done, destroy it with @ref mongocrypt_ctx_destroy.
|
580
|
+
*
|
581
|
+
* @param[in] crypt The @ref mongocrypt_t object.
|
582
|
+
* @returns A new context.
|
583
|
+
*/
|
584
|
+
mongocrypt_ctx_t *
|
585
|
+
mongocrypt_ctx_new (mongocrypt_t *crypt);
|
586
|
+
|
587
|
+
/**
|
588
|
+
* Get the status associated with a @ref mongocrypt_ctx_t object.
|
589
|
+
*
|
590
|
+
* @param[in] ctx The @ref mongocrypt_ctx_t object.
|
591
|
+
* @param[out] status Receives the status.
|
592
|
+
*
|
593
|
+
* @returns True if the output is an ok status, false if it is an error
|
594
|
+
* status.
|
595
|
+
*
|
596
|
+
* @see mongocrypt_status_ok
|
597
|
+
*/
|
598
|
+
bool
|
599
|
+
mongocrypt_ctx_status (mongocrypt_ctx_t *ctx, mongocrypt_status_t *status);
|
600
|
+
|
601
|
+
/**
|
602
|
+
* Set the key id to use for explicit encryption.
|
603
|
+
*
|
604
|
+
* It is an error to set both this and the key alt name.
|
605
|
+
*
|
606
|
+
* @param[in] ctx The @ref mongocrypt_ctx_t object.
|
607
|
+
* @param[in] key_id The binary corresponding to the _id (a UUID) of the data
|
608
|
+
* key to use from the key vault collection. Note, the UUID must be encoded with
|
609
|
+
* RFC-4122 byte order. The viewed data is copied. It is valid to destroy
|
610
|
+
* @p key_id with @ref mongocrypt_binary_destroy immediately after.
|
611
|
+
* @pre @p ctx has not been initialized.
|
612
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
613
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
614
|
+
*/
|
615
|
+
bool
|
616
|
+
mongocrypt_ctx_setopt_key_id (mongocrypt_ctx_t *ctx,
|
617
|
+
mongocrypt_binary_t *key_id);
|
618
|
+
|
619
|
+
/**
|
620
|
+
* Set the keyAltName to use for explicit encryption or
|
621
|
+
* data key creation.
|
622
|
+
*
|
623
|
+
* Pass the binary encoding a BSON document like the following:
|
624
|
+
*
|
625
|
+
* { "keyAltName" : (BSON UTF8 value) }
|
626
|
+
*
|
627
|
+
* For explicit encryption, it is an error to set both the keyAltName
|
628
|
+
* and the key id.
|
629
|
+
*
|
630
|
+
* For creating data keys, call this function repeatedly to set
|
631
|
+
* multiple keyAltNames.
|
632
|
+
*
|
633
|
+
* @param[in] ctx The @ref mongocrypt_ctx_t object.
|
634
|
+
* @param[in] key_alt_name The name to use. The viewed data is copied. It is
|
635
|
+
* valid to destroy @p key_alt_name with @ref mongocrypt_binary_destroy
|
636
|
+
* immediately after.
|
637
|
+
* @pre @p ctx has not been initialized.
|
638
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
639
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
640
|
+
*/
|
641
|
+
bool
|
642
|
+
mongocrypt_ctx_setopt_key_alt_name (mongocrypt_ctx_t *ctx,
|
643
|
+
mongocrypt_binary_t *key_alt_name);
|
644
|
+
|
645
|
+
/**
|
646
|
+
* Set the keyMaterial to use for encrypting data.
|
647
|
+
*
|
648
|
+
* Pass the binary encoding of a BSON document like the following:
|
649
|
+
*
|
650
|
+
* { "keyMaterial" : (BSON BINARY value) }
|
651
|
+
*
|
652
|
+
* @param[in] ctx The @ref mongocrypt_ctx_t object.
|
653
|
+
* @param[in] key_material The data encryption key to use. The viewed data is
|
654
|
+
* copied. It is valid to destroy @p key_material with @ref
|
655
|
+
* mongocrypt_binary_destroy immediately after.
|
656
|
+
* @pre @p ctx has not been initialized.
|
657
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
658
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
659
|
+
*/
|
660
|
+
bool
|
661
|
+
mongocrypt_ctx_setopt_key_material (mongocrypt_ctx_t *ctx,
|
662
|
+
mongocrypt_binary_t *key_material);
|
663
|
+
|
664
|
+
/**
|
665
|
+
* Set the algorithm used for encryption to either
|
666
|
+
* deterministic or random encryption. This value
|
667
|
+
* should only be set when using explicit encryption.
|
668
|
+
*
|
669
|
+
* If -1 is passed in for "len", then "algorithm" is
|
670
|
+
* assumed to be a null-terminated string.
|
671
|
+
*
|
672
|
+
* Valid values for algorithm are:
|
673
|
+
* "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"
|
674
|
+
* "AEAD_AES_256_CBC_HMAC_SHA_512-Random"
|
675
|
+
*
|
676
|
+
* @param[in] ctx The @ref mongocrypt_ctx_t object.
|
677
|
+
* @param[in] algorithm A string specifying the algorithm to
|
678
|
+
* use for encryption.
|
679
|
+
* @param[in] len The length of the algorithm string.
|
680
|
+
* @pre @p ctx has not been initialized.
|
681
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
682
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
683
|
+
*/
|
684
|
+
bool
|
685
|
+
mongocrypt_ctx_setopt_algorithm (mongocrypt_ctx_t *ctx,
|
686
|
+
const char *algorithm,
|
687
|
+
int len);
|
688
|
+
|
689
|
+
/// String constant for setopt_algorithm "Deterministic" encryption
|
690
|
+
/// String constant for setopt_algorithm "Random" encryption
|
691
|
+
/// String constant for setopt_algorithm "Indexed" explicit encryption
|
692
|
+
/// String constant for setopt_algorithm "Unindexed" explicit encryption
|
693
|
+
/// String constant for setopt_algorithm "rangePreview" explicit encryption
|
694
|
+
/// NOTE: The RangePreview algorithm is experimental only. It is not intended
|
695
|
+
/// for public use.
|
696
|
+
|
697
|
+
/**
|
698
|
+
* Identify the AWS KMS master key to use for creating a data key.
|
699
|
+
*
|
700
|
+
* This has been superseded by the more flexible:
|
701
|
+
* @ref mongocrypt_ctx_setopt_key_encryption_key
|
702
|
+
*
|
703
|
+
* @param[in] ctx The @ref mongocrypt_ctx_t object.
|
704
|
+
* @param[in] region The AWS region.
|
705
|
+
* @param[in] region_len The string length of @p region. Pass -1 to determine
|
706
|
+
* the string length with strlen (must be NULL terminated).
|
707
|
+
* @param[in] cmk The Amazon Resource Name (ARN) of the customer master key
|
708
|
+
* (CMK).
|
709
|
+
* @param[in] cmk_len The string length of @p cmk_len. Pass -1 to determine the
|
710
|
+
* string length with strlen (must be NULL terminated).
|
711
|
+
* @pre @p ctx has not been initialized.
|
712
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
713
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
714
|
+
*/
|
715
|
+
bool
|
716
|
+
mongocrypt_ctx_setopt_masterkey_aws (mongocrypt_ctx_t *ctx,
|
717
|
+
const char *region,
|
718
|
+
int32_t region_len,
|
719
|
+
const char *cmk,
|
720
|
+
int32_t cmk_len);
|
721
|
+
|
722
|
+
/**
|
723
|
+
* Identify a custom AWS endpoint when creating a data key.
|
724
|
+
* This is used internally to construct the correct HTTP request
|
725
|
+
* (with the Host header set to this endpoint). This endpoint
|
726
|
+
* is persisted in the new data key, and will be returned via
|
727
|
+
* @ref mongocrypt_kms_ctx_endpoint.
|
728
|
+
*
|
729
|
+
* This has been superseded by the more flexible:
|
730
|
+
* @ref mongocrypt_ctx_setopt_key_encryption_key
|
731
|
+
*
|
732
|
+
* @param[in] ctx The @ref mongocrypt_ctx_t object.
|
733
|
+
* @param[in] endpoint The endpoint.
|
734
|
+
* @param[in] endpoint_len The string length of @p endpoint. Pass -1 to
|
735
|
+
* determine the string length with strlen (must be NULL terminated).
|
736
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
737
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
738
|
+
*/
|
739
|
+
bool
|
740
|
+
mongocrypt_ctx_setopt_masterkey_aws_endpoint (mongocrypt_ctx_t *ctx,
|
741
|
+
const char *endpoint,
|
742
|
+
int32_t endpoint_len);
|
743
|
+
|
744
|
+
/**
|
745
|
+
* Set the master key to "local" for creating a data key.
|
746
|
+
* This has been superseded by the more flexible:
|
747
|
+
* @ref mongocrypt_ctx_setopt_key_encryption_key
|
748
|
+
*
|
749
|
+
* @param[in] ctx The @ref mongocrypt_ctx_t object.
|
750
|
+
* @pre @p ctx has not been initialized.
|
751
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
752
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
753
|
+
*/
|
754
|
+
bool
|
755
|
+
mongocrypt_ctx_setopt_masterkey_local (mongocrypt_ctx_t *ctx);
|
756
|
+
|
757
|
+
/**
|
758
|
+
* Set key encryption key document for creating a data key or for rewrapping
|
759
|
+
* datakeys.
|
760
|
+
*
|
761
|
+
* @param[in] ctx The @ref mongocrypt_ctx_t object.
|
762
|
+
* @param[in] bin BSON representing the key encryption key document with
|
763
|
+
* an additional "provider" field. The following forms are accepted:
|
764
|
+
*
|
765
|
+
* AWS
|
766
|
+
* {
|
767
|
+
* provider: "aws",
|
768
|
+
* region: <string>,
|
769
|
+
* key: <string>,
|
770
|
+
* endpoint: <optional string>
|
771
|
+
* }
|
772
|
+
*
|
773
|
+
* Azure
|
774
|
+
* {
|
775
|
+
* provider: "azure",
|
776
|
+
* keyVaultEndpoint: <string>,
|
777
|
+
* keyName: <string>,
|
778
|
+
* keyVersion: <optional string>
|
779
|
+
* }
|
780
|
+
*
|
781
|
+
* GCP
|
782
|
+
* {
|
783
|
+
* provider: "gcp",
|
784
|
+
* projectId: <string>,
|
785
|
+
* location: <string>,
|
786
|
+
* keyRing: <string>,
|
787
|
+
* keyName: <string>,
|
788
|
+
* keyVersion: <optional string>,
|
789
|
+
* endpoint: <optional string>
|
790
|
+
* }
|
791
|
+
*
|
792
|
+
* Local
|
793
|
+
* {
|
794
|
+
* provider: "local"
|
795
|
+
* }
|
796
|
+
*
|
797
|
+
* KMIP
|
798
|
+
* {
|
799
|
+
* provider: "kmip",
|
800
|
+
* keyId: <optional string>
|
801
|
+
* endpoint: <string>
|
802
|
+
* }
|
803
|
+
*
|
804
|
+
* @pre @p ctx has not been initialized.
|
805
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
806
|
+
* Retrieve it with @ref mongocrypt_ctx_status.
|
807
|
+
*/
|
808
|
+
bool
|
809
|
+
mongocrypt_ctx_setopt_key_encryption_key (mongocrypt_ctx_t *ctx,
|
810
|
+
mongocrypt_binary_t *bin);
|
811
|
+
|
812
|
+
/**
|
813
|
+
* Initialize a context to create a data key.
|
814
|
+
*
|
815
|
+
* Associated options:
|
816
|
+
* - @ref mongocrypt_ctx_setopt_masterkey_aws
|
817
|
+
* - @ref mongocrypt_ctx_setopt_masterkey_aws_endpoint
|
818
|
+
* - @ref mongocrypt_ctx_setopt_masterkey_local
|
819
|
+
*
|
820
|
+
* @param[in] ctx The @ref mongocrypt_ctx_t object.
|
821
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
822
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
823
|
+
* @pre A master key option has been set, and an associated KMS provider
|
824
|
+
* has been set on the parent @ref mongocrypt_t.
|
825
|
+
*/
|
826
|
+
bool
|
827
|
+
mongocrypt_ctx_datakey_init (mongocrypt_ctx_t *ctx);
|
828
|
+
|
829
|
+
/**
|
830
|
+
* Initialize a context for encryption.
|
831
|
+
*
|
832
|
+
* @param[in] ctx The @ref mongocrypt_ctx_t object.
|
833
|
+
* @param[in] db The database name.
|
834
|
+
* @param[in] db_len The byte length of @p db. Pass -1 to determine the string
|
835
|
+
* length with strlen (must
|
836
|
+
* be NULL terminated).
|
837
|
+
* @param[in] cmd The BSON command to be encrypted. The viewed data is copied.
|
838
|
+
* It is valid to destroy @p cmd with @ref mongocrypt_binary_destroy immediately
|
839
|
+
* after.
|
840
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
841
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
842
|
+
*/
|
843
|
+
bool
|
844
|
+
mongocrypt_ctx_encrypt_init (mongocrypt_ctx_t *ctx,
|
845
|
+
const char *db,
|
846
|
+
int32_t db_len,
|
847
|
+
mongocrypt_binary_t *cmd);
|
848
|
+
|
849
|
+
/**
|
850
|
+
* Explicit helper method to encrypt a single BSON object. Contexts
|
851
|
+
* created for explicit encryption will not go through mongocryptd.
|
852
|
+
*
|
853
|
+
* To specify a key_id, algorithm, or iv to use, please use the
|
854
|
+
* corresponding mongocrypt_setopt methods before calling this.
|
855
|
+
*
|
856
|
+
* This method expects the passed-in BSON to be of the form:
|
857
|
+
* { "v" : BSON value to encrypt }
|
858
|
+
*
|
859
|
+
* The value of "v" is expected to be the BSON value passed to a driver
|
860
|
+
* ClientEncryption.encrypt helper.
|
861
|
+
*
|
862
|
+
* Associated options for FLE 1:
|
863
|
+
* - @ref mongocrypt_ctx_setopt_key_id
|
864
|
+
* - @ref mongocrypt_ctx_setopt_key_alt_name
|
865
|
+
* - @ref mongocrypt_ctx_setopt_algorithm
|
866
|
+
*
|
867
|
+
* Associated options for Queryable Encryption:
|
868
|
+
* - @ref mongocrypt_ctx_setopt_key_id
|
869
|
+
* - @ref mongocrypt_ctx_setopt_index_key_id
|
870
|
+
* - @ref mongocrypt_ctx_setopt_contention_factor
|
871
|
+
* - @ref mongocrypt_ctx_setopt_query_type
|
872
|
+
* - @ref mongocrypt_ctx_setopt_algorithm_range
|
873
|
+
*
|
874
|
+
* An error is returned if FLE 1 and Queryable Encryption incompatible options
|
875
|
+
* are set.
|
876
|
+
*
|
877
|
+
* @param[in] ctx A @ref mongocrypt_ctx_t.
|
878
|
+
* @param[in] msg A @ref mongocrypt_binary_t the plaintext BSON value. The
|
879
|
+
* viewed data is copied. It is valid to destroy @p msg with @ref
|
880
|
+
* mongocrypt_binary_destroy immediately after.
|
881
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
882
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
883
|
+
*/
|
884
|
+
bool
|
885
|
+
mongocrypt_ctx_explicit_encrypt_init (mongocrypt_ctx_t *ctx,
|
886
|
+
mongocrypt_binary_t *msg);
|
887
|
+
|
888
|
+
/**
|
889
|
+
* Explicit helper method to encrypt a Match Expression or Aggregate Expression.
|
890
|
+
* Contexts created for explicit encryption will not go through mongocryptd.
|
891
|
+
* Requires query_type to be "rangePreview".
|
892
|
+
* NOTE: The RangePreview algorithm is experimental only. It is not intended for
|
893
|
+
* public use.
|
894
|
+
*
|
895
|
+
* This method expects the passed-in BSON to be of the form:
|
896
|
+
* { "v" : FLE2RangeFindDriverSpec }
|
897
|
+
*
|
898
|
+
* FLE2RangeFindDriverSpec is a BSON document with one of these forms:
|
899
|
+
*
|
900
|
+
* 1. A Match Expression of this form:
|
901
|
+
* {$and: [{<field>: {<op>: <value1>, {<field>: {<op>: <value2> }}]}
|
902
|
+
* 2. An Aggregate Expression of this form:
|
903
|
+
* {$and: [{<op>: [<fieldpath>, <value1>]}, {<op>: [<fieldpath>, <value2>]}]
|
904
|
+
*
|
905
|
+
* <op> may be $lt, $lte, $gt, or $gte.
|
906
|
+
*
|
907
|
+
* The value of "v" is expected to be the BSON value passed to a driver
|
908
|
+
* ClientEncryption.encryptExpression helper.
|
909
|
+
*
|
910
|
+
* Associated options for FLE 1:
|
911
|
+
* - @ref mongocrypt_ctx_setopt_key_id
|
912
|
+
* - @ref mongocrypt_ctx_setopt_key_alt_name
|
913
|
+
* - @ref mongocrypt_ctx_setopt_algorithm
|
914
|
+
*
|
915
|
+
* Associated options for Queryable Encryption:
|
916
|
+
* - @ref mongocrypt_ctx_setopt_key_id
|
917
|
+
* - @ref mongocrypt_ctx_setopt_index_key_id
|
918
|
+
* - @ref mongocrypt_ctx_setopt_contention_factor
|
919
|
+
* - @ref mongocrypt_ctx_setopt_query_type
|
920
|
+
* - @ref mongocrypt_ctx_setopt_algorithm_range
|
921
|
+
*
|
922
|
+
* An error is returned if FLE 1 and Queryable Encryption incompatible options
|
923
|
+
* are set.
|
924
|
+
*
|
925
|
+
* @param[in] ctx A @ref mongocrypt_ctx_t.
|
926
|
+
* @param[in] msg A @ref mongocrypt_binary_t the plaintext BSON value. The
|
927
|
+
* viewed data is copied. It is valid to destroy @p msg with @ref
|
928
|
+
* mongocrypt_binary_destroy immediately after.
|
929
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
930
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
931
|
+
*/
|
932
|
+
bool
|
933
|
+
mongocrypt_ctx_explicit_encrypt_expression_init (mongocrypt_ctx_t *ctx,
|
934
|
+
mongocrypt_binary_t *msg);
|
935
|
+
|
936
|
+
/**
|
937
|
+
* Initialize a context for decryption.
|
938
|
+
*
|
939
|
+
* This method expects the passed-in BSON to be of the form:
|
940
|
+
* { "v" : BSON value to encrypt }
|
941
|
+
*
|
942
|
+
* @param[in] ctx The @ref mongocrypt_ctx_t object.
|
943
|
+
* @param[in] doc The document to be decrypted. The viewed data is copied. It is
|
944
|
+
* valid to destroy @p doc with @ref mongocrypt_binary_destroy immediately
|
945
|
+
* after.
|
946
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
947
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
948
|
+
*/
|
949
|
+
bool
|
950
|
+
mongocrypt_ctx_decrypt_init (mongocrypt_ctx_t *ctx, mongocrypt_binary_t *doc);
|
951
|
+
|
952
|
+
/**
|
953
|
+
* Explicit helper method to decrypt a single BSON object.
|
954
|
+
*
|
955
|
+
* Pass the binary encoding of a BSON document containing the BSON value to
|
956
|
+
* encrypt like the following:
|
957
|
+
*
|
958
|
+
* { "v" : (BSON BINARY value of subtype 6) }
|
959
|
+
*
|
960
|
+
* @param[in] ctx A @ref mongocrypt_ctx_t.
|
961
|
+
* @param[in] msg A @ref mongocrypt_binary_t the encrypted BSON. The viewed data
|
962
|
+
* is copied. It is valid to destroy @p msg with @ref mongocrypt_binary_destroy
|
963
|
+
* immediately after.
|
964
|
+
*/
|
965
|
+
bool
|
966
|
+
mongocrypt_ctx_explicit_decrypt_init (mongocrypt_ctx_t *ctx,
|
967
|
+
mongocrypt_binary_t *msg);
|
968
|
+
|
969
|
+
/**
|
970
|
+
* @brief Initialize a context to rewrap datakeys.
|
971
|
+
*
|
972
|
+
* Associated options:
|
973
|
+
* - @ref mongocrypt_ctx_setopt_key_encryption_key
|
974
|
+
*
|
975
|
+
* @param[in] ctx The @ref mongocrypt_ctx_t object.
|
976
|
+
* @param[in] filter The filter to use for the find command on the key vault
|
977
|
+
* collection to retrieve datakeys to rewrap.
|
978
|
+
* @return A boolean indicating success. If false, an error status is set.
|
979
|
+
* Retrieve it with @ref mongocrypt_ctx_status.
|
980
|
+
*/
|
981
|
+
bool
|
982
|
+
mongocrypt_ctx_rewrap_many_datakey_init (mongocrypt_ctx_t *ctx,
|
983
|
+
mongocrypt_binary_t *filter);
|
984
|
+
|
985
|
+
/**
|
986
|
+
* Indicates the state of the @ref mongocrypt_ctx_t. Each state requires
|
987
|
+
* different handling. See [the integration
|
988
|
+
* guide](https://github.com/mongodb/libmongocrypt/blob/master/integrating.md#state-machine)
|
989
|
+
* for information on what to do for each state.
|
990
|
+
*/
|
991
|
+
typedef enum {
|
992
|
+
MONGOCRYPT_CTX_ERROR = 0,
|
993
|
+
MONGOCRYPT_CTX_NEED_MONGO_COLLINFO = 1, /* run on main MongoClient */
|
994
|
+
MONGOCRYPT_CTX_NEED_MONGO_MARKINGS = 2, /* run on mongocryptd. */
|
995
|
+
MONGOCRYPT_CTX_NEED_MONGO_KEYS = 3, /* run on key vault */
|
996
|
+
MONGOCRYPT_CTX_NEED_KMS = 4,
|
997
|
+
MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS = 7, /* fetch/renew KMS credentials */
|
998
|
+
MONGOCRYPT_CTX_READY = 5, /* ready for encryption/decryption */
|
999
|
+
MONGOCRYPT_CTX_DONE = 6,
|
1000
|
+
} mongocrypt_ctx_state_t;
|
1001
|
+
|
1002
|
+
/**
|
1003
|
+
* Get the current state of a context.
|
1004
|
+
*
|
1005
|
+
* @param[in] ctx The @ref mongocrypt_ctx_t object.
|
1006
|
+
* @returns A @ref mongocrypt_ctx_state_t.
|
1007
|
+
*/
|
1008
|
+
mongocrypt_ctx_state_t
|
1009
|
+
mongocrypt_ctx_state (mongocrypt_ctx_t *ctx);
|
1010
|
+
|
1011
|
+
/**
|
1012
|
+
* Get BSON necessary to run the mongo operation when mongocrypt_ctx_t
|
1013
|
+
* is in MONGOCRYPT_CTX_NEED_MONGO_* states.
|
1014
|
+
*
|
1015
|
+
* @p op_bson is a BSON document to be used for the operation.
|
1016
|
+
* - For MONGOCRYPT_CTX_NEED_MONGO_COLLINFO it is a listCollections filter.
|
1017
|
+
* - For MONGOCRYPT_CTX_NEED_MONGO_KEYS it is a find filter.
|
1018
|
+
* - For MONGOCRYPT_CTX_NEED_MONGO_MARKINGS it is a command to send to
|
1019
|
+
* mongocryptd.
|
1020
|
+
*
|
1021
|
+
* The lifetime of @p op_bson is tied to the lifetime of @p ctx. It is valid
|
1022
|
+
* until @ref mongocrypt_ctx_destroy is called.
|
1023
|
+
*
|
1024
|
+
* @param[in] ctx The @ref mongocrypt_ctx_t object.
|
1025
|
+
* @param[out] op_bson A BSON document for the MongoDB operation. The data
|
1026
|
+
* viewed by @p op_bson is guaranteed to be valid until @p ctx is destroyed with
|
1027
|
+
* @ref mongocrypt_ctx_destroy.
|
1028
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
1029
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
1030
|
+
*/
|
1031
|
+
bool
|
1032
|
+
mongocrypt_ctx_mongo_op (mongocrypt_ctx_t *ctx, mongocrypt_binary_t *op_bson);
|
1033
|
+
|
1034
|
+
/**
|
1035
|
+
* Feed a BSON reply or result when mongocrypt_ctx_t is in
|
1036
|
+
* MONGOCRYPT_CTX_NEED_MONGO_* states. This may be called multiple times
|
1037
|
+
* depending on the operation.
|
1038
|
+
*
|
1039
|
+
* reply is a BSON document result being fed back for this operation.
|
1040
|
+
* - For MONGOCRYPT_CTX_NEED_MONGO_COLLINFO it is a doc from a listCollections
|
1041
|
+
* cursor. (Note, if listCollections returned no result, do not call this
|
1042
|
+
* function.)
|
1043
|
+
* - For MONGOCRYPT_CTX_NEED_MONGO_KEYS it is a doc from a find cursor.
|
1044
|
+
* (Note, if find returned no results, do not call this function. reply must
|
1045
|
+
* not
|
1046
|
+
* be NULL.)
|
1047
|
+
* - For MONGOCRYPT_CTX_NEED_MONGO_MARKINGS it is a reply from mongocryptd.
|
1048
|
+
*
|
1049
|
+
* @param[in] ctx The @ref mongocrypt_ctx_t object.
|
1050
|
+
* @param[in] reply A BSON document for the MongoDB operation. The viewed data
|
1051
|
+
* is copied. It is valid to destroy @p reply with @ref
|
1052
|
+
* mongocrypt_binary_destroy immediately after.
|
1053
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
1054
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
1055
|
+
*/
|
1056
|
+
bool
|
1057
|
+
mongocrypt_ctx_mongo_feed (mongocrypt_ctx_t *ctx, mongocrypt_binary_t *reply);
|
1058
|
+
|
1059
|
+
/**
|
1060
|
+
* Call when done feeding the reply (or replies) back to the context.
|
1061
|
+
*
|
1062
|
+
* @param[in] ctx The @ref mongocrypt_ctx_t object.
|
1063
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
1064
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
1065
|
+
*/
|
1066
|
+
bool
|
1067
|
+
mongocrypt_ctx_mongo_done (mongocrypt_ctx_t *ctx);
|
1068
|
+
|
1069
|
+
/**
|
1070
|
+
* Manages a single KMS HTTP request/response.
|
1071
|
+
*/
|
1072
|
+
typedef struct _mongocrypt_kms_ctx_t mongocrypt_kms_ctx_t;
|
1073
|
+
|
1074
|
+
/**
|
1075
|
+
* Get the next KMS handle.
|
1076
|
+
*
|
1077
|
+
* Multiple KMS handles may be retrieved at once. Drivers may do this to fan
|
1078
|
+
* out multiple concurrent KMS HTTP requests. Feeding multiple KMS requests
|
1079
|
+
* is thread-safe.
|
1080
|
+
*
|
1081
|
+
* If KMS handles are being handled synchronously, the driver can reuse the same
|
1082
|
+
* TLS socket to send HTTP requests and receive responses.
|
1083
|
+
*
|
1084
|
+
* @param[in] ctx A @ref mongocrypt_ctx_t.
|
1085
|
+
* @returns a new @ref mongocrypt_kms_ctx_t or NULL.
|
1086
|
+
*/
|
1087
|
+
mongocrypt_kms_ctx_t *
|
1088
|
+
mongocrypt_ctx_next_kms_ctx (mongocrypt_ctx_t *ctx);
|
1089
|
+
|
1090
|
+
/**
|
1091
|
+
* Get the HTTP request message for a KMS handle.
|
1092
|
+
*
|
1093
|
+
* The lifetime of @p msg is tied to the lifetime of @p kms. It is valid
|
1094
|
+
* until @ref mongocrypt_ctx_kms_done is called.
|
1095
|
+
*
|
1096
|
+
* @param[in] kms A @ref mongocrypt_kms_ctx_t.
|
1097
|
+
* @param[out] msg The HTTP request to send to KMS. The data viewed by @p msg is
|
1098
|
+
* guaranteed to be valid until the call of @ref mongocrypt_ctx_kms_done of the
|
1099
|
+
* parent @ref mongocrypt_ctx_t.
|
1100
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
1101
|
+
* Retrieve it with @ref mongocrypt_kms_ctx_status
|
1102
|
+
*/
|
1103
|
+
bool
|
1104
|
+
mongocrypt_kms_ctx_message (mongocrypt_kms_ctx_t *kms,
|
1105
|
+
mongocrypt_binary_t *msg);
|
1106
|
+
|
1107
|
+
/**
|
1108
|
+
* Get the hostname from which to connect over TLS.
|
1109
|
+
*
|
1110
|
+
* The storage for @p endpoint is not owned by the caller, but
|
1111
|
+
* is valid until calling @ref mongocrypt_ctx_kms_done.
|
1112
|
+
*
|
1113
|
+
* @param[in] kms A @ref mongocrypt_kms_ctx_t.
|
1114
|
+
* @param[out] endpoint The output endpoint as a NULL terminated string.
|
1115
|
+
* The endpoint consists of a hostname and port separated by a colon.
|
1116
|
+
* E.g. "example.com:123". A port is always present.
|
1117
|
+
*
|
1118
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
1119
|
+
* Retrieve it with @ref mongocrypt_kms_ctx_status
|
1120
|
+
*/
|
1121
|
+
bool
|
1122
|
+
mongocrypt_kms_ctx_endpoint (mongocrypt_kms_ctx_t *kms, const char **endpoint);
|
1123
|
+
|
1124
|
+
/**
|
1125
|
+
* Indicates how many bytes to feed into @ref mongocrypt_kms_ctx_feed.
|
1126
|
+
*
|
1127
|
+
* @param[in] kms The @ref mongocrypt_kms_ctx_t.
|
1128
|
+
* @returns The number of requested bytes.
|
1129
|
+
*/
|
1130
|
+
uint32_t
|
1131
|
+
mongocrypt_kms_ctx_bytes_needed (mongocrypt_kms_ctx_t *kms);
|
1132
|
+
|
1133
|
+
/**
|
1134
|
+
* Feed bytes from the HTTP response.
|
1135
|
+
*
|
1136
|
+
* Feeding more bytes than what has been returned in @ref
|
1137
|
+
* mongocrypt_kms_ctx_bytes_needed is an error.
|
1138
|
+
*
|
1139
|
+
* @param[in] kms The @ref mongocrypt_kms_ctx_t.
|
1140
|
+
* @param[in] bytes The bytes to feed. The viewed data is copied. It is valid to
|
1141
|
+
* destroy @p bytes with @ref mongocrypt_binary_destroy immediately after.
|
1142
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
1143
|
+
* Retrieve it with @ref mongocrypt_kms_ctx_status
|
1144
|
+
*/
|
1145
|
+
bool
|
1146
|
+
mongocrypt_kms_ctx_feed (mongocrypt_kms_ctx_t *kms, mongocrypt_binary_t *bytes);
|
1147
|
+
|
1148
|
+
/**
|
1149
|
+
* Get the status associated with a @ref mongocrypt_kms_ctx_t object.
|
1150
|
+
*
|
1151
|
+
* @param[in] kms The @ref mongocrypt_kms_ctx_t object.
|
1152
|
+
* @param[out] status Receives the status.
|
1153
|
+
*
|
1154
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
1155
|
+
*/
|
1156
|
+
bool
|
1157
|
+
mongocrypt_kms_ctx_status (mongocrypt_kms_ctx_t *kms,
|
1158
|
+
mongocrypt_status_t *status);
|
1159
|
+
|
1160
|
+
/**
|
1161
|
+
* Get the KMS provider identifier associated with this KMS request.
|
1162
|
+
*
|
1163
|
+
* This is used to conditionally configure TLS connections based on the KMS
|
1164
|
+
* request. It is useful for KMIP, which authenticates with a client
|
1165
|
+
* certificate.
|
1166
|
+
*
|
1167
|
+
* @param[in] kms The @ref mongocrypt_kms_ctx_t object.
|
1168
|
+
* @param[out] len Receives the length of the returned string. It may be NULL.
|
1169
|
+
* If it is not NULL, it is set to the length of the returned string without
|
1170
|
+
* the NULL terminator.
|
1171
|
+
*
|
1172
|
+
* @returns One of the NULL terminated static strings: "aws", "azure", "gcp", or
|
1173
|
+
* "kmip".
|
1174
|
+
*/
|
1175
|
+
const char *
|
1176
|
+
mongocrypt_kms_ctx_get_kms_provider (mongocrypt_kms_ctx_t *kms, uint32_t *len);
|
1177
|
+
|
1178
|
+
/**
|
1179
|
+
* Call when done handling all KMS contexts.
|
1180
|
+
*
|
1181
|
+
* @param[in] ctx The @ref mongocrypt_ctx_t object.
|
1182
|
+
*
|
1183
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
1184
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
1185
|
+
*/
|
1186
|
+
bool
|
1187
|
+
mongocrypt_ctx_kms_done (mongocrypt_ctx_t *ctx);
|
1188
|
+
|
1189
|
+
/**
|
1190
|
+
* Call in response to the MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS state
|
1191
|
+
* to set per-context KMS provider settings. These follow the same format
|
1192
|
+
* as @ref mongocrypt_setopt_kms_providers. If no keys are present in the
|
1193
|
+
* BSON input, the KMS provider settings configured for the @ref mongocrypt_t
|
1194
|
+
* at initialization are used.
|
1195
|
+
*
|
1196
|
+
* @param[in] ctx The @ref mongocrypt_ctx_t object.
|
1197
|
+
* @param[in] kms_providers_definition A BSON document mapping the KMS provider
|
1198
|
+
* names to credentials.
|
1199
|
+
*
|
1200
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
1201
|
+
* Retrieve it with @ref mongocrypt_ctx_status.
|
1202
|
+
*/
|
1203
|
+
bool
|
1204
|
+
mongocrypt_ctx_provide_kms_providers (
|
1205
|
+
mongocrypt_ctx_t *ctx, mongocrypt_binary_t *kms_providers_definition);
|
1206
|
+
|
1207
|
+
/**
|
1208
|
+
* Perform the final encryption or decryption.
|
1209
|
+
*
|
1210
|
+
* @param[in] ctx A @ref mongocrypt_ctx_t.
|
1211
|
+
* @param[out] out The final BSON. The data viewed by @p out is guaranteed
|
1212
|
+
* to be valid until @p ctx is destroyed with @ref mongocrypt_ctx_destroy.
|
1213
|
+
* The meaning of this BSON depends on the type of @p ctx.
|
1214
|
+
*
|
1215
|
+
* If @p ctx was initialized with @ref mongocrypt_ctx_encrypt_init, then
|
1216
|
+
* this BSON is the (possibly) encrypted command to send to the server.
|
1217
|
+
*
|
1218
|
+
* If @p ctx was initialized with @ref mongocrypt_ctx_decrypt_init, then
|
1219
|
+
* this BSON is the decrypted result to return to the user.
|
1220
|
+
*
|
1221
|
+
* If @p ctx was initialized with @ref mongocrypt_ctx_explicit_encrypt_init,
|
1222
|
+
* then this BSON has the form { "v": (BSON binary) } where the BSON binary
|
1223
|
+
* is the resulting encrypted value.
|
1224
|
+
*
|
1225
|
+
* If @p ctx was initialized with @ref mongocrypt_ctx_explicit_decrypt_init,
|
1226
|
+
* then this BSON has the form { "v": (BSON value) } where the BSON value
|
1227
|
+
* is the resulting decrypted value.
|
1228
|
+
*
|
1229
|
+
* If @p ctx was initialized with @ref mongocrypt_ctx_datakey_init, then
|
1230
|
+
* this BSON is the document containing the new data key to be inserted into
|
1231
|
+
* the key vault collection.
|
1232
|
+
*
|
1233
|
+
* If @p ctx was initialized with @ref mongocrypt_ctx_rewrap_many_datakey_init,
|
1234
|
+
* then this BSON has the form:
|
1235
|
+
* { "v": [{ "_id": ..., "keyMaterial": ..., "masterKey": ... }, ...] }
|
1236
|
+
* where each BSON document in the array contains the updated fields of a
|
1237
|
+
* rewrapped datakey to be bulk-updated into the key vault collection.
|
1238
|
+
* Note: the updateDate field should be updated using the $currentDate operator.
|
1239
|
+
*
|
1240
|
+
* @returns a bool indicating success. If false, an error status is set.
|
1241
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
1242
|
+
*/
|
1243
|
+
bool
|
1244
|
+
mongocrypt_ctx_finalize (mongocrypt_ctx_t *ctx, mongocrypt_binary_t *out);
|
1245
|
+
|
1246
|
+
/**
|
1247
|
+
* Destroy and free all memory associated with a @ref mongocrypt_ctx_t.
|
1248
|
+
*
|
1249
|
+
* @param[in] ctx A @ref mongocrypt_ctx_t.
|
1250
|
+
*/
|
1251
|
+
void
|
1252
|
+
mongocrypt_ctx_destroy (mongocrypt_ctx_t *ctx);
|
1253
|
+
|
1254
|
+
/**
|
1255
|
+
* An crypto AES-256-CBC encrypt or decrypt function.
|
1256
|
+
*
|
1257
|
+
* Note, @p in is already padded. Encrypt with padding disabled.
|
1258
|
+
* @param[in] ctx An optional context object that may have been set when hooks
|
1259
|
+
* were enabled.
|
1260
|
+
* @param[in] key An encryption key (32 bytes for AES_256).
|
1261
|
+
* @param[in] iv An initialization vector (16 bytes for AES_256);
|
1262
|
+
* @param[in] in The input.
|
1263
|
+
* @param[out] out A preallocated byte array for the output. See @ref
|
1264
|
+
* mongocrypt_binary_data.
|
1265
|
+
* @param[out] bytes_written Set this to the number of bytes written to @p out.
|
1266
|
+
* @param[out] status An optional status to pass error messages. See @ref
|
1267
|
+
* mongocrypt_status_set.
|
1268
|
+
* @returns A boolean indicating success. If returning false, set @p status
|
1269
|
+
* with a message indiciating the error using @ref mongocrypt_status_set.
|
1270
|
+
*/
|
1271
|
+
typedef bool (*mongocrypt_crypto_fn) (void *ctx,
|
1272
|
+
mongocrypt_binary_t *key,
|
1273
|
+
mongocrypt_binary_t *iv,
|
1274
|
+
mongocrypt_binary_t *in,
|
1275
|
+
mongocrypt_binary_t *out,
|
1276
|
+
uint32_t *bytes_written,
|
1277
|
+
mongocrypt_status_t *status);
|
1278
|
+
|
1279
|
+
/**
|
1280
|
+
* A crypto signature or HMAC function.
|
1281
|
+
*
|
1282
|
+
* Currently used in callbacks for HMAC SHA-512, HMAC SHA-256, and RSA SHA-256
|
1283
|
+
* signature.
|
1284
|
+
*
|
1285
|
+
* @param[in] ctx An optional context object that may have been set when hooks
|
1286
|
+
* were enabled.
|
1287
|
+
* @param[in] key An encryption key (32 bytes for HMAC_SHA512).
|
1288
|
+
* @param[in] in The input.
|
1289
|
+
* @param[out] out A preallocated byte array for the output. See @ref
|
1290
|
+
* mongocrypt_binary_data.
|
1291
|
+
* @param[out] status An optional status to pass error messages. See @ref
|
1292
|
+
* mongocrypt_status_set.
|
1293
|
+
* @returns A boolean indicating success. If returning false, set @p status
|
1294
|
+
* with a message indiciating the error using @ref mongocrypt_status_set.
|
1295
|
+
*/
|
1296
|
+
typedef bool (*mongocrypt_hmac_fn) (void *ctx,
|
1297
|
+
mongocrypt_binary_t *key,
|
1298
|
+
mongocrypt_binary_t *in,
|
1299
|
+
mongocrypt_binary_t *out,
|
1300
|
+
mongocrypt_status_t *status);
|
1301
|
+
|
1302
|
+
/**
|
1303
|
+
* A crypto hash (SHA-256) function.
|
1304
|
+
*
|
1305
|
+
* @param[in] ctx An optional context object that may have been set when hooks
|
1306
|
+
* were enabled.
|
1307
|
+
* @param[in] in The input.
|
1308
|
+
* @param[out] out A preallocated byte array for the output. See @ref
|
1309
|
+
* mongocrypt_binary_data.
|
1310
|
+
* @param[out] status An optional status to pass error messages. See @ref
|
1311
|
+
* mongocrypt_status_set.
|
1312
|
+
* @returns A boolean indicating success. If returning false, set @p status
|
1313
|
+
* with a message indiciating the error using @ref mongocrypt_status_set.
|
1314
|
+
*/
|
1315
|
+
typedef bool (*mongocrypt_hash_fn) (void *ctx,
|
1316
|
+
mongocrypt_binary_t *in,
|
1317
|
+
mongocrypt_binary_t *out,
|
1318
|
+
mongocrypt_status_t *status);
|
1319
|
+
|
1320
|
+
/**
|
1321
|
+
* A crypto secure random function.
|
1322
|
+
*
|
1323
|
+
* @param[in] ctx An optional context object that may have been set when hooks
|
1324
|
+
* were enabled.
|
1325
|
+
* @param[out] out A preallocated byte array for the output. See @ref
|
1326
|
+
* mongocrypt_binary_data.
|
1327
|
+
* @param[in] count The number of random bytes requested.
|
1328
|
+
* @param[out] status An optional status to pass error messages. See @ref
|
1329
|
+
* mongocrypt_status_set.
|
1330
|
+
* @returns A boolean indicating success. If returning false, set @p status
|
1331
|
+
* with a message indiciating the error using @ref mongocrypt_status_set.
|
1332
|
+
*/
|
1333
|
+
typedef bool (*mongocrypt_random_fn) (void *ctx,
|
1334
|
+
mongocrypt_binary_t *out,
|
1335
|
+
uint32_t count,
|
1336
|
+
mongocrypt_status_t *status);
|
1337
|
+
|
1338
|
+
bool
|
1339
|
+
mongocrypt_setopt_crypto_hooks (mongocrypt_t *crypt,
|
1340
|
+
mongocrypt_crypto_fn aes_256_cbc_encrypt,
|
1341
|
+
mongocrypt_crypto_fn aes_256_cbc_decrypt,
|
1342
|
+
mongocrypt_random_fn random,
|
1343
|
+
mongocrypt_hmac_fn hmac_sha_512,
|
1344
|
+
mongocrypt_hmac_fn hmac_sha_256,
|
1345
|
+
mongocrypt_hash_fn sha_256,
|
1346
|
+
void *ctx);
|
1347
|
+
|
1348
|
+
/**
|
1349
|
+
* Set a crypto hook for the AES256-CTR operations.
|
1350
|
+
*
|
1351
|
+
* @param[in] crypt The @ref mongocrypt_t object.
|
1352
|
+
* @param[in] aes_256_ctr_encrypt The crypto callback function for encrypt
|
1353
|
+
* operation.
|
1354
|
+
* @param[in] aes_256_ctr_decrypt The crypto callback function for decrypt
|
1355
|
+
* operation.
|
1356
|
+
* @param[in] ctx A context passed as an argument to the crypto callback
|
1357
|
+
* every invocation.
|
1358
|
+
* @pre @ref mongocrypt_init has not been called on @p crypt.
|
1359
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
1360
|
+
* Retrieve it with @ref mongocrypt_status
|
1361
|
+
*
|
1362
|
+
*/
|
1363
|
+
bool
|
1364
|
+
mongocrypt_setopt_aes_256_ctr (mongocrypt_t *crypt,
|
1365
|
+
mongocrypt_crypto_fn aes_256_ctr_encrypt,
|
1366
|
+
mongocrypt_crypto_fn aes_256_ctr_decrypt,
|
1367
|
+
void *ctx);
|
1368
|
+
|
1369
|
+
/**
|
1370
|
+
* Set an AES256-ECB crypto hook for the AES256-CTR operations. If CTR hook was
|
1371
|
+
* configured using @ref mongocrypt_setopt_aes_256_ctr, ECB hook will be
|
1372
|
+
* ignored.
|
1373
|
+
*
|
1374
|
+
* @param[in] crypt The @ref mongocrypt_t object.
|
1375
|
+
* @param[in] aes_256_ecb_encrypt The crypto callback function for encrypt
|
1376
|
+
* operation.
|
1377
|
+
* @param[in] ctx A context passed as an argument to the crypto callback
|
1378
|
+
* every invocation.
|
1379
|
+
* @pre @ref mongocrypt_init has not been called on @p crypt.
|
1380
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
1381
|
+
* Retrieve it with @ref mongocrypt_status
|
1382
|
+
*
|
1383
|
+
*/
|
1384
|
+
bool
|
1385
|
+
mongocrypt_setopt_aes_256_ecb (mongocrypt_t *crypt,
|
1386
|
+
mongocrypt_crypto_fn aes_256_ecb_encrypt,
|
1387
|
+
void *ctx);
|
1388
|
+
|
1389
|
+
/**
|
1390
|
+
* Set a crypto hook for the RSASSA-PKCS1-v1_5 algorithm with a SHA-256 hash.
|
1391
|
+
*
|
1392
|
+
* See: https://tools.ietf.org/html/rfc3447#section-8.2
|
1393
|
+
*
|
1394
|
+
* Note: this function has the wrong name. It should be:
|
1395
|
+
* mongocrypt_setopt_crypto_hook_sign_rsassa_pkcs1_v1_5
|
1396
|
+
*
|
1397
|
+
* @param[in] crypt The @ref mongocrypt_t object.
|
1398
|
+
* @param[in] sign_rsaes_pkcs1_v1_5 The crypto callback function.
|
1399
|
+
* @param[in] sign_ctx A context passed as an argument to the crypto callback
|
1400
|
+
* every invocation.
|
1401
|
+
* @pre @ref mongocrypt_init has not been called on @p crypt.
|
1402
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
1403
|
+
* Retrieve it with @ref mongocrypt_status
|
1404
|
+
*
|
1405
|
+
*/
|
1406
|
+
bool
|
1407
|
+
mongocrypt_setopt_crypto_hook_sign_rsaes_pkcs1_v1_5 (
|
1408
|
+
mongocrypt_t *crypt,
|
1409
|
+
mongocrypt_hmac_fn sign_rsaes_pkcs1_v1_5,
|
1410
|
+
void *sign_ctx);
|
1411
|
+
|
1412
|
+
/**
|
1413
|
+
* @brief Opt-into skipping query analysis.
|
1414
|
+
*
|
1415
|
+
* If opted in:
|
1416
|
+
* - The crypt_shared library will not attempt to be loaded.
|
1417
|
+
* - A mongocrypt_ctx_t will never enter the MONGOCRYPT_CTX_NEED_MARKINGS state.
|
1418
|
+
*
|
1419
|
+
* @param[in] crypt The @ref mongocrypt_t object to update
|
1420
|
+
*/
|
1421
|
+
void
|
1422
|
+
mongocrypt_setopt_bypass_query_analysis (mongocrypt_t *crypt);
|
1423
|
+
|
1424
|
+
/**
|
1425
|
+
* Set the contention factor used for explicit encryption.
|
1426
|
+
* The contention factor is only used for indexed Queryable Encryption.
|
1427
|
+
*
|
1428
|
+
* @param[in] ctx The @ref mongocrypt_ctx_t object.
|
1429
|
+
* @param[in] contention_factor
|
1430
|
+
* @pre @p ctx has not been initialized.
|
1431
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
1432
|
+
* Retrieve it with @ref mongocrypt_ctx_status.
|
1433
|
+
*/
|
1434
|
+
bool
|
1435
|
+
mongocrypt_ctx_setopt_contention_factor (mongocrypt_ctx_t *ctx,
|
1436
|
+
int64_t contention_factor);
|
1437
|
+
|
1438
|
+
/**
|
1439
|
+
* Set the index key id to use for explicit Queryable Encryption.
|
1440
|
+
*
|
1441
|
+
* If the index key id not set, the key id from @ref
|
1442
|
+
* mongocrypt_ctx_setopt_key_id is used.
|
1443
|
+
*
|
1444
|
+
* @param[in] ctx The @ref mongocrypt_ctx_t object.
|
1445
|
+
* @param[in] key_id The binary corresponding to the _id (a UUID) of the data
|
1446
|
+
* key to use from the key vault collection. Note, the UUID must be encoded with
|
1447
|
+
* RFC-4122 byte order. The viewed data is copied. It is valid to destroy
|
1448
|
+
* @p key_id with @ref mongocrypt_binary_destroy immediately after.
|
1449
|
+
* @pre @p ctx has not been initialized.
|
1450
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
1451
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
1452
|
+
*/
|
1453
|
+
bool
|
1454
|
+
mongocrypt_ctx_setopt_index_key_id (mongocrypt_ctx_t *ctx,
|
1455
|
+
mongocrypt_binary_t *key_id);
|
1456
|
+
|
1457
|
+
/**
|
1458
|
+
* Set the query type to use for explicit Queryable Encryption.
|
1459
|
+
*
|
1460
|
+
* @param[in] ctx The @ref mongocrypt_ctx_t object.
|
1461
|
+
* @param[in] query_type The query type string
|
1462
|
+
* @param[in] len The length of query_type, or -1 for automatic
|
1463
|
+
* @pre @p ctx has not been initialized.
|
1464
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
1465
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
1466
|
+
*/
|
1467
|
+
bool
|
1468
|
+
mongocrypt_ctx_setopt_query_type (mongocrypt_ctx_t *ctx,
|
1469
|
+
const char *query_type,
|
1470
|
+
int len);
|
1471
|
+
|
1472
|
+
/**
|
1473
|
+
* Set options for explicit encryption with the "rangePreview" algorithm.
|
1474
|
+
* NOTE: The RangePreview algorithm is experimental only. It is not intended for
|
1475
|
+
* public use.
|
1476
|
+
*
|
1477
|
+
* @p opts is a BSON document of the form:
|
1478
|
+
* {
|
1479
|
+
* "min": Optional<BSON value>,
|
1480
|
+
* "max": Optional<BSON value>,
|
1481
|
+
* "sparsity": Int64,
|
1482
|
+
* "precision": Optional<Int32>
|
1483
|
+
* }
|
1484
|
+
*
|
1485
|
+
* @param[in] ctx The @ref mongocrypt_ctx_t object.
|
1486
|
+
* @param[in] opts BSON.
|
1487
|
+
* @pre @p ctx has not been initialized.
|
1488
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
1489
|
+
* Retrieve it with @ref mongocrypt_ctx_status
|
1490
|
+
*/
|
1491
|
+
bool
|
1492
|
+
mongocrypt_ctx_setopt_algorithm_range (mongocrypt_ctx_t *ctx,
|
1493
|
+
mongocrypt_binary_t *opts);
|
1494
|
+
|
1495
|
+
/// String constants for setopt_query_type
|
1496
|
+
// NOTE: The RangePreview algorithm is experimental only. It is not intended for
|
1497
|
+
// public use.
|
1498
|
+
""")
|
1499
|
+
|
1500
|
+
if PY3:
|
1501
|
+
def _to_string(cdata):
|
1502
|
+
"""Decode a cdata c-string to a Python str."""
|
1503
|
+
return ffi.string(cdata).decode()
|
1504
|
+
else:
|
1505
|
+
def _to_string(cdata):
|
1506
|
+
"""Decode a cdata c-string to a Python str."""
|
1507
|
+
return ffi.string(cdata)
|
1508
|
+
|
1509
|
+
|
1510
|
+
def libmongocrypt_version():
|
1511
|
+
"""Returns the version of libmongocrypt."""
|
1512
|
+
return _to_string(lib.mongocrypt_version(ffi.NULL))
|
1513
|
+
|
1514
|
+
|
1515
|
+
# Use the PYMONGOCRYPT_LIB environment variable to load a custom libmongocrypt
|
1516
|
+
# build without relying on platform specific library path environment
|
1517
|
+
# variables, like LD_LIBRARY_PATH. For example:
|
1518
|
+
# export PYMONGOCRYPT_LIB='/path/to/libmongocrypt.so'
|
1519
|
+
# If the PYMONGOCRYPT_LIB is not set then load the embedded library and
|
1520
|
+
# fallback to the relying on a system installed library.
|
1521
|
+
_base = os.path.dirname(os.path.realpath(__file__))
|
1522
|
+
if sys.platform == 'win32':
|
1523
|
+
_path = os.path.join(_base, 'mongocrypt.dll')
|
1524
|
+
elif sys.platform == 'darwin':
|
1525
|
+
_path = os.path.join(_base, 'libmongocrypt.dylib')
|
1526
|
+
else:
|
1527
|
+
_path = os.path.join(_base, 'libmongocrypt.so')
|
1528
|
+
|
1529
|
+
|
1530
|
+
class _Library(object):
|
1531
|
+
"""Helper class for delaying errors that would usually be raised at
|
1532
|
+
import time until the library is actually used."""
|
1533
|
+
def __init__(self, error):
|
1534
|
+
self._error = error
|
1535
|
+
|
1536
|
+
def __getattr__(self, name):
|
1537
|
+
raise self._error
|
1538
|
+
|
1539
|
+
|
1540
|
+
_PYMONGOCRYPT_LIB = os.environ.get('PYMONGOCRYPT_LIB')
|
1541
|
+
try:
|
1542
|
+
if _PYMONGOCRYPT_LIB:
|
1543
|
+
lib = ffi.dlopen(_PYMONGOCRYPT_LIB)
|
1544
|
+
else:
|
1545
|
+
try:
|
1546
|
+
lib = ffi.dlopen(_path)
|
1547
|
+
except OSError as exc:
|
1548
|
+
# Fallback to libmongocrypt installed on the system.
|
1549
|
+
lib = ffi.dlopen('mongocrypt')
|
1550
|
+
except OSError as exc:
|
1551
|
+
# dlopen raises OSError when the library cannot be found.
|
1552
|
+
# Delay the error until the library is actually used.
|
1553
|
+
lib = _Library(exc)
|
1554
|
+
else:
|
1555
|
+
# Check the libmongocrypt version when the library is found.
|
1556
|
+
_limongocrypt_version = _parse_version(libmongocrypt_version())
|
1557
|
+
if _limongocrypt_version < _parse_version(_MIN_LIBMONGOCRYPT_VERSION):
|
1558
|
+
exc = RuntimeError(
|
1559
|
+
"Expected libmongocrypt version %s or greater, found %s" % (
|
1560
|
+
_MIN_LIBMONGOCRYPT_VERSION, libmongocrypt_version()))
|
1561
|
+
lib = _Library(exc)
|