Crypt_blowfish 8-bit character mishandling
seclists.org
seclists.org
Most of the users are German or French speaking, so I'm sure there will be 8bit characters. I wonder whether just forcing them to use the forgot-my-password function is good enough or whether I will have to do extra work.
Still. Very detailed email and very helpful thread.
This just goes to show that testing more and especially unexpected input is extremely important. Test driven development is nice, but in general it only tests for known valid data and what it should return but doesn't include the tests to verify that the program still behaves as expected when given invalid data or data that you aren't expecting it to receive.
Crypt_blowfish handles 8(and higher?)-bit characters wrong on OpenBSD? Are other *nix systems also affected? Is the wrong character handling consistent?
according to another post (http://seclists.org/oss-sec/2011/q2/653) postgresql and php-suhosin use the same crypt_blowfish code, but may or may not be affected.
Colin uses uint8_t* everywhere -- I think it's a standard practice in crypto code to use types that specify their size and signness right in the name and avoid using char/unsigned char directly.
Plus, scrypt doesn't do any encoding -- it's user's responsibility to serialize raw bytes into the suitable format.