[winpr,sspi] add some missing krb5 return checks

This commit is contained in:
akallabeth 2023-10-23 17:30:59 +02:00 committed by akallabeth
parent afc9ddd15f
commit c5cd40f1bc

View File

@ -129,7 +129,9 @@ krb5_error_code krb5glue_get_init_creds(krb5_context ctx, krb5_principal princ,
WINPR_ASSERT(ctx);
krb5_get_init_creds_opt_alloc(ctx, &gic_opt);
rv = krb5_get_init_creds_opt_alloc(ctx, &gic_opt);
if (rv)
goto cleanup;
krb5_get_init_creds_opt_set_forwardable(gic_opt, 0);
krb5_get_init_creds_opt_set_proxiable(gic_opt, 0);
@ -143,15 +145,32 @@ krb5_error_code krb5glue_get_init_creds(krb5_context ctx, krb5_principal princ,
if (krb_settings->renewLifeTime)
krb5_get_init_creds_opt_set_renew_life(gic_opt, krb_settings->renewLifeTime);
if (krb_settings->withPac)
krb5_get_init_creds_opt_set_pac_request(ctx, gic_opt, TRUE);
{
rv = krb5_get_init_creds_opt_set_pac_request(ctx, gic_opt, TRUE);
if (rv)
goto cleanup;
}
if (krb_settings->armorCache)
krb5_get_init_creds_opt_set_fast_ccache_name(ctx, gic_opt, krb_settings->armorCache);
{
rv = krb5_get_init_creds_opt_set_fast_ccache_name(ctx, gic_opt,
krb_settings->armorCache);
if (rv)
goto cleanup;
}
if (krb_settings->pkinitX509Identity)
krb5_get_init_creds_opt_set_pa(ctx, gic_opt, "X509_user_identity",
krb_settings->pkinitX509Identity);
{
rv = krb5_get_init_creds_opt_set_pa(ctx, gic_opt, "X509_user_identity",
krb_settings->pkinitX509Identity);
if (rv)
goto cleanup;
}
if (krb_settings->pkinitX509Anchors)
krb5_get_init_creds_opt_set_pa(ctx, gic_opt, "X509_anchors",
krb_settings->pkinitX509Anchors);
{
rv = krb5_get_init_creds_opt_set_pa(ctx, gic_opt, "X509_anchors",
krb_settings->pkinitX509Anchors);
if (rv)
goto cleanup;
}
if (krb_settings->kdcUrl)
{
const char* names[4] = { 0 };