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
@@ -14,161 +14,127 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
|
17
|
-
#include "test-mongocrypt.h"
|
18
17
|
#include "mc-rangeopts-private.h"
|
18
|
+
#include "test-mongocrypt.h"
|
19
19
|
|
20
20
|
#define RAW_STRING(...) #__VA_ARGS__
|
21
21
|
|
22
|
-
static void
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
mc_optional_uint32_t expectPrecision;
|
33
|
-
} testcase;
|
22
|
+
static void test_mc_RangeOpts_parse(_mongocrypt_tester_t *tester) {
|
23
|
+
typedef struct {
|
24
|
+
const char *desc;
|
25
|
+
const char *in;
|
26
|
+
const char *expectError;
|
27
|
+
mc_optional_int32_t expectMin;
|
28
|
+
mc_optional_int32_t expectMax;
|
29
|
+
int64_t expectSparsity;
|
30
|
+
mc_optional_uint32_t expectPrecision;
|
31
|
+
} testcase;
|
34
32
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
{"min" : 123, "max" : 456, "sparsity" : {"$numberLong" : "1"}}),
|
39
|
-
.expectSparsity = 1,
|
40
|
-
.expectMin = OPT_I32_C (123),
|
41
|
-
.expectMax = OPT_I32_C (456)},
|
42
|
-
{.desc = "Errors if precision is set with int min/max",
|
43
|
-
.in = RAW_STRING ({
|
44
|
-
"min" : 123,
|
45
|
-
"max" : 456,
|
46
|
-
"precision" : 2,
|
47
|
-
"sparsity" : {"$numberLong" : "1"}
|
48
|
-
}),
|
49
|
-
.expectError =
|
50
|
-
"expected 'precision' to be set with double or decimal128 index"},
|
51
|
-
{.desc = "Errors on missing fields",
|
52
|
-
.in = RAW_STRING ({"min" : 123, "max" : 456}),
|
53
|
-
.expectError = "Missing field 'sparsity'"},
|
54
|
-
{.desc = "Errors on extra fields",
|
55
|
-
.in = RAW_STRING ({
|
56
|
-
"min" : 123,
|
57
|
-
"max" : 456,
|
58
|
-
"sparsity" : {"$numberLong" : "1"},
|
59
|
-
"foo" : 1
|
60
|
-
}),
|
61
|
-
.expectError = "Unrecognized field: 'foo'"},
|
62
|
-
{.desc = "Errors if min/max types mismatch",
|
63
|
-
.in = RAW_STRING (
|
64
|
-
{"min" : 123, "max" : 456.0, "sparsity" : {"$numberLong" : "1"}}),
|
65
|
-
.expectError = "expected 'min' and 'max' to be same type"},
|
66
|
-
{
|
67
|
-
.desc = "Does not require min/max",
|
68
|
-
.in = RAW_STRING ({"sparsity" : {"$numberLong" : "1"}}),
|
33
|
+
testcase tests[] = {
|
34
|
+
{.desc = "Works",
|
35
|
+
.in = RAW_STRING({"min" : 123, "max" : 456, "sparsity" : {"$numberLong" : "1"}}),
|
69
36
|
.expectSparsity = 1,
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
37
|
+
.expectMin = OPT_I32_C(123),
|
38
|
+
.expectMax = OPT_I32_C(456)},
|
39
|
+
{.desc = "Errors if precision is set with int min/max",
|
40
|
+
.in = RAW_STRING({"min" : 123, "max" : 456, "precision" : 2, "sparsity" : {"$numberLong" : "1"}}),
|
41
|
+
.expectError = "expected 'precision' to be set with double or decimal128 index"},
|
42
|
+
{.desc = "Errors on missing fields",
|
43
|
+
.in = RAW_STRING({"min" : 123, "max" : 456}),
|
44
|
+
.expectError = "Missing field 'sparsity'"},
|
45
|
+
{.desc = "Errors on extra fields",
|
46
|
+
.in = RAW_STRING({"min" : 123, "max" : 456, "sparsity" : {"$numberLong" : "1"}, "foo" : 1}),
|
47
|
+
.expectError = "Unrecognized field: 'foo'"},
|
48
|
+
{.desc = "Errors if min/max types mismatch",
|
49
|
+
.in = RAW_STRING({"min" : 123, "max" : 456.0, "sparsity" : {"$numberLong" : "1"}}),
|
50
|
+
.expectError = "expected 'min' and 'max' to be same type"},
|
51
|
+
{
|
52
|
+
.desc = "Does not require min/max",
|
53
|
+
.in = RAW_STRING({"sparsity" : {"$numberLong" : "1"}}),
|
54
|
+
.expectSparsity = 1,
|
55
|
+
},
|
56
|
+
{.desc = "Requires precision for double when min/max is set",
|
57
|
+
.in = RAW_STRING({"min" : 0.0, "max" : 1.0, "sparsity" : {"$numberLong" : "1"}}),
|
58
|
+
.expectError = "expected 'precision'"},
|
59
|
+
{.desc = "Requires min/max for double when precision is set",
|
60
|
+
.in = RAW_STRING({"precision" : 1, "sparsity" : {"$numberLong" : "1"}}),
|
61
|
+
.expectError = "setting precision requires min"},
|
62
|
+
{.desc = "Requires precision for double when only min is set",
|
63
|
+
.in = RAW_STRING({"min" : 0.0, "sparsity" : {"$numberLong" : "1"}}),
|
64
|
+
.expectError = "expected 'precision'"},
|
65
|
+
};
|
82
66
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
mongocrypt_status_destroy (status);
|
109
|
-
}
|
67
|
+
for (size_t i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) {
|
68
|
+
testcase *test = tests + i;
|
69
|
+
mongocrypt_status_t *status = mongocrypt_status_new();
|
70
|
+
mc_RangeOpts_t ro;
|
71
|
+
printf("running test_mc_RangeOpts_parse subtest: %s\n", test->desc);
|
72
|
+
bool ret = mc_RangeOpts_parse(&ro, TMP_BSON(test->in), status);
|
73
|
+
if (!test->expectError) {
|
74
|
+
ASSERT_OK_STATUS(ret, status);
|
75
|
+
ASSERT_CMPINT(test->expectMin.set, ==, ro.min.set);
|
76
|
+
if (test->expectMin.set) {
|
77
|
+
ASSERT_CMPINT32(test->expectMin.value, ==, bson_iter_int32(&ro.min.value));
|
78
|
+
}
|
79
|
+
ASSERT_CMPINT(test->expectMax.set, ==, ro.max.set);
|
80
|
+
if (test->expectMax.set) {
|
81
|
+
ASSERT_CMPINT32(test->expectMax.value, ==, bson_iter_int32(&ro.max.value));
|
82
|
+
}
|
83
|
+
ASSERT_CMPINT64(test->expectSparsity, ==, ro.sparsity);
|
84
|
+
ASSERT_CMPINT(test->expectPrecision.set, ==, ro.precision.set);
|
85
|
+
ASSERT_CMPINT(test->expectPrecision.value, ==, ro.precision.value);
|
86
|
+
} else {
|
87
|
+
ASSERT_FAILS_STATUS(ret, status, test->expectError);
|
88
|
+
}
|
89
|
+
mc_RangeOpts_cleanup(&ro);
|
90
|
+
mongocrypt_status_destroy(status);
|
91
|
+
}
|
110
92
|
}
|
111
93
|
|
112
|
-
static void
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
const char *expect;
|
121
|
-
} testcase;
|
94
|
+
static void test_mc_RangeOpts_to_FLE2RangeInsertSpec(_mongocrypt_tester_t *tester) {
|
95
|
+
typedef struct {
|
96
|
+
const char *desc;
|
97
|
+
const char *in;
|
98
|
+
const char *v;
|
99
|
+
const char *expectError;
|
100
|
+
const char *expect;
|
101
|
+
} testcase;
|
122
102
|
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
.v = RAW_STRING ({"v" : 789.0}),
|
137
|
-
.expect = RAW_STRING ({
|
138
|
-
"v" : {"v" : 789.0, "min" : 123.0, "max" : 456.0, "precision" : 2}
|
139
|
-
})},
|
140
|
-
{.desc = "Errors with missing 'v'",
|
141
|
-
.in = RAW_STRING (
|
142
|
-
{"min" : 123, "max" : 456, "sparsity" : {"$numberLong" : "1"}}),
|
143
|
-
.v = RAW_STRING ({"foo" : "bar"}),
|
144
|
-
.expectError = "Unable to find 'v'"}};
|
103
|
+
testcase tests[] = {
|
104
|
+
{.desc = "Works",
|
105
|
+
.in = RAW_STRING({"min" : 123, "max" : 456, "sparsity" : {"$numberLong" : "1"}}),
|
106
|
+
.v = RAW_STRING({"v" : 789}),
|
107
|
+
.expect = RAW_STRING({"v" : {"v" : 789, "min" : 123, "max" : 456}})},
|
108
|
+
{.desc = "Works with precision",
|
109
|
+
.in = RAW_STRING({"min" : 123.0, "max" : 456.0, "precision" : 2, "sparsity" : {"$numberLong" : "1"}}),
|
110
|
+
.v = RAW_STRING({"v" : 789.0}),
|
111
|
+
.expect = RAW_STRING({"v" : {"v" : 789.0, "min" : 123.0, "max" : 456.0, "precision" : 2}})},
|
112
|
+
{.desc = "Errors with missing 'v'",
|
113
|
+
.in = RAW_STRING({"min" : 123, "max" : 456, "sparsity" : {"$numberLong" : "1"}}),
|
114
|
+
.v = RAW_STRING({"foo" : "bar"}),
|
115
|
+
.expectError = "Unable to find 'v'"}};
|
145
116
|
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
mc_RangeOpts_cleanup (&ro);
|
165
|
-
mongocrypt_status_destroy (status);
|
166
|
-
}
|
117
|
+
for (size_t i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) {
|
118
|
+
testcase *test = tests + i;
|
119
|
+
mongocrypt_status_t *status = mongocrypt_status_new();
|
120
|
+
mc_RangeOpts_t ro;
|
121
|
+
printf("running test_mc_RangeOpts_to_FLE2RangeInsertSpec subtest: %s\n", test->desc);
|
122
|
+
ASSERT_OK_STATUS(mc_RangeOpts_parse(&ro, TMP_BSON(test->in), status), status);
|
123
|
+
bson_t out = BSON_INITIALIZER;
|
124
|
+
bool ret = mc_RangeOpts_to_FLE2RangeInsertSpec(&ro, TMP_BSON(test->v), &out, status);
|
125
|
+
if (!test->expectError) {
|
126
|
+
ASSERT_OK_STATUS(ret, status);
|
127
|
+
ASSERT_EQUAL_BSON(TMP_BSON(test->expect), &out);
|
128
|
+
} else {
|
129
|
+
ASSERT_FAILS_STATUS(ret, status, test->expectError);
|
130
|
+
}
|
131
|
+
bson_destroy(&out);
|
132
|
+
mc_RangeOpts_cleanup(&ro);
|
133
|
+
mongocrypt_status_destroy(status);
|
134
|
+
}
|
167
135
|
}
|
168
136
|
|
169
|
-
void
|
170
|
-
|
171
|
-
|
172
|
-
INSTALL_TEST (test_mc_RangeOpts_parse);
|
173
|
-
INSTALL_TEST (test_mc_RangeOpts_to_FLE2RangeInsertSpec);
|
137
|
+
void _mongocrypt_tester_install_mc_RangeOpts(_mongocrypt_tester_t *tester) {
|
138
|
+
INSTALL_TEST(test_mc_RangeOpts_parse);
|
139
|
+
INSTALL_TEST(test_mc_RangeOpts_to_FLE2RangeInsertSpec);
|
174
140
|
}
|
@@ -18,234 +18,151 @@
|
|
18
18
|
#include "test-mongocrypt-assert.h"
|
19
19
|
#include "test-mongocrypt.h"
|
20
20
|
|
21
|
-
static void
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
"expected byte length >= 3 got: 2");
|
47
|
-
|
48
|
-
_mongocrypt_buffer_cleanup (&input_buf);
|
49
|
-
mongocrypt_status_destroy (status);
|
21
|
+
static void _test_mc_reader(_mongocrypt_tester_t *tester) {
|
22
|
+
_mongocrypt_buffer_t input_buf;
|
23
|
+
_mongocrypt_buffer_copy_from_hex(&input_buf, "ABCD");
|
24
|
+
|
25
|
+
mongocrypt_status_t *status;
|
26
|
+
status = mongocrypt_status_new();
|
27
|
+
|
28
|
+
mc_reader_t reader;
|
29
|
+
mc_reader_init_from_buffer(&reader, &input_buf, __FUNCTION__);
|
30
|
+
|
31
|
+
uint8_t value;
|
32
|
+
ASSERT_OK_STATUS(mc_reader_read_u8(&reader, &value, status), status);
|
33
|
+
ASSERT_CMPUINT(value, ==, 0xAB);
|
34
|
+
ASSERT_CMPUINT64(mc_reader_get_consumed_length(&reader), ==, 1);
|
35
|
+
ASSERT_CMPUINT64(mc_reader_get_remaining_length(&reader), ==, 1);
|
36
|
+
|
37
|
+
ASSERT_OK_STATUS(mc_reader_read_u8(&reader, &value, status), status);
|
38
|
+
ASSERT_CMPUINT(value, ==, 0xCD);
|
39
|
+
ASSERT_CMPUINT64(mc_reader_get_consumed_length(&reader), ==, 2);
|
40
|
+
ASSERT_CMPUINT64(mc_reader_get_remaining_length(&reader), ==, 0);
|
41
|
+
|
42
|
+
ASSERT_FAILS_STATUS(mc_reader_read_u8(&reader, &value, status), status, "expected byte length >= 3 got: 2");
|
43
|
+
|
44
|
+
_mongocrypt_buffer_cleanup(&input_buf);
|
45
|
+
mongocrypt_status_destroy(status);
|
50
46
|
}
|
51
47
|
|
52
|
-
static void
|
53
|
-
|
54
|
-
{
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
status = mongocrypt_status_new ();
|
79
|
-
|
80
|
-
mc_reader_t reader;
|
81
|
-
mc_reader_init_from_buffer (&reader, &input_buf, __FUNCTION__);
|
82
|
-
|
83
|
-
_mongocrypt_buffer_t value;
|
84
|
-
ASSERT_OK_STATUS (mc_reader_read_uuid_buffer (&reader, &value, status),
|
85
|
-
status);
|
86
|
-
ASSERT (value.subtype == BSON_SUBTYPE_UUID);
|
87
|
-
|
88
|
-
ASSERT_CMPBYTES (
|
89
|
-
expected_bytes, (size_t) expected_len, value.data, value.len);
|
90
|
-
|
91
|
-
|
92
|
-
uint8_t ui;
|
93
|
-
ASSERT_FAILS_STATUS (mc_reader_read_u8 (&reader, &ui, status),
|
94
|
-
status,
|
95
|
-
"expected byte length >= 17 got: 16");
|
96
|
-
|
97
|
-
_mongocrypt_buffer_cleanup (&input_buf);
|
98
|
-
_mongocrypt_buffer_cleanup (&value);
|
99
|
-
mongocrypt_status_destroy (status);
|
48
|
+
static void _test_mc_reader_uuid(_mongocrypt_tester_t *tester) {
|
49
|
+
const uint8_t expected_bytes[] =
|
50
|
+
{0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12};
|
51
|
+
uint64_t expected_len = sizeof(expected_bytes);
|
52
|
+
|
53
|
+
_mongocrypt_buffer_t input_buf;
|
54
|
+
_mongocrypt_buffer_copy_from_hex(&input_buf, "12345678901234567890123456789012");
|
55
|
+
|
56
|
+
mongocrypt_status_t *status;
|
57
|
+
status = mongocrypt_status_new();
|
58
|
+
|
59
|
+
mc_reader_t reader;
|
60
|
+
mc_reader_init_from_buffer(&reader, &input_buf, __FUNCTION__);
|
61
|
+
|
62
|
+
_mongocrypt_buffer_t value;
|
63
|
+
ASSERT_OK_STATUS(mc_reader_read_uuid_buffer(&reader, &value, status), status);
|
64
|
+
ASSERT(value.subtype == BSON_SUBTYPE_UUID);
|
65
|
+
|
66
|
+
ASSERT_CMPBYTES(expected_bytes, (size_t)expected_len, value.data, value.len);
|
67
|
+
|
68
|
+
uint8_t ui;
|
69
|
+
ASSERT_FAILS_STATUS(mc_reader_read_u8(&reader, &ui, status), status, "expected byte length >= 17 got: 16");
|
70
|
+
|
71
|
+
_mongocrypt_buffer_cleanup(&input_buf);
|
72
|
+
_mongocrypt_buffer_cleanup(&value);
|
73
|
+
mongocrypt_status_destroy(status);
|
100
74
|
}
|
101
75
|
|
102
|
-
static void
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
0x56,
|
116
|
-
0x78,
|
117
|
-
0x12,
|
118
|
-
0x34,
|
119
|
-
0x56,
|
120
|
-
0x78, // 16
|
121
|
-
0x12,
|
122
|
-
0x34,
|
123
|
-
0x56,
|
124
|
-
0x78,
|
125
|
-
0x12,
|
126
|
-
0x34,
|
127
|
-
0x56,
|
128
|
-
0x78,
|
129
|
-
0x12,
|
130
|
-
0x34,
|
131
|
-
0x56,
|
132
|
-
0x78,
|
133
|
-
0x12,
|
134
|
-
0x34,
|
135
|
-
0x56,
|
136
|
-
0x78};
|
137
|
-
uint64_t expected_len = sizeof (expected_bytes);
|
138
|
-
|
139
|
-
_mongocrypt_buffer_t input_buf;
|
140
|
-
_mongocrypt_buffer_copy_from_hex (&input_buf,
|
76
|
+
static void _test_mc_reader_prfblock(_mongocrypt_tester_t *tester) {
|
77
|
+
const uint8_t expected_bytes[] = {0x12, 0x34, 0x56,
|
78
|
+
0x78, // 4
|
79
|
+
0x12, 0x34, 0x56,
|
80
|
+
0x78, // 8
|
81
|
+
0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56,
|
82
|
+
0x78, // 16
|
83
|
+
0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78,
|
84
|
+
0x12, 0x34, 0x56, 0x78, 0x12, 0x34, 0x56, 0x78};
|
85
|
+
uint64_t expected_len = sizeof(expected_bytes);
|
86
|
+
|
87
|
+
_mongocrypt_buffer_t input_buf;
|
88
|
+
_mongocrypt_buffer_copy_from_hex(&input_buf,
|
141
89
|
"12345678123456781234567812345678"
|
142
90
|
"12345678123456781234567812345678");
|
143
91
|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
mc_reader_t reader;
|
148
|
-
mc_reader_init_from_buffer (&reader, &input_buf, __FUNCTION__);
|
92
|
+
mongocrypt_status_t *status;
|
93
|
+
status = mongocrypt_status_new();
|
149
94
|
|
150
|
-
|
151
|
-
|
152
|
-
status);
|
153
|
-
ASSERT (value.subtype == BSON_SUBTYPE_ENCRYPTED);
|
95
|
+
mc_reader_t reader;
|
96
|
+
mc_reader_init_from_buffer(&reader, &input_buf, __FUNCTION__);
|
154
97
|
|
155
|
-
|
156
|
-
|
98
|
+
_mongocrypt_buffer_t value;
|
99
|
+
ASSERT_OK_STATUS(mc_reader_read_prfblock_buffer(&reader, &value, status), status);
|
100
|
+
ASSERT(value.subtype == BSON_SUBTYPE_ENCRYPTED);
|
157
101
|
|
102
|
+
ASSERT_CMPBYTES(expected_bytes, (size_t)expected_len, value.data, value.len);
|
158
103
|
|
159
|
-
|
160
|
-
|
161
|
-
status,
|
162
|
-
"expected byte length >= 33 got: 32");
|
104
|
+
uint8_t ui;
|
105
|
+
ASSERT_FAILS_STATUS(mc_reader_read_u8(&reader, &ui, status), status, "expected byte length >= 33 got: 32");
|
163
106
|
|
164
|
-
|
165
|
-
|
166
|
-
|
107
|
+
_mongocrypt_buffer_cleanup(&input_buf);
|
108
|
+
_mongocrypt_buffer_cleanup(&value);
|
109
|
+
mongocrypt_status_destroy(status);
|
167
110
|
}
|
168
111
|
|
112
|
+
static void _test_mc_reader_ints(_mongocrypt_tester_t *tester) {
|
113
|
+
_mongocrypt_buffer_t input_buf;
|
114
|
+
_mongocrypt_buffer_copy_from_hex(&input_buf, "001122330011223344556677");
|
169
115
|
|
170
|
-
|
171
|
-
|
172
|
-
{
|
173
|
-
_mongocrypt_buffer_t input_buf;
|
174
|
-
_mongocrypt_buffer_copy_from_hex (&input_buf, "001122330011223344556677");
|
116
|
+
mongocrypt_status_t *status;
|
117
|
+
status = mongocrypt_status_new();
|
175
118
|
|
176
|
-
|
177
|
-
|
119
|
+
mc_reader_t reader;
|
120
|
+
mc_reader_init_from_buffer(&reader, &input_buf, __FUNCTION__);
|
178
121
|
|
179
|
-
|
180
|
-
|
122
|
+
uint32_t u32;
|
123
|
+
ASSERT_OK_STATUS(mc_reader_read_u32(&reader, &u32, status), status);
|
124
|
+
ASSERT_CMPUINT32(u32, ==, 0x33221100);
|
181
125
|
|
182
|
-
|
183
|
-
|
184
|
-
|
126
|
+
uint64_t u64;
|
127
|
+
ASSERT_OK_STATUS(mc_reader_read_u64(&reader, &u64, status), status);
|
128
|
+
ASSERT_CMPUINT64(u64, ==, 0x7766554433221100ULL);
|
185
129
|
|
186
|
-
|
187
|
-
|
188
|
-
ASSERT_CMPUINT64 (u64, ==, 0x7766554433221100ULL);
|
189
|
-
|
190
|
-
_mongocrypt_buffer_cleanup (&input_buf);
|
191
|
-
mongocrypt_status_destroy (status);
|
130
|
+
_mongocrypt_buffer_cleanup(&input_buf);
|
131
|
+
mongocrypt_status_destroy(status);
|
192
132
|
}
|
193
133
|
|
194
|
-
static void
|
195
|
-
|
196
|
-
{
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
status = mongocrypt_status_new ();
|
221
|
-
|
222
|
-
mc_reader_t reader;
|
223
|
-
mc_reader_init_from_buffer (&reader, &input_buf, __FUNCTION__);
|
224
|
-
|
225
|
-
const uint8_t *ptr;
|
226
|
-
const uint64_t len = 4;
|
227
|
-
ASSERT_OK_STATUS (
|
228
|
-
mc_reader_read_bytes (&reader, (const uint8_t **) &ptr, len, status),
|
229
|
-
status);
|
230
|
-
ASSERT_CMPBYTES (expected_bytes, 4, ptr, (size_t) len);
|
231
|
-
|
232
|
-
_mongocrypt_buffer_t value_buf;
|
233
|
-
ASSERT_OK_STATUS (mc_reader_read_buffer_to_end (&reader, &value_buf, status),
|
234
|
-
status);
|
235
|
-
ASSERT_CMPBYTES (
|
236
|
-
expected_bytes + 4u, (size_t)expected_len - 4u, value_buf.data, value_buf.len);
|
237
|
-
|
238
|
-
_mongocrypt_buffer_cleanup (&input_buf);
|
239
|
-
_mongocrypt_buffer_cleanup (&value_buf);
|
240
|
-
mongocrypt_status_destroy (status);
|
134
|
+
static void _test_mc_reader_bytes(_mongocrypt_tester_t *tester) {
|
135
|
+
const uint8_t expected_bytes[] =
|
136
|
+
{0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12};
|
137
|
+
uint64_t expected_len = sizeof(expected_bytes);
|
138
|
+
|
139
|
+
_mongocrypt_buffer_t input_buf;
|
140
|
+
_mongocrypt_buffer_copy_from_hex(&input_buf, "12345678901234567890123456789012");
|
141
|
+
|
142
|
+
mongocrypt_status_t *status;
|
143
|
+
status = mongocrypt_status_new();
|
144
|
+
|
145
|
+
mc_reader_t reader;
|
146
|
+
mc_reader_init_from_buffer(&reader, &input_buf, __FUNCTION__);
|
147
|
+
|
148
|
+
const uint8_t *ptr;
|
149
|
+
const uint64_t len = 4;
|
150
|
+
ASSERT_OK_STATUS(mc_reader_read_bytes(&reader, (const uint8_t **)&ptr, len, status), status);
|
151
|
+
ASSERT_CMPBYTES(expected_bytes, 4, ptr, (size_t)len);
|
152
|
+
|
153
|
+
_mongocrypt_buffer_t value_buf;
|
154
|
+
ASSERT_OK_STATUS(mc_reader_read_buffer_to_end(&reader, &value_buf, status), status);
|
155
|
+
ASSERT_CMPBYTES(expected_bytes + 4u, (size_t)expected_len - 4u, value_buf.data, value_buf.len);
|
156
|
+
|
157
|
+
_mongocrypt_buffer_cleanup(&input_buf);
|
158
|
+
_mongocrypt_buffer_cleanup(&value_buf);
|
159
|
+
mongocrypt_status_destroy(status);
|
241
160
|
}
|
242
161
|
|
243
|
-
void
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
INSTALL_TEST (_test_mc_reader_ints);
|
250
|
-
INSTALL_TEST (_test_mc_reader_bytes);
|
162
|
+
void _mongocrypt_tester_install_mc_reader(_mongocrypt_tester_t *tester) {
|
163
|
+
INSTALL_TEST(_test_mc_reader);
|
164
|
+
INSTALL_TEST(_test_mc_reader_uuid);
|
165
|
+
INSTALL_TEST(_test_mc_reader_prfblock);
|
166
|
+
INSTALL_TEST(_test_mc_reader_ints);
|
167
|
+
INSTALL_TEST(_test_mc_reader_bytes);
|
251
168
|
}
|