Your message dated Thu, 26 May 2011 18:23:50 +0200
with message-id <[email protected]>
and subject line Bug#516543: sasl-sample-client: Decoding data from base64: bad 
protocol / cancel
has caused the Debian Bug report #516543,
regarding lt-sample-client: Decoding data from base64: bad protocol / cancel
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
516543: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=516543
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: sasl2-bin
Version: 2.1.22.dfsg1-23
Severity: normal
Tags: patch

Playing around with the sasl-sample-client/sasl-sample-server, I always get 
this:

$ ./sample-client -s test
service=test
Waiting for mechanism list from server...
S: Q1JBTS1NRDUgTE9HSU4gRElHRVNULU1ENSBOVExNIFBMQUlOIEFOT05ZTU9VUw==
lt-sample-client: Decoding data from base64: bad protocol / cancel

A similar report can be found here: 
https://answers.launchpad.net/ubuntu/+source/cyrus-sasl2/+question/60325

The problem turns out to be that the newline at the end of the base64-encoded 
string needs to be stripped off before the string is passed to the decoding 
routine.  According to Debian bug #400955, this was at some point made more 
strict, so it probably worked in an earlier version, but it doesn't anymore.

A simple fix is to change the following lines, identical in sample-server.c 
and sample-client.c, from

  result = sasl_decode64(buf + 3, (unsigned) strlen(buf + 3), buf,
                         SAMPLE_SEC_BUF_SIZE, &len);

to

  result = sasl_decode64(buf + 3, (unsigned) strlen(buf + 3) - 1, buf,
                         SAMPLE_SEC_BUF_SIZE, &len);
 
This assumes that the string always contains a trailing newline, which is 
technically not guaranteed, but should be unlikely.  (The input buf comes from 
fgets().)

With this fix, I could get sasl-sample-client/sasl-sample-server working.



--- End Message ---
--- Begin Message ---
Version: 2.1.24~rc1.dfsg1-1

Hi,

this bug was fixed upstream, the version in unstable works correctly:

# sasl-sample-client -s test
service=test
Waiting for mechanism list from server...
S: Q1JBTS1NRDUgTE9HSU4gRElHRVNULU1ENSBOVExNIFBMQUlOIEFOT05ZTU9VUw==
recieved 46 byte message
Choosing best mechanism from: CRAM-MD5 LOGIN DIGEST-MD5 NTLM PLAIN ANONYMOUS
Using mechanism DIGEST-MD5
Sending initial response...
C: RElHRVNULU1ENQ==
Waiting for server reply...

The version in testing fails:

# sasl-sample-client -s test
service=test
Waiting for mechanism list from server...
S: Q1JBTS1NRDUgTE9HSU4gRElHRVNULU1ENSBOVExNIFBMQUlOIEFOT05ZTU9VUw==
sasl-sample-client: Decoding data from base64: bad protocol / cancel


O.
-- 
Ondřej Surý <[email protected]>


--- End Message ---

Reply via email to