9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] factotum apop protocol is incorrect
@ 2003-12-13  3:55 David Presotto
  2003-12-14 21:59 ` Dan Cross
  2003-12-15  8:49 ` Fco.J.Ballesteros
  0 siblings, 2 replies; 8+ messages in thread
From: David Presotto @ 2003-12-13  3:55 UTC (permalink / raw)
  To: 9fans

	From: Dan Cross <cross@math.psu.edu>

	David Presotto <presotto@closedmind.org> writes:
	> 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.

	Many of the format specifiers in print(2) already can already be
	modified by flags; case in point: what 'h' does to %d.  How about
	adding a flag to %H that forces it to use a lowercase map, instead of
	an undercase map?

	- Dan C.

OK, %lH now means lower case hexdump.

%luhs means print out correct spelling of the string pointed
to by the argument.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] factotum apop protocol is incorrect
  2003-12-13  3:55 [9fans] factotum apop protocol is incorrect David Presotto
@ 2003-12-14 21:59 ` Dan Cross
  2003-12-15  8:49 ` Fco.J.Ballesteros
  1 sibling, 0 replies; 8+ messages in thread
From: Dan Cross @ 2003-12-14 21:59 UTC (permalink / raw)
  To: 9fans

David Presotto <presotto@closedmind.org> writes:
> %luhs means print out correct spelling of the string pointed
> to by the argument.

Wunderfool!  Souper!

	- Dan C.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] factotum apop protocol is incorrect
  2003-12-13  3:55 [9fans] factotum apop protocol is incorrect David Presotto
  2003-12-14 21:59 ` Dan Cross
@ 2003-12-15  8:49 ` Fco.J.Ballesteros
  2003-12-15 14:26   ` David Presotto
  1 sibling, 1 reply; 8+ messages in thread
From: Fco.J.Ballesteros @ 2003-12-15  8:49 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 194 bytes --]

There are so many uses of %<blah>, that I miss something like
/sys/lib/%master, or some convetion to aid programs to choose
flags that won't be later used by other libraries.
Is it just me?

[-- Attachment #2: Type: message/rfc822, Size: 2228 bytes --]

From: David Presotto <presotto@closedmind.org>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] factotum apop protocol is incorrect
Date: Fri, 12 Dec 2003 22:55:30 -0500
Message-ID: <6786cb2c3839f91e170e726ac4ac0805@plan9.bell-labs.com>

	From: Dan Cross <cross@math.psu.edu>

	David Presotto <presotto@closedmind.org> writes:
	> 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.

	Many of the format specifiers in print(2) already can already be
	modified by flags; case in point: what 'h' does to %d.  How about
	adding a flag to %H that forces it to use a lowercase map, instead of
	an undercase map?

	- Dan C.

OK, %lH now means lower case hexdump.

%luhs means print out correct spelling of the string pointed
to by the argument.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] factotum apop protocol is incorrect
  2003-12-15  8:49 ` Fco.J.Ballesteros
@ 2003-12-15 14:26   ` David Presotto
  0 siblings, 0 replies; 8+ messages in thread
From: David Presotto @ 2003-12-15 14:26 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 82 bytes --]

grep varargck.*" /sys/include/*.h

Some are overloaded, H, D, and M for example.

[-- Attachment #2: Type: message/rfc822, Size: 4502 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 194 bytes --]

There are so many uses of %<blah>, that I miss something like
/sys/lib/%master, or some convetion to aid programs to choose
flags that won't be later used by other libraries.
Is it just me?

[-- Attachment #2.1.2: Type: message/rfc822, Size: 2228 bytes --]

From: David Presotto <presotto@closedmind.org>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] factotum apop protocol is incorrect
Date: Fri, 12 Dec 2003 22:55:30 -0500
Message-ID: <6786cb2c3839f91e170e726ac4ac0805@plan9.bell-labs.com>

	From: Dan Cross <cross@math.psu.edu>

	David Presotto <presotto@closedmind.org> writes:
	> 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.

	Many of the format specifiers in print(2) already can already be
	modified by flags; case in point: what 'h' does to %d.  How about
	adding a flag to %H that forces it to use a lowercase map, instead of
	an undercase map?

	- Dan C.

OK, %lH now means lower case hexdump.

%luhs means print out correct spelling of the string pointed
to by the argument.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] factotum apop protocol is incorrect
  2003-12-13  2:42 ` Dan Cross
@ 2003-12-13  2:47   ` Dan Cross
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Cross @ 2003-12-13  2:47 UTC (permalink / raw)
  To: 9fans

Dan Cross <cross@math.psu.edu> writes:
> Many of the format specifiers in print(2) already can already be
> modified by flags; case in point: what 'h' does to %d.  How about
> adding a flag to %H that forces it to use a lowercase map, instead of
> an undercase map?

For that matter, how about a grammar checker!

	- Dan C.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] factotum apop protocol is incorrect
  2003-12-12 19:59 David Presotto
@ 2003-12-13  2:42 ` Dan Cross
  2003-12-13  2:47   ` Dan Cross
  0 siblings, 1 reply; 8+ messages in thread
From: Dan Cross @ 2003-12-13  2:42 UTC (permalink / raw)
  To: 9fans

David Presotto <presotto@closedmind.org> writes:
> 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.

Many of the format specifiers in print(2) already can already be
modified by flags; case in point: what 'h' does to %d.  How about
adding a flag to %H that forces it to use a lowercase map, instead of
an undercase map?

	- Dan C.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] factotum apop protocol is incorrect
@ 2003-12-12 19:59 David Presotto
  2003-12-13  2:42 ` Dan Cross
  0 siblings, 1 reply; 8+ messages in thread
From: David Presotto @ 2003-12-12 19:59 UTC (permalink / raw)
  To: miller, 9fans

[-- Attachment #1: Type: text/plain, Size: 177 bytes --]

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.

[-- Attachment #2: Type: message/rfc822, Size: 2775 bytes --]

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
Message-ID: <b07c2ff1dcb618953620ac173286d274@hamnavoe.com>

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [9fans] factotum apop protocol is incorrect
@ 2003-12-12 19:47 Richard Miller
  0 siblings, 0 replies; 8+ messages in thread
From: Richard Miller @ 2003-12-12 19:47 UTC (permalink / raw)
  To: 9fans

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



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-12-15 14:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-13  3:55 [9fans] factotum apop protocol is incorrect David Presotto
2003-12-14 21:59 ` Dan Cross
2003-12-15  8:49 ` Fco.J.Ballesteros
2003-12-15 14:26   ` David Presotto
  -- strict thread matches above, loose matches on Subject: below --
2003-12-12 19:59 David Presotto
2003-12-13  2:42 ` Dan Cross
2003-12-13  2:47   ` Dan Cross
2003-12-12 19:47 Richard Miller

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).