From e83eb833d4c427f66038ac36d59b87435d157f57 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 11 Feb 2001 19:33:35 +0000 Subject: We can specify the authentication command now. svn path=/trunk/; revision=3062 --- cram.c | 4 ++-- fetchmail.h | 2 +- imap.c | 2 +- odmr.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cram.c b/cram.c index df7c3d1f..01952f6b 100644 --- a/cram.c +++ b/cram.c @@ -60,7 +60,7 @@ static void hmac_md5 (unsigned char *password, size_t pass_len, MD5Final (response, &ctx); } -int do_cram_md5 (int sock, struct query *ctl) +int do_cram_md5 (int sock, char *command, struct query *ctl) /* authenticate as per RFC2195 */ { int result; @@ -70,7 +70,7 @@ int do_cram_md5 (int sock, struct query *ctl) unsigned char response[16]; unsigned char reply[1024]; - gen_send (sock, "AUTHENTICATE CRAM-MD5"); + gen_send (sock, "%s CRAM-MD5", command); /* From RFC2195: * The data encoded in the first ready response contains an diff --git a/fetchmail.h b/fetchmail.h index 5a2ca283..c0f72f69 100644 --- a/fetchmail.h +++ b/fetchmail.h @@ -534,7 +534,7 @@ int is_host_alias(const char *, struct query *); char *host_fqdn(void); char *rfc822timestamp(void); flag isafile(int); -int do_cram_md5 (int sock, struct query *ctl); +int do_cram_md5 (int sock, char *command, struct query *ctl); void yyerror(const char *); int yylex(void); diff --git a/imap.c b/imap.c index 41e07a76..cf6a5ea5 100644 --- a/imap.c +++ b/imap.c @@ -849,7 +849,7 @@ int imap_getauth(int sock, struct query *ctl, char *greeting) report (stdout, _("CRAM-MD5 authentication is supported\n")); if (ctl->server.protocol != P_IMAP_LOGIN) { - if ((ok = do_cram_md5 (sock, ctl))) + if ((ok = do_cram_md5 (sock, "AUTHENTICATE", ctl))) /* SASL cancellation of authentication */ gen_send(sock, "*"); diff --git a/odmr.c b/odmr.c index 1f3708d2..4c3d2322 100644 --- a/odmr.c +++ b/odmr.c @@ -62,7 +62,7 @@ static int odmr_getrange(int sock, struct query *ctl, const char *id, *bytes = *countp = *newp = -1; /* authenticate via CRAM-MD5 */ - ok = do_cram_md5(sock, ctl); + ok = do_cram_md5(sock, "AUTH", ctl); if (ok) return(ok); -- cgit v1.2.3