client-authenticate.c revision 59678f0d3af684aeeb8e46cf554db4ccf109ba7d
/* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "base64.h"
#include "buffer.h"
#include "ioloop.h"
#include "istream.h"
#include "ostream.h"
#include "safe-memset.h"
#include "str.h"
#include "auth-connection.h"
#include "../auth/auth-mech-desc.h"
#include "../pop3/capability.h"
#include "master.h"
#include "auth-common.h"
#include "client.h"
#include "client-authenticate.h"
#include "ssl-proxy.h"
static enum auth_mech auth_mechs = 0;
static char *auth_mechs_capability = NULL;
{
int i;
if (auth_mechs != available_auth_mechs) {
for (i = 0; i < AUTH_MECH_COUNT; i++) {
}
}
}
"\r\n.", NULL));
return TRUE;
}
{
int i;
for (i = 0; i < AUTH_MECH_COUNT; i++) {
return &auth_mech_desc[i];
}
return NULL;
}
{
}
"-ERR Authentication failed.");
/* get back to normal client input */
}
{
if (success) {
NULL);
} else {
}
}
{
t_push();
t_pop();
}
struct auth_login_reply *reply,
{
const char *error;
const void *ptr;
master_callback, &error)) {
case -1:
/* login failed */
break;
case 0:
break;
default:
/* success, we should be able to log in. if we fail, just
disconnect the client. */
}
}
{
"-ERR Plaintext authentication disabled.");
return TRUE;
}
/* authorization ID \0 authentication ID \0 pass */
return TRUE;
}
{
const char *error;
return TRUE;
}
/* don't read any input from client until login is finished */
}
return TRUE;
} else {
return TRUE;
}
}
struct auth_login_reply *reply,
const unsigned char *data,
{
const char *error;
master_callback, &error)) {
case -1:
/* login failed */
break;
case 0:
break;
default:
/* success, we should be able to log in. if we fail, just
disconnect the client. */
}
}
static void client_auth_input(void *context)
{
char *line;
if (!client_read(client))
return;
/* @UNSAFE */
return;
return;
}
/* failed */
} else {
}
/* clear sensitive data */
}
{
struct auth_mech_desc *mech;
const char *error;
/* we have only one argument: authentication mechanism name */
"-ERR Unsupported authentication mechanism.");
return TRUE;
}
"-ERR Plaintext authentication disabled.");
return TRUE;
}
/* following input data will go to authentication */
} else {
}
return TRUE;
}