auth-server-request.c revision 89a126810703c666309310d0f3189e9834d70b5b
/* Copyright (c) 2003-2007 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "str.h"
#include "hash.h"
#include "ostream.h"
#include "auth-client.h"
#include "auth-server-connection.h"
#include "auth-server-request.h"
#include <stdlib.h>
struct auth_request {
struct auth_server_connection *conn;
unsigned int id;
enum auth_request_flags flags;
unsigned int local_port, remote_port;
char *initial_resp_base64;
void *context;
struct auth_server_connection *next_conn;
char *plaintext_data; /* for resending to other servers */
unsigned int init_sent:1;
unsigned int retrying:1;
};
struct auth_request *request,
const char **error_r);
static struct auth_server_connection *
{
if (conn->has_plain_mech)
return conn;
}
return NULL;
}
static void
{
const char *error;
/* plaintext authentication - save the data so we can
try it for the next */
}
}
}
static bool is_valid_string(const char *str)
{
const char *p;
/* make sure we're not sending any characters that have a special
meaning. */
for (p = str; *p != '\0'; p++) {
if (*p == '\t' || *p == '\n' || *p == '\r')
return FALSE;
}
return TRUE;
}
struct auth_request *request,
const char **error_r)
{
t_push();
t_pop();
*error_r = "Invalid username in SSL certificate";
return -1;
}
}
if (request->local_port != 0)
if (request->remote_port != 0)
/*if (!is_valid_string(request->initial_resp_base64)) {
t_pop();
*error_r = "Invalid base64 data in initial response";
return -1;
}*/
}
t_pop();
if (ret < 0) {
i_warning("Error sending request to auth server: %m");
return -1;
}
return 0;
}
struct auth_request *request,
const char *data_base64)
{
const char *prefix;
i_warning("Error sending continue request to auth server: %m");
}
}
{
struct auth_request *request;
unsigned int id;
i_error("BUG: Authentication server sent broken OK line");
return FALSE;
}
/* We've already destroyed the request */
return TRUE;
}
data_base64 = NULL;
break;
}
}
return TRUE;
}
const char *args)
{
struct auth_request *request;
const char *data;
unsigned int id;
i_error("BUG: Authentication server sent broken CONT line");
return FALSE;
}
data++;
/* We've already destroyed the request */
return TRUE;
}
} else {
}
return TRUE;
}
const char *args)
{
struct auth_request *request;
struct auth_server_connection *next;
unsigned int id;
i_error("BUG: Authentication server sent broken FAIL line");
return FALSE;
}
/* We've already destroyed the request */
return TRUE;
}
/* the other one hasn't replied yet */
return TRUE;
}
} else {
request);
&error);
return TRUE;
}
}
return TRUE;
}
struct auth_request *request)
{
} else {
}
} else {
}
}
{
struct hash_iterate_context *iter;
}
struct auth_request *
const struct auth_request_info *request_info,
const char **error_r)
{
struct auth_server_connection *conn;
struct auth_request *request;
*error_r = "Temporary authentication failure.";
error_r);
} else {
break;
}
}
return NULL;
}
/* wrapped - ID 0 not allowed */
}
else {
}
return request;
}
const char *data_base64)
{
}
{
}
{
}
{
}
{
}