Repository navigation
Commit 233f3cc
committed
fix(stack-encrypt): an empty batch still has its context checked before any key request
A slice or Vec batch checked the call's context only through each item's
own check, so an empty batch checked nothing: a plan with no context and
none from the call, or a plan with its own context given a second one,
passed the pre-I/O check, loaded the keyset the chain named, and resolved
to an empty success. Opening a Vec of records had the same gap.
The batch impls of Runs (for fields plans and one-value plans) and Opens
(for a fields plan over Vec<FieldValues>) now check the context once,
apart from the items, before checking each item; their pending and
decryption fail on the same context, so a direct caller and a chain
agree. A context field's expected value is still checked per record,
since only a record holds the field. The one-value plans' Vec openings
already checked the context alone and only share the helper now.
Tests pin both refusals for an empty slice and Vec, run and opened,
before any keyset load, and the plan_build fuzz target checks an empty
batch's context for every plan it builds.1 parent 6e68d17 commit 233f3cc
4 files changed
Lines changed: 281 additions & 16 deletions
File tree
- packages/stack-encrypt
- fuzz/fuzz_targets
- src/plan
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
29 | | - | |
| 33 | + | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
| |||
135 | 139 | | |
136 | 140 | | |
137 | 141 | | |
138 | | - | |
139 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
140 | 146 | | |
141 | 147 | | |
142 | 148 | | |
| |||
160 | 166 | | |
161 | 167 | | |
162 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
163 | 203 | | |
164 | 204 | | |
165 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1324 | 1324 | | |
1325 | 1325 | | |
1326 | 1326 | | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
1327 | 1334 | | |
1328 | 1335 | | |
1329 | 1336 | | |
| |||
1352 | 1359 | | |
1353 | 1360 | | |
1354 | 1361 | | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
1355 | 1376 | | |
1356 | 1377 | | |
1357 | 1378 | | |
| |||
1545 | 1566 | | |
1546 | 1567 | | |
1547 | 1568 | | |
1548 | | - | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
1549 | 1572 | | |
1550 | | - | |
| 1573 | + | |
1551 | 1574 | | |
1552 | 1575 | | |
1553 | 1576 | | |
| |||
1557 | 1580 | | |
1558 | 1581 | | |
1559 | 1582 | | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
1560 | 1586 | | |
1561 | 1587 | | |
1562 | 1588 | | |
| |||
1574 | 1600 | | |
1575 | 1601 | | |
1576 | 1602 | | |
| 1603 | + | |
1577 | 1604 | | |
1578 | 1605 | | |
1579 | 1606 | | |
| |||
1598 | 1625 | | |
1599 | 1626 | | |
1600 | 1627 | | |
1601 | | - | |
| 1628 | + | |
1602 | 1629 | | |
1603 | 1630 | | |
1604 | 1631 | | |
| |||
1624 | 1651 | | |
1625 | 1652 | | |
1626 | 1653 | | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
1627 | 1657 | | |
1628 | 1658 | | |
1629 | 1659 | | |
1630 | 1660 | | |
1631 | 1661 | | |
1632 | 1662 | | |
1633 | 1663 | | |
| 1664 | + | |
1634 | 1665 | | |
1635 | 1666 | | |
1636 | 1667 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
318 | 325 | | |
319 | 326 | | |
320 | 327 | | |
| |||
375 | 382 | | |
376 | 383 | | |
377 | 384 | | |
378 | | - | |
| 385 | + | |
379 | 386 | | |
380 | 387 | | |
381 | 388 | | |
382 | 389 | | |
383 | | - | |
| 390 | + | |
384 | 391 | | |
385 | 392 | | |
386 | 393 | | |
| |||
444 | 451 | | |
445 | 452 | | |
446 | 453 | | |
447 | | - | |
| 454 | + | |
448 | 455 | | |
449 | 456 | | |
450 | 457 | | |
| |||
462 | 469 | | |
463 | 470 | | |
464 | 471 | | |
465 | | - | |
| 472 | + | |
466 | 473 | | |
467 | 474 | | |
468 | 475 | | |
| |||
491 | 498 | | |
492 | 499 | | |
493 | 500 | | |
494 | | - | |
| 501 | + | |
495 | 502 | | |
496 | 503 | | |
497 | 504 | | |
| |||
512 | 519 | | |
513 | 520 | | |
514 | 521 | | |
515 | | - | |
| 522 | + | |
516 | 523 | | |
517 | 524 | | |
0 commit comments