gc_via_tkt.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
#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.
*
*
* Given a tkt, and a target cred, get it.
* Assumes that the kdc_rep has been decrypted.
*/
#include "k5-int.h"
#include "int-proto.h"
static krb5_error_code
krb5_address *const * address;
krb5_creds ** ppcreds;
{
return ENOMEM;
}
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup_keyblock;
} else {
/* no addresses in the list means we got what we had */
goto cleanup_keyblock;
}
goto cleanup_keyblock;
return 0;
return retval;
}
krb5_creds * tkt;
const krb5_flags kdcoptions;
krb5_address *const * address;
krb5_creds ** out_cred;
{
krb5_enctype *enctypes = 0;
/* tkt->client must be equal to in_cred->client */
return KRB5_PRINC_NOMATCH;
return KRB5_NO_TKT_SUPPLIED;
if ((kdcoptions & KDC_OPT_ENC_TKT_IN_SKEY) &&
return(KRB5_NO_2ND_TKT);
/* check if we have the right TGT */
/* tkt->server must be equal to */
/*
{
krb5_principal tempprinc;
if (retval = krb5_tgtname(context,
krb5_princ_realm(context, in_cred->server),
krb5_princ_realm(context, tkt->server), &tempprinc))
return(retval);
if (!krb5_principal_compare(context, tempprinc, tkt->server)) {
krb5_free_principal(context, tempprinc);
return (KRB5_PRINC_NOMATCH);
}
krb5_free_principal(context, tempprinc);
}
*/
if (!enctypes)
return ENOMEM;
enctypes[1] = 0;
}
0, /* no padata */
if (enctypes)
if (retval)
return retval;
switch (tgsrep.message_type) {
case KRB5_TGS_REP:
break;
case KRB5_ERROR:
default:
else
if (retval) /* neither proper reply nor error! */
goto error_4;
goto error_4;
}
goto error_4;
goto error_3;
}
/* make sure the response hasn't been tampered with..... */
retval = 0;
if ((kdcoptions & KDC_OPT_POSTDATED) &&
if ((kdcoptions & KDC_OPT_RENEWABLE) &&
if ((kdcoptions & KDC_OPT_RENEWABLE_OK) &&
if (retval != 0)
goto error_3;
tgsrep.request_time)) {
goto error_3;
}
error_3:;
error_4:;
return retval;
}