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,929 @@
|
|
1
|
+
#include "mongocrypt.h"
|
2
|
+
#include <cassert>
|
3
|
+
|
4
|
+
namespace node_mongocrypt {
|
5
|
+
|
6
|
+
using namespace Napi;
|
7
|
+
|
8
|
+
// anonymous namepace for helpers
|
9
|
+
namespace {
|
10
|
+
struct InstanceData {
|
11
|
+
Reference<Function> MongoCryptContextCtor;
|
12
|
+
Reference<Function> MongoCryptKMSRequestCtor;
|
13
|
+
};
|
14
|
+
|
15
|
+
struct MongoCryptStatusDeleter {
|
16
|
+
void operator()(mongocrypt_status_t* status) {
|
17
|
+
mongocrypt_status_destroy(status);
|
18
|
+
}
|
19
|
+
};
|
20
|
+
|
21
|
+
Object ExtractStatus(Env env, mongocrypt_status_t* status) {
|
22
|
+
Object result = Object::New(env);
|
23
|
+
result["type"] = Number::New(env, mongocrypt_status_type(status));
|
24
|
+
result["code"] = Number::New(env, mongocrypt_status_code(status));
|
25
|
+
const char* message = mongocrypt_status_message(status, nullptr);
|
26
|
+
if (message != nullptr) {
|
27
|
+
result["message"] = String::New(env, message);
|
28
|
+
}
|
29
|
+
|
30
|
+
return result;
|
31
|
+
}
|
32
|
+
|
33
|
+
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter>
|
34
|
+
BufferToBinary(Uint8Array node_buffer) {
|
35
|
+
uint8_t* buffer = node_buffer.Data();
|
36
|
+
size_t buffer_len = node_buffer.ByteLength();
|
37
|
+
return std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter>(
|
38
|
+
mongocrypt_binary_new_from_data(buffer, buffer_len));
|
39
|
+
}
|
40
|
+
|
41
|
+
Uint8Array BufferFromBinary(Env env, mongocrypt_binary_t* binary) {
|
42
|
+
const uint8_t* data = mongocrypt_binary_data(binary);
|
43
|
+
size_t len = mongocrypt_binary_len(binary);
|
44
|
+
return Buffer<uint8_t>::Copy(env, data, len);
|
45
|
+
}
|
46
|
+
|
47
|
+
Uint8Array BufferWithLengthOf(Env env, mongocrypt_binary_t* binary) {
|
48
|
+
size_t len = mongocrypt_binary_len(binary);
|
49
|
+
return Buffer<uint8_t>::New(env, len);
|
50
|
+
}
|
51
|
+
|
52
|
+
void CopyBufferData(mongocrypt_binary_t* out, Uint8Array buffer, size_t count) {
|
53
|
+
assert(count <= mongocrypt_binary_len(out));
|
54
|
+
assert(count <= buffer.ByteLength());
|
55
|
+
memcpy(mongocrypt_binary_data(out), buffer.Data(), count);
|
56
|
+
}
|
57
|
+
|
58
|
+
void CopyBufferData(mongocrypt_binary_t* out, Uint8Array buffer) {
|
59
|
+
CopyBufferData(out, buffer, mongocrypt_binary_len(out));
|
60
|
+
}
|
61
|
+
|
62
|
+
std::string errorStringFromStatus(mongocrypt_t* crypt) {
|
63
|
+
std::unique_ptr<mongocrypt_status_t, MongoCryptStatusDeleter> status(mongocrypt_status_new());
|
64
|
+
mongocrypt_status(crypt, status.get());
|
65
|
+
const char* errorMessage = mongocrypt_status_message(status.get(), nullptr);
|
66
|
+
if (!errorMessage) {
|
67
|
+
return "Operation failed";
|
68
|
+
}
|
69
|
+
|
70
|
+
return errorMessage;
|
71
|
+
}
|
72
|
+
|
73
|
+
std::string errorStringFromStatus(mongocrypt_ctx_t* context) {
|
74
|
+
std::unique_ptr<mongocrypt_status_t, MongoCryptStatusDeleter> status(mongocrypt_status_new());
|
75
|
+
mongocrypt_ctx_status(context, status.get());
|
76
|
+
const char* errorMessage = mongocrypt_status_message(status.get(), nullptr);
|
77
|
+
if (!errorMessage) {
|
78
|
+
return "Operation failed";
|
79
|
+
}
|
80
|
+
|
81
|
+
return errorMessage;
|
82
|
+
}
|
83
|
+
|
84
|
+
template<typename E>
|
85
|
+
E strToEnumValue(
|
86
|
+
Env env,
|
87
|
+
const std::string& str,
|
88
|
+
const char* option_name,
|
89
|
+
const std::initializer_list<std::pair<const char*, E>>& values) {
|
90
|
+
for (const auto& candidate : values) {
|
91
|
+
if (candidate.first == str) {
|
92
|
+
return candidate.second;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
throw Error::New(env,
|
96
|
+
std::string("invalid enum value: '") + str + "' for " + option_name);
|
97
|
+
}
|
98
|
+
|
99
|
+
} // anonymous namespace
|
100
|
+
|
101
|
+
Function MongoCrypt::Init(Napi::Env env) {
|
102
|
+
return
|
103
|
+
DefineClass(env,
|
104
|
+
"MongoCrypt",
|
105
|
+
{
|
106
|
+
InstanceMethod("makeEncryptionContext", &MongoCrypt::MakeEncryptionContext),
|
107
|
+
InstanceMethod("makeExplicitEncryptionContext", &MongoCrypt::MakeExplicitEncryptionContext),
|
108
|
+
InstanceMethod("makeDecryptionContext", &MongoCrypt::MakeDecryptionContext),
|
109
|
+
InstanceMethod("makeExplicitDecryptionContext", &MongoCrypt::MakeExplicitDecryptionContext),
|
110
|
+
InstanceMethod("makeDataKeyContext", &MongoCrypt::MakeDataKeyContext),
|
111
|
+
InstanceMethod("makeRewrapManyDataKeyContext", &MongoCrypt::MakeRewrapManyDataKeyContext),
|
112
|
+
InstanceAccessor("status", &MongoCrypt::Status, nullptr),
|
113
|
+
InstanceAccessor("cryptSharedLibVersionInfo", &MongoCrypt::CryptSharedLibVersionInfo, nullptr),
|
114
|
+
StaticValue("libmongocryptVersion", String::New(env, mongocrypt_version(nullptr)))
|
115
|
+
});
|
116
|
+
}
|
117
|
+
|
118
|
+
void MongoCrypt::logHandler(mongocrypt_log_level_t level,
|
119
|
+
const char* message,
|
120
|
+
uint32_t message_len,
|
121
|
+
void* ctx) {
|
122
|
+
MongoCrypt* mongoCrypt = static_cast<MongoCrypt*>(ctx);
|
123
|
+
if (!mongoCrypt) {
|
124
|
+
fprintf(stderr, "Log handler called without `MongoCrypt` instance\n");
|
125
|
+
return;
|
126
|
+
}
|
127
|
+
|
128
|
+
Napi::Env env = mongoCrypt->Env();
|
129
|
+
HandleScope scope(env);
|
130
|
+
Function logger = mongoCrypt->GetCallback("logger");
|
131
|
+
|
132
|
+
if (logger.IsEmpty()) {
|
133
|
+
fprintf(stderr, "No logger set, but log handler registered\n");
|
134
|
+
return;
|
135
|
+
}
|
136
|
+
|
137
|
+
try {
|
138
|
+
logger.Call(std::initializer_list<napi_value>
|
139
|
+
{ Number::New(env, level), String::New(env, message, message_len) });
|
140
|
+
} catch (const std::exception& ex) {
|
141
|
+
fprintf(stderr, "Uncaught exception in logger callback: %s\n", ex.what());
|
142
|
+
} catch (...) {
|
143
|
+
fprintf(stderr, "Uncaught exception in logger callback\n");
|
144
|
+
}
|
145
|
+
}
|
146
|
+
|
147
|
+
|
148
|
+
static void MaybeSetCryptoHookErrorStatus(Value result, mongocrypt_status_t *status) {
|
149
|
+
if (!result.IsObject()) {
|
150
|
+
return;
|
151
|
+
}
|
152
|
+
Object hookError = result.As<Object>();
|
153
|
+
if (!hookError.Has("message")) {
|
154
|
+
return;
|
155
|
+
}
|
156
|
+
std::string errorMessage = hookError.Get("message").ToString();
|
157
|
+
mongocrypt_status_set(
|
158
|
+
status,
|
159
|
+
MONGOCRYPT_STATUS_ERROR_CLIENT,
|
160
|
+
1,
|
161
|
+
errorMessage.c_str(),
|
162
|
+
errorMessage.length() + 1
|
163
|
+
);
|
164
|
+
}
|
165
|
+
|
166
|
+
static bool aes_256_generic_hook (MongoCrypt* mongoCrypt, mongocrypt_binary_t *key, mongocrypt_binary_t *iv, mongocrypt_binary_t *in, mongocrypt_binary_t *out, uint32_t *bytes_written, mongocrypt_status_t *status, Function hook) {
|
167
|
+
Env env = mongoCrypt->Env();
|
168
|
+
HandleScope scope(env);
|
169
|
+
|
170
|
+
Uint8Array keyBuffer = BufferFromBinary(env, key);
|
171
|
+
Uint8Array ivBuffer = BufferFromBinary(env, iv);
|
172
|
+
Uint8Array inBuffer = BufferFromBinary(env, in);
|
173
|
+
Uint8Array outBuffer = BufferWithLengthOf(env, out);
|
174
|
+
|
175
|
+
Value result;
|
176
|
+
try {
|
177
|
+
result = hook.Call(std::initializer_list<napi_value>
|
178
|
+
{ keyBuffer, ivBuffer, inBuffer, outBuffer });
|
179
|
+
} catch (...) {
|
180
|
+
return false;
|
181
|
+
}
|
182
|
+
|
183
|
+
if (!result.IsNumber()) {
|
184
|
+
MaybeSetCryptoHookErrorStatus(result, status);
|
185
|
+
return false;
|
186
|
+
}
|
187
|
+
|
188
|
+
*bytes_written = result.ToNumber().Uint32Value();
|
189
|
+
CopyBufferData(out, outBuffer, *bytes_written);
|
190
|
+
return true;
|
191
|
+
}
|
192
|
+
|
193
|
+
bool MongoCrypt::setupCryptoHooks() {
|
194
|
+
auto aes_256_cbc_encrypt =
|
195
|
+
[](void *ctx, mongocrypt_binary_t *key, mongocrypt_binary_t *iv, mongocrypt_binary_t *in, mongocrypt_binary_t *out, uint32_t *bytes_written, mongocrypt_status_t *status) -> bool {
|
196
|
+
MongoCrypt* mc = static_cast<MongoCrypt*>(ctx);
|
197
|
+
return aes_256_generic_hook(mc, key, iv, in, out, bytes_written, status, mc->GetCallback("aes256CbcEncryptHook"));
|
198
|
+
};
|
199
|
+
|
200
|
+
auto aes_256_cbc_decrypt =
|
201
|
+
[](void *ctx, mongocrypt_binary_t *key, mongocrypt_binary_t *iv, mongocrypt_binary_t *in, mongocrypt_binary_t *out, uint32_t *bytes_written, mongocrypt_status_t *status) -> bool {
|
202
|
+
MongoCrypt* mc = static_cast<MongoCrypt*>(ctx);
|
203
|
+
return aes_256_generic_hook(mc, key, iv, in, out, bytes_written, status, mc->GetCallback("aes256CbcDecryptHook"));
|
204
|
+
};
|
205
|
+
|
206
|
+
auto aes_256_ctr_encrypt =
|
207
|
+
[](void *ctx, mongocrypt_binary_t *key, mongocrypt_binary_t *iv, mongocrypt_binary_t *in, mongocrypt_binary_t *out, uint32_t *bytes_written, mongocrypt_status_t *status) -> bool {
|
208
|
+
MongoCrypt* mc = static_cast<MongoCrypt*>(ctx);
|
209
|
+
return aes_256_generic_hook(mc, key, iv, in, out, bytes_written, status, mc->GetCallback("aes256CtrEncryptHook"));
|
210
|
+
};
|
211
|
+
|
212
|
+
auto aes_256_ctr_decrypt =
|
213
|
+
[](void *ctx, mongocrypt_binary_t *key, mongocrypt_binary_t *iv, mongocrypt_binary_t *in, mongocrypt_binary_t *out, uint32_t *bytes_written, mongocrypt_status_t *status) -> bool {
|
214
|
+
MongoCrypt* mc = static_cast<MongoCrypt*>(ctx);
|
215
|
+
return aes_256_generic_hook(mc, key, iv, in, out, bytes_written, status, mc->GetCallback("aes256CtrDecryptHook"));
|
216
|
+
};
|
217
|
+
|
218
|
+
auto random =
|
219
|
+
[](void *ctx, mongocrypt_binary_t *out, uint32_t count, mongocrypt_status_t *status) -> bool {
|
220
|
+
MongoCrypt* mongoCrypt = static_cast<MongoCrypt*>(ctx);
|
221
|
+
Napi::Env env = mongoCrypt->Env();
|
222
|
+
HandleScope scope(env);
|
223
|
+
Function hook = mongoCrypt->GetCallback("randomHook");
|
224
|
+
|
225
|
+
Uint8Array outBuffer = BufferWithLengthOf(env, out);
|
226
|
+
Napi::Value result;
|
227
|
+
try {
|
228
|
+
result = hook.Call(std::initializer_list<napi_value>
|
229
|
+
{ outBuffer, Number::New(env, count) });
|
230
|
+
} catch (...) {
|
231
|
+
return false;
|
232
|
+
}
|
233
|
+
|
234
|
+
if (!result.IsNumber()) {
|
235
|
+
MaybeSetCryptoHookErrorStatus(result, status);
|
236
|
+
return false;
|
237
|
+
}
|
238
|
+
|
239
|
+
CopyBufferData(out, outBuffer);
|
240
|
+
return true;
|
241
|
+
};
|
242
|
+
|
243
|
+
auto hmac_sha_512 =
|
244
|
+
[](void *ctx, mongocrypt_binary_t *key, mongocrypt_binary_t *in, mongocrypt_binary_t *out, mongocrypt_status_t *status) -> bool {
|
245
|
+
MongoCrypt* mongoCrypt = static_cast<MongoCrypt*>(ctx);
|
246
|
+
Napi::Env env = mongoCrypt->Env();
|
247
|
+
HandleScope scope(env);
|
248
|
+
Function hook = mongoCrypt->GetCallback("hmacSha512Hook");
|
249
|
+
|
250
|
+
Uint8Array keyBuffer = BufferFromBinary(env, key);
|
251
|
+
Uint8Array inputBuffer = BufferFromBinary(env, in);
|
252
|
+
Uint8Array outputBuffer = BufferWithLengthOf(env, out);
|
253
|
+
|
254
|
+
Napi::Value result;
|
255
|
+
try {
|
256
|
+
result = hook.Call(std::initializer_list<napi_value>
|
257
|
+
{ keyBuffer, inputBuffer, outputBuffer });
|
258
|
+
} catch (...) {
|
259
|
+
return false;
|
260
|
+
}
|
261
|
+
|
262
|
+
if (!result.IsNumber()) {
|
263
|
+
MaybeSetCryptoHookErrorStatus(result, status);
|
264
|
+
return false;
|
265
|
+
}
|
266
|
+
|
267
|
+
CopyBufferData(out, outputBuffer);
|
268
|
+
return true;
|
269
|
+
};
|
270
|
+
|
271
|
+
auto hmac_sha_256 =
|
272
|
+
[](void *ctx, mongocrypt_binary_t *key, mongocrypt_binary_t *in, mongocrypt_binary_t *out, mongocrypt_status_t *status) -> bool {
|
273
|
+
MongoCrypt* mongoCrypt = static_cast<MongoCrypt*>(ctx);
|
274
|
+
Napi::Env env = mongoCrypt->Env();
|
275
|
+
HandleScope scope(env);
|
276
|
+
Function hook = mongoCrypt->GetCallback("hmacSha256Hook");
|
277
|
+
|
278
|
+
Uint8Array keyBuffer = BufferFromBinary(env, key);
|
279
|
+
Uint8Array inputBuffer = BufferFromBinary(env, in);
|
280
|
+
Uint8Array outputBuffer = BufferWithLengthOf(env, out);
|
281
|
+
|
282
|
+
Napi::Value result;
|
283
|
+
try {
|
284
|
+
result = hook.Call(std::initializer_list<napi_value>
|
285
|
+
{ keyBuffer, inputBuffer, outputBuffer });
|
286
|
+
} catch (...) {
|
287
|
+
return false;
|
288
|
+
}
|
289
|
+
|
290
|
+
if (!result.IsNumber()) {
|
291
|
+
MaybeSetCryptoHookErrorStatus(result, status);
|
292
|
+
return false;
|
293
|
+
}
|
294
|
+
|
295
|
+
CopyBufferData(out, outputBuffer);
|
296
|
+
return true;
|
297
|
+
};
|
298
|
+
|
299
|
+
auto sha_256 =
|
300
|
+
[](void *ctx, mongocrypt_binary_t *in, mongocrypt_binary_t *out, mongocrypt_status_t *status) -> bool {
|
301
|
+
MongoCrypt* mongoCrypt = static_cast<MongoCrypt*>(ctx);
|
302
|
+
Napi::Env env = mongoCrypt->Env();
|
303
|
+
HandleScope scope(env);
|
304
|
+
Function hook = mongoCrypt->GetCallback("sha256Hook");
|
305
|
+
|
306
|
+
Uint8Array inputBuffer = BufferFromBinary(env, in);
|
307
|
+
Uint8Array outputBuffer = BufferWithLengthOf(env, out);
|
308
|
+
|
309
|
+
Napi::Value result;
|
310
|
+
try {
|
311
|
+
result = hook.Call(std::initializer_list<napi_value>
|
312
|
+
{ inputBuffer, outputBuffer });
|
313
|
+
} catch (...) {
|
314
|
+
return false;
|
315
|
+
}
|
316
|
+
|
317
|
+
if (!result.IsNumber()) {
|
318
|
+
MaybeSetCryptoHookErrorStatus(result, status);
|
319
|
+
return false;
|
320
|
+
}
|
321
|
+
|
322
|
+
CopyBufferData(out, outputBuffer);
|
323
|
+
return true;
|
324
|
+
};
|
325
|
+
|
326
|
+
auto sign_rsa_sha256 =
|
327
|
+
[](void *ctx, mongocrypt_binary_t *key, mongocrypt_binary_t *in, mongocrypt_binary_t *out, mongocrypt_status_t *status) -> bool {
|
328
|
+
MongoCrypt* mongoCrypt = static_cast<MongoCrypt*>(ctx);
|
329
|
+
Napi::Env env = mongoCrypt->Env();
|
330
|
+
HandleScope scope(env);
|
331
|
+
Function hook = mongoCrypt->GetCallback("signRsaSha256Hook");
|
332
|
+
|
333
|
+
Uint8Array keyBuffer = BufferFromBinary(env, key);
|
334
|
+
Uint8Array inputBuffer = BufferFromBinary(env, in);
|
335
|
+
Uint8Array outputBuffer = BufferWithLengthOf(env, out);
|
336
|
+
|
337
|
+
Napi::Value result;
|
338
|
+
try {
|
339
|
+
result = hook.Call(std::initializer_list<napi_value>
|
340
|
+
{ keyBuffer, inputBuffer, outputBuffer });
|
341
|
+
} catch (...) {
|
342
|
+
return false;
|
343
|
+
}
|
344
|
+
|
345
|
+
if (!result.IsNumber()) {
|
346
|
+
MaybeSetCryptoHookErrorStatus(result, status);
|
347
|
+
return false;
|
348
|
+
}
|
349
|
+
|
350
|
+
CopyBufferData(out, outputBuffer);
|
351
|
+
return true;
|
352
|
+
};
|
353
|
+
|
354
|
+
if (!mongocrypt_setopt_crypto_hooks(_mongo_crypt.get(),
|
355
|
+
aes_256_cbc_encrypt,
|
356
|
+
aes_256_cbc_decrypt,
|
357
|
+
random,
|
358
|
+
hmac_sha_512,
|
359
|
+
hmac_sha_256,
|
360
|
+
sha_256,
|
361
|
+
this)) {
|
362
|
+
return false;
|
363
|
+
}
|
364
|
+
|
365
|
+
// Added after `mongocrypt_setopt_crypto_hooks`, they should be treated as the same during configuration
|
366
|
+
if (!mongocrypt_setopt_crypto_hook_sign_rsaes_pkcs1_v1_5(_mongo_crypt.get(), sign_rsa_sha256, this)) {
|
367
|
+
return false;
|
368
|
+
}
|
369
|
+
|
370
|
+
if (!mongocrypt_setopt_aes_256_ctr(_mongo_crypt.get(), aes_256_ctr_encrypt, aes_256_ctr_decrypt, this)) {
|
371
|
+
return false;
|
372
|
+
}
|
373
|
+
|
374
|
+
return true;
|
375
|
+
}
|
376
|
+
|
377
|
+
MongoCrypt::MongoCrypt(const CallbackInfo& info)
|
378
|
+
: ObjectWrap(info), _mongo_crypt(mongocrypt_new()) {
|
379
|
+
if (info.Length() < 1 || !info[0].IsObject()) {
|
380
|
+
throw TypeError::New(Env(), "First parameter must be an object");
|
381
|
+
}
|
382
|
+
|
383
|
+
Object options = info[0].ToObject();
|
384
|
+
|
385
|
+
if (options.Has("kmsProviders")) {
|
386
|
+
Napi::Value kmsProvidersOptions = options["kmsProviders"];
|
387
|
+
|
388
|
+
if (!kmsProvidersOptions.IsBuffer()) {
|
389
|
+
throw TypeError::New(Env(), "Option `kmsProviders` must be a Buffer");
|
390
|
+
}
|
391
|
+
|
392
|
+
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter> kmsProvidersBinary(
|
393
|
+
BufferToBinary(kmsProvidersOptions.As<Uint8Array>()));
|
394
|
+
if (!mongocrypt_setopt_kms_providers(_mongo_crypt.get(), kmsProvidersBinary.get())) {
|
395
|
+
throw TypeError::New(Env(), errorStringFromStatus(_mongo_crypt.get()));
|
396
|
+
}
|
397
|
+
}
|
398
|
+
|
399
|
+
if (options.Has("schemaMap")) {
|
400
|
+
Napi::Value schemaMapBuffer = options["schemaMap"];
|
401
|
+
|
402
|
+
if (!schemaMapBuffer.IsBuffer()) {
|
403
|
+
throw TypeError::New(Env(), "Option `schemaMap` must be a Buffer");
|
404
|
+
}
|
405
|
+
|
406
|
+
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter> schemaMapBinary(
|
407
|
+
BufferToBinary(schemaMapBuffer.As<Uint8Array>()));
|
408
|
+
if (!mongocrypt_setopt_schema_map(_mongo_crypt.get(), schemaMapBinary.get())) {
|
409
|
+
throw TypeError::New(Env(), errorStringFromStatus(_mongo_crypt.get()));
|
410
|
+
}
|
411
|
+
}
|
412
|
+
|
413
|
+
if (options.Has("encryptedFieldsMap")) {
|
414
|
+
Napi::Value encryptedFieldsMapBuffer = options["encryptedFieldsMap"];
|
415
|
+
|
416
|
+
if (!encryptedFieldsMapBuffer.IsBuffer()) {
|
417
|
+
throw TypeError::New(Env(), "Option `encryptedFieldsMap` must be a Buffer");
|
418
|
+
}
|
419
|
+
|
420
|
+
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter> encryptedFieldsMapBinary(
|
421
|
+
BufferToBinary(encryptedFieldsMapBuffer.As<Uint8Array>()));
|
422
|
+
if (!mongocrypt_setopt_encrypted_field_config_map(_mongo_crypt.get(), encryptedFieldsMapBinary.get())) {
|
423
|
+
throw TypeError::New(Env(), errorStringFromStatus(_mongo_crypt.get()));
|
424
|
+
}
|
425
|
+
}
|
426
|
+
|
427
|
+
if (options.Has("logger")) {
|
428
|
+
SetCallback("logger", options["logger"]);
|
429
|
+
if (!mongocrypt_setopt_log_handler(
|
430
|
+
_mongo_crypt.get(), MongoCrypt::logHandler, this)) {
|
431
|
+
throw TypeError::New(Env(), errorStringFromStatus(_mongo_crypt.get()));
|
432
|
+
}
|
433
|
+
}
|
434
|
+
|
435
|
+
if (options.Has("cryptoCallbacks")) {
|
436
|
+
Object cryptoCallbacks = options.Get("cryptoCallbacks").ToObject();
|
437
|
+
|
438
|
+
SetCallback("aes256CbcEncryptHook", cryptoCallbacks["aes256CbcEncryptHook"]);
|
439
|
+
SetCallback("aes256CbcDecryptHook", cryptoCallbacks["aes256CbcDecryptHook"]);
|
440
|
+
SetCallback("aes256CtrEncryptHook", cryptoCallbacks["aes256CtrEncryptHook"]);
|
441
|
+
SetCallback("aes256CtrDecryptHook", cryptoCallbacks["aes256CtrDecryptHook"]);
|
442
|
+
SetCallback("randomHook", cryptoCallbacks["randomHook"]);
|
443
|
+
SetCallback("hmacSha512Hook", cryptoCallbacks["hmacSha512Hook"]);
|
444
|
+
SetCallback("hmacSha256Hook", cryptoCallbacks["hmacSha256Hook"]);
|
445
|
+
SetCallback("sha256Hook", cryptoCallbacks["sha256Hook"]);
|
446
|
+
SetCallback("signRsaSha256Hook", cryptoCallbacks["signRsaSha256Hook"]);
|
447
|
+
|
448
|
+
if (!setupCryptoHooks()) {
|
449
|
+
throw Error::New(Env(), "unable to configure crypto hooks");
|
450
|
+
}
|
451
|
+
}
|
452
|
+
|
453
|
+
if (options.Has("cryptSharedLibSearchPaths")) {
|
454
|
+
Napi::Value search_paths_v = options["cryptSharedLibSearchPaths"];
|
455
|
+
if (!search_paths_v.IsArray()) {
|
456
|
+
throw TypeError::New(Env(), "Option `cryptSharedLibSearchPaths` must be an array");
|
457
|
+
}
|
458
|
+
Array search_paths = search_paths_v.As<Array>();
|
459
|
+
for (uint32_t i = 0; i < search_paths.Length(); i++) {
|
460
|
+
mongocrypt_setopt_append_crypt_shared_lib_search_path(
|
461
|
+
_mongo_crypt.get(),
|
462
|
+
search_paths.Get(i).ToString().Utf8Value().c_str());
|
463
|
+
}
|
464
|
+
}
|
465
|
+
|
466
|
+
if (options.Has("cryptSharedLibPath")) {
|
467
|
+
mongocrypt_setopt_set_crypt_shared_lib_path_override(
|
468
|
+
_mongo_crypt.get(),
|
469
|
+
options.Get("cryptSharedLibPath").ToString().Utf8Value().c_str());
|
470
|
+
}
|
471
|
+
|
472
|
+
if (options.Get("bypassQueryAnalysis").ToBoolean()) {
|
473
|
+
mongocrypt_setopt_bypass_query_analysis(_mongo_crypt.get());
|
474
|
+
}
|
475
|
+
|
476
|
+
mongocrypt_setopt_use_need_kms_credentials_state(_mongo_crypt.get());
|
477
|
+
|
478
|
+
// Initialize after all options are set.
|
479
|
+
if (!mongocrypt_init(_mongo_crypt.get())) {
|
480
|
+
throw TypeError::New(Env(), errorStringFromStatus(_mongo_crypt.get()));
|
481
|
+
}
|
482
|
+
}
|
483
|
+
|
484
|
+
Value MongoCrypt::CryptSharedLibVersionInfo(const CallbackInfo& info) {
|
485
|
+
uint64_t version_numeric = mongocrypt_crypt_shared_lib_version(_mongo_crypt.get());
|
486
|
+
const char* version_string = mongocrypt_crypt_shared_lib_version_string(_mongo_crypt.get(), nullptr);
|
487
|
+
if (version_string == nullptr) {
|
488
|
+
return Env().Null();
|
489
|
+
}
|
490
|
+
|
491
|
+
Object ret = Object::New(Env());
|
492
|
+
ret["version"] = BigInt::New(Env(), version_numeric);
|
493
|
+
ret["versionStr"] = String::New(Env(), version_string);
|
494
|
+
return ret;
|
495
|
+
}
|
496
|
+
|
497
|
+
Value MongoCrypt::Status(const CallbackInfo& info) {
|
498
|
+
std::unique_ptr<mongocrypt_status_t, MongoCryptStatusDeleter> status(mongocrypt_status_new());
|
499
|
+
mongocrypt_status(_mongo_crypt.get(), status.get());
|
500
|
+
return ExtractStatus(Env(), status.get());
|
501
|
+
}
|
502
|
+
|
503
|
+
Value MongoCrypt::MakeEncryptionContext(const CallbackInfo& info) {
|
504
|
+
std::string ns = info[0].ToString();
|
505
|
+
std::unique_ptr<mongocrypt_ctx_t, MongoCryptContextDeleter> context(
|
506
|
+
mongocrypt_ctx_new(_mongo_crypt.get()));
|
507
|
+
|
508
|
+
Napi::Value commandBuffer = info[1];
|
509
|
+
if (!commandBuffer.IsBuffer()) {
|
510
|
+
throw TypeError::New(Env(), "Parameter `command` must be a Buffer");
|
511
|
+
}
|
512
|
+
|
513
|
+
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter> binaryCommand(BufferToBinary(commandBuffer.As<Uint8Array>()));
|
514
|
+
if (!mongocrypt_ctx_encrypt_init(
|
515
|
+
context.get(), ns.c_str(), ns.size(), binaryCommand.get())) {
|
516
|
+
throw TypeError::New(Env(), errorStringFromStatus(context.get()));
|
517
|
+
}
|
518
|
+
|
519
|
+
return MongoCryptContext::NewInstance(Env(), std::move(context));
|
520
|
+
}
|
521
|
+
|
522
|
+
Value MongoCrypt::MakeExplicitEncryptionContext(const CallbackInfo& info) {
|
523
|
+
std::unique_ptr<mongocrypt_ctx_t, MongoCryptContextDeleter> context(
|
524
|
+
mongocrypt_ctx_new(_mongo_crypt.get()));
|
525
|
+
|
526
|
+
Napi::Value valueBuffer = info[0];
|
527
|
+
if (!valueBuffer.IsBuffer()) {
|
528
|
+
throw TypeError::New(Env(), "Parameter `value` must be a Buffer");
|
529
|
+
}
|
530
|
+
|
531
|
+
if (info.Length() > 1) {
|
532
|
+
Object options = info[1].ToObject();
|
533
|
+
|
534
|
+
if (options.Has("keyId")) {
|
535
|
+
Napi::Value keyId = options["keyId"];
|
536
|
+
|
537
|
+
if (!keyId.IsBuffer()) {
|
538
|
+
throw TypeError::New(Env(), "`keyId` must be a Buffer");
|
539
|
+
}
|
540
|
+
|
541
|
+
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter> binary(BufferToBinary(keyId.As<Uint8Array>()));
|
542
|
+
if (!mongocrypt_ctx_setopt_key_id(context.get(), binary.get())) {
|
543
|
+
throw TypeError::New(Env(), errorStringFromStatus(context.get()));
|
544
|
+
}
|
545
|
+
}
|
546
|
+
|
547
|
+
if (options.Has("keyAltName")) {
|
548
|
+
Napi::Value keyAltName = options["keyAltName"];
|
549
|
+
|
550
|
+
if (!keyAltName.IsBuffer()) {
|
551
|
+
throw TypeError::New(Env(), "`keyAltName` must be a Buffer");
|
552
|
+
}
|
553
|
+
|
554
|
+
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter> binary(
|
555
|
+
BufferToBinary(keyAltName.As<Uint8Array>()));
|
556
|
+
if (!mongocrypt_ctx_setopt_key_alt_name(context.get(), binary.get())) {
|
557
|
+
throw TypeError::New(Env(), errorStringFromStatus(context.get()));
|
558
|
+
}
|
559
|
+
}
|
560
|
+
|
561
|
+
if (options.Has("algorithm")) {
|
562
|
+
std::string algorithm = options.Get("algorithm").ToString();
|
563
|
+
if (!mongocrypt_ctx_setopt_algorithm(
|
564
|
+
context.get(), algorithm.c_str(), algorithm.size())) {
|
565
|
+
throw TypeError::New(Env(), errorStringFromStatus(context.get()));
|
566
|
+
}
|
567
|
+
}
|
568
|
+
|
569
|
+
if (options.Has("contentionFactor")) {
|
570
|
+
Napi::Value contention_factor_value = options["contentionFactor"];
|
571
|
+
int64_t contention_factor = contention_factor_value.IsBigInt() ?
|
572
|
+
contention_factor_value.As<BigInt>().Int64Value(nullptr) :
|
573
|
+
contention_factor_value.ToNumber().Int64Value();
|
574
|
+
if (!mongocrypt_ctx_setopt_contention_factor(context.get(), contention_factor)) {
|
575
|
+
throw TypeError::New(Env(), errorStringFromStatus(context.get()));
|
576
|
+
}
|
577
|
+
}
|
578
|
+
|
579
|
+
if (options.Has("queryType")) {
|
580
|
+
std::string query_type_str = options.Get("queryType").ToString();
|
581
|
+
if (!mongocrypt_ctx_setopt_query_type(context.get(), query_type_str.data(), -1)) {
|
582
|
+
throw TypeError::New(Env(), errorStringFromStatus(context.get()));
|
583
|
+
}
|
584
|
+
}
|
585
|
+
}
|
586
|
+
|
587
|
+
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter> binaryValue(BufferToBinary(valueBuffer.As<Uint8Array>()));
|
588
|
+
if (!mongocrypt_ctx_explicit_encrypt_init(context.get(), binaryValue.get())) {
|
589
|
+
throw TypeError::New(Env(), errorStringFromStatus(context.get()));
|
590
|
+
}
|
591
|
+
|
592
|
+
return MongoCryptContext::NewInstance(Env(), std::move(context));
|
593
|
+
}
|
594
|
+
|
595
|
+
Value MongoCrypt::MakeDecryptionContext(const CallbackInfo& info) {
|
596
|
+
if (!info[0].IsBuffer()) {
|
597
|
+
throw TypeError::New(Env(), "First parameter must be a Buffer");
|
598
|
+
}
|
599
|
+
|
600
|
+
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter> binary(
|
601
|
+
BufferToBinary(info[0].As<Uint8Array>()));
|
602
|
+
std::unique_ptr<mongocrypt_ctx_t, MongoCryptContextDeleter> context(
|
603
|
+
mongocrypt_ctx_new(_mongo_crypt.get()));
|
604
|
+
|
605
|
+
if (!mongocrypt_ctx_decrypt_init(context.get(), binary.get())) {
|
606
|
+
throw TypeError::New(Env(), errorStringFromStatus(context.get()));
|
607
|
+
}
|
608
|
+
|
609
|
+
return MongoCryptContext::NewInstance(Env(), std::move(context));
|
610
|
+
}
|
611
|
+
|
612
|
+
Value MongoCrypt::MakeExplicitDecryptionContext(const CallbackInfo& info) {
|
613
|
+
if (!info[0].IsBuffer()) {
|
614
|
+
throw TypeError::New(Env(), "First parameter must be a Buffer");
|
615
|
+
}
|
616
|
+
|
617
|
+
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter> binary(
|
618
|
+
BufferToBinary(info[0].As<Uint8Array>()));
|
619
|
+
std::unique_ptr<mongocrypt_ctx_t, MongoCryptContextDeleter> context(
|
620
|
+
mongocrypt_ctx_new(_mongo_crypt.get()));
|
621
|
+
|
622
|
+
if (!mongocrypt_ctx_explicit_decrypt_init(context.get(), binary.get())) {
|
623
|
+
throw TypeError::New(Env(), errorStringFromStatus(context.get()));
|
624
|
+
}
|
625
|
+
|
626
|
+
return MongoCryptContext::NewInstance(Env(), std::move(context));
|
627
|
+
}
|
628
|
+
|
629
|
+
Value MongoCrypt::MakeDataKeyContext(const CallbackInfo& info) {
|
630
|
+
Napi::Value optionsBuffer = info[0];
|
631
|
+
if (!optionsBuffer.IsBuffer()) {
|
632
|
+
throw TypeError::New(Env(), "Parameter `options` must be a Buffer");
|
633
|
+
}
|
634
|
+
|
635
|
+
std::unique_ptr<mongocrypt_ctx_t, MongoCryptContextDeleter> context(
|
636
|
+
mongocrypt_ctx_new(_mongo_crypt.get()));
|
637
|
+
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter> binary(
|
638
|
+
BufferToBinary(optionsBuffer.As<Uint8Array>()));
|
639
|
+
|
640
|
+
if (!mongocrypt_ctx_setopt_key_encryption_key(context.get(), binary.get())) {
|
641
|
+
throw TypeError::New(Env(), errorStringFromStatus(context.get()));
|
642
|
+
}
|
643
|
+
|
644
|
+
Object options = info[1].ToObject();
|
645
|
+
if (options.Has("keyAltNames")) {
|
646
|
+
Napi::Value keyAltNames = options["keyAltNames"];
|
647
|
+
|
648
|
+
if (keyAltNames.IsArray()) {
|
649
|
+
Array keyAltNamesArray = keyAltNames.As<Array>();
|
650
|
+
uint32_t keyAltNamesLength = keyAltNamesArray.Length();
|
651
|
+
for (uint32_t i = 0; i < keyAltNamesLength; i += 1) {
|
652
|
+
if (keyAltNamesArray.Has(i)) {
|
653
|
+
Napi::Value keyAltName = keyAltNamesArray[i];
|
654
|
+
if (!keyAltName.IsBuffer()) {
|
655
|
+
// We should never get here
|
656
|
+
throw TypeError::New(Env(), "Serialized keyAltName must be a Buffer");
|
657
|
+
}
|
658
|
+
|
659
|
+
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter> binary(
|
660
|
+
BufferToBinary(keyAltName.As<Uint8Array>()));
|
661
|
+
if (!mongocrypt_ctx_setopt_key_alt_name(context.get(), binary.get())) {
|
662
|
+
throw TypeError::New(Env(), errorStringFromStatus(context.get()));
|
663
|
+
}
|
664
|
+
}
|
665
|
+
}
|
666
|
+
}
|
667
|
+
}
|
668
|
+
|
669
|
+
if (options.Has("keyMaterial")) {
|
670
|
+
Napi::Value keyMaterial = options["keyMaterial"];
|
671
|
+
|
672
|
+
if (!keyMaterial.IsUndefined()) {
|
673
|
+
if (!keyMaterial.IsBuffer()) {
|
674
|
+
// We should never get here
|
675
|
+
throw TypeError::New(Env(), "Serialized keyMaterial must be a Buffer");
|
676
|
+
}
|
677
|
+
|
678
|
+
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter> binary(
|
679
|
+
BufferToBinary(keyMaterial.As<Uint8Array>()));
|
680
|
+
if (!mongocrypt_ctx_setopt_key_material(context.get(), binary.get())) {
|
681
|
+
throw TypeError::New(Env(), errorStringFromStatus(context.get()));
|
682
|
+
}
|
683
|
+
}
|
684
|
+
}
|
685
|
+
|
686
|
+
if (!mongocrypt_ctx_datakey_init(context.get())) {
|
687
|
+
throw TypeError::New(Env(), errorStringFromStatus(context.get()));
|
688
|
+
}
|
689
|
+
|
690
|
+
return MongoCryptContext::NewInstance(Env(), std::move(context));
|
691
|
+
}
|
692
|
+
|
693
|
+
Value MongoCrypt::MakeRewrapManyDataKeyContext(const CallbackInfo& info) {
|
694
|
+
Napi::Value filter_buffer = info[0];
|
695
|
+
if (!filter_buffer.IsBuffer()) {
|
696
|
+
throw TypeError::New(Env(), "Parameter `options` must be a Buffer");
|
697
|
+
}
|
698
|
+
|
699
|
+
std::unique_ptr<mongocrypt_ctx_t, MongoCryptContextDeleter> context(
|
700
|
+
mongocrypt_ctx_new(_mongo_crypt.get()));
|
701
|
+
|
702
|
+
Napi::Value key_encryption_key = info[1];
|
703
|
+
if (key_encryption_key.IsBuffer()) {
|
704
|
+
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter> key_binary(
|
705
|
+
BufferToBinary(key_encryption_key.As<Uint8Array>()));
|
706
|
+
if (!mongocrypt_ctx_setopt_key_encryption_key(context.get(), key_binary.get())) {
|
707
|
+
throw TypeError::New(Env(), errorStringFromStatus(context.get()));
|
708
|
+
}
|
709
|
+
}
|
710
|
+
|
711
|
+
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter> filter_binary(
|
712
|
+
BufferToBinary(filter_buffer.As<Uint8Array>()));
|
713
|
+
if (!mongocrypt_ctx_rewrap_many_datakey_init(context.get(), filter_binary.get())) {
|
714
|
+
throw TypeError::New(Env(), errorStringFromStatus(context.get()));
|
715
|
+
}
|
716
|
+
|
717
|
+
return MongoCryptContext::NewInstance(Env(), std::move(context));
|
718
|
+
}
|
719
|
+
|
720
|
+
// Store callbacks as nested properties on the MongoCrypt binding object
|
721
|
+
// itself, and use these helpers to do so. Storing them as JS engine
|
722
|
+
// References is a big memory leak footgun.
|
723
|
+
Function MongoCrypt::GetCallback(const char* name) {
|
724
|
+
Napi::Value storage = Value().Get("__callbackStorage");
|
725
|
+
if (!storage.IsObject()) {
|
726
|
+
throw Error::New(Env(), "Cannot get callbacks becauses none were registered");
|
727
|
+
}
|
728
|
+
Napi::Value entry = storage.As<Object>().Get(name);
|
729
|
+
if (!entry.IsFunction()) {
|
730
|
+
throw Error::New(Env(), std::string("Trying to look up unknown callback ") + name);
|
731
|
+
}
|
732
|
+
return entry.As<Function>();
|
733
|
+
}
|
734
|
+
|
735
|
+
void MongoCrypt::SetCallback(const char* name, Napi::Value fn) {
|
736
|
+
if (!fn.IsFunction()) {
|
737
|
+
throw Error::New(Env(), std::string("Storing non-function as callback ") + name);
|
738
|
+
}
|
739
|
+
|
740
|
+
Napi::Value storage = Value().Get("__callbackStorage");
|
741
|
+
if (!storage.IsObject()) {
|
742
|
+
storage = Object::New(Env());
|
743
|
+
Value().Set("__callbackStorage", storage);
|
744
|
+
}
|
745
|
+
storage.As<Object>().Set(name, fn);
|
746
|
+
}
|
747
|
+
|
748
|
+
Function MongoCryptContext::Init(Napi::Env env) {
|
749
|
+
return
|
750
|
+
DefineClass(env,
|
751
|
+
"MongoCryptContext",
|
752
|
+
{
|
753
|
+
InstanceMethod("nextMongoOperation", &MongoCryptContext::NextMongoOperation),
|
754
|
+
InstanceMethod("addMongoOperationResponse", &MongoCryptContext::AddMongoOperationResponse),
|
755
|
+
InstanceMethod("finishMongoOperation", &MongoCryptContext::FinishMongoOperation),
|
756
|
+
InstanceMethod("nextKMSRequest", &MongoCryptContext::NextKMSRequest),
|
757
|
+
InstanceMethod("provideKMSProviders", &MongoCryptContext::ProvideKMSProviders),
|
758
|
+
InstanceMethod("finishKMSRequests", &MongoCryptContext::FinishKMSRequests),
|
759
|
+
InstanceMethod("finalize", &MongoCryptContext::FinalizeContext),
|
760
|
+
InstanceAccessor("status", &MongoCryptContext::Status, nullptr),
|
761
|
+
InstanceAccessor("state", &MongoCryptContext::State, nullptr)
|
762
|
+
});
|
763
|
+
}
|
764
|
+
|
765
|
+
Object MongoCryptContext::NewInstance(Napi::Env env, std::unique_ptr<mongocrypt_ctx_t, MongoCryptContextDeleter> context) {
|
766
|
+
InstanceData* instance_data = env.GetInstanceData<InstanceData>();
|
767
|
+
Object obj = instance_data->MongoCryptContextCtor.Value().New({});
|
768
|
+
MongoCryptContext* instance = MongoCryptContext::Unwrap(obj);
|
769
|
+
instance->_context = std::move(context);
|
770
|
+
return obj;
|
771
|
+
}
|
772
|
+
|
773
|
+
MongoCryptContext::MongoCryptContext(const CallbackInfo& info)
|
774
|
+
: ObjectWrap(info) {}
|
775
|
+
|
776
|
+
Value MongoCryptContext::Status(const CallbackInfo& info) {
|
777
|
+
std::unique_ptr<mongocrypt_status_t, MongoCryptStatusDeleter> status(mongocrypt_status_new());
|
778
|
+
mongocrypt_ctx_status(_context.get(), status.get());
|
779
|
+
return ExtractStatus(Env(), status.get());
|
780
|
+
}
|
781
|
+
|
782
|
+
Value MongoCryptContext::State(const CallbackInfo& info) {
|
783
|
+
return Number::New(Env(), mongocrypt_ctx_state(_context.get()));
|
784
|
+
}
|
785
|
+
|
786
|
+
Value MongoCryptContext::NextMongoOperation(const CallbackInfo& info) {
|
787
|
+
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter> op_bson(mongocrypt_binary_new());
|
788
|
+
mongocrypt_ctx_mongo_op(_context.get(), op_bson.get());
|
789
|
+
return BufferFromBinary(Env(), op_bson.get());
|
790
|
+
}
|
791
|
+
|
792
|
+
void MongoCryptContext::AddMongoOperationResponse(const CallbackInfo& info) {
|
793
|
+
if (info.Length() != 1 || !info[0].IsObject()) {
|
794
|
+
throw TypeError::New(Env(), "Missing required parameter `buffer`");
|
795
|
+
}
|
796
|
+
|
797
|
+
if (!info[0].IsBuffer()) {
|
798
|
+
throw TypeError::New(Env(), "First parameter must be a Buffer");
|
799
|
+
}
|
800
|
+
|
801
|
+
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter> reply_bson(
|
802
|
+
BufferToBinary(info[0].As<Uint8Array>()));
|
803
|
+
mongocrypt_ctx_mongo_feed(_context.get(), reply_bson.get());
|
804
|
+
// return value
|
805
|
+
}
|
806
|
+
|
807
|
+
void MongoCryptContext::FinishMongoOperation(const CallbackInfo& info) {
|
808
|
+
mongocrypt_ctx_mongo_done(_context.get());
|
809
|
+
}
|
810
|
+
|
811
|
+
void MongoCryptContext::ProvideKMSProviders(const CallbackInfo& info) {
|
812
|
+
if (info.Length() != 1 || !info[0].IsObject()) {
|
813
|
+
throw TypeError::New(Env(), "Missing required parameter `buffer`");
|
814
|
+
}
|
815
|
+
|
816
|
+
if (!info[0].IsBuffer()) {
|
817
|
+
throw TypeError::New(Env(), "First parameter must be a Buffer");
|
818
|
+
}
|
819
|
+
|
820
|
+
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter> kms_bson(
|
821
|
+
BufferToBinary(info[0].As<Uint8Array>()));
|
822
|
+
mongocrypt_ctx_provide_kms_providers(_context.get(), kms_bson.get());
|
823
|
+
}
|
824
|
+
|
825
|
+
Value MongoCryptContext::NextKMSRequest(const CallbackInfo& info) {
|
826
|
+
mongocrypt_kms_ctx_t* kms_context = mongocrypt_ctx_next_kms_ctx(_context.get());
|
827
|
+
if (kms_context == nullptr) {
|
828
|
+
return Env().Null();
|
829
|
+
} else {
|
830
|
+
Object result = MongoCryptKMSRequest::NewInstance(Env(), kms_context);
|
831
|
+
// The lifetime of the `kms_context` pointer is not specified
|
832
|
+
// anywhere, so it seems reasonable to assume that it is at
|
833
|
+
// least the lifetime of this context object.
|
834
|
+
// Use a symbol to enforce that lifetime dependency.
|
835
|
+
result.Set("__kmsRequestContext", Value());
|
836
|
+
return result;
|
837
|
+
}
|
838
|
+
}
|
839
|
+
|
840
|
+
void MongoCryptContext::FinishKMSRequests(const CallbackInfo& info) {
|
841
|
+
mongocrypt_ctx_kms_done(_context.get());
|
842
|
+
}
|
843
|
+
|
844
|
+
Value MongoCryptContext::FinalizeContext(const CallbackInfo& info) {
|
845
|
+
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter> output(mongocrypt_binary_new());
|
846
|
+
mongocrypt_ctx_finalize(_context.get(), output.get());
|
847
|
+
return BufferFromBinary(Env(), output.get());
|
848
|
+
}
|
849
|
+
|
850
|
+
Function MongoCryptKMSRequest::Init(Napi::Env env) {
|
851
|
+
return
|
852
|
+
DefineClass(env,
|
853
|
+
"MongoCryptKMSRequest",
|
854
|
+
{
|
855
|
+
InstanceMethod("addResponse", &MongoCryptKMSRequest::AddResponse),
|
856
|
+
InstanceAccessor("status", &MongoCryptKMSRequest::Status, nullptr),
|
857
|
+
InstanceAccessor("bytesNeeded", &MongoCryptKMSRequest::BytesNeeded, nullptr),
|
858
|
+
InstanceAccessor("kmsProvider", &MongoCryptKMSRequest::KMSProvider, nullptr),
|
859
|
+
InstanceAccessor("endpoint", &MongoCryptKMSRequest::Endpoint, nullptr),
|
860
|
+
InstanceAccessor("message", &MongoCryptKMSRequest::Message, nullptr)
|
861
|
+
});
|
862
|
+
}
|
863
|
+
|
864
|
+
Object MongoCryptKMSRequest::NewInstance(Napi::Env env, mongocrypt_kms_ctx_t* kms_context) {
|
865
|
+
InstanceData* instance_data = env.GetInstanceData<InstanceData>();
|
866
|
+
Object obj = instance_data->MongoCryptKMSRequestCtor.Value().New({});
|
867
|
+
MongoCryptKMSRequest* instance = MongoCryptKMSRequest::Unwrap(obj);
|
868
|
+
instance->_kms_context = kms_context;
|
869
|
+
return obj;
|
870
|
+
}
|
871
|
+
|
872
|
+
MongoCryptKMSRequest::MongoCryptKMSRequest(const CallbackInfo& info)
|
873
|
+
: ObjectWrap(info), _kms_context(nullptr) {}
|
874
|
+
|
875
|
+
Value MongoCryptKMSRequest::Status(const CallbackInfo& info) {
|
876
|
+
std::unique_ptr<mongocrypt_status_t, MongoCryptStatusDeleter> status(mongocrypt_status_new());
|
877
|
+
mongocrypt_kms_ctx_status(_kms_context, status.get());
|
878
|
+
return ExtractStatus(Env(), status.get());
|
879
|
+
}
|
880
|
+
|
881
|
+
Value MongoCryptKMSRequest::BytesNeeded(const CallbackInfo& info) {
|
882
|
+
return Number::New(Env(), mongocrypt_kms_ctx_bytes_needed(_kms_context));
|
883
|
+
}
|
884
|
+
|
885
|
+
Value MongoCryptKMSRequest::KMSProvider(const CallbackInfo& info) {
|
886
|
+
return String::New(Env(), mongocrypt_kms_ctx_get_kms_provider(_kms_context, nullptr));
|
887
|
+
}
|
888
|
+
|
889
|
+
Value MongoCryptKMSRequest::Message(const CallbackInfo& info) {
|
890
|
+
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter> message(mongocrypt_binary_new());
|
891
|
+
mongocrypt_kms_ctx_message(_kms_context, message.get());
|
892
|
+
return BufferFromBinary(Env(), message.get());
|
893
|
+
}
|
894
|
+
|
895
|
+
Value MongoCryptKMSRequest::Endpoint(const CallbackInfo& info) {
|
896
|
+
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter> message(mongocrypt_binary_new());
|
897
|
+
|
898
|
+
const char* endpoint;
|
899
|
+
mongocrypt_kms_ctx_endpoint(_kms_context, &endpoint);
|
900
|
+
return String::New(Env(), endpoint);
|
901
|
+
}
|
902
|
+
|
903
|
+
void MongoCryptKMSRequest::AddResponse(const CallbackInfo& info) {
|
904
|
+
if (!info[0].IsBuffer()) {
|
905
|
+
throw TypeError::New(Env(), "First parameter must be of type Buffer");
|
906
|
+
}
|
907
|
+
|
908
|
+
std::unique_ptr<mongocrypt_binary_t, MongoCryptBinaryDeleter> reply_bytes(
|
909
|
+
BufferToBinary(info[0].As<Uint8Array>()));
|
910
|
+
mongocrypt_kms_ctx_feed(_kms_context, reply_bytes.get());
|
911
|
+
}
|
912
|
+
|
913
|
+
static Object Init(Env env, Object exports) {
|
914
|
+
Function MongoCryptCtor = MongoCrypt::Init(env);
|
915
|
+
Function MongoCryptContextCtor = MongoCryptContext::Init(env);
|
916
|
+
Function MongoCryptKMSRequestCtor = MongoCryptKMSRequest::Init(env);
|
917
|
+
exports["MongoCrypt"] = MongoCryptCtor;
|
918
|
+
exports["MongoCryptContextCtor"] = MongoCryptContextCtor;
|
919
|
+
exports["MongoCryptKMSRequestCtor"] = MongoCryptKMSRequestCtor;
|
920
|
+
env.SetInstanceData(new InstanceData {
|
921
|
+
Reference<Function>::New(MongoCryptContextCtor, 1),
|
922
|
+
Reference<Function>::New(MongoCryptKMSRequestCtor, 1)
|
923
|
+
});
|
924
|
+
return exports;
|
925
|
+
}
|
926
|
+
|
927
|
+
NODE_API_MODULE(mongocrypt, Init)
|
928
|
+
|
929
|
+
} // namespace node_mongocrypt
|