/*
*/
/*
*
* This file of the Kerberos V5 software is derived from public-domain code
* contributed by Daniel J. Bernstein, <brnstnd@acf10.nyu.edu>.
*/
/*
* An implementation for the memory only (mem) replay cache type.
* This file was derived from rc_dfl.c with NOIOSTUFF defined.
*/
#include "rc_mem.h"
#ifndef HASHSIZE
#endif
#define CMP_HOHUM 0
struct authlist
{
};
/*
* We want the replay cache to hang around for the entire life span of the
* process, regardless if the auth_context or acceptor_cred handles are
* destroyed.
*/
static unsigned int
{
return h % hsize;
}
/*ARGSUSED*/
static int
{
/* If both records include message hashes, compare them as well. */
return CMP_REPLAY;
}
return CMP_HOHUM;
}
static int
{
if (mytime == 0)
return CMP_HOHUM; /* who cares? */
/* I hope we don't have to worry about overflow */
return CMP_EXPIRED;
return CMP_HOHUM;
}
/*
* of course, list is backwards
* hash could be forwards since we have to search on match, but naaaah
*/
static int
{
int rephash;
/* Calling krb_timeofday() here, once for better perf. */
/*
* Calling alive() on rep since it doesn't make sense to store
* an expired replay.
*/
return (CMP_EXPIRED);
case CMP_REPLAY:
return (CMP_REPLAY);
case CMP_HOHUM:
== CMP_EXPIRED) {
if (pta) {
} else {
}
continue;
}
}
}
return (CMP_MALLOC);
goto error;
goto error;
goto error;
return (CMP_HOHUM);
return (CMP_MALLOC);
}
/*ARGSUSED*/
char *KRB5_CALLCONV
{
}
/*ARGSUSED*/
{
struct mem_data *t;
return (0);
}
{
/* default to clockskew from the context */
return (0);
}
{
return (retval);
}
/*
* We want the replay cache to be persistent since we can't
* read from a file to retrieve the rcache, so we must not free
* here. Just return success.
*/
{
return (0);
}
{
}
/*ARGSUSED*/
{
struct mem_data *t = 0;
/*
* If the global rcache has already been initialized through a prior
* call to this function then just set the rcache to point to it for
* any subsequent operations.
*/
return (0);
}
/* allocate id? no */
return (KRB5_RC_MALLOC);
}
if (name) {
if (!t->name) {
goto cleanup;
}
} else
t->name = 0;
if (!t->h) {
goto cleanup;
}
return (0);
if (t) {
if (t->name)
if (t->h)
free(t->h);
free(t);
}
return (retval);
}
/*
* Recovery (retrieval) of the replay cache occurred during
* krb5_rc_resolve(). So we just return error here.
*/
{
return (KRB5_RC_NOIO);
}
{
if (retval)
return (retval);
}
{
case CMP_MALLOC:
return (KRB5_RC_MALLOC);
case CMP_REPLAY:
return (KRB5KRB_AP_ERR_REPEAT);
case CMP_EXPIRED:
return (KRB5KRB_AP_ERR_SKEW);
case CMP_HOHUM:
break;
}
return (0);
}
0,
"MEMORY",
/* expunging not used in memory rcache type */
NULL,
};