Commit d0aed74
fix: use length-check + ct_eq for constant-time auth comparison (#153)
Replace zero-padded constant-time comparison with the canonical pattern:
check lengths first (non-constant-time, acceptable since length
leakage doesn't help brute-force a high-entropy token), then ct_eq
on equal-length slices. This avoids a theoretical null-byte
false-positive in the padding approach.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent b1c837b commit d0aed74
1 file changed
Lines changed: 5 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
943 | 943 | | |
944 | 944 | | |
945 | 945 | | |
946 | | - | |
| 946 | + | |
| 947 | + | |
947 | 948 | | |
948 | 949 | | |
949 | 950 | | |
950 | 951 | | |
951 | 952 | | |
952 | 953 | | |
953 | | - | |
954 | | - | |
955 | | - | |
956 | | - | |
957 | | - | |
958 | | - | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
959 | 957 | | |
960 | 958 | | |
961 | 959 | | |
| |||
0 commit comments