client-authenticate.c revision cf8fbfe121e7b09d4ca9088ea3b32eec5dc48dd6
/* Copyright (c) 2002-2007 Dovecot authors, see the included COPYING file */
#include "common.h"
#include "base64.h"
#include "buffer.h"
#include "hex-binary.h"
#include "ioloop.h"
#include "istream.h"
#include "ostream.h"
#include "safe-memset.h"
#include "str.h"
#include "str-sanitize.h"
#include "auth-client.h"
#include "../pop3/capability.h"
#include "ssl-proxy.h"
#include "client.h"
#include "client-authenticate.h"
#include "pop3-proxy.h"
#include <stdlib.h>
#define POP3_SERVICE_NAME "pop3"
const char *capability_string = POP3_CAPABILITY_REPLY;
{
const struct auth_mech_desc *mech;
unsigned int i, count;
for (i = 0; i < count; i++) {
/* a) transport is secured
b) auth mechanism isn't plaintext
c) we allow insecure authentication
*/
}
}
return TRUE;
}
{
char *line;
if (!client_read(client))
return;
/* @UNSAFE */
return;
"Authentication aborted");
"Don't send unrequested data");
} else {
/* clear sensitive data */
}
}
{
unsigned int port = 110;
}
if (proxy &&
/* we want to proxy the connection to another server.
don't do this unless authentication succeeded. with
master user proxying we can get FAIL with proxy still set.
proxy host=.. [port=..] [destuser=..] pass=.. */
if (!success)
return FALSE;
return TRUE;
}
if (!nologin)
return FALSE;
else if (temp)
else
/* get back to normal client input. */
}
return TRUE;
}
{
const char *msg;
switch (reply) {
break;
}
break;
break;
}
/* get back to normal client input. */
}
break;
else {
}
break;
/* don't check return value here. it gets tricky if we try
to call client_destroy() in here. */
return;
}
}
{
const struct auth_mech_desc *mech;
const char *mech_name, *p;
if (*args == '\0') {
/* Old-style SASL discovery, used by MS Outlook */
unsigned int i, count;
for (i = 0; i < count; i++) {
}
return TRUE;
}
/* <mechanism name> <initial response> */
if (p == NULL) {
args = "";
} else {
args = p+1;
}
return TRUE;
/* following input data will go to authentication */
return TRUE;
}
{
return TRUE;
if (verbose_auth) {
"Plaintext authentication disabled");
}
return FALSE;
}
{
if (!check_plaintext_auth(client))
return TRUE;
return TRUE;
}
{
/* client may ignore the USER reply and only display the error
message from PASS */
if (!check_plaintext_auth(client))
return TRUE;
return TRUE;
}
/* authorization ID \0 authentication ID \0 pass */
return TRUE;
/* don't read any input from client until login is finished */
return TRUE;
}
{
const char *p;
if (verbose_auth) {
"APOP failed: APOP not enabled");
}
return TRUE;
}
/* <username> <md5 sum in hex> */
if (verbose_auth) {
"APOP failed: Invalid parameters");
}
return TRUE;
}
/* APOP challenge \0 username \0 APOP response */
if (verbose_auth) {
"Invalid characters in MD5 response");
}
"-ERR Invalid characters in MD5 response.");
return TRUE;
}
return TRUE;
/* don't read any input from client until login is finished */
return TRUE;
}