libmongocrypt-helper 1.7.4.0.1002 → 1.8.0.0.1001
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/libmongocrypt/CHANGELOG.md +9 -7
- data/ext/libmongocrypt/libmongocrypt/CMakeLists.txt +17 -23
- data/ext/libmongocrypt/libmongocrypt/Earthfile +374 -0
- data/ext/libmongocrypt/libmongocrypt/README.md +7 -7
- data/ext/libmongocrypt/libmongocrypt/VERSION_CURRENT +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptClient.cs +25 -6
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/Library.cs +25 -3
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Example/MongoDB.Libmongocrypt.Example.csproj +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/BasicTests.cs +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.cake +3 -2
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/cs.sln +79 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/build.gradle.kts +2 -2
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/java/com/mongodb/crypt/capi/MongoCryptTest.java +6 -4
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit-v2/int32/encrypted-payload.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/CHANGELOG.md +24 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/README.md +134 -5
- data/ext/libmongocrypt/libmongocrypt/bindings/node/etc/build-static.sh +3 -6
- data/ext/libmongocrypt/libmongocrypt/bindings/node/index.d.ts +203 -77
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/autoEncrypter.js +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/clientEncryption.js +165 -43
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/common.js +12 -14
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/errors.js +75 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/index.js +34 -3
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/aws.js +26 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/azure.js +178 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/gcp.js +24 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/index.js +54 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/providers/utils.js +39 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/stateMachine.js +9 -4
- data/ext/libmongocrypt/libmongocrypt/bindings/node/package-lock.json +4440 -5189
- data/ext/libmongocrypt/libmongocrypt/bindings/node/package.json +27 -8
- data/ext/libmongocrypt/libmongocrypt/bindings/node/src/mongocrypt.cc +65 -38
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/autoEncrypter.test.js +4 -7
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/clientEncryption.test.js +434 -42
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/common.test.js +94 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/cryptoCallbacks.test.js +1 -45
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/index.test.js +45 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/mongocryptdManager.test.js +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/providers/credentialsProvider.test.js +551 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/release.test.js +10 -3
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/requirements.helper.js +23 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/stateMachine.test.js +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/tools/chai-addons.js +8 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/types/index.test-d.ts +63 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/CHANGELOG.rst +26 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/README.rst +2 -2
- data/ext/libmongocrypt/libmongocrypt/bindings/python/build-manylinux-wheel.sh +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/binding.py +128 -238
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/compat.py +0 -27
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/explicit_encrypter.py +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/mongocrypt.py +5 -21
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/version.py +2 -2
- data/ext/libmongocrypt/libmongocrypt/bindings/python/release.sh +5 -5
- data/ext/libmongocrypt/libmongocrypt/bindings/python/setup.py +14 -9
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/__init__.py +1 -10
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-range-explicit-v2/int32/encrypted-payload.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_mongocrypt.py +5 -5
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test-requirements.txt +4 -12
- data/ext/libmongocrypt/libmongocrypt/cmake/ImportBSON.cmake +8 -6
- data/ext/libmongocrypt/libmongocrypt/cmake/IntelDFP.cmake +2 -1
- data/ext/libmongocrypt/libmongocrypt/cmake/Platform.cmake +50 -0
- data/ext/libmongocrypt/libmongocrypt/cmake/mongocrypt-config.cmake +21 -0
- data/ext/libmongocrypt/libmongocrypt/debian/gbp.conf +2 -2
- data/ext/libmongocrypt/libmongocrypt/etc/c6-vault.repo +39 -0
- data/ext/libmongocrypt/libmongocrypt/etc/fle2_aead_generate_tests.py +15 -24
- data/ext/libmongocrypt/libmongocrypt/etc/fle2_crypto.py +66 -54
- data/ext/libmongocrypt/libmongocrypt/etc/fle2_generate_tests.py +14 -23
- data/ext/libmongocrypt/libmongocrypt/etc/fle2v2_aead_generate_tests.py +32 -0
- data/ext/libmongocrypt/libmongocrypt/etc/format-all.sh +12 -0
- data/ext/libmongocrypt/libmongocrypt/etc/format.sh +16 -0
- data/ext/libmongocrypt/libmongocrypt/etc/install-package.sh +48 -0
- data/ext/libmongocrypt/libmongocrypt/etc/mongo-inteldfp-libmongocrypt-pr-625.patch +13 -0
- data/ext/libmongocrypt/libmongocrypt/src/crypto/cng.c +381 -436
- data/ext/libmongocrypt/libmongocrypt/src/crypto/commoncrypto.c +162 -227
- data/ext/libmongocrypt/libmongocrypt/src/crypto/libcrypto.c +180 -248
- data/ext/libmongocrypt/libmongocrypt/src/crypto/none.c +33 -55
- data/ext/libmongocrypt/libmongocrypt/src/csfle-markup.cpp +175 -205
- data/ext/libmongocrypt/libmongocrypt/src/mc-array-private.h +10 -21
- data/ext/libmongocrypt/libmongocrypt/src/mc-array.c +44 -56
- data/ext/libmongocrypt/libmongocrypt/src/mc-check-conversions-private.h +4 -8
- data/ext/libmongocrypt/libmongocrypt/src/mc-dec128.h +351 -463
- data/ext/libmongocrypt/libmongocrypt/src/mc-dec128.test.cpp +59 -66
- data/ext/libmongocrypt/libmongocrypt/src/mc-efc-private.h +7 -11
- data/ext/libmongocrypt/libmongocrypt/src/mc-efc.c +80 -92
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle-blob-subtype-private.h +18 -10
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder-private.h +59 -70
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder.c +384 -439
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-private-v2.h +41 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-private.h +11 -18
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-v2.c +135 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload.c +109 -126
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-private-v2.h +88 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-private.h +24 -27
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-v2.c +137 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload.c +106 -125
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-private-v2.h +117 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-private.h +28 -36
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-v2.c +294 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload.c +237 -278
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev-private-v2.h +133 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev-private.h +67 -56
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev-v2.c +437 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev.c +476 -325
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-common-private.h +69 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-common.c +182 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-private.h +23 -31
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-v2-private.h +85 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-v2.c +142 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev.c +104 -231
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-range-operator-private.h +8 -7
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-rfds-private.h +55 -56
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-rfds.c +517 -580
- data/ext/libmongocrypt/libmongocrypt/src/mc-optional-private.h +36 -66
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-edge-generation-private.h +57 -76
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-edge-generation.c +158 -189
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-encoding-private.h +36 -42
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-encoding.c +515 -558
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover-generator.template.h +155 -191
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover-private.h +43 -53
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover.c +170 -240
- data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts-private.h +29 -34
- data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts.c +289 -338
- data/ext/libmongocrypt/libmongocrypt/src/mc-reader-private.h +36 -71
- data/ext/libmongocrypt/libmongocrypt/src/mc-reader.c +111 -164
- data/ext/libmongocrypt/libmongocrypt/src/mc-tokens-private.h +55 -49
- data/ext/libmongocrypt/libmongocrypt/src/mc-tokens.c +109 -125
- data/ext/libmongocrypt/libmongocrypt/src/mc-writer-private.h +66 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-writer.c +141 -0
- data/ext/libmongocrypt/libmongocrypt/src/mlib/check.hpp +37 -55
- data/ext/libmongocrypt/libmongocrypt/src/mlib/endian.h +11 -11
- data/ext/libmongocrypt/libmongocrypt/src/mlib/error.h +27 -32
- data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.h +444 -499
- data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.test.cpp +251 -334
- data/ext/libmongocrypt/libmongocrypt/src/mlib/macros.h +4 -5
- data/ext/libmongocrypt/libmongocrypt/src/mlib/path.h +196 -231
- data/ext/libmongocrypt/libmongocrypt/src/mlib/path.test.c +56 -79
- data/ext/libmongocrypt/libmongocrypt/src/mlib/str.h +411 -530
- data/ext/libmongocrypt/libmongocrypt/src/mlib/str.test.c +116 -131
- data/ext/libmongocrypt/libmongocrypt/src/mlib/thread.h +17 -26
- data/ext/libmongocrypt/libmongocrypt/src/mlib/user-check.h +2 -2
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-binary-private.h +3 -6
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-binary.c +31 -48
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-buffer-private.h +55 -131
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-buffer.c +444 -565
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-collinfo-private.h +1 -2
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-collinfo.c +28 -45
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-key-private.h +11 -17
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-key.c +103 -132
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-oauth-private.h +8 -14
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-oauth.c +78 -90
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-private.h +26 -45
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache.c +220 -273
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ciphertext-private.h +13 -25
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ciphertext.c +147 -166
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-compat.h +2 -2
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-crypto-private.h +110 -204
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-crypto.c +1137 -1565
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-datakey.c +425 -472
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-decrypt.c +817 -694
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-encrypt.c +2394 -2697
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-private.h +166 -186
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-rewrap-many-datakey.c +308 -351
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx.c +921 -1138
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-dll-private.h +16 -24
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-endian-private.h +44 -58
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-endpoint-private.h +21 -25
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-endpoint.c +167 -181
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kek-private.h +37 -43
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kek.c +215 -253
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-broker-private.h +73 -108
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-broker.c +889 -1034
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-private.h +27 -44
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key.c +349 -402
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kms-ctx-private.h +92 -120
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kms-ctx.c +1397 -1612
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-log-private.h +35 -67
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-log.c +49 -83
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking-private.h +30 -36
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking.c +1821 -1470
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-mutex-private.h +7 -12
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts-private.h +80 -108
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts.c +354 -424
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-private.h +101 -117
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-status-private.h +3 -8
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-status.c +92 -119
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-traverse-util-private.h +19 -29
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-traverse-util.c +136 -176
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-util-private.h +11 -21
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-util.c +96 -135
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt.c +1092 -1320
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt.h +130 -295
- data/ext/libmongocrypt/libmongocrypt/src/os_posix/os_dll.c +66 -78
- data/ext/libmongocrypt/libmongocrypt/src/os_posix/os_mutex.c +20 -28
- data/ext/libmongocrypt/libmongocrypt/src/os_win/os_dll.c +60 -73
- data/ext/libmongocrypt/libmongocrypt/src/os_win/os_mutex.c +8 -16
- data/ext/libmongocrypt/libmongocrypt/test/crypt_shared-stub.cpp +57 -87
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/empty/encrypted-payload-v2.json +60 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/success/encrypted-payload-v2.json +67 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-csfle/encrypted-payload.json +2 -2
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/find-indexed-contentionFactor1-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/find-indexed-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/insert-indexed-contentionFactor1-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/insert-indexed-same-user-and-index-key-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/insert-indexed-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality-v2/cmd.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality-v2/encrypted-field-map.json +22 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality-v2/encrypted-payload.json +40 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality-v2/mongocryptd-reply.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/cmd.json +10 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/encrypted-payload.json +41 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/mongocryptd-reply.json +49 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/cmd.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/encrypted-field-map.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/encrypted-payload.json +50 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/mongocryptd-reply.json +58 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/cmd.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/encrypted-payload.json +41 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/mongocryptd-reply.json +49 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision-v2/cmd.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision-v2/encrypted-field-map.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision-v2/encrypted-payload.json +44 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision-v2/mongocryptd-reply.json +52 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/cmd.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/encrypted-payload.json +41 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/mongocryptd-reply.json +49 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/cmd.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/encrypted-payload.json +41 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/mongocryptd-reply.json +49 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/cmd.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/encrypted-payload.json +41 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/mongocryptd-reply.json +49 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double/encrypted-payload-v2.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double-precision/encrypted-payload-v2.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32/encrypted-payload-v2.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/encrypted-payload-v2.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-openinterval/encrypted-payload-v2.json +16 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert/cmd.json +1 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date/RNG_DATA.h +65 -65
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/cmd.json +13 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/encrypted-payload.json +44 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/mongocryptd-reply.json +52 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128/RNG_DATA.h +132 -132
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision/RNG_DATA.h +71 -71
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/cmd.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/encrypted-field-map.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/encrypted-payload.json +53 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/mongocryptd-reply.json +61 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/cmd.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/encrypted-payload.json +44 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/mongocryptd-reply.json +52 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double/RNG_DATA.h +68 -68
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision/RNG_DATA.h +19 -19
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision-v2/cmd.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision-v2/encrypted-field-map.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision-v2/encrypted-payload.json +47 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision-v2/mongocryptd-reply.json +55 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/cmd.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/encrypted-payload.json +44 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/mongocryptd-reply.json +52 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32/RNG_DATA.h +25 -25
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/cmd.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/encrypted-payload.json +44 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/mongocryptd-reply.json +52 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64/RNG_DATA.h +65 -65
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/cmd.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/encrypted-payload.json +44 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/mongocryptd-reply.json +52 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double/RNG_DATA.h +68 -68
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double/encrypted-payload-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double-precision/RNG_DATA.h +19 -19
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double-precision/encrypted-payload-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32/RNG_DATA.h +25 -25
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32/encrypted-payload-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/encrypted-payload-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/sparsity-2/RNG_DATA.h +15 -15
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/sparsity-2/encrypted-payload-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed-v2/cmd.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed-v2/encrypted-field-map.json +18 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed-v2/encrypted-payload.json +14 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed-v2/mongocryptd-reply.json +41 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-v2/cmd.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-v2/encrypted-field-map.json +22 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-v2/encrypted-payload.json +39 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-v2/mongocryptd-reply.json +49 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/iev-v2/FLECrudTest-insertOneRangeV2.json +10 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/iev-v2/FLECrudTest-insertOneV2.json +10 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/README.md +17 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/aes-ctr.json +29 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2-fixed.json +10 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2-generated.json +38 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2aead-decrypt.json +35 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2aead-fixed.json +29 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2aead-generated.json +122 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2v2-aead-fixed.json +29 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2v2-aead-generated.json +122 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/mcgrew.json +12 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/nist.json +20 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/tokens/README.md +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/tokens/mc.json +21 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/tokens/server.json +21 -0
- data/ext/libmongocrypt/libmongocrypt/test/example-no-bson.c +4 -4
- data/ext/libmongocrypt/libmongocrypt/test/example-state-machine.c +278 -323
- data/ext/libmongocrypt/libmongocrypt/test/fuzz_kms.c +8 -7
- data/ext/libmongocrypt/libmongocrypt/test/test-dll.cpp +6 -7
- data/ext/libmongocrypt/libmongocrypt/test/test-gcp-auth.c +221 -283
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-efc.c +58 -73
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-find-equality-payload-v2.c +78 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-find-range-payload-v2.c +89 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iev-v2.c +248 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iev.c +467 -414
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iup-v2.c +172 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iup.c +141 -159
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-uev-v2.c +338 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-uev.c +238 -176
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-rfds.c +373 -474
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-edge-generation.c +346 -388
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-encoding.c +708 -825
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-mincover.c +417 -481
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-rangeopts.c +110 -144
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-reader.c +124 -207
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-tokens.c +223 -213
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-writer.c +176 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert-match-bson.c +634 -807
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert-match-bson.h +1 -2
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert.h +168 -189
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-buffer.c +187 -211
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cache-oauth.c +34 -36
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cache.c +210 -233
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ciphertext.c +185 -220
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-compact.c +331 -445
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-hooks.c +670 -814
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-std-hooks.c +102 -135
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-std-hooks.h +54 -71
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto.c +394 -846
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-csfle-lib.c +159 -183
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-decrypt.c +867 -1045
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-encrypt.c +4349 -4713
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-rewrap-many-datakey.c +750 -964
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-setopt.c +991 -1178
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-datakey.c +342 -419
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-dll.c +23 -30
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-endpoint.c +98 -111
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kek.c +49 -52
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key-broker.c +770 -920
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key-cache.c +354 -407
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key.c +197 -245
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kms-ctx.c +286 -370
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kms-responses.c +147 -166
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-local-kms.c +50 -61
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-log.c +85 -100
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-marking.c +656 -692
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-status.c +46 -58
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-traverse-util.c +377 -451
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-util.c +48 -67
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-util.h +4 -10
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.c +827 -918
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.h +111 -172
- data/ext/libmongocrypt/libmongocrypt/test/util/csfle.c +508 -559
- data/ext/libmongocrypt/libmongocrypt/test/util/util.c +735 -881
- data/ext/libmongocrypt/libmongocrypt/test/util/util.h +33 -55
- data/lib/libmongocrypt_helper/version.rb +2 -2
- data.tar.gz.sig +0 -0
- metadata +154 -26
- metadata.gz.sig +0 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit/int32/encrypted-payload.json +0 -26
- 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/node/lib/credentialsProvider.js +0 -33
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/credentialsProvider.test.js +0 -163
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-range-explicit/int32/encrypted-payload.json +0 -26
- data/ext/libmongocrypt/libmongocrypt/test/data/aes-ctr.cstructs +0 -359
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-aead.cstructs +0 -109
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/encrypted-payload.json +0 -26
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/rangeopts.json +0 -5
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/value-to-encrypt.json +0 -20
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/RNG_DATA.h +0 -70
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/encrypted-payload.json +0 -8
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/rangeopts.json +0 -5
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/value-to-encrypt.json +0 -5
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2.cstructs +0 -33
- /data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/{fle2-find-range-explicit → fle2-find-range-explicit-v2}/int32/key-filter.json +0 -0
- /data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/{fle2-find-range-explicit → fle2-find-range-explicit-v2}/int32/rangeopts.json +0 -0
- /data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/{fle2-find-range-explicit → fle2-find-range-explicit-v2}/int32/value-to-encrypt.json +0 -0
- /data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/{fle2-find-range-explicit → fle2-find-range-explicit-v2}/int32/rangeopts.json +0 -0
- /data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/{fle2-find-range-explicit → fle2-find-range-explicit-v2}/int32/value-to-encrypt.json +0 -0
@@ -17,181 +17,165 @@
|
|
17
17
|
#ifndef MONGOCRYPT_PRIVATE_H
|
18
18
|
#define MONGOCRYPT_PRIVATE_H
|
19
19
|
|
20
|
-
#include "mongocrypt.h"
|
21
|
-
#include "mongocrypt-config.h"
|
22
20
|
#include "bson/bson.h"
|
21
|
+
#include "mongocrypt-config.h"
|
22
|
+
#include "mongocrypt.h"
|
23
23
|
|
24
|
-
#include "mongocrypt-dll-private.h"
|
25
|
-
#include "mongocrypt-log-private.h"
|
26
24
|
#include "mongocrypt-buffer-private.h"
|
27
|
-
#include "mongocrypt-cache-private.h"
|
28
25
|
#include "mongocrypt-cache-key-private.h"
|
26
|
+
#include "mongocrypt-cache-oauth-private.h"
|
27
|
+
#include "mongocrypt-cache-private.h"
|
28
|
+
#include "mongocrypt-crypto-private.h"
|
29
|
+
#include "mongocrypt-dll-private.h"
|
30
|
+
#include "mongocrypt-log-private.h"
|
29
31
|
#include "mongocrypt-mutex-private.h"
|
30
32
|
#include "mongocrypt-opts-private.h"
|
31
|
-
#include "mongocrypt-crypto-private.h"
|
32
|
-
#include "mongocrypt-cache-oauth-private.h"
|
33
33
|
|
34
34
|
#include "mongo_crypt-v1.h"
|
35
35
|
|
36
36
|
#include <mlib/macros.h>
|
37
37
|
|
38
|
-
|
39
38
|
#define MONGOCRYPT_GENERIC_ERROR_CODE 1
|
40
39
|
|
41
|
-
#define CLIENT_ERR_W_CODE(code, ...)
|
42
|
-
_mongocrypt_set_error ( \
|
43
|
-
status, MONGOCRYPT_STATUS_ERROR_CLIENT, code, __VA_ARGS__)
|
40
|
+
#define CLIENT_ERR_W_CODE(code, ...) _mongocrypt_set_error(status, MONGOCRYPT_STATUS_ERROR_CLIENT, code, __VA_ARGS__)
|
44
41
|
|
45
|
-
#define CLIENT_ERR(...)
|
46
|
-
CLIENT_ERR_W_CODE (MONGOCRYPT_GENERIC_ERROR_CODE, __VA_ARGS__)
|
42
|
+
#define CLIENT_ERR(...) CLIENT_ERR_W_CODE(MONGOCRYPT_GENERIC_ERROR_CODE, __VA_ARGS__)
|
47
43
|
|
48
|
-
#define KMS_ERR_W_CODE(code, ...)
|
49
|
-
_mongocrypt_set_error ( \
|
50
|
-
status, MONGOCRYPT_STATUS_ERROR_KMS, code, __VA_ARGS__)
|
44
|
+
#define KMS_ERR_W_CODE(code, ...) _mongocrypt_set_error(status, MONGOCRYPT_STATUS_ERROR_KMS, code, __VA_ARGS__)
|
51
45
|
|
52
|
-
#define KMS_ERR(...) KMS_ERR_W_CODE
|
46
|
+
#define KMS_ERR(...) KMS_ERR_W_CODE(MONGOCRYPT_GENERIC_ERROR_CODE, __VA_ARGS__)
|
53
47
|
|
54
|
-
#define MONGOCRYPT_STR_AND_LEN(x) (x), (sizeof
|
48
|
+
#define MONGOCRYPT_STR_AND_LEN(x) (x), (sizeof(x) / sizeof((x)[0]) - 1)
|
55
49
|
|
56
|
-
#define MONGOCRYPT_DATA_AND_LEN(x)
|
57
|
-
((uint8_t *) x), (sizeof (x) / sizeof ((x)[0]) - 1)
|
50
|
+
#define MONGOCRYPT_DATA_AND_LEN(x) ((uint8_t *)x), (sizeof(x) / sizeof((x)[0]) - 1)
|
58
51
|
|
59
52
|
/* TODO: remove after integrating into libmongoc */
|
60
53
|
#define BSON_SUBTYPE_ENCRYPTED 6
|
61
54
|
|
62
55
|
/* TODO: Move these to mongocrypt-log-private.h? */
|
63
|
-
const char *
|
64
|
-
tmp_json (const bson_t *bson);
|
56
|
+
const char *tmp_json(const bson_t *bson);
|
65
57
|
|
66
|
-
const char *
|
67
|
-
tmp_buf (const _mongocrypt_buffer_t *buf);
|
58
|
+
const char *tmp_buf(const _mongocrypt_buffer_t *buf);
|
68
59
|
|
69
60
|
// _mongocrypt_set_error sets an error status.
|
70
61
|
// `status->message` is set after evaluating `format` and variadic args.
|
71
|
-
// It is safe to uses a `status->message` as an argument to wrap an error. For
|
72
|
-
// _mongocrypt_set_error (
|
62
|
+
// It is safe to uses a `status->message` as an argument to wrap an error. For
|
63
|
+
// example: _mongocrypt_set_error (
|
73
64
|
// status,
|
74
65
|
// MONGOCRYPT_STATUS_ERROR_CLIENT,
|
75
66
|
// MONGOCRYPT_GENERIC_ERROR_CODE,
|
76
67
|
// "Error occurred. Original error: %s",
|
77
68
|
// mongocrypt_status_message (status, NULL /* len */));
|
78
|
-
MLIB_ANNOTATE_PRINTF
|
79
|
-
void
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
...);
|
69
|
+
MLIB_ANNOTATE_PRINTF(4, 5)
|
70
|
+
void _mongocrypt_set_error(mongocrypt_status_t *status,
|
71
|
+
mongocrypt_status_type_t type,
|
72
|
+
uint32_t code,
|
73
|
+
const char *format,
|
74
|
+
...);
|
85
75
|
|
86
76
|
typedef struct _mongo_crypt_v1_vtable {
|
87
|
-
#define MONGOC_CSFLE_FUNCTIONS_X
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
mongo_crypt_v1_lib *lib,
|
101
|
-
mongo_crypt_v1_status *status)
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
X_FUNC (get_version_str, const char *, void) \
|
119
|
-
/* Free bson data created by csfle */ \
|
120
|
-
X_FUNC (bson_free, void, uint8_t *bson)
|
121
|
-
|
122
|
-
#define X_FUNC(Name, RetType, ...) RetType (*Name) (__VA_ARGS__);
|
123
|
-
MONGOC_CSFLE_FUNCTIONS_X
|
77
|
+
#define MONGOC_CSFLE_FUNCTIONS_X \
|
78
|
+
/* status methods */ \
|
79
|
+
X_FUNC(status_create, mongo_crypt_v1_status *, void) \
|
80
|
+
X_FUNC(status_destroy, void, mongo_crypt_v1_status *status) \
|
81
|
+
X_FUNC(status_get_error, int, const mongo_crypt_v1_status *status) \
|
82
|
+
X_FUNC(status_get_explanation, const char *, const mongo_crypt_v1_status *status) \
|
83
|
+
X_FUNC(status_get_code, int, const mongo_crypt_v1_status *status) \
|
84
|
+
/* lib methods */ \
|
85
|
+
X_FUNC(lib_create, mongo_crypt_v1_lib *, mongo_crypt_v1_status *status) \
|
86
|
+
X_FUNC(lib_destroy, int, mongo_crypt_v1_lib *lib, mongo_crypt_v1_status *status) \
|
87
|
+
/* query_analyzer methods */ \
|
88
|
+
X_FUNC(query_analyzer_create, \
|
89
|
+
mongo_crypt_v1_query_analyzer *, \
|
90
|
+
mongo_crypt_v1_lib *lib, \
|
91
|
+
mongo_crypt_v1_status *status) \
|
92
|
+
X_FUNC(query_analyzer_destroy, void, mongo_crypt_v1_query_analyzer *analyzer) \
|
93
|
+
X_FUNC(analyze_query, \
|
94
|
+
uint8_t *, \
|
95
|
+
mongo_crypt_v1_query_analyzer *analyer, \
|
96
|
+
const uint8_t *documentBSON, \
|
97
|
+
const char *ns_str, \
|
98
|
+
uint32_t ns_len, \
|
99
|
+
uint32_t *bson_len, \
|
100
|
+
mongo_crypt_v1_status *status) \
|
101
|
+
X_FUNC(get_version, uint64_t, void) \
|
102
|
+
X_FUNC(get_version_str, const char *, void) \
|
103
|
+
/* Free bson data created by csfle */ \
|
104
|
+
X_FUNC(bson_free, void, uint8_t *bson)
|
105
|
+
|
106
|
+
#define X_FUNC(Name, RetType, ...) RetType (*Name)(__VA_ARGS__);
|
107
|
+
MONGOC_CSFLE_FUNCTIONS_X
|
124
108
|
#undef X_FUNC
|
125
109
|
|
126
|
-
|
127
|
-
|
110
|
+
/// Whether the vtable is valid and complete
|
111
|
+
bool okay;
|
128
112
|
} _mongo_crypt_v1_vtable;
|
129
113
|
|
130
114
|
struct _mongocrypt_t {
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
115
|
+
bool initialized;
|
116
|
+
_mongocrypt_opts_t opts;
|
117
|
+
mongocrypt_mutex_t mutex;
|
118
|
+
/* The collinfo and key cache are protected with an internal mutex. */
|
119
|
+
_mongocrypt_cache_t cache_collinfo;
|
120
|
+
_mongocrypt_cache_t cache_key;
|
121
|
+
_mongocrypt_log_t log;
|
122
|
+
mongocrypt_status_t *status;
|
123
|
+
_mongocrypt_crypto_t *crypto;
|
124
|
+
/* A counter, protected by mutex, for generating unique context ids */
|
125
|
+
uint32_t ctx_counter;
|
126
|
+
_mongocrypt_cache_oauth_t *cache_oauth_azure;
|
127
|
+
_mongocrypt_cache_oauth_t *cache_oauth_gcp;
|
128
|
+
/// A CSFLE DLL vtable, initialized by mongocrypt_init
|
129
|
+
_mongo_crypt_v1_vtable csfle;
|
130
|
+
/// Pointer to the global csfle_lib object. Should not be freed directly.
|
131
|
+
mongo_crypt_v1_lib *csfle_lib;
|
148
132
|
};
|
149
133
|
|
150
134
|
typedef enum {
|
151
|
-
|
152
|
-
|
153
|
-
|
135
|
+
MONGOCRYPT_ENCRYPTION_ALGORITHM_NONE = 0,
|
136
|
+
MONGOCRYPT_ENCRYPTION_ALGORITHM_DETERMINISTIC = 1,
|
137
|
+
MONGOCRYPT_ENCRYPTION_ALGORITHM_RANDOM = 2
|
154
138
|
} mongocrypt_encryption_algorithm_t;
|
155
139
|
|
156
140
|
typedef enum {
|
157
|
-
|
158
|
-
|
141
|
+
MONGOCRYPT_FLE2_PLACEHOLDER_TYPE_INSERT = 1,
|
142
|
+
MONGOCRYPT_FLE2_PLACEHOLDER_TYPE_FIND = 2
|
159
143
|
} mongocrypt_fle2_placeholder_type_t;
|
160
144
|
|
161
145
|
typedef enum {
|
162
|
-
|
163
|
-
|
164
|
-
|
146
|
+
MONGOCRYPT_FLE2_ALGORITHM_UNINDEXED = 1,
|
147
|
+
MONGOCRYPT_FLE2_ALGORITHM_EQUALITY = 2,
|
148
|
+
MONGOCRYPT_FLE2_ALGORITHM_RANGE = 3
|
165
149
|
} mongocrypt_fle2_encryption_algorithm_t;
|
166
150
|
|
167
|
-
bool
|
168
|
-
_mongocrypt_validate_and_copy_string (const char *in,
|
169
|
-
int32_t in_len,
|
170
|
-
char **out) MONGOCRYPT_WARN_UNUSED_RESULT;
|
151
|
+
bool _mongocrypt_validate_and_copy_string(const char *in, int32_t in_len, char **out) MONGOCRYPT_WARN_UNUSED_RESULT;
|
171
152
|
|
172
|
-
char *
|
173
|
-
_mongocrypt_new_string_from_bytes (const void *in, int len);
|
153
|
+
char *_mongocrypt_new_string_from_bytes(const void *in, int len);
|
174
154
|
|
175
|
-
char *
|
176
|
-
_mongocrypt_new_json_string_from_binary (mongocrypt_binary_t *binary);
|
155
|
+
char *_mongocrypt_new_json_string_from_binary(mongocrypt_binary_t *binary);
|
177
156
|
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
_mongocrypt_opts_kms_providers_t *kms_providers,
|
183
|
-
mongocrypt_status_t *status,
|
184
|
-
_mongocrypt_log_t *log);
|
157
|
+
bool _mongocrypt_parse_kms_providers(mongocrypt_binary_t *kms_providers_definition,
|
158
|
+
_mongocrypt_opts_kms_providers_t *kms_providers,
|
159
|
+
mongocrypt_status_t *status,
|
160
|
+
_mongocrypt_log_t *log);
|
185
161
|
|
186
162
|
/* _mongocrypt_needs_credentials returns true if @crypt was configured to
|
187
163
|
* request credentials for any KMS provider. */
|
188
|
-
bool
|
189
|
-
_mongocrypt_needs_credentials (mongocrypt_t *crypt);
|
164
|
+
bool _mongocrypt_needs_credentials(mongocrypt_t *crypt);
|
190
165
|
|
191
166
|
/* _mongocrypt_needs_credentials returns true if @crypt was configured to
|
192
167
|
* request credentials for @provider. */
|
193
|
-
bool
|
194
|
-
|
195
|
-
|
168
|
+
bool _mongocrypt_needs_credentials_for_provider(mongocrypt_t *crypt, _mongocrypt_kms_provider_t provider);
|
169
|
+
|
170
|
+
/**
|
171
|
+
* Enable/disable the use of FLE2v2 payload types for write.
|
172
|
+
*
|
173
|
+
* @param[in] crypt The @ref mongocrypt_t object.
|
174
|
+
* @param[in] enable Whether to enable use of FLE2v2 payloads.
|
175
|
+
*
|
176
|
+
* @returns A boolean indicating success. If false, an error status is set.
|
177
|
+
* Retrieve it with @ref mongocrypt_status
|
178
|
+
*/
|
179
|
+
bool mongocrypt_setopt_fle2v2(mongocrypt_t *crypt, bool enable);
|
196
180
|
|
197
181
|
#endif /* MONGOCRYPT_PRIVATE_H */
|
@@ -19,12 +19,9 @@
|
|
19
19
|
|
20
20
|
#include "mongocrypt.h"
|
21
21
|
|
22
|
-
void
|
23
|
-
_mongocrypt_status_copy_to (mongocrypt_status_t *src, mongocrypt_status_t *dst);
|
22
|
+
void _mongocrypt_status_copy_to(mongocrypt_status_t *src, mongocrypt_status_t *dst);
|
24
23
|
|
25
|
-
|
26
|
-
void
|
27
|
-
_mongocrypt_status_reset (mongocrypt_status_t *status);
|
24
|
+
void _mongocrypt_status_reset(mongocrypt_status_t *status);
|
28
25
|
|
29
26
|
/* Append the message of @to_append in @status.
|
30
27
|
* Example:
|
@@ -32,8 +29,6 @@ _mongocrypt_status_reset (mongocrypt_status_t *status);
|
|
32
29
|
* - @to_append has the message "append error"
|
33
30
|
* After calling, @status will have the message: "status error: append error"
|
34
31
|
*/
|
35
|
-
void
|
36
|
-
_mongocrypt_status_append (mongocrypt_status_t *status,
|
37
|
-
mongocrypt_status_t *to_append);
|
32
|
+
void _mongocrypt_status_append(mongocrypt_status_t *status, mongocrypt_status_t *to_append);
|
38
33
|
|
39
34
|
#endif /* MONGOCRYPT_STATUS_PRIVATE_H */
|
@@ -18,152 +18,125 @@
|
|
18
18
|
|
19
19
|
#include "mongocrypt-status-private.h"
|
20
20
|
|
21
|
-
|
22
21
|
struct _mongocrypt_status_t {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
22
|
+
mongocrypt_status_type_t type;
|
23
|
+
uint32_t code;
|
24
|
+
char *message;
|
25
|
+
uint32_t len;
|
27
26
|
};
|
28
27
|
|
29
|
-
mongocrypt_status_t *
|
30
|
-
|
31
|
-
{
|
32
|
-
return bson_malloc0 (sizeof (mongocrypt_status_t));
|
28
|
+
mongocrypt_status_t *mongocrypt_status_new(void) {
|
29
|
+
return bson_malloc0(sizeof(mongocrypt_status_t));
|
33
30
|
}
|
34
31
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
status->len = (uint32_t) message_len - 1;
|
61
|
-
status->type = type;
|
62
|
-
status->code = code;
|
32
|
+
void mongocrypt_status_set(mongocrypt_status_t *status,
|
33
|
+
mongocrypt_status_type_t type,
|
34
|
+
uint32_t code,
|
35
|
+
const char *message,
|
36
|
+
int32_t message_len) {
|
37
|
+
if (!status) {
|
38
|
+
return;
|
39
|
+
}
|
40
|
+
|
41
|
+
if (message_len < 0) {
|
42
|
+
message_len = (int32_t)strlen(message) + 1;
|
43
|
+
} else if (message_len == 0) {
|
44
|
+
/* This is really an error, since message_len should be one more than the
|
45
|
+
* string length. But interpret as the empty string */
|
46
|
+
message_len = 1;
|
47
|
+
}
|
48
|
+
|
49
|
+
bson_free(status->message);
|
50
|
+
status->message = bson_malloc((size_t)message_len);
|
51
|
+
BSON_ASSERT(status->message);
|
52
|
+
status->message[message_len - 1] = '\0';
|
53
|
+
memcpy(status->message, message, (size_t)message_len - 1);
|
54
|
+
status->len = (uint32_t)message_len - 1;
|
55
|
+
status->type = type;
|
56
|
+
status->code = code;
|
63
57
|
}
|
64
58
|
|
65
|
-
const char *
|
66
|
-
|
67
|
-
{
|
68
|
-
BSON_ASSERT_PARAM (status);
|
69
|
-
|
70
|
-
if (mongocrypt_status_ok (status)) {
|
71
|
-
return NULL;
|
72
|
-
}
|
73
|
-
if (len) {
|
74
|
-
*len = status->len;
|
75
|
-
}
|
76
|
-
return status->message;
|
77
|
-
}
|
59
|
+
const char *mongocrypt_status_message(mongocrypt_status_t *status, uint32_t *len) {
|
60
|
+
BSON_ASSERT_PARAM(status);
|
78
61
|
|
62
|
+
if (mongocrypt_status_ok(status)) {
|
63
|
+
return NULL;
|
64
|
+
}
|
65
|
+
if (len) {
|
66
|
+
*len = status->len;
|
67
|
+
}
|
68
|
+
return status->message;
|
69
|
+
}
|
79
70
|
|
80
|
-
uint32_t
|
81
|
-
|
82
|
-
{
|
83
|
-
BSON_ASSERT_PARAM (status);
|
71
|
+
uint32_t mongocrypt_status_code(mongocrypt_status_t *status) {
|
72
|
+
BSON_ASSERT_PARAM(status);
|
84
73
|
|
85
|
-
|
74
|
+
return status->code;
|
86
75
|
}
|
87
76
|
|
77
|
+
mongocrypt_status_type_t mongocrypt_status_type(mongocrypt_status_t *status) {
|
78
|
+
BSON_ASSERT_PARAM(status);
|
88
79
|
|
89
|
-
|
90
|
-
mongocrypt_status_type (mongocrypt_status_t *status)
|
91
|
-
{
|
92
|
-
BSON_ASSERT_PARAM (status);
|
93
|
-
|
94
|
-
return status->type;
|
80
|
+
return status->type;
|
95
81
|
}
|
96
82
|
|
83
|
+
bool mongocrypt_status_ok(mongocrypt_status_t *status) {
|
84
|
+
BSON_ASSERT_PARAM(status);
|
97
85
|
|
98
|
-
|
99
|
-
mongocrypt_status_ok (mongocrypt_status_t *status)
|
100
|
-
{
|
101
|
-
BSON_ASSERT_PARAM (status);
|
102
|
-
|
103
|
-
return (status->type == MONGOCRYPT_STATUS_OK);
|
86
|
+
return (status->type == MONGOCRYPT_STATUS_OK);
|
104
87
|
}
|
105
88
|
|
106
|
-
void
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
dst->message = bson_strdup (src->message);
|
126
|
-
}
|
89
|
+
void _mongocrypt_status_copy_to(mongocrypt_status_t *src, mongocrypt_status_t *dst) {
|
90
|
+
BSON_ASSERT_PARAM(dst);
|
91
|
+
BSON_ASSERT_PARAM(src);
|
92
|
+
|
93
|
+
if (dst == src) {
|
94
|
+
return;
|
95
|
+
}
|
96
|
+
|
97
|
+
dst->type = src->type;
|
98
|
+
dst->code = src->code;
|
99
|
+
dst->len = src->len;
|
100
|
+
if (dst->message) {
|
101
|
+
bson_free(dst->message);
|
102
|
+
dst->message = NULL;
|
103
|
+
}
|
104
|
+
|
105
|
+
if (src->message) {
|
106
|
+
dst->message = bson_strdup(src->message);
|
107
|
+
}
|
127
108
|
}
|
128
109
|
|
129
|
-
void
|
130
|
-
|
131
|
-
{
|
132
|
-
BSON_ASSERT_PARAM (status);
|
110
|
+
void _mongocrypt_status_reset(mongocrypt_status_t *status) {
|
111
|
+
BSON_ASSERT_PARAM(status);
|
133
112
|
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
113
|
+
status->type = MONGOCRYPT_STATUS_OK;
|
114
|
+
status->code = 0;
|
115
|
+
status->len = 0;
|
116
|
+
bson_free(status->message);
|
117
|
+
status->message = NULL;
|
139
118
|
}
|
140
119
|
|
141
|
-
void
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
return;
|
146
|
-
}
|
120
|
+
void mongocrypt_status_destroy(mongocrypt_status_t *status) {
|
121
|
+
if (!status) {
|
122
|
+
return;
|
123
|
+
}
|
147
124
|
|
148
|
-
|
149
|
-
|
125
|
+
bson_free(status->message);
|
126
|
+
bson_free(status);
|
150
127
|
}
|
151
128
|
|
129
|
+
void _mongocrypt_status_append(mongocrypt_status_t *status, mongocrypt_status_t *to_append) {
|
130
|
+
char *orig;
|
152
131
|
|
153
|
-
|
154
|
-
|
155
|
-
mongocrypt_status_t *to_append)
|
156
|
-
{
|
157
|
-
char *orig;
|
158
|
-
|
159
|
-
BSON_ASSERT_PARAM (status);
|
160
|
-
BSON_ASSERT_PARAM (to_append);
|
132
|
+
BSON_ASSERT_PARAM(status);
|
133
|
+
BSON_ASSERT_PARAM(to_append);
|
161
134
|
|
162
|
-
|
135
|
+
orig = status->message;
|
163
136
|
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
137
|
+
if (mongocrypt_status_ok(to_append)) {
|
138
|
+
return;
|
139
|
+
}
|
140
|
+
status->message = bson_strdup_printf("%s: %s", orig, to_append->message);
|
141
|
+
bson_free(orig);
|
169
142
|
}
|
@@ -21,39 +21,29 @@
|
|
21
21
|
#include "mongocrypt-status-private.h"
|
22
22
|
|
23
23
|
typedef enum {
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
TRAVERSE_MATCH_CIPHERTEXT,
|
25
|
+
TRAVERSE_MATCH_MARKING,
|
26
|
+
TRAVERSE_MATCH_SUBTYPE6,
|
27
27
|
} traversal_match_t;
|
28
28
|
|
29
|
-
typedef bool (*_mongocrypt_traverse_callback_t)
|
29
|
+
typedef bool (*_mongocrypt_traverse_callback_t)(void *ctx, _mongocrypt_buffer_t *in, mongocrypt_status_t *status);
|
30
|
+
|
31
|
+
typedef bool (*_mongocrypt_transform_callback_t)(void *ctx,
|
30
32
|
_mongocrypt_buffer_t *in,
|
33
|
+
bson_value_t *out,
|
31
34
|
mongocrypt_status_t *status);
|
32
35
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
mongocrypt_status_t *status)
|
46
|
-
MONGOCRYPT_WARN_UNUSED_RESULT;
|
47
|
-
|
48
|
-
|
49
|
-
bool
|
50
|
-
_mongocrypt_transform_binary_in_bson (_mongocrypt_transform_callback_t cb,
|
51
|
-
void *ctx,
|
52
|
-
traversal_match_t match,
|
53
|
-
bson_iter_t *iter,
|
54
|
-
bson_t *out,
|
55
|
-
mongocrypt_status_t *status)
|
56
|
-
MONGOCRYPT_WARN_UNUSED_RESULT;
|
57
|
-
|
36
|
+
bool _mongocrypt_traverse_binary_in_bson(_mongocrypt_traverse_callback_t cb,
|
37
|
+
void *ctx,
|
38
|
+
traversal_match_t match,
|
39
|
+
bson_iter_t *iter,
|
40
|
+
mongocrypt_status_t *status) MONGOCRYPT_WARN_UNUSED_RESULT;
|
41
|
+
|
42
|
+
bool _mongocrypt_transform_binary_in_bson(_mongocrypt_transform_callback_t cb,
|
43
|
+
void *ctx,
|
44
|
+
traversal_match_t match,
|
45
|
+
bson_iter_t *iter,
|
46
|
+
bson_t *out,
|
47
|
+
mongocrypt_status_t *status) MONGOCRYPT_WARN_UNUSED_RESULT;
|
58
48
|
|
59
49
|
#endif /* MONGOCRYPT_TRAVERSE_UTIL_H */
|