client-authenticate.c revision 63969c244e8973a61760a98a23b127827d3d652c
/* Copyright (C) 2002 Timo Sirainen */
#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 "auth-client.h"
#include "../pop3/capability.h"
#include "ssl-proxy.h"
#include "master.h"
#include "auth-common.h"
#include "client.h"
#include "client-authenticate.h"
#include "ssl-proxy.h"
{
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
- but don't advertise AUTH=PLAIN, as RFC 2595 requires
*/
}
}
"STLS\r\n" : "",
"\r\n.", NULL));
return TRUE;
}
{
}
"-ERR Authentication failed.");
/* get back to normal client input */
}
{
if (success) {
NULL);
} else {
"Error report written to server log.");
}
}
{
const void *buf_data;
t_push();
t_pop();
}
static enum auth_client_request_new_flags
{
enum auth_client_request_new_flags auth_flags = 0;
return auth_flags;
}
struct auth_client_request_reply *reply,
{
const char *error;
master_callback, &error)) {
case -1:
case 0:
/* login failed */
break;
default:
/* success, we should be able to log in. if we fail, just
disconnect the client. */
}
}
{
"-ERR Plaintext authentication disabled.");
return TRUE;
}
return TRUE;
}
{
const char *error;
struct auth_request_info info;
return TRUE;
}
/* authorization ID \0 authentication ID \0 pass */
/* don't read any input from client until login is finished */
}
return TRUE;
} else {
return TRUE;
}
}
struct auth_client_request_reply *reply,
{
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_request_info info;
const struct auth_mech_desc *mech;
if (*args == '\0' &&
/* This is needed to allow MS Outlook to use NTLM
authentication. Sometimes this kludge is called
"old-style SASL discovery". */
return TRUE;
}
/* <mechanism name> <initial response> */
if (p == NULL) {
args = "";
} else {
args = p+1;
}
"-ERR Unsupported authentication mechanism.");
return TRUE;
}
"-ERR Plaintext authentication disabled.");
return TRUE;
}
/* failed */
return TRUE;
}
/* following input data will go to authentication */
} else {
}
return TRUE;
}
{
struct auth_request_info info;
const char *error, *p;
return TRUE;
}
/* <username> <md5 sum in hex> */
return TRUE;
}
/* APOP challenge \0 username \0 APOP response */
"-ERR Invalid characters in MD5 response.");
return TRUE;
}
/* don't read any input from client until login is finished */
}
/* the auth connection was lost. we have no choice
but to fail the APOP logins completely since the
challenge is auth connection-specific. disconnect. */
} else {
}
return TRUE;
}