Commit df7fd97
committed
Throw on below-minimum opslimit/memlimit in sodium pwhash
The four sodium pwhash functions queued a zend_argument_error for an
opslimit or memlimit below the documented minimum but fell through to the
KDF instead of returning. When libsodium rejects the value the precise
argument error is clobbered by a generic "internal error"; when it
accepts the value the full KDF runs before the queued error surfaces,
defeating the minimum-cost gate. Add the missing RETURN_THROWS() so each
lower-bound check returns like its sibling upper-bound branches.
Closes GH-223831 parent ca4561c commit df7fd97
2 files changed
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1473 | 1473 | | |
1474 | 1474 | | |
1475 | 1475 | | |
| 1476 | + | |
1476 | 1477 | | |
1477 | 1478 | | |
1478 | 1479 | | |
| |||
1532 | 1533 | | |
1533 | 1534 | | |
1534 | 1535 | | |
| 1536 | + | |
1535 | 1537 | | |
1536 | 1538 | | |
1537 | 1539 | | |
| 1540 | + | |
1538 | 1541 | | |
1539 | 1542 | | |
1540 | 1543 | | |
| |||
1640 | 1643 | | |
1641 | 1644 | | |
1642 | 1645 | | |
| 1646 | + | |
1643 | 1647 | | |
1644 | 1648 | | |
1645 | 1649 | | |
| 1650 | + | |
1646 | 1651 | | |
1647 | 1652 | | |
1648 | 1653 | | |
| |||
1685 | 1690 | | |
1686 | 1691 | | |
1687 | 1692 | | |
| 1693 | + | |
1688 | 1694 | | |
1689 | 1695 | | |
1690 | 1696 | | |
| 1697 | + | |
1691 | 1698 | | |
1692 | 1699 | | |
1693 | 1700 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
0 commit comments