fcc_retrv.c revision 505d05c73a6e56769f263d4803b22eddd168ee24
/*
* Copyright 2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
*
* Copyright 1990,1991 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
* require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
*
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright notice and
* this permission notice appear in supporting documentation, and that
* the name of M.I.T. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
* permission. Furthermore if you modify this software you must label
* your software as modified software and not distribute it in such a
* fashion that it might be confused with the original M.I.T. software.
* M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*
*
* This file contains the source code for krb5_fcc_retrieve.
*/
#if 0
#include "fcc.h"
#ifdef macintosh
#define register
#endif
#define flags_match(a,b) (((a) & (b)) == (a))
const krb5_ticket_times *));
const krb5_creds *,
const krb5_creds *));
static krb5_boolean srvname_match
const krb5_creds *,
const krb5_creds *));
static krb5_boolean authdata_match
static krb5_boolean
{
if (!data1) {
if (!data2)
return TRUE;
else
return FALSE;
}
return FALSE;
else
}
/*
* Effects:
* Searches the file cred cache is for a credential matching mcreds,
* with the fields specified by whichfields. If one if found, it is
* returned in creds, which should be freed by the caller with
* krb5_free_credentials().
*
* The fields are interpreted in the following way (all constants are
* preceded by KRB5_TC_). MATCH_IS_SKEY requires the is_skey field to
* match exactly. MATCH_TIMES requires the requested lifetime to be
* at least as great as that specified; MATCH_TIMES_EXACT requires the
* requested lifetime to be exactly that specified. MATCH_FLAGS
* requires only the set bits in mcreds be set in creds;
* MATCH_FLAGS_EXACT requires all bits to match.
*
* Errors:
* system errors
* permission errors
* KRB5_CC_NOMEM
*/
{
/* This function could be considerably faster if it kept indexing */
/* information.. sounds like a "next version" idea to me. :-) */
return kret;
if (((set(KRB5_TC_MATCH_SRV_NAMEONLY) &&
&&
(! set(KRB5_TC_MATCH_IS_SKEY) ||
&&
(! set(KRB5_TC_MATCH_FLAGS_EXACT) ||
&&
(! set(KRB5_TC_MATCH_FLAGS) ||
&&
(! set(KRB5_TC_MATCH_TIMES_EXACT) ||
&&
(! set(KRB5_TC_MATCH_TIMES) ||
&&
( ! set(KRB5_TC_MATCH_AUTHDATA) ||
&&
(! set(KRB5_TC_MATCH_2ND_TKT) ||
&&
((! set(KRB5_TC_MATCH_KTYPE))||
{
*creds = fetchcreds;
return KRB5_OK;
}
/* This one doesn't match */
}
/* If we get here, a match wasn't found */
return KRB5_CC_NOTFOUND;
}
static krb5_boolean
register const krb5_ticket_times *t1;
register const krb5_ticket_times *t2;
{
if (t1->renew_till) {
return FALSE; /* this one expires too late */
}
return FALSE; /* this one expires too late */
}
/* only care about expiration on a times_match */
return TRUE;
}
static krb5_boolean
const krb5_creds *mcreds;
const krb5_creds *creds;
{
}
/* only match the server name portion, not the server realm portion */
static krb5_boolean
{
return retval;
/*
* Hack to ignore the server realm for the purposes of the compare.
*/
}
static krb5_boolean
{
return TRUE;
return FALSE;
mdata++;
data++;
}
}
#else
#include <k5-int.h>
{
}
#endif