The current problem is that pam still doesn't authenticate against the OX database: saslauthd[8487]: pam_mysql - SELECT returned no result.
This is due to he fact that pam and ox hashes the passwords differently. That much is evident, but I don't understand in what format OX stores it's passwords... As seen in the script, the default method of SHA is changed to CRYPT, as this is the only method we have got to work with pam-mysql... Still, after this change, a restart and a new user creation, the password in the database doesn't match any of the following hashing methods:
Still, as encrypt() produces a string with the same length, I guess OX is indeed using encrypt() - but possibly with some seed/salt added to the password. Can anyone confirm this and possible instruct how to tell pam how to authenticate against this?
EDIT: Even more confusing:
Creating a second testuser with the same password ("secret") produces yet another hash in the password field:
This is due to he fact that pam and ox hashes the passwords differently. That much is evident, but I don't understand in what format OX stores it's passwords... As seen in the script, the default method of SHA is changed to CRYPT, as this is the only method we have got to work with pam-mysql... Still, after this change, a restart and a new user creation, the password in the database doesn't match any of the following hashing methods:
Code:
mysql> select l.uid, u.userPassword from login2user l LEFT JOIN user u on l.id=u.id and l.cid=u.cid WHERE u.cid=1 AND l.uid='testuser'; +----------+---------------+ | uid | userPassword | +----------+---------------+ | testuser | PmJ.sS6RSS1io | +----------+---------------+ 1 row in set (0.00 sec) mysql> select sha('secret'); +------------------------------------------+ | sha('secret') | +------------------------------------------+ | e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4 | +------------------------------------------+ 1 row in set (0.00 sec) mysql> select encrypt('secret'); +-------------------+ | encrypt('secret') | +-------------------+ | KCuK/kHIq6f2Y | +-------------------+ 1 row in set (0.00 sec) mysql> SELECT password('secret'); +-------------------------------------------+ | password('secret') | +-------------------------------------------+ | *14E65567ABDB5135D0CFD9A70B3032C179A49EE7 | +-------------------------------------------+ 1 row in set (0.00 sec) mysql> SELECT md5('secret'); +----------------------------------+ | md5('secret') | +----------------------------------+ | 5ebe2294ecd0e0f08eab7690d2a6ee69 | +----------------------------------+ 1 row in set (0.00 sec)
EDIT: Even more confusing:
Creating a second testuser with the same password ("secret") produces yet another hash in the password field:
Code:
/etc/init.d/open-xchange-admin restart /etc/init.d/open-xchange-groupware restart /opt/open-xchange/sbin/createuser -c 1 -A oxadmin -P $OX_ADMIN_PASSWORD -u testuser2 -d "Test User 2" -g Test -s User -p secret -e testuser2@$DOMAIN --imaplogin testuser2 --imapserver 127.0.0.1 --smtpserver 127.0.0.1 mysql -D oxdatabase_6 -u openexchange -p mysql> select l.uid, u.userPassword from login2user l LEFT JOIN user u on l.id=u.id and l.cid=u.cid WHERE u.cid=1 AND l.uid='testuser2'; +-----------+---------------+ | uid | userPassword | +-----------+---------------+ | testuser2 | 7rw6tPeKns97A | +-----------+---------------+ 1 row in set (0.00 sec)
Comment