[tpop3d-discuss]MySQL Auth with MD5/Base64 Hash

Nico Rittner nrittner at cs.atlas-brb.de
Mon, 28 Nov 2005 09:09:18 +0100


just trying to get Mysql-Authentication with
Md5 PW-Hashes (encoded in Base64 ) to work.

The Hash of the PW i create this way:
echo -n "doedel" | openssl dgst -md5 -binary|openssl enc -base64
$ fGU0HaMppGmX4p+FX00aoQ==   ( 24 bytes )
If i prepend {md5} to the hash, tpop3d fails
with 'has password type md5, but hash is of incorrect length'.
If i use only the Hash without {md5}, it fails with
'failed login with wrong password' .
BUT : If i use Hex instead of base64 encoding (without prepending {md5} )
everything works.
I looked at the source and found that tpop3d assumes hex
if the length of the hash is 32 and base64 if it is 24 bytes long.
Am i wrong in understanding when and how
tpop3d handles the hash-prefixes and md5/base64 PW-Hashes ?
The version i use is 1.5.3 ( Gentoo ).

Thank you.