/*
* APOP (RFC-1460) authentication mechanism.
*
* Copyright (c) 2004 Andrey Panin <pazke@donpac.ru>
*
* This software is released under the MIT license.
*/
#include "auth-common.h"
#include "mech.h"
#include "passdb.h"
#include "md5.h"
#include "buffer.h"
#include "auth-client-connection.h"
#include "auth-master-connection.h"
#include <stdio.h>
#include <unistd.h>
struct apop_auth_request {
/* requested: */
char *challenge;
/* received: */
};
{
}
static void
struct auth_request *auth_request)
{
(struct apop_auth_request *)auth_request;
switch (result) {
case PASSDB_RESULT_OK:
else
break;
break;
default:
break;
}
}
static void
{
(struct apop_auth_request *)auth_request;
const char *error;
/* pop3-login handles sending the challenge and getting the response.
Our input here is: <challenge> \0 <username> \0 <response> */
if (data_size == 0) {
/* Should never happen */
"no initial response");
return;
}
/* get the challenge */
tmp++;
/* get the username */
tmp++;
} else {
/* should never happen */
"malformed data");
return;
}
/* Should never happen */
"malformed data");
return;
}
sizeof(request->response_digest));
/* the challenge must begin with trusted unique ID. we trust only
ourself, so make sure it matches our connection specific UID
which we told to client in handshake. Also require a timestamp
which is later than this process's start time. */
"invalid challenge");
return;
}
&error)) {
return;
}
}
{
return &request->auth_request;
}
"APOP",
NULL,
};