Looks like a bug but looking at Ns_HtuuEncode i do not see where the
problem could be.
Bernd Eidenschink wrote:
Hi guys,
while updating the sendmail.tcl to also be capable of the simple AUTH PLAIN
mechanism (if you have to use at least a basic form of relay control)
I noticed a problem with ns_base64encode:
(1) Working:
~> perl -MMIME::Base64 -e 'print encode_base64("test\0test\0testpass");'
dGVzdAB0ZXN0AHRlc3RwYXNz
% package require base64
% ::base64::encode "test\0test\0testpass"
dGVzdAB0ZXN0AHRlc3RwYXNz
(2) Failing:
% ns_base64encode "test\0test\0testpass"
dGVzdMCAdGVzdMCAdGVzdHBhc3M=
In the particular AUTH PLAIN situation, where user, realm and pw are split by
the null byte, the problem (one of the problems) is the missing null byte of
the ns_uuencoded string:
~> perl -MMIME::Base64 -e 'print decode_base64
("dGVzdMCAdGVzdMCAdGVzdHBhc3M=");'|hexdump
0000000 6574 7473 80c0 6574 7473 80c0 6574 7473
0000010 6170 7373
0000014
and in the perl and tcllib example it works:
~> perl -MMIME::Base64 -e 'print decode_base64("dGVzdAB0ZXN0AHRlc3RwYXNz");'|
hexdump
0000000 6574 7473 7400 7365 0074 6574 7473 6170
0000010 7373
0000012
Do I miss something or could it be a bug?
-Bernd.
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel
--
Vlad Seryakov
571 262-8608 office
[EMAIL PROTECTED]
http://www.crystalballinc.com/vlad/