]> jfr.im git - irc/atheme/atheme.git/commit
modules/crypto/pbkdf2v2: fix regression from v7.2.9
authorAaron Jones <redacted>
Thu, 5 Jul 2018 14:06:06 +0000 (14:06 +0000)
committerAaron Jones <redacted>
Thu, 5 Jul 2018 14:06:06 +0000 (14:06 +0000)
commitf281c237d509b39b7b1dee414776692813836c66
tree49f9161d22eb9d1ae2cafb1d8f7d93e4f58bc057
parentba6db376ea53b94f7081bf1cbd5e89bd5a6a7f25
modules/crypto/pbkdf2v2: fix regression from v7.2.9

Interoperability tests were performed between 7.2.9 and master,
and 7.2.10 and master, but not 7.2.9 and 7.2.10. 7.2.10 and
master use base64-encoded salts for new hashes, and master has
a verify function which doesn't require string-equal output.

However, 7.2 doesn't have that feature, so crypt() must output
a string-equal hash to all of the previous outputs over all
versions. What I failed to notice was that crypt() was assuming
the salt was base64-encoded, so if it wasn't, password
verification would fail; the hash is the same byte-wise, but it
is encoded as a string differently.

While we're at it, make sure the parameter upgrade system takes
account of various salt lengths, allow the user to configure a
different salt length (as if on master), and make sure we erase
the password from the stack after we're done with it.

Reported-by: xerox123
modules/crypto/pbkdf2v2.c