Example #1
0
File: gic.c Project: heimdal/MKShim
mit_krb5_error_code KRB5_CALLCONV
krb5_verify_init_creds(mit_krb5_context context,
		       mit_krb5_creds *creds,
		       mit_krb5_principal ap_req_server,
		       mit_krb5_keytab ap_req_keytab,
		       mit_krb5_ccache *ccache,
		       mit_krb5_verify_init_creds_opt *options)
{
    struct comb_principal *p = (struct comb_principal *)ap_req_server;
    krb5_error_code ret;
    krb5_creds hcreds;
    krb5_verify_init_creds_opt hopts;

    memset(&hcreds, 0, sizeof(hcreds));
    heim_krb5_verify_init_creds_opt_init(&hopts);
    
    if (options->ap_req_nofail)
	heim_krb5_verify_init_creds_opt_set_ap_req_nofail(&hopts, options->ap_req_nofail);

    mshim_mcred2hcred(HC(context), creds, &hcreds);

    ret = heim_krb5_verify_init_creds(HC(context), 
				      &hcreds, p->heim,
				      (krb5_keytab)ap_req_keytab,
				      (krb5_ccache *)ccache,
				      &hopts);
    heim_krb5_free_cred_contents(HC(context), &hcreds);

    return ret;
}
Example #2
0
mit_krb5_error_code KRB5_CALLCONV
mit_krb5_get_validated_creds(mit_krb5_context context,
                             mit_krb5_creds *creds,
                             mit_krb5_principal client,
                             mit_krb5_ccache ccache,
                             char *in_tkt_service)
{
    struct comb_principal *p = (struct comb_principal *)client;
    krb5_error_code ret;
    krb5_creds hcreds;

    LOG_ENTRY();

    mshim_mcred2hcred(HC(context), creds, &hcreds);

    ret = heim_krb5_get_validated_creds(HC(context), &hcreds, p->heim,
                                        (krb5_ccache)ccache, in_tkt_service);
    heim_krb5_free_cred_contents(HC(context), &hcreds);
    return ret;
}