Hi, thank your response:

I prepare the password:

my $digest = md5_base64("foo");

my $result = $ldap->modify(dn=>$dn, 
replace=>{'userPassword'=>"{MD5}$digest"});

The expected result is to have {MD5}rL0Y20zC+Fzt72VPzMSk2A as the value for 
the userPassword field, but instead i get: 

userPassword:: e01ENX1yTDBZMjB6QytGenQ3MlZQek1TazJB

If i base64 decode this password:

perl -MMIME::Base64 -e 'print decode_base64 
("e01ENX1yTDBZMjB6QytGenQ3MlZQek1TazJB"), "\n"; '

I get {MD5}rL0Y20zC+Fzt72VPzMSk2A. For instance the password is encoded 
twice to base64. 

Sorry if i'am not seeing something obvious ?, i've been the whole day 
looking in google.

Hans







Hans

On Thu, 09 Nov 2006 14:32:08 -0800, Quanah Gibson-Mount wrote
> --On Thursday, November 09, 2006 6:46 PM -0400 Hans Poo 
> <[EMAIL PROTECTED]> wrote:
> 
> > I'am using the Perl Net::LDAP Module with openldap-2.3.24 (uses LDAP
> > protocol Version 3).
> >
> > I need to update the userPassword field, the problem is that somewhere 
in
> > the middle the new password i'am giving gets base64 encoded.
> >
> > As to my understanding i'am preparing the whole password.
> >
> > In the password i'am putting first the encoding type: {MD5}, {SSHA}, etc
> > and  then the hash. No matter what i do, even the supposed encoding type
> > gets  base64 encoded once in the Server.
> >
> > I'am not sure if it is Net::LDAP or the server itself who is doing this:
> >
> > I've tried two diferent perl ways:
> >
> > 1.- Using replace
> >
> > my $result = $ldap->modify(dn=>$dn,
> > replace=>{'userPassword'=>"{MD5}$digest"});
> >
> > 2.- Using extended operations
> > my $result = $ldap->set_password(user=>$dn, newpasswd 
=> "{MD5}$digest");
> >
> > In the server the new password "{MD5}$digest" is a big base64 string.
> >
> > I'am not including the rest of the MD5 or bind stuff, but it's Ok.
> 
> It is supposed to be base64 encoded, what is the problem here?
> 
> --Quanah
> 
> --
> Quanah Gibson-Mount
> Principal Software Developer
> ITS/Shared Application Services
> Stanford University
> GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html


Hans Christian Poo Rocco, Gerente General WeLinux.S.A. 
Of: 672.93.18, Cel: 09-319.93.05, [EMAIL PROTECTED], http://www.welinux.cl
Nataniel Cox # 210 Of 56, Santiago de Chile

Reply via email to