sasl-server.c revision 814bf67459ad405a157af0b8940602024d7fadfe
/* Copyright (c) 2002-2015 Dovecot authors, see the included COPYING file */
#include "login-common.h"
#include "base64.h"
#include "buffer.h"
#include "hex-binary.h"
#include "ioloop.h"
#include "istream.h"
#include "write-full.h"
#include "strescape.h"
#include "str-sanitize.h"
#include "anvil-client.h"
#include "auth-client.h"
#include "ssl-proxy.h"
#include "master-service.h"
#include "master-service-ssl-settings.h"
#include "master-interface.h"
#include "master-auth.h"
#include "client-common.h"
#include <unistd.h>
#define ERR_TOO_MANY_USERIP_CONNECTIONS \
"Maximum number of connections from user+IP exceeded " \
"(mail_max_userip_connections=%u)"
struct anvil_request {
unsigned char cookie[MASTER_AUTH_COOKIE_SIZE];
};
const struct auth_mech_desc *
{
const struct auth_mech_desc *mech;
struct auth_mech_desc *ret_mech;
unsigned int i, j, count;
*count_r = 0;
return NULL;
}
for (i = j = 0; i < count; i++) {
/* a) transport is secured
b) auth mechanism isn't plaintext
c) we allow insecure authentication
*/
}
*count_r = j;
return ret_mech;
}
static enum auth_request_flags
{
enum auth_request_flags auth_flags = 0;
/* e.g. webmail */
}
return auth_flags;
}
{
/* NOTE: client may be destroyed now */
}
static void
{
client->master_tag = 0;
case MASTER_AUTH_STATUS_OK:
break;
break;
}
} else {
}
}
{
struct master_auth_request req;
const unsigned char *data;
/* session ID */
/* protocol specific data (e.g. IMAP tag) */
/* buffered client input */
}
static void ATTR_NULL(1)
{
const char *errmsg;
unsigned int conn_count;
conn_count = 0;
/* reply=NULL if we didn't need to do anvil lookup,
or if the anvil lookup failed. allow failed anvil lookups in. */
else {
}
}
static void
struct auth_client_request *request)
{
struct anvil_request *req;
return;
}
}
static void
{
unsigned int i;
bool nologin;
if (!client->authenticating) {
/* client aborted */
return;
}
switch (status) {
/* continue */
data_base64, NULL);
break;
case AUTH_REQUEST_STATUS_OK:
client->auth_successes++;
/* user can't login */
}
}
if (nologin) {
} else {
}
break;
/* fall through */
case AUTH_REQUEST_STATUS_FAIL:
/* parse our username if it's there */
}
}
}
break;
}
}
const char *initial_resp_base64,
{
struct auth_request_info info;
const struct auth_mech_desc *mech;
client->auth_attempts++;
if (client->auth_first_started == 0)
"Unsupported authentication mechanism.");
return;
}
"Plaintext authentication disabled.");
return;
}
}
static void ATTR_NULL(2)
enum sasl_server_reply reply)
{
const char *auth_name =
}
}
{
}
{
}