]> Pileus Git - ~andy/fetchmail/commitdiff
We can specify the authentication command now.
authorEric S. Raymond <esr@thyrsus.com>
Sun, 11 Feb 2001 19:33:35 +0000 (19:33 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 11 Feb 2001 19:33:35 +0000 (19:33 -0000)
svn path=/trunk/; revision=3062

cram.c
fetchmail.h
imap.c
odmr.c

diff --git a/cram.c b/cram.c
index df7c3d1f0b9d5cc0f07486c5c1803580bb8b0110..01952f6bdcc6a2c375efba9885e4b97a70e23343 100644 (file)
--- 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
index 5a2ca283ef8c3796fbf88588763882c7501601e1..c0f72f69af097407ef190737ebfeabe583601078 100644 (file)
@@ -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 41e07a765bb9aaa0fe3f108d7b7aa747a3049eed..cf6a5ea508212ccd2e9f5287a7adf6af35832ea2 100644 (file)
--- 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 1f3708d2c5bfa1e76dc405434b814d9500e9722c..4c3d2322c16cca03c0f0bdce8ff09f3fd9ff9d8f 100644 (file)
--- 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);