OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: Cyrus SASL + Postfix

From: Andreas Winkelmann (mlawinkelmann.de)
Date: Sat Jan 14 2006 - 02:24:16 CST


Am Tuesday 10 January 2006 15:50 schrieb Asaf Shakarchi:

> Regarding my question,
>
> I couldn’t figure out why postfix’s smtpd doesn’t even connect to
> saslauthd, at the end, I found out that the encoded string was NOT VALID, I
> created it by:
>
> perl -MMIME::Base64 -e 'print
> encode_base64("rmoo.co.il\0rmoo.co.il\01");'
>
> I spent hours on this, for some reason, the password ‘1’ caused the
> problem, when I changed it to anything else it seems that smtpd connected
> to saslauthd and I could successfully authenticate.

"\0" for 0 is incomplete. The Parser knows, that "\0" is all, if the next
character is no number. If it is a number it will be assigned to "\0".

$ echo -en "\01"|hex
0000 01 .

$ echo -en "\00001"|hex
0000 00 31 .1

> But still, I have a little question which probably is something that is
> known,
>
> Using a username as HYPERLINK "mailto:rmoo.co.il"rmoo.co.il with password
> such as abc by:
>
> perl -MMIME::Base64 -e 'print
> encode_base64("rmoo.co.il\0rmoo.co.il\0abc");’ resulted:
>
> ci5jby5pbAByLmNvLmlsAGFiYw==

$ echo "ci5jby5pbAByLmNvLmlsAGFiYw=="|mimencode -u|hex
0000 72 2e 63 6f 2e 69 6c 00 72 2e 63 6f 2e 69 6c 00 r.co.il. r.co.il.
0010 61 62 63 abc

> while authenticating by “AUTH PLAIN ci5jby5pbAByLmNvLmlsAGFiYw==” it seems
> that saslauthd receives the following:
> saslauthd[29607] :do_auth : auth failure: [user=r.co.il]
> [service=smtp] [realm=] [mech=ldap] [reason=Unknown]
>
> saslauthd[29607] :do_request : response: NO
>
> I’m not sure exactly what’s happening, but I truly do not understand the
> ‘r.co.il’ while the expected username should be ‘rmoo.co.il’,

"" has a special meaning in perl. But this regards to a Perl-Releated list.

--
        Andreas