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
@@ -0,0 +1,137 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright 2022-present MongoDB, Inc.
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
#include <bson/bson.h>
|
18
|
+
|
19
|
+
#include "mc-fle2-find-range-payload-private-v2.h"
|
20
|
+
#include "mongocrypt-buffer-private.h"
|
21
|
+
#include "mongocrypt.h"
|
22
|
+
|
23
|
+
void mc_FLE2FindRangePayloadV2_init(mc_FLE2FindRangePayloadV2_t *payload) {
|
24
|
+
BSON_ASSERT_PARAM(payload);
|
25
|
+
*payload = (mc_FLE2FindRangePayloadV2_t){{{{0}}}};
|
26
|
+
_mc_array_init(&payload->payload.value.edgeFindTokenSetArray, sizeof(mc_EdgeFindTokenSetV2_t));
|
27
|
+
}
|
28
|
+
|
29
|
+
static void mc_EdgeFindTokenSetV2_cleanup(mc_EdgeFindTokenSetV2_t *etc) {
|
30
|
+
if (!etc) {
|
31
|
+
return;
|
32
|
+
}
|
33
|
+
_mongocrypt_buffer_cleanup(&etc->edcDerivedToken);
|
34
|
+
_mongocrypt_buffer_cleanup(&etc->escDerivedToken);
|
35
|
+
_mongocrypt_buffer_cleanup(&etc->serverDerivedFromDataToken);
|
36
|
+
}
|
37
|
+
|
38
|
+
void mc_FLE2FindRangePayloadV2_cleanup(mc_FLE2FindRangePayloadV2_t *payload) {
|
39
|
+
if (!payload) {
|
40
|
+
return;
|
41
|
+
}
|
42
|
+
// Free all EdgeFindTokenSet entries.
|
43
|
+
for (size_t i = 0; i < payload->payload.value.edgeFindTokenSetArray.len; i++) {
|
44
|
+
mc_EdgeFindTokenSetV2_t entry =
|
45
|
+
_mc_array_index(&payload->payload.value.edgeFindTokenSetArray, mc_EdgeFindTokenSetV2_t, i);
|
46
|
+
mc_EdgeFindTokenSetV2_cleanup(&entry);
|
47
|
+
}
|
48
|
+
_mc_array_destroy(&payload->payload.value.edgeFindTokenSetArray);
|
49
|
+
}
|
50
|
+
|
51
|
+
#define APPEND_BINDATA(out, name, value) \
|
52
|
+
if (!_mongocrypt_buffer_append(&(value), out, name, -1)) { \
|
53
|
+
return false; \
|
54
|
+
}
|
55
|
+
|
56
|
+
bool mc_FLE2FindRangePayloadV2_serialize(const mc_FLE2FindRangePayloadV2_t *payload, bson_t *out) {
|
57
|
+
BSON_ASSERT_PARAM(out);
|
58
|
+
BSON_ASSERT_PARAM(payload);
|
59
|
+
|
60
|
+
// Append "payload" if this is not a stub.
|
61
|
+
if (payload->payload.set) {
|
62
|
+
bson_t payload_bson;
|
63
|
+
|
64
|
+
if (!BSON_APPEND_DOCUMENT_BEGIN(out, "payload", &payload_bson)) {
|
65
|
+
return false;
|
66
|
+
}
|
67
|
+
// Append "payload.g" array of EdgeTokenSets.
|
68
|
+
bson_t g_bson;
|
69
|
+
if (!BSON_APPEND_ARRAY_BEGIN(&payload_bson, "g", &g_bson)) {
|
70
|
+
return false;
|
71
|
+
}
|
72
|
+
|
73
|
+
uint32_t g_index = 0;
|
74
|
+
for (size_t i = 0; i < payload->payload.value.edgeFindTokenSetArray.len; i++) {
|
75
|
+
mc_EdgeFindTokenSetV2_t etc =
|
76
|
+
_mc_array_index(&payload->payload.value.edgeFindTokenSetArray, mc_EdgeFindTokenSetV2_t, i);
|
77
|
+
bson_t etc_bson;
|
78
|
+
|
79
|
+
const char *g_index_string;
|
80
|
+
char storage[16];
|
81
|
+
bson_uint32_to_string(g_index, &g_index_string, storage, sizeof(storage));
|
82
|
+
|
83
|
+
if (!BSON_APPEND_DOCUMENT_BEGIN(&g_bson, g_index_string, &etc_bson)) {
|
84
|
+
return false;
|
85
|
+
}
|
86
|
+
|
87
|
+
etc.edcDerivedToken.subtype = BSON_SUBTYPE_BINARY;
|
88
|
+
etc.escDerivedToken.subtype = BSON_SUBTYPE_BINARY;
|
89
|
+
etc.serverDerivedFromDataToken.subtype = BSON_SUBTYPE_BINARY;
|
90
|
+
|
91
|
+
APPEND_BINDATA(&etc_bson, "d", etc.edcDerivedToken);
|
92
|
+
APPEND_BINDATA(&etc_bson, "s", etc.escDerivedToken);
|
93
|
+
APPEND_BINDATA(&etc_bson, "l", etc.serverDerivedFromDataToken);
|
94
|
+
|
95
|
+
if (!bson_append_document_end(&g_bson, &etc_bson)) {
|
96
|
+
return false;
|
97
|
+
}
|
98
|
+
if (g_index == UINT32_MAX) {
|
99
|
+
break;
|
100
|
+
}
|
101
|
+
g_index++;
|
102
|
+
}
|
103
|
+
|
104
|
+
if (!bson_append_array_end(&payload_bson, &g_bson)) {
|
105
|
+
return false;
|
106
|
+
}
|
107
|
+
|
108
|
+
// Append "payload.cm".
|
109
|
+
if (!BSON_APPEND_INT64(&payload_bson, "cm", payload->payload.value.maxContentionCounter)) {
|
110
|
+
return false;
|
111
|
+
}
|
112
|
+
|
113
|
+
if (!bson_append_document_end(out, &payload_bson)) {
|
114
|
+
return false;
|
115
|
+
}
|
116
|
+
}
|
117
|
+
|
118
|
+
// Append "payloadId"
|
119
|
+
if (!BSON_APPEND_INT32(out, "payloadId", payload->payloadId)) {
|
120
|
+
return false;
|
121
|
+
}
|
122
|
+
|
123
|
+
// Append "firstOperator".
|
124
|
+
if (!BSON_APPEND_INT32(out, "firstOperator", payload->firstOperator)) {
|
125
|
+
return false;
|
126
|
+
}
|
127
|
+
|
128
|
+
// Append "secondOperator" if present.
|
129
|
+
if (payload->secondOperator != FLE2RangeOperator_kNone
|
130
|
+
&& !BSON_APPEND_INT32(out, "secondOperator", payload->secondOperator)) {
|
131
|
+
return false;
|
132
|
+
}
|
133
|
+
|
134
|
+
return true;
|
135
|
+
}
|
136
|
+
|
137
|
+
#undef APPEND_BINDATA
|
@@ -17,142 +17,123 @@
|
|
17
17
|
#include <bson/bson.h>
|
18
18
|
|
19
19
|
#include "mc-fle2-find-range-payload-private.h"
|
20
|
-
#include "mongocrypt.h"
|
21
20
|
#include "mongocrypt-buffer-private.h"
|
21
|
+
#include "mongocrypt.h"
|
22
22
|
|
23
|
-
void
|
24
|
-
|
25
|
-
{
|
26
|
-
|
27
|
-
*payload = (mc_FLE2FindRangePayload_t){{{{0}}}};
|
28
|
-
_mc_array_init (&payload->payload.value.edgeFindTokenSetArray,
|
29
|
-
sizeof (mc_EdgeFindTokenSet_t));
|
23
|
+
void mc_FLE2FindRangePayload_init(mc_FLE2FindRangePayload_t *payload) {
|
24
|
+
BSON_ASSERT_PARAM(payload);
|
25
|
+
*payload = (mc_FLE2FindRangePayload_t){{{{0}}}};
|
26
|
+
_mc_array_init(&payload->payload.value.edgeFindTokenSetArray, sizeof(mc_EdgeFindTokenSet_t));
|
30
27
|
}
|
31
28
|
|
32
|
-
static void
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
_mongocrypt_buffer_cleanup (&etc->escDerivedToken);
|
40
|
-
_mongocrypt_buffer_cleanup (&etc->eccDerivedToken);
|
29
|
+
static void mc_EdgeFindTokenSet_cleanup(mc_EdgeFindTokenSet_t *etc) {
|
30
|
+
if (!etc) {
|
31
|
+
return;
|
32
|
+
}
|
33
|
+
_mongocrypt_buffer_cleanup(&etc->edcDerivedToken);
|
34
|
+
_mongocrypt_buffer_cleanup(&etc->escDerivedToken);
|
35
|
+
_mongocrypt_buffer_cleanup(&etc->eccDerivedToken);
|
41
36
|
}
|
42
37
|
|
43
|
-
void
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
mc_EdgeFindTokenSet_t,
|
56
|
-
i);
|
57
|
-
mc_EdgeFindTokenSet_cleanup (&entry);
|
58
|
-
}
|
59
|
-
_mc_array_destroy (&payload->payload.value.edgeFindTokenSetArray);
|
38
|
+
void mc_FLE2FindRangePayload_cleanup(mc_FLE2FindRangePayload_t *payload) {
|
39
|
+
if (!payload) {
|
40
|
+
return;
|
41
|
+
}
|
42
|
+
_mongocrypt_buffer_cleanup(&payload->payload.value.serverEncryptionToken);
|
43
|
+
// Free all EdgeFindTokenSet entries.
|
44
|
+
for (size_t i = 0; i < payload->payload.value.edgeFindTokenSetArray.len; i++) {
|
45
|
+
mc_EdgeFindTokenSet_t entry =
|
46
|
+
_mc_array_index(&payload->payload.value.edgeFindTokenSetArray, mc_EdgeFindTokenSet_t, i);
|
47
|
+
mc_EdgeFindTokenSet_cleanup(&entry);
|
48
|
+
}
|
49
|
+
_mc_array_destroy(&payload->payload.value.edgeFindTokenSetArray);
|
60
50
|
}
|
61
51
|
|
62
|
-
#define APPEND_BINDATA(out, name,
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
bool
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
bson_t payload_bson;
|
77
|
-
|
78
|
-
if (!BSON_APPEND_DOCUMENT_BEGIN (out, "payload", &payload_bson)) {
|
79
|
-
return false;
|
80
|
-
}
|
81
|
-
// Append "payload.g" array of EdgeTokenSets.
|
82
|
-
bson_t g_bson;
|
83
|
-
if (!BSON_APPEND_ARRAY_BEGIN (&payload_bson, "g", &g_bson)) {
|
84
|
-
return false;
|
85
|
-
}
|
86
|
-
|
87
|
-
uint32_t g_index = 0;
|
88
|
-
for (size_t i = 0; i < payload->payload.value.edgeFindTokenSetArray.len;
|
89
|
-
i++) {
|
90
|
-
mc_EdgeFindTokenSet_t etc =
|
91
|
-
_mc_array_index (&payload->payload.value.edgeFindTokenSetArray,
|
92
|
-
mc_EdgeFindTokenSet_t,
|
93
|
-
i);
|
94
|
-
bson_t etc_bson;
|
95
|
-
|
96
|
-
const char *g_index_string;
|
97
|
-
char storage[16];
|
98
|
-
bson_uint32_to_string (
|
99
|
-
g_index, &g_index_string, storage, sizeof (storage));
|
100
|
-
|
101
|
-
if (!BSON_APPEND_DOCUMENT_BEGIN (&g_bson, g_index_string, &etc_bson)) {
|
52
|
+
#define APPEND_BINDATA(out, name, value) \
|
53
|
+
if (!_mongocrypt_buffer_append(&(value), out, name, -1)) { \
|
54
|
+
return false; \
|
55
|
+
}
|
56
|
+
|
57
|
+
bool mc_FLE2FindRangePayload_serialize(const mc_FLE2FindRangePayload_t *payload, bson_t *out) {
|
58
|
+
BSON_ASSERT_PARAM(out);
|
59
|
+
BSON_ASSERT_PARAM(payload);
|
60
|
+
|
61
|
+
// Append "payload" if this is not a stub.
|
62
|
+
if (payload->payload.set) {
|
63
|
+
bson_t payload_bson;
|
64
|
+
|
65
|
+
if (!BSON_APPEND_DOCUMENT_BEGIN(out, "payload", &payload_bson)) {
|
102
66
|
return false;
|
103
|
-
|
67
|
+
}
|
68
|
+
// Append "payload.g" array of EdgeTokenSets.
|
69
|
+
bson_t g_bson;
|
70
|
+
if (!BSON_APPEND_ARRAY_BEGIN(&payload_bson, "g", &g_bson)) {
|
71
|
+
return false;
|
72
|
+
}
|
73
|
+
|
74
|
+
uint32_t g_index = 0;
|
75
|
+
for (size_t i = 0; i < payload->payload.value.edgeFindTokenSetArray.len; i++) {
|
76
|
+
mc_EdgeFindTokenSet_t etc =
|
77
|
+
_mc_array_index(&payload->payload.value.edgeFindTokenSetArray, mc_EdgeFindTokenSet_t, i);
|
78
|
+
bson_t etc_bson;
|
79
|
+
|
80
|
+
const char *g_index_string;
|
81
|
+
char storage[16];
|
82
|
+
bson_uint32_to_string(g_index, &g_index_string, storage, sizeof(storage));
|
83
|
+
|
84
|
+
if (!BSON_APPEND_DOCUMENT_BEGIN(&g_bson, g_index_string, &etc_bson)) {
|
85
|
+
return false;
|
86
|
+
}
|
87
|
+
|
88
|
+
etc.edcDerivedToken.subtype = BSON_SUBTYPE_BINARY;
|
89
|
+
etc.escDerivedToken.subtype = BSON_SUBTYPE_BINARY;
|
90
|
+
etc.eccDerivedToken.subtype = BSON_SUBTYPE_BINARY;
|
91
|
+
|
92
|
+
APPEND_BINDATA(&etc_bson, "d", etc.edcDerivedToken);
|
93
|
+
APPEND_BINDATA(&etc_bson, "s", etc.escDerivedToken);
|
94
|
+
APPEND_BINDATA(&etc_bson, "c", etc.eccDerivedToken);
|
95
|
+
|
96
|
+
if (!bson_append_document_end(&g_bson, &etc_bson)) {
|
97
|
+
return false;
|
98
|
+
}
|
99
|
+
if (g_index == UINT32_MAX) {
|
100
|
+
break;
|
101
|
+
}
|
102
|
+
g_index++;
|
103
|
+
}
|
104
|
+
|
105
|
+
if (!bson_append_array_end(&payload_bson, &g_bson)) {
|
106
|
+
return false;
|
107
|
+
}
|
104
108
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
&etc_bson, "c", BSON_SUBTYPE_BINARY, etc.eccDerivedToken);
|
109
|
+
// Append "payload.e" and "payload.cm".
|
110
|
+
APPEND_BINDATA(&payload_bson, "e", payload->payload.value.serverEncryptionToken);
|
111
|
+
if (!BSON_APPEND_INT64(&payload_bson, "cm", payload->payload.value.maxContentionCounter)) {
|
112
|
+
return false;
|
113
|
+
}
|
111
114
|
|
112
|
-
|
115
|
+
if (!bson_append_document_end(out, &payload_bson)) {
|
113
116
|
return false;
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
if (!bson_append_document_end (out, &payload_bson)) {
|
136
|
-
return false;
|
137
|
-
}
|
138
|
-
}
|
139
|
-
|
140
|
-
// Append "payloadId"
|
141
|
-
if (!BSON_APPEND_INT32 (out, "payloadId", payload->payloadId)) {
|
142
|
-
return false;
|
143
|
-
}
|
144
|
-
|
145
|
-
// Append "firstOperator".
|
146
|
-
if (!BSON_APPEND_INT32 (out, "firstOperator", payload->firstOperator)) {
|
147
|
-
return false;
|
148
|
-
}
|
149
|
-
|
150
|
-
// Append "secondOperator" if present.
|
151
|
-
if (payload->secondOperator != FLE2RangeOperator_kNone &&
|
152
|
-
!BSON_APPEND_INT32 (out, "secondOperator", payload->secondOperator)) {
|
153
|
-
return false;
|
154
|
-
}
|
155
|
-
|
156
|
-
return true;
|
117
|
+
}
|
118
|
+
}
|
119
|
+
|
120
|
+
// Append "payloadId"
|
121
|
+
if (!BSON_APPEND_INT32(out, "payloadId", payload->payloadId)) {
|
122
|
+
return false;
|
123
|
+
}
|
124
|
+
|
125
|
+
// Append "firstOperator".
|
126
|
+
if (!BSON_APPEND_INT32(out, "firstOperator", payload->firstOperator)) {
|
127
|
+
return false;
|
128
|
+
}
|
129
|
+
|
130
|
+
// Append "secondOperator" if present.
|
131
|
+
if (payload->secondOperator != FLE2RangeOperator_kNone
|
132
|
+
&& !BSON_APPEND_INT32(out, "secondOperator", payload->secondOperator)) {
|
133
|
+
return false;
|
134
|
+
}
|
135
|
+
|
136
|
+
return true;
|
157
137
|
}
|
138
|
+
|
158
139
|
#undef APPEND_BINDATA
|
@@ -0,0 +1,117 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright 2022-present MongoDB, Inc.
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
#ifndef MC_FLE2_INSERT_UPDATE_PAYLOAD_PRIVATE_V2_H
|
18
|
+
#define MC_FLE2_INSERT_UPDATE_PAYLOAD_PRIVATE_V2_H
|
19
|
+
|
20
|
+
#include <bson/bson.h>
|
21
|
+
|
22
|
+
#include "mc-array-private.h"
|
23
|
+
#include "mongocrypt-buffer-private.h"
|
24
|
+
#include "mongocrypt-private.h"
|
25
|
+
#include "mongocrypt.h"
|
26
|
+
|
27
|
+
/**
|
28
|
+
* FLE2InsertUpdatePayloadV2 represents an FLE2 payload of an indexed field to
|
29
|
+
* insert or update. It is created client side.
|
30
|
+
*
|
31
|
+
* FLE2InsertUpdatePayloadV2 has the following data layout:
|
32
|
+
*
|
33
|
+
* struct {
|
34
|
+
* uint8_t fle_blob_subtype = 11;
|
35
|
+
* uint8_t bson[];
|
36
|
+
* } FLE2InsertUpdatePayloadV2;
|
37
|
+
*
|
38
|
+
* bson is a BSON document of this form:
|
39
|
+
* d: <binary> // EDCDerivedFromDataTokenAndCounter
|
40
|
+
* s: <binary> // ESCDerivedFromDataTokenAndCounter
|
41
|
+
* p: <binary> // Encrypted Tokens
|
42
|
+
* u: <UUID> // Index KeyId
|
43
|
+
* t: <int32> // Encrypted type
|
44
|
+
* v: <binary> // Encrypted value
|
45
|
+
* e: <binary> // ServerDataEncryptionLevel1Token
|
46
|
+
* l: <binary> // ServerDerivedFromDataToken
|
47
|
+
* k: <int64> // Randomly sampled contention factor value
|
48
|
+
* g: array<EdgeTokenSetV2> // Array of Edges
|
49
|
+
*
|
50
|
+
* p is the result of:
|
51
|
+
* Encrypt(
|
52
|
+
* key=ECOCToken,
|
53
|
+
* plaintext=(
|
54
|
+
* ESCDerivedFromDataTokenAndCounter)
|
55
|
+
* )
|
56
|
+
*
|
57
|
+
* v is the result of:
|
58
|
+
* UserKeyId || EncryptAEAD(
|
59
|
+
* key=UserKey,
|
60
|
+
* plaintext=value
|
61
|
+
* associated_data=UserKeyId)
|
62
|
+
*/
|
63
|
+
|
64
|
+
typedef struct {
|
65
|
+
_mongocrypt_buffer_t edcDerivedToken; // d
|
66
|
+
_mongocrypt_buffer_t escDerivedToken; // s
|
67
|
+
_mongocrypt_buffer_t encryptedTokens; // p
|
68
|
+
_mongocrypt_buffer_t indexKeyId; // u
|
69
|
+
bson_type_t valueType; // t
|
70
|
+
_mongocrypt_buffer_t value; // v
|
71
|
+
_mongocrypt_buffer_t serverEncryptionToken; // e
|
72
|
+
_mongocrypt_buffer_t serverDerivedFromDataToken; // l
|
73
|
+
int64_t contentionFactor; // k
|
74
|
+
mc_array_t edgeTokenSetArray; // g
|
75
|
+
_mongocrypt_buffer_t plaintext;
|
76
|
+
_mongocrypt_buffer_t userKeyId;
|
77
|
+
} mc_FLE2InsertUpdatePayloadV2_t;
|
78
|
+
|
79
|
+
/**
|
80
|
+
* EdgeTokenSetV2 is the following BSON document:
|
81
|
+
* d: <binary> // EDCDerivedFromDataTokenAndCounter
|
82
|
+
* s: <binary> // ESCDerivedFromDataTokenAndCounter
|
83
|
+
* l: <binary> // ServerDerivedFromDataToken
|
84
|
+
* p: <binary> // Encrypted Tokens
|
85
|
+
*
|
86
|
+
* Instances of mc_EdgeTokenSetV2_t are expected to be owned by
|
87
|
+
* mc_FLE2InsertUpdatePayloadV2_t and are freed in
|
88
|
+
* mc_FLE2InsertUpdatePayloadV2_cleanup.
|
89
|
+
*/
|
90
|
+
typedef struct {
|
91
|
+
_mongocrypt_buffer_t edcDerivedToken; // d
|
92
|
+
_mongocrypt_buffer_t escDerivedToken; // s
|
93
|
+
_mongocrypt_buffer_t serverDerivedFromDataToken; // l
|
94
|
+
_mongocrypt_buffer_t encryptedTokens; // p
|
95
|
+
} mc_EdgeTokenSetV2_t;
|
96
|
+
|
97
|
+
void mc_FLE2InsertUpdatePayloadV2_init(mc_FLE2InsertUpdatePayloadV2_t *payload);
|
98
|
+
|
99
|
+
bool mc_FLE2InsertUpdatePayloadV2_parse(mc_FLE2InsertUpdatePayloadV2_t *out,
|
100
|
+
const _mongocrypt_buffer_t *in,
|
101
|
+
mongocrypt_status_t *status);
|
102
|
+
|
103
|
+
/* mc_FLE2InsertUpdatePayloadV2_decrypt decrypts ciphertext.
|
104
|
+
* Returns NULL and sets @status on error. It is an error to call before
|
105
|
+
* mc_FLE2InsertUpdatePayloadV2_parse. */
|
106
|
+
const _mongocrypt_buffer_t *mc_FLE2InsertUpdatePayloadV2_decrypt(_mongocrypt_crypto_t *crypto,
|
107
|
+
mc_FLE2InsertUpdatePayloadV2_t *iup,
|
108
|
+
const _mongocrypt_buffer_t *user_key,
|
109
|
+
mongocrypt_status_t *status);
|
110
|
+
|
111
|
+
bool mc_FLE2InsertUpdatePayloadV2_serialize(const mc_FLE2InsertUpdatePayloadV2_t *payload, bson_t *out);
|
112
|
+
|
113
|
+
bool mc_FLE2InsertUpdatePayloadV2_serializeForRange(const mc_FLE2InsertUpdatePayloadV2_t *payload, bson_t *out);
|
114
|
+
|
115
|
+
void mc_FLE2InsertUpdatePayloadV2_cleanup(mc_FLE2InsertUpdatePayloadV2_t *payload);
|
116
|
+
|
117
|
+
#endif /* MC_FLE2_INSERT_UPDATE_PAYLOAD_PRIVATE_V2_H */
|
@@ -20,9 +20,9 @@
|
|
20
20
|
#include <bson/bson.h>
|
21
21
|
|
22
22
|
#include "mc-array-private.h"
|
23
|
-
#include "mongocrypt.h"
|
24
|
-
#include "mongocrypt-private.h"
|
25
23
|
#include "mongocrypt-buffer-private.h"
|
24
|
+
#include "mongocrypt-private.h"
|
25
|
+
#include "mongocrypt.h"
|
26
26
|
|
27
27
|
/**
|
28
28
|
* FLE2InsertUpdatePayload represents an FLE2 payload of an indexed field to
|
@@ -62,17 +62,17 @@
|
|
62
62
|
*/
|
63
63
|
|
64
64
|
typedef struct {
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
65
|
+
_mongocrypt_buffer_t edcDerivedToken; // d
|
66
|
+
_mongocrypt_buffer_t escDerivedToken; // s
|
67
|
+
_mongocrypt_buffer_t eccDerivedToken; // c
|
68
|
+
_mongocrypt_buffer_t encryptedTokens; // p
|
69
|
+
_mongocrypt_buffer_t indexKeyId; // u
|
70
|
+
bson_type_t valueType; // t
|
71
|
+
_mongocrypt_buffer_t value; // v
|
72
|
+
_mongocrypt_buffer_t serverEncryptionToken; // e
|
73
|
+
mc_array_t edgeTokenSetArray; // g
|
74
|
+
_mongocrypt_buffer_t plaintext;
|
75
|
+
_mongocrypt_buffer_t userKeyId;
|
76
76
|
} mc_FLE2InsertUpdatePayload_t;
|
77
77
|
|
78
78
|
/**
|
@@ -87,38 +87,30 @@ typedef struct {
|
|
87
87
|
* mc_FLE2InsertUpdatePayload_cleanup.
|
88
88
|
*/
|
89
89
|
typedef struct {
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
90
|
+
_mongocrypt_buffer_t edcDerivedToken; // d
|
91
|
+
_mongocrypt_buffer_t escDerivedToken; // s
|
92
|
+
_mongocrypt_buffer_t eccDerivedToken; // c
|
93
|
+
_mongocrypt_buffer_t encryptedTokens; // p
|
94
94
|
} mc_EdgeTokenSet_t;
|
95
95
|
|
96
|
-
void
|
97
|
-
mc_FLE2InsertUpdatePayload_init (mc_FLE2InsertUpdatePayload_t *payload);
|
96
|
+
void mc_FLE2InsertUpdatePayload_init(mc_FLE2InsertUpdatePayload_t *payload);
|
98
97
|
|
99
|
-
bool
|
100
|
-
|
101
|
-
|
102
|
-
mongocrypt_status_t *status);
|
98
|
+
bool mc_FLE2InsertUpdatePayload_parse(mc_FLE2InsertUpdatePayload_t *out,
|
99
|
+
const _mongocrypt_buffer_t *in,
|
100
|
+
mongocrypt_status_t *status);
|
103
101
|
|
104
102
|
/* mc_FLE2InsertUpdatePayload_decrypt decrypts ciphertext.
|
105
103
|
* Returns NULL and sets @status on error. It is an error to call before
|
106
104
|
* mc_FLE2InsertUpdatePayload_parse. */
|
107
|
-
const _mongocrypt_buffer_t *
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
mongocrypt_status_t *status);
|
105
|
+
const _mongocrypt_buffer_t *mc_FLE2InsertUpdatePayload_decrypt(_mongocrypt_crypto_t *crypto,
|
106
|
+
mc_FLE2InsertUpdatePayload_t *iup,
|
107
|
+
const _mongocrypt_buffer_t *user_key,
|
108
|
+
mongocrypt_status_t *status);
|
112
109
|
|
113
|
-
bool
|
114
|
-
mc_FLE2InsertUpdatePayload_serialize (
|
115
|
-
const mc_FLE2InsertUpdatePayload_t *payload, bson_t *out);
|
110
|
+
bool mc_FLE2InsertUpdatePayload_serialize(const mc_FLE2InsertUpdatePayload_t *payload, bson_t *out);
|
116
111
|
|
117
|
-
bool
|
118
|
-
mc_FLE2InsertUpdatePayload_serializeForRange (
|
119
|
-
const mc_FLE2InsertUpdatePayload_t *payload, bson_t *out);
|
112
|
+
bool mc_FLE2InsertUpdatePayload_serializeForRange(const mc_FLE2InsertUpdatePayload_t *payload, bson_t *out);
|
120
113
|
|
121
|
-
void
|
122
|
-
mc_FLE2InsertUpdatePayload_cleanup (mc_FLE2InsertUpdatePayload_t *payload);
|
114
|
+
void mc_FLE2InsertUpdatePayload_cleanup(mc_FLE2InsertUpdatePayload_t *payload);
|
123
115
|
|
124
116
|
#endif /* MC_FLE2_INSERT_UPDATE_PAYLOAD_PRIVATE_H */
|