This patch adds more flexibility to the password encryption feature.

The old mechanism would only write cleartext or MD5 password hashes back to LDAP wherein this new method handles many more encryption types like salted hashes and SHA. It does check to see if these additional encryption types are supported by PHP at configuration time.

The patch includes a database update (currently number 6003) that renames the "encrypted" column to "enc_type" to better reflect the data stored. Also, the old values of the column were not remapped to keep disruption at a minimum ( '0' = clear, '1' = MD5).

Tested with D6.14 and OpenLDAP.

Comments

retsamedoc’s picture

Version: 6.x-1.0-beta1 » 6.x-1.0-beta2
StatusFileSize
new12.68 KB

Updated for 6.x-1.0-beta2. Please test.

retsamedoc’s picture

Oops, forgot to increment the database update to 6004. Fixed here.

thtas’s picture

Tested this and it works well with SSHA for authentication. thanks!

The patch just needs to change the LDAPInterface.inc to change the set/get option name from "encrypted" to "enc_type"
otherwise it only sets plain text passwords in the LDAP directory.

arthur.duarte’s picture

Hi,

The patch works, but I needed to do some modifications:

In the Database:
- I had to go the ldapauth table and change manually column "encrypted" to column "enc_type"

In the LDAPInterface.inc file:
- I modified all entries from "encrypted" to "enc_type"

Now, I can have Drupal as a password manager to my LDAP.

Thank you Dude.

landry’s picture

Attaching new patch with LDAPInterface.inc change for getOption/setOption.
Tested working fine with ldapprov, with the added patch changing encrypted occurences to enc_type, and adding ldapprov_encode_password(). encode_password() in ldapdata could take a server as arg, instead of relying on global $_ldapdata_ldap.

Could be good to have that integrated. Of course tested working fine here.

john franklin’s picture

Applied and tested on one of my sites, works as expected. Thanks.

johnbarclay’s picture

Status: Needs review » Reviewed & tested by the community
cgmonroe’s picture

Version: 6.x-1.0-beta2 » 6.x-1.x-dev
StatusFileSize
new13.62 KB

Here is a new version of the ldap_integration patch that will apply to the 6.x-1.x head.

Same as #5 but with some line number changes and updates ldapsync.module to use enc_type and not encryption.

cgmonroe’s picture

Status: Reviewed & tested by the community » Closed (fixed)

This has been committed to the 6.x-1.x branch. Marking as fixed/closed.