Skip to content

Commit

Permalink
MONGOCRYPT-316 bypass hello, buildInfo, getCmdLineOpts, and getLog (#346
Browse files Browse the repository at this point in the history
)

Also resolves MONGOCRYPT-308
  • Loading branch information
kevinAlbs authored May 23, 2022
1 parent 64f9a08 commit 591bcfa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/mongocrypt-ctx-encrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2192,6 +2192,14 @@ _check_cmd_for_auto_encrypt (mongocrypt_binary_t *cmd,
*bypass = true;
} else if (0 == strcmp (cmd_name, "compactStructuredEncryptionData")) {
eligible = true;
} else if (0 == strcmp (cmd_name, "hello")) {
*bypass = true;
} else if (0 == strcmp (cmd_name, "buildInfo")) {
*bypass = true;
} else if (0 == strcmp (cmd_name, "getCmdLineOpts")) {
*bypass = true;
} else if (0 == strcmp (cmd_name, "getLog")) {
*bypass = true;
}

/* database/client commands are ineligible. */
Expand Down
4 changes: 4 additions & 0 deletions test/test-mongocrypt-ctx-encrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,10 @@ _test_encrypt_init_each_cmd (_mongocrypt_tester_t *tester)
_init_bypass (tester, "{'killAllSessionsByPattern': 1}");
_init_bypass (tester, "{'refreshSessions': 1}");
_init_ok (tester, "{'compactStructuredEncryptionData': 'coll'}");
_init_bypass (tester, "{'hello': 1}");
_init_bypass (tester, "{'buildInfo': 1}");
_init_bypass (tester, "{'getCmdLineOpts': 1}");
_init_bypass (tester, "{'getLog': 1}");
}


Expand Down

0 comments on commit 591bcfa

Please sign in to comment.