Skip to content

Commit a28bf1c

Browse files
authored
MONGOCRYPT-822 bypass "buildinfo" command (#1034)
To match server behavior. Server supports both "buildInfo" and "buildinfo"
1 parent 5c474ff commit a28bf1c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/mongocrypt-ctx-encrypt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2168,7 +2168,8 @@ _check_cmd_for_auto_encrypt(mongocrypt_binary_t *cmd, bool *bypass, char **targe
21682168
eligible = true;
21692169
} else if (0 == strcmp(cmd_name, "hello")) {
21702170
*bypass = true;
2171-
} else if (0 == strcmp(cmd_name, "buildInfo")) {
2171+
} else if (0 == strcmp(cmd_name, "buildInfo") || 0 == strcmp(cmd_name, "buildinfo")) {
2172+
// Accept either case form to match server behavior.
21722173
*bypass = true;
21732174
} else if (0 == strcmp(cmd_name, "getCmdLineOpts")) {
21742175
*bypass = true;

test/test-mongocrypt-ctx-encrypt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,7 @@ static void _test_encrypt_init_each_cmd(_mongocrypt_tester_t *tester) {
983983
_init_ok(tester, "{'compactStructuredEncryptionData': 'coll'}");
984984
_init_bypass(tester, "{'hello': 1}");
985985
_init_bypass(tester, "{'buildInfo': 1}");
986+
_init_bypass(tester, "{'buildinfo': 1}");
986987
_init_bypass(tester, "{'getCmdLineOpts': 1}");
987988
_init_bypass(tester, "{'getLog': 1}");
988989
_init_ok(tester, "{'collMod': 'coll'}");

0 commit comments

Comments
 (0)