/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
*
* This file of the Kerberos V5 software is derived from public-domain code
* contributed by Daniel J. Bernstein, <brnstnd@acf10.nyu.edu>.
*/
/*
* Solaris Kerberos:
* An implementation for the memory only (mem) replay cache type.
*/
#include "rc_common.h"
#include "rc_mem.h"
/*
* 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.
*/
/*
* of course, list is backwards
* hash could be forwards since we have to search on match, but naaaah
*/
static int
{
int rephash;
/* Solaris: calling krb_timeofday() here, once for better perf. */
/*
* Solaris: 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);
return (CMP_MALLOC);
}
return (CMP_MALLOC);
}
return (CMP_HOHUM);
}
/*ARGSUSED*/
char *KRB5_CALLCONV
{
}
/*ARGSUSED*/
{
struct mem_data *t;
if (err)
return err;
return (err);
}
return 0;
}
{
/* default to clockskew from the context */
return (0);
}
{
if (retval)
return retval;
if (retval) {
return (retval);
}
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 (retval)
return (retval);
/*
* 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)
krb5_xfree(t->name);
if (t->h)
krb5_xfree(t->h);
krb5_xfree(t);
}
return (retval);
}
/*
* Recovery (retrieval) of the replay cache occurred during
* krb5_rc_resolve(). So we just return error here.
*/
{
/* SUNW14resync - No need for locking here, just returning RC_NOIO */
return (KRB5_RC_NOIO);
}
{
if (retval)
return retval;
}
{
if (ret)
return (ret);
if (ret) {
return (ret);
}
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);
}