return errors

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@982 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1996-11-16 17:54:17 +00:00
parent 7a2f2857d5
commit a4237d6c48
3 changed files with 21 additions and 7 deletions

View File

@@ -51,12 +51,16 @@ otp_challenge (OtpContext *ctx, char *user, char *str, size_t len)
ctx->user = strdup(user);
dbm = otp_db_open ();
if (dbm == NULL)
if (dbm == NULL) {
ctx->err = "Cannot open database";
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);
ctx->err = NULL;
ctx->challengep = 1;
return 0;
}