client-authenticate.c revision c0a708fa3f7b8f4fbca32052da5faf7a0125189d
/* 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 "imap-parser.h"
#include "auth-connection.h"
#include "../auth/auth-mech-desc.h"
#include "client.h"
#include "client-authenticate.h"
#include "master.h"
{
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)
else {
}
}
{
t_push();
t_pop();
}
{
return NULL;
}
struct auth_login_reply *reply,
{
/* failed */
return FALSE;
}
return TRUE;
/* we should be able to log in. if we fail, just
disconnect the client. */
/* disable IO until we're back from master */
}
return FALSE;
/* see if we have error message */
"-ERR Authentication failed: ",
} else {
/* default error message */
}
return FALSE;
}
i_unreached();
}
struct auth_login_reply *reply,
{
const void *ptr;
}
}
{
"-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,
{
}
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;
}