roundcube/roundcubemail — pull request #230 by lopezio (2014-10-14 23:29:30+00:00)
Title: Password Plugin / LDAP Driver: Add support for CRAM-MD5 and multiple userPassword values

This pull request replaces another one I recently submitted - please apologize for the bad first submit, which also contained a conflicting change now removed.

This patch adds support to the LDAP password change driver for storing the CRAM-MD5 hashed password (doveadm pw style), as well as adding support for multiple userPassword values.

The former is necessary in environments where CRAM-MD5 auth is used or required by mail user agents, and multiple values support is necessary to be able to store at least one more hashing method compatible with LDAP bind auth (which does not support CRAM-MD5). This has been tested with CRAM-MD5 + SSHA hashes against dovecot2-2.2.13 (IMAP, both CRAM-MD5 and PLAIN login), ldapsearch, roundcube, phpldapadmin, and postfix.

Changes are fully backward compatible and do not present any issues to existing installations and existing settings. To use this change, users must explicitly specify a $config['password_ldap_encodage'] with a value of 'cram-md5' or 'cram-md5+' (or '++').

Credits for the PHP version of the hmac_md5 generator go to Hajo Noerenberg, whose code is included in the added file plugins/password/helpers/dovecot_hmacmd5.php.

I hope it is good enough for a pull now after review.