mech-otp.c revision 08d6658a4e2ec8104cd1307f6baa75fdb07a24f8
/*
* One-Time-Password (RFC 2444) authentication mechanism.
*
* Copyright (c) 2006 Andrey Panin <pazke@donpac.ru>
*
* This software is released under the MIT license.
*/
#include "auth-common.h"
#include "safe-memset.h"
#include "hash.h"
#include "mech.h"
#include "passdb.h"
#include "hex-binary.h"
#include "otp.h"
#include "mech-otp-skey-common.h"
static void
{
struct otp_auth_request *request =
(struct otp_auth_request *)auth_request;
const char *answer;
"invalid OTP data in passdb");
return;
}
"sequence number < 1");
return;
}
"user is locked, race attack?");
return;
}
}
static void
struct auth_request *auth_request)
{
switch (result) {
case PASSDB_RESULT_OK:
break;
break;
default:
break;
}
}
static void
struct auth_request *auth_request)
{
switch (result) {
case PASSDB_RESULT_OK:
break;
break;
default:
break;
}
}
static void
{
struct otp_auth_request *request =
(struct otp_auth_request *)auth_request;
/* authorization ID \0 authentication ID
FIXME: we'll ignore authorization ID for now. */
count = 0;
for (i = 0; i < data_size; i++) {
if (data[i] == '\0') {
if (++count == 1)
}
}
"invalid input");
return;
}
return;
}
}
{
struct otp_auth_request *request =
(struct otp_auth_request *)auth_request;
int ret;
if (ret < 0) {
"invalid response");
return;
}
if (ret != 0) {
return;
}
}
{
struct otp_auth_request *request =
(struct otp_auth_request *)auth_request;
const char *error;
int ret;
if (ret < 0) {
"invalid init response, %s", error);
return;
}
if (ret != 0) {
return;
}
}
static void
{
} else {
"unsupported response type");
}
}
static void
{
} else {
}
}
static struct auth_request *mech_otp_auth_new(void)
{
struct otp_auth_request *request;
return &request->auth_request;
}
const struct mech_module mech_otp = {
"OTP",
};