9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Richard Miller <miller@hamnavoe.demon.co.uk>
To: 9fans@cse.psu.edu
Subject: [9fans] factotum apop protocol is incorrect
Date: Fri, 12 Dec 2003 19:47:35 +0000	[thread overview]
Message-ID: <b07c2ff1dcb618953620ac173286d274@hamnavoe.com> (raw)

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; i<MD5dlen; i++)
			sprint(&s->resp[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



             reply	other threads:[~2003-12-12 19:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-12 19:47 Richard Miller [this message]
2003-12-12 19:59 David Presotto
2003-12-13  2:42 ` Dan Cross
2003-12-13  2:47   ` Dan Cross
2003-12-13  3:55 David Presotto
2003-12-14 21:59 ` Dan Cross
2003-12-15  8:49 ` Fco.J.Ballesteros
2003-12-15 14:26   ` David Presotto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b07c2ff1dcb618953620ac173286d274@hamnavoe.com \
    --to=miller@hamnavoe.demon.co.uk \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).