Skip to content

Commit a34bc57

Browse files
mdb-adkevinAlbs
andauthored
Apply suggestions from code review
Co-authored-by: Kevin Albertson <kevin.eric.albertson@gmail.com>
1 parent 6f385a3 commit a34bc57

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

test/gen_fuzz_corpus.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
88
The optional extra bytes are consumed by drive_ctx() as it walks the state
99
machine. For NEED_MONGO_* states it reads a 2-byte LE length then that many
10-
bytes; for NEED_KMS it reads exactly bytes_needed bytes from the KMS context.
10+
bytes; for NEED_KMS it reads exactly bytes_needed bytes from the input.
1111
1212
Op selectors (must match the enum in fuzz_mongocrypt.c):
1313
0 OP_ENCRYPT
1414
1 OP_DECRYPT
1515
2 OP_EXPLICIT_ENCRYPT
1616
3 OP_EXPLICIT_DECRYPT
17-
4 OP_DATAKEY (input_bin ignored; extra bytes unused unless
18-
5 OP_REWRAP_MANY_DATAKEY state machine needs feeding)
17+
4 OP_DATAKEY (input_bin ignored; extra bytes unused unless state machine needs feeding)
18+
5 OP_REWRAP_MANY_DATAKEY
1919
6 OP_EXPLICIT_ENCRYPT_EXPRESSION
2020
7 OP_DATAKEY_AWS (extra bytes fed to KMS HTTP response parser)
2121
8 OP_DATAKEY_KMIP (extra bytes fed to KMIP/TTLV response parser)
@@ -81,8 +81,8 @@ def build_entries() -> dict[str, bytes]:
8181

8282
# -- OP_ENCRYPT (0) ------------------------------------------------------
8383
# mongocrypt_ctx_encrypt_init expects a command BSON doc.
84-
for cmd, coll in [("find", "test"), ("aggregate", "test"), ("insert", "test")]:
85-
name = f"op0_encrypt_{cmd}"
84+
for cmd in ["find", "aggregate", "insert"]:
85+
coll = "test"
8686
payload = bson(_bson_elem_string(cmd, coll))
8787
entries[name] = bytes([0]) + payload
8888
# With extra bytes to drive state machine transitions.

0 commit comments

Comments
 (0)