client-authenticate.c revision 73bfdbe28c2ce6d143eadf0bab8ccfbe4cab0fae
/* Copyright (C) 2002-2004 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 "str-sanitize.h"
#include "imap-parser.h"
#include "auth-client.h"
#include "client.h"
#include "client-authenticate.h"
const char *client_authenticate_get_capabilities(int secured)
{
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
*/
(secured || !disable_plaintext_auth ||
}
}
}
static void client_auth_input(void *context)
{
char *line;
if (!client_read(client))
return;
return;
}
/* @UNSAFE */
return;
"Authentication aborted");
return;
}
"Don't send unrequested data");
} else {
}
/* clear sensitive data */
}
const char *data)
{
switch (reply) {
break;
else {
}
/* get back to normal client input. */
break;
"Refer to server log for more information.");
NULL));
break;
if (ret < 0)
else {
/* continue */
return;
}
break;
}
}
{
const char *mech_name;
/* we want only one argument: authentication mechanism name */
return -1;
return -1;
if (*mech_name == '\0')
return FALSE;
return 1;
/* following input data will go to authentication */
return 0;
}
{
/* two arguments: username and password */
return -1;
return -1;
return -1;
if (verbose_auth) {
"Plaintext authentication disabled");
}
"* BAD [ALERT] Plaintext authentication is disabled, "
"but your client sent password in plaintext anyway. "
"If anyone was listening, the password was exposed.");
"NO Plaintext authentication disabled.");
return 1;
}
/* authorization ID \0 authentication ID \0 pass */
return 1;
/* don't read any input from client until login is finished */
}
return 0;
}