<div class="gmail_quote">On Wed, Jul 29, 2009 at 10:51 AM, Kevin Horn <span dir="ltr">&lt;<a href="mailto:kevin.horn@gmail.com">kevin.horn@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="gmail_quote"><div><div></div><div class="h5">On Wed, Jul 29, 2009 at 6:29 AM, Jean-Paul Calderone <span dir="ltr">&lt;<a href="mailto:exarkun@divmod.com" target="_blank">exarkun@divmod.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div>On Wed, 29 Jul 2009 00:54:20 -0500, Kevin Horn &lt;<a href="mailto:kevin.horn@gmail.com" target="_blank">kevin.horn@gmail.com</a>&gt; wrote:<br>
&gt;I was digging through the Twisted IMAP code tonight and I noticed something<br>
&gt;puzzling...<br>
&gt;<br>
&gt;PLAINAuthenticator.challengeResponse() uses the following statement to send<br>
&gt;auth credentials to the server<br>
&gt;<br>
&gt;        return &#39;%s\0%s\0&#39; % (self.user, secret)<br>
&gt;<br>
&gt;which would give auth credentials of the form:<br>
&gt;<br>
&gt;        authid&lt;NUL&gt;password&lt;NUL&gt;<br>
&gt;<br>
&gt;        (where &lt;NUL&gt; is the NUL character)<br>
&gt;<br>
&gt;However, both RFC2595 and RFC4616 (both define the PLAIN SASL mechanism),<br>
&gt;say that credentials should be passed this way:<br>
&gt;<br>
&gt;        [authzid]&lt;NUL&gt;authnid&lt;NUL&gt;password<br>
&gt;<br>
&gt;        (where &lt;NUL&gt; is the NUL character and [authzid] is optional)<br>
&gt;<br>
&gt;Now even if one was to leave the authzid out of the equation, you would end<br>
&gt;up with something like this:<br>
&gt;<br>
&gt;        &lt;NUL&gt;authnid&lt;NUL&gt;password<br>
&gt;<br>
&gt;and the version Twisted&#39;s IMAP code uses appears to be invalid.<br>
&gt;<br>
&gt;Am I crazy?<br>
&gt;Am I missing something?<br>
&gt;Is it just way too late and I should put the RFCs down and back away slowly?<br>
<br>
</div></div>My early morning reading of the RFC agrees with yours.  Someone else brought<br>
this up a long time ago, I think, but never pointed out the RFC.<br>
<br>
Can you file a ticket?<br>
<br>
Jean-Paul<br>
<br>
</blockquote></div></div><div><br><br>At least I&#39;m not crazy... :)<br>
<br>
Ticket #3939 filed: <a href="http://twistedmatrix.com/trac/ticket/3939" target="_blank">http://twistedmatrix.com/trac/ticket/3939</a><br><br>also added a note in the ticket that PLAINCredentials may need to be modified to match<br>

<br>
Kevin Horn<br> </div></div><br>
</blockquote></div><br>FYI, attached a patch to the ticket. I haven&#39;t really tested it, but if someone could take a look and let me know what they think I&#39;d appreciate it.<br><br>Kevin Horn<br>