Commit 5991f12
committed
test[faustwp]: relax hash_equals count assertion to avoid false positives
Principal-review nit on the source-level regression guard in
RestCallbacksTests::test_secret_comparisons_use_constant_time_hash_equals.
The previous assertion hardcoded substr_count(rest/callbacks.php,
'hash_equals') === 2, matching the exact number of hash_equals call
sites that this PR adds. Any future contributor legitimately adding
a third hash_equals call (e.g. for a new permission callback) would
trip a false-positive 'security regression' and waste debugging time
chasing a non-bug.
Switched to assertGreaterThanOrEqual(1, ...). The real revert guards
are the two assertStringNotContainsString(...) calls above, which
specifically catch the '=== $header_key' and '!== $_SERVER[...]'
patterns this PR removes. The substr_count assertion is an affirmative
check that hash_equals() is still present somewhere -- a count of >= 1
is sufficient for that purpose.1 parent 31e10ba commit 5991f12
1 file changed
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
157 | | - | |
158 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
159 | 164 | | |
160 | 165 | | |
161 | 166 | | |
| |||
0 commit comments