From 265027a7c122ab9992ca9e6c9a42dd9b93f4944b Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 26 Oct 1999 18:39:04 +0000 Subject: Backed oup username quoting. svn path=/trunk/; revision=2641 --- imap.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'imap.c') diff --git a/imap.c b/imap.c index 1c7d1fe8..19defbc9 100644 --- a/imap.c +++ b/imap.c @@ -749,7 +749,6 @@ static int do_cram_md5 (int sock, struct query *ctl) { int result; int len; - int quot; unsigned char buf1[1024]; unsigned char msg_id[768]; unsigned char response[16]; @@ -787,28 +786,19 @@ static int do_cram_md5 (int sock, struct query *ctl) * computed by applying the keyed MD5 algorithm from [KEYED-MD5] where * the key is a shared secret and the digested text is the timestamp * (including angle-brackets). - * - * If the usename has a space in it, it's surrounded by string quotes - * before being shipped. This is not in conformance with the CRAM-MD5 - * RFCs (which don't describe any kind of quoting and imply that the - * username must be a single token), but at least one server accepts - * it anyway (the greeting line says "InterChange IMAP4 Server v3.51.06"). - * If this doesn't work, sending the unquoted name wouldn't have worked - * either, so we lost nothing. */ hmac_md5 (ctl->password, strlen (ctl->password), msg_id, strlen (msg_id), response, sizeof (response)); - quot = (int) strpbrk (ctl->remotename, " "); #ifdef HAVE_SNPRINTF snprintf (reply, sizeof (reply), #else sprintf(reply, #endif - "%s%s%s %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", - quot ? "\"" : "", ctl->remotename, quot ? "\"" : "", + "%s %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", + ctl->remotename, response[0], response[1], response[2], response[3], response[4], response[5], response[6], response[7], response[8], response[9], response[10], response[11], @@ -1268,8 +1258,8 @@ static int imap_trail(int sock, struct query *ctl, int number) : "STORE %d +FLAGS (\\Seen)", number))) return(ok); - } #endif /* __UNUSED__ */ + } return(PS_SUCCESS); } -- cgit v1.2.3