new files

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@885 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1996-10-25 05:51:14 +00:00
parent 58bc1c7e9a
commit cc2014c8c7
14 changed files with 3507 additions and 0 deletions

24
lib/otp/otp_challenge.c Normal file
View File

@@ -0,0 +1,24 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
RCSID("$Id$");
#endif
#include "otp_locl.h"
int
otp_challenge (OtpContext *ctx, char *user, char *str, size_t len)
{
void *dbm;
int ret;
ctx->user = strdup(user);
dbm = otp_db_open ();
if (dbm == NULL)
return -1;
ret = otp_get (dbm, ctx);
otp_db_close (dbm);
if (ret)
return ret;
sprintf (str, "[ otp-%s %u %s ]", ctx->alg->name, ctx->n-1, ctx->seed);
return 0;
}