erlang/otp — pull request #369 by pguyot (2014-05-15 14:40:35+00:00)
Title: Fix bug in SRP implementation

SRP didn't work with smaller primes as user secret was improperly
computed.

Formula is: (B - (k * g^x)) ^ (a + (u * x)) % N

Previously, the code computed a + (u * x) % N instead of a + (u * x).
a typically is a 256 bits random number (RFC 5054 says it should be at
least 256 bits), u and x are SHA1 signatures (160 bits). So a + (u * x)
can differ from a + (u * x) % N for N primes smaller than 320 bits.