Antoine Jacoutot wrote:
Hi.
After several failed attempts, I need some help regarding the following issue. I need to import some users from a MySQL database to OpenLDAP. I cannot find a working way of converting the md5 password stored in the database (using md5() ) to the {MD5} password format for Ldap.
e.g: SQL: the md5 value of 'password' is 5f4dcc3b5aa765d61d8327deb882cf99
Looks like a hexpair representation of a binary value. Convert it to binary and base64 encode it.
OpenLDAP: the result of `slappasswd -h {MD5} -s password` is {MD5}X03MO1qnZdYdgyfeuILPmQ==
So obviously I won't be able to use {MD5}5f4dcc3b5aa765d61d8327deb882cf99
From what I could gather it has to do with Base64 encoding but all my
attemps at scripting something failed miserably :( Any hint would be appreciated.
p.
Ing. Pierangelo Masarati OpenLDAP Core Team
SysNet s.r.l. via Dossi, 8 - 27100 Pavia - ITALIA http://www.sys-net.it --------------------------------------- Office: +39 02 23998309 Mobile: +39 333 4963172 Email: pierangelo.masarati@sys-net.it ---------------------------------------