Commit dca2d90
jmestwa-coder
use SecureRandom for digest auth cnonce (#2220)
The digest cnonce was drawn from a non-cryptographic PRNG:
- Realm.Builder.newCnonce seeds the cnonce from ThreadLocalRandom, whose
output is predictable
- RFC 7616 section 3.3 needs the cnonce unpredictable so it guards
against chosen-plaintext and precomputation attacks on the credentials
- NtlmEngine and ScramEngine in this repo already use SecureRandom for
their nonces
Switched the cnonce source to SecureRandom to match.1 parent cb1bd89 commit dca2d90
1 file changed
Lines changed: 8 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | | - | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
| |||
283 | 282 | | |
284 | 283 | | |
285 | 284 | | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
286 | 288 | | |
287 | 289 | | |
288 | 290 | | |
| |||
608 | 610 | | |
609 | 611 | | |
610 | 612 | | |
611 | | - | |
| 613 | + | |
612 | 614 | | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | | - | |
| 615 | + | |
| 616 | + | |
618 | 617 | | |
619 | 618 | | |
620 | 619 | | |
| |||
719 | 718 | | |
720 | 719 | | |
721 | 720 | | |
722 | | - | |
| 721 | + | |
723 | 722 | | |
724 | 723 | | |
725 | 724 | | |
| |||
0 commit comments