diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2001-02-11 21:32:24 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2001-02-11 21:32:24 +0000 |
commit | b749096ca1c0842db21742e53d8f9766412d2c5d (patch) | |
tree | 831465249d25b943252696e13e6133c449a7199d /pop3.c | |
parent | 49e1f41ffef6834125db955993f99f1ac17c0bcf (diff) | |
download | fetchmail-b749096ca1c0842db21742e53d8f9766412d2c5d.tar.gz fetchmail-b749096ca1c0842db21742e53d8f9766412d2c5d.tar.bz2 fetchmail-b749096ca1c0842db21742e53d8f9766412d2c5d.zip |
Authentication completely refactored.
svn path=/trunk/; revision=3067
Diffstat (limited to 'pop3.c')
-rw-r--r-- | pop3.c | 29 |
1 files changed, 27 insertions, 2 deletions
@@ -204,11 +204,20 @@ int pop3_getauth(int sock, struct query *ctl, char *greeting) * don't implement this, so don't do it at all unless the * server advertises APOP with <> in the greeting line. This * certainly catches IMAP-2000's POP3 gateway. + * + * These authentication methods are blessed by RFC1734, + * POP3 AUTHentication command. */ if (strchr(greeting, '<') && gen_transact(sock, "AUTH") == 0) { char buffer[10]; flag has_cram = FALSE; +#if defined(KERBEROS_IV) + flag has_kerberos = FALSE; +#endif /* defined(KERBEROS_IV) */ +#ifdef OPIE_ENABLE + flag has_opie = FALSE; +#endif /* OPIE_ENABLE */ while ((ok = gen_recv(sock, buffer, sizeof(buffer))) == 0) { @@ -216,9 +225,25 @@ int pop3_getauth(int sock, struct query *ctl, char *greeting) break; if (strncasecmp(buffer, "CRAM-MD5", 8) == 0) has_cram = TRUE; +#if defined(KERBEROS_IV) + if (strncasecmp(buffer, "KERBEROS_V4", 8) == 0) + has_kerberos = TRUE; +#endif /* defined(KERBEROS_IV) */ +#ifdef OPIE_ENABLE + if (strncasecmp(buffer, "SKEY", 8) == 0) + has_opie = TRUE; +#endif /* OPIE_ENABLE */ } - if (has_cram && !do_cram_md5(sock, "AUTH", ctl)) - return(PS_SUCCESS); +#if defined(KERBEROS_IV) + if (has_kerberos) + return(do_rfc1731(sock, "AUTH", ctl->server.truename)); +#endif /* defined(KERBEROS_IV) */ +#ifdef OPIE_ENABLE + if (has_opie) + do_otp(sock, ctl) +#endif /* OPIE_ENABLE */ + if (has_cram) + return(do_cram_md5(sock, "AUTH", ctl)); } /* ordinary validation, no one-time password or RPA */ |