This commit is contained in:
Love Hornquist Astrand
2010-11-26 09:03:36 -08:00
parent dc992b1525
commit 23f5f03c7e
2 changed files with 1 additions and 44 deletions

View File

@@ -130,23 +130,9 @@ v5_convert(krb5_context context, krb5_ccache id,
if (strcasecmp(val, "local") == 0 ||
strcasecmp(val, "2b") == 0)
ret = v5_to_kt(cred, uid, kt, 1);
else if(strcasecmp(val, "yes") == 0 ||
strcasecmp(val, "true") == 0 ||
atoi(val)) {
struct credentials cred4;
if (id == NULL)
ret = krb524_convert_creds_kdc(context, cred, &cred4);
else
ret = krb524_convert_creds_kdc_ccache(context, id, cred, &cred4);
if (ret)
goto out;
ret = _kafs_v4_to_kt(&cred4, uid, kt);
} else
else
ret = v5_to_kt(cred, uid, kt, 0);
out:
free(val);
return ret;
}

View File

@@ -139,35 +139,6 @@ _kafs_fixup_viceid(struct ClearToken *ct, uid_t uid)
}
}
int
_kafs_v4_to_kt(CREDENTIALS *c, uid_t uid, struct kafs_token *kt)
{
kt->ticket = NULL;
if (c->ticket_st.length > MAX_KTXT_LEN)
return EINVAL;
kt->ticket = malloc(c->ticket_st.length);
if (kt->ticket == NULL)
return ENOMEM;
kt->ticket_len = c->ticket_st.length;
memcpy(kt->ticket, c->ticket_st.dat, kt->ticket_len);
/*
* Build a struct ClearToken
*/
kt->ct.AuthHandle = c->kvno;
memcpy (kt->ct.HandShakeKey, c->session, sizeof(c->session));
kt->ct.ViceId = uid;
kt->ct.BeginTimestamp = c->issue_date;
kt->ct.EndTimestamp = krb_life_to_time(c->issue_date, c->lifetime);
_kafs_fixup_viceid(&kt->ct, uid);
return 0;
}
/* Try to get a db-server for an AFS cell from a AFSDB record */
static int