[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: inconsistent sshPublicKey entries



Michael W. Lucas wrote:
> On Tue, Feb 12, 2013 at 05:47:23PM +0100, Pierangelo Masarati wrote:
>> On 02/12/2013 05:32 PM, Michael W. Lucas wrote:
>>> Hi,
>>>
>>> I'm running OpenLDAP 2.4.21 on FreeBSD. We do a lot of administration
>>> via phpLDAPAdmin, but I do some command-line stuff. And I've seen an
>>> inconsistency between the two in the ldapPublicKey object class.
>>>
>>> When I look in phpLDAPAdmin, my SSH keys start like this:
>>>
>>> ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAw9zmtbk8b...
>>> ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfZ/p...
>>>
>>> If I do a ldapsearch, however, I get:
>>>
>>> sshPublicKey:: c3NoLXJzYSBBQUFBQjNOemFD....
>>> sshPublicKey: ssh-rsa AAAAB3NzaC1
>>
>> $ echo -n 'c3NoLXJzYSBBQUFBQjNOemFD' | base64 -d && echo ''
>> ssh-rsa AAAAB3NzaC
>>
>> likely there is something in the key that makes ldapsearch present in 
>> b64-encoded (likely a trailing space?)
> 
> You are exactly correct, thank you!
> 
> The problem keys had a trailing newline. Removed that, and all
> problems went away.

That's the reason why web2ldap's plugin class SshPublicKey strips white-space
chars from the user's input.

Ciao, Michael.