On 6/21/2011 6:06 PM, Sahil Tandon wrote:
On Tue, 2011-06-21 at 18:45:47 -0400, Wietse Venema wrote:

Peter:
The SASL_README doc has a section about doing a telnet test of a PLAIN
SASL authentication.  There are some methods suggested for generating
the base64 hash required to do the authentication,  Of those two methods
one requires downloading a special utility to generate the auth string
and the other requires installing a perl module.  I have a third suggestion:

echo -ne '\000username\000password' | openssl base64

This method is relatively easy to do, and will work with the programs
that are already readily available on most systems.  I think it would be
good to add it to the docs.

This does not work for me. If you make a suggestion, be sure
to indicate what platform and shell this applies to.

Appears to work in bash and zsh; not in (t)csh.  I quickly tested on
FreeBSD and Darwin.  Likely related to handling of null byte/char.


Yes, sh (not bash) & csh ignore the \000.

Probably more portable using printf rather than echo, but I don't have anything other than fBSD to try it on.

printf '\000user\000pass' | openssl base64



  -- Noel Jones

Reply via email to