client-authenticate.c revision a19c6b87b303dd99c26598949ce71c040e10e353
/* Copyright (c) 2002-2009 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/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"
#define AUTH_FAILURE_DELAY_INCREASE_MSECS 5000
const char *capability_string = POP3_CAPABILITY_REPLY;
{
const struct auth_mech_desc *mech;
unsigned int i, count;
for (i = 0; i < count; i++) {
}
return TRUE;
}
{
char *line;
if (!client_read(client))
return;
/* @UNSAFE */
return;
else {
/* clear sensitive data */
}
}
{
/* get back to normal client input. */
}
{
unsigned int delay_msecs;
if (client->auth_initializing)
return;
if (nodelay) {
return;
}
/* increase the timeout after each unsuccessful attempt, but don't
increase it so high that the idle timeout would be triggered */
}
bool *nodelay_r)
{
const char *master_user = NULL;
enum login_proxy_ssl_flags ssl_flags = 0;
unsigned int port = 110;
if (p == NULL) {
value = "";
} else {
value = p + 1;
}
master_user = value;
/* already handled in login-common */
}
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
return TRUE;
}
{
const char *msg;
bool nodelay;
switch (reply) {
break;
}
break;
break;
}
if (reply == SASL_SERVER_REPLY_AUTH_ABORTED)
msg = "-ERR Authentication aborted by client.";
else
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;
"SSL required for authentication");
}
return TRUE;
}
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) {
} else {
args = p+1;
}
return TRUE;
/* don't handle input until we get the initial auth reply */
return TRUE;
}
{
return TRUE;
"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;
"APOP failed: APOP not enabled");
}
return TRUE;
}
/* <username> <md5 sum in hex> */
"APOP failed: Invalid parameters");
}
return TRUE;
}
/* APOP challenge \0 username \0 APOP response */
"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;
}