示例#1
0
krb5_error_code KRB5_CALLCONV
krb5_tkt_creds_get_creds(krb5_context context, krb5_tkt_creds_context ctx,
                         krb5_creds *creds)
{
    if (ctx->state != STATE_COMPLETE)
        return KRB5_NO_TKT_SUPPLIED;
    return krb5int_copy_creds_contents(context, ctx->reply_creds, creds);
}
示例#2
0
/*
 * Requires:
 * cursor is a krb5_cc_cursor originally obtained from
 * krb5_mcc_start_seq_get.
 *
 * Modifes:
 * cursor, creds
 *
 * Effects:
 * Fills in creds with the "next" credentals structure from the cache
 * id.  The actual order the creds are returned in is arbitrary.
 * Space is allocated for the variable length fields in the
 * credentials structure, so the object returned must be passed to
 * krb5_destroy_credential.
 *
 * The cursor is updated for the next call to krb5_mcc_next_cred.
 *
 * Errors:
 * system errors
 */
krb5_error_code KRB5_CALLCONV
krb5_mcc_next_cred(krb5_context context, krb5_ccache id,
                   krb5_cc_cursor *cursor, krb5_creds *creds)
{
    krb5_mcc_cursor mcursor;
    krb5_error_code retval;

    /* Once the node in the linked list is created, it's never
       modified, so we don't need to worry about locking here.  (Note
       that we don't support _remove_cred.)  */
    mcursor = (krb5_mcc_cursor) *cursor;
    if (mcursor == NULL)
        return KRB5_CC_END;
    memset(creds, 0, sizeof(krb5_creds));
    if (mcursor->creds) {
        retval = krb5int_copy_creds_contents(context, mcursor->creds, creds);
        if (retval)
            return retval;
    }
    *cursor = (krb5_cc_cursor)mcursor->next;
    return KRB5_OK;
}