Resolves sporadic Negotiate/Kerberos auth failures that manifested
as proxy 407 loops or helper errors when decoding PAC data, depending
on ticket layout.
Previously, the parser advanced bpos by the remainder:
(bpos += bpos %n)
instead of padding to the next multiple of n.
For example, n = 4:
bpos=5 (r=1): current: 6 (wrong), correct: 8
bpos=6 (r=2): current: 8 (accidentally right)
bpos=7 (r=3): current: 10 (wrong), correct: 8
void
align(int n)
{
- if ( bpos % n != 0 ) {
- int al;
- al = (bpos/n);
- bpos = bpos+(bpos-n*al);
- }
+ if (const auto r = bpos % n)
+ bpos += (n - r);
}
void