client-authenticate.c revision 94f11e46199ea913e4ae17198b3024771b1bef68
/* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "base64.h"
#include "ioloop.h"
#include "ibuffer.h"
#include "obuffer.h"
#include "temp-string.h"
#include "auth-connection.h"
#include "client.h"
#include "client-authenticate.h"
#include "master.h"
typedef struct {
int method;
const char *name;
int plaintext;
static AuthMethod auth_methods = 0;
static char *auth_methods_capability = NULL;
};
const char *client_authenticate_get_capabilities(void)
{
int i;
if (auth_methods == available_auth_methods)
return auth_methods_capability;
for (i = 0; i < AUTH_METHODS_COUNT; i++) {
}
}
return auth_methods_capability;
}
{
int i;
for (i = 0; i < AUTH_METHODS_COUNT; i++) {
return &auth_method_desc[i];
}
return NULL;
}
{
"NO Authentication failed.");
/* get back to normal client input */
}
{
switch (result) {
case MASTER_RESULT_SUCCESS:
break;
break;
default:
break;
}
}
{
const char *base64_data;
t_push();
t_pop();
}
{
switch (result) {
case AUTH_RESULT_CONTINUE:
return TRUE;
case AUTH_RESULT_SUCCESS:
/* disable IO until we're back from master */
}
return FALSE;
case AUTH_RESULT_FAILURE:
/* see if we have error message */
if (reply_data_size > 0 &&
"NO Authentication failed: ",
(const char *) reply_data, NULL));
} else {
/* default error message */
}
return FALSE;
default:
return FALSE;
}
}
{
}
}
{
const char *error;
unsigned char *p;
"NO Plaintext authentication disabled.");
return TRUE;
}
/* code it into user\0user\0password */
/* don't read any input from client until login is finished */
return TRUE;
} else {
return TRUE;
}
}
const unsigned char *reply_data,
{
}
{
char *line;
if (!client_read(client))
return;
return;
return;
}
if (size < 0) {
/* failed */
return;
}
return;
}
/* clear sensitive data */
}
{
const char *error;
if (*method_name == '\0')
return FALSE;
"NO Unsupported authentication method.");
return TRUE;
}
"NO Plaintext authentication disabled.");
return TRUE;
}
/* following input data will go to authentication */
} else {
}
return TRUE;
}