From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <37dc31191ad95043011ccf18788b8dcd@plan9.bell-labs.com> From: David Presotto To: miller@hamnavoe.demon.co.uk, 9fans@cse.psu.edu Subject: Re: [9fans] factotum apop protocol is incorrect MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-llhganjhqwvqeiiqkafsbwyucb" Date: Fri, 12 Dec 2003 14:59:46 -0500 Topicbox-Message-UUID: a0c6b810-eacc-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. --upas-llhganjhqwvqeiiqkafsbwyucb Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit I really dinna want to change %H. The logical thing there would be to have a %h and a %H but little 'h' is already taken as a flag. I'll just fix apop with your suggestion. --upas-llhganjhqwvqeiiqkafsbwyucb Content-Type: message/rfc822 Content-Disposition: inline Received: from plan9.cs.bell-labs.com ([135.104.9.2]) by plan9; Fri Dec 12 14:49:34 EST 2003 Received: from mail.cse.psu.edu ([130.203.4.6]) by plan9; Fri Dec 12 14:49:32 EST 2003 Received: by mail.cse.psu.edu (CSE Mail Server, from userid 60001) id 4BB7519ABA; Fri, 12 Dec 2003 14:49:27 -0500 (EST) Received: from psuvax1.cse.psu.edu (psuvax1.cse.psu.edu [130.203.20.6]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id ACB1A19BA9; Fri, 12 Dec 2003 14:49:08 -0500 (EST) X-Original-To: 9fans@cse.psu.edu Delivered-To: 9fans@cse.psu.edu Received: by mail.cse.psu.edu (CSE Mail Server, from userid 60001) id 5A1AD19AF8; Fri, 12 Dec 2003 14:48:11 -0500 (EST) Received: from hamnavoe.gotadsl.co.uk (hamnavoe.gotadsl.co.uk [213.208.117.150]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id EAE6319ABA for <9fans@cse.psu.edu>; Fri, 12 Dec 2003 14:47:58 -0500 (EST) Message-ID: To: 9fans@cse.psu.edu From: Richard Miller MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] factotum apop protocol is incorrect Sender: 9fans-admin@cse.psu.edu Errors-To: 9fans-admin@cse.psu.edu X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.0.11 Precedence: bulk Reply-To: 9fans@cse.psu.edu List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> List-Archive: Date: Fri, 12 Dec 2003 19:47:35 0000 X-Spam-Status: No, hits=0.6 required=5.0 tests=INVALID_DATE version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) RFC1939 introduces the 'APOP name digest' command for challenge-response authentication to a POP3 mail server, and says: "The digest parameter ... is sent in hexadecimal format, using lower-case ASCII characters." Factotum's proto=apop implementation encodes the digest as upper-case hexadecimal. Probably most POP3 servers can handle both, but I've just hit an unforgiving one. Possible fixes: In /sys/src/cmd/auth/factotum/apop.c, replace sprint(s->resp, "%.*H", MD5dlen, digest); with something like for(i=0; iresp[2*i], "%.2x", digest[i]); or in /sys/src/libc/port/u16.c, replace static char t16e[] = "0123456789ABCDEF"; with static char t16e[] = "0123456789abcdef"; The latter has a more widespread effect, but it arguably makes the %H format conform to its documentation. The man page for print(2) makes a distinction between "hexadecimal" and "upper case hexadecimal" for %x and %X respectively. enc16(2) just says %H means "base 16 (i.e. hexadecimal)", so one might expect it to be lower case. -- Richard Miller --upas-llhganjhqwvqeiiqkafsbwyucb--