krb5_get_init_creds_opt_set_in_ccache.rst
krb5_get_init_creds_opt_set_out_ccache.rst
krb5_get_init_creds_opt_set_pa.rst
+ krb5_get_init_creds_opt_set_pac_request.rst
krb5_get_init_creds_opt_set_preauth_list.rst
krb5_get_init_creds_opt_set_proxiable.rst
krb5_get_init_creds_opt_set_renew_life.rst
krb5_get_init_creds_opt *opt,
krb5_ccache ccache);
+/**
+ * @brief Ask the KDC to include or not include a PAC in the ticket
+ *
+ * @param [in] context Library context
+ * @param [in] opt Options structure
+ * @param [in] req_pac Whether to request a PAC or not
+ *
+ * If this option is set, the AS request will include a PAC-REQUEST pa-data
+ * item explicitly asking the KDC to either include or not include a privilege
+ * attribute certificate in the ticket authorization data. By default, no
+ * request is made; typically the KDC will default to including a PAC if it
+ * supports them.
+ *
+ * @version New in 1.15
+ */
+krb5_error_code KRB5_CALLCONV
+krb5_get_init_creds_opt_set_pac_request(krb5_context context,
+ krb5_get_init_creds_opt *opt,
+ krb5_boolean req_pac);
+
/**
* Set FAST flags in initial credential options.
*
MAKE_ENCODER(encode_krb5_s4u_userid, s4u_userid);
MAKE_ENCODER(encode_krb5_pa_s4u_x509_user, pa_s4u_x509_user);
MAKE_DECODER(decode_krb5_pa_s4u_x509_user, pa_s4u_x509_user);
+MAKE_ENCODER(encode_krb5_pa_pac_req, pa_pac_req);
MAKE_DECODER(decode_krb5_pa_pac_req, pa_pac_req);
MAKE_ENCODER(encode_krb5_etype_list, etype_list);
MAKE_DECODER(decode_krb5_etype_list, etype_list);
return code;
}
+/* Add a KERB-PA-PAC-REQUEST pa-data item if the gic options require one. */
+static krb5_error_code
+maybe_add_pac_request(krb5_context context, krb5_init_creds_context ctx)
+{
+ krb5_error_code code;
+ krb5_pa_pac_req pac_req;
+ krb5_data *encoded;
+ int val;
+
+ val = k5_gic_opt_pac_request(ctx->opt);
+ if (val == -1)
+ return 0;
+
+ pac_req.include_pac = val;
+ code = encode_krb5_pa_pac_req(&pac_req, &encoded);
+ if (code)
+ return code;
+ code = add_padata(&ctx->request->padata, KRB5_PADATA_PAC_REQUEST,
+ encoded->data, encoded->length);
+ krb5_free_data(context, encoded);
+ return code;
+}
+
static krb5_error_code
init_creds_step_request(krb5_context context,
krb5_init_creds_context ctx,
}
if (code)
goto cleanup;
+
+ code = maybe_add_pac_request(context, ctx);
+ if (code)
+ goto cleanup;
+
code = krb5int_fast_prep_req(context, ctx->fast_state,
ctx->request, ctx->outer_request_body,
encode_krb5_as_req,
void *expire_data;
krb5_responder_fn responder;
void *responder_data;
+ int pac_request; /* -1 unset, 0 false, 1 true */
};
#if TARGET_OS_MAC
#pragma pack(pop)
if (opte == NULL)
return ENOMEM;
opte->opt.flags = DEFAULT_FLAGS | GIC_OPT_EXTENDED;
+ opte->pac_request = -1;
*opt = (krb5_get_init_creds_opt *)opte;
return 0;
}
opte->opt.flags |= GIC_OPT_SHALLOW_COPY;
return (krb5_get_init_creds_opt *)opte;
}
+
+krb5_error_code KRB5_CALLCONV
+krb5_get_init_creds_opt_set_pac_request(krb5_context context,
+ krb5_get_init_creds_opt *opt,
+ krb5_boolean req_pac)
+{
+ struct extended_options *opte = (struct extended_options *)opt;
+
+ if (opt == NULL || !(opt->flags & GIC_OPT_EXTENDED))
+ return EINVAL;
+ opte->pac_request = !!req_pac;
+ return 0;
+}
+
+int
+k5_gic_opt_pac_request(krb5_get_init_creds_opt *opt)
+{
+ struct extended_options *opte = (struct extended_options *)opt;
+
+ if (opt == NULL || !(opt->flags & GIC_OPT_EXTENDED))
+ return -1;
+ return opte->pac_request;
+}
krb5_get_init_creds_opt *
k5_gic_opt_shallow_copy(krb5_get_init_creds_opt *opt);
+/* Return -1 if no PAC request option was specified, or the option value as a
+ * boolean (0 or 1). */
+int
+k5_gic_opt_pac_request(krb5_get_init_creds_opt *opt);
+
#endif /* KRB5_INT_FUNC_PROTO__ */
krb5_get_init_creds_opt_set_in_ccache
krb5_get_init_creds_opt_set_out_ccache
krb5_get_init_creds_opt_set_pa
+krb5_get_init_creds_opt_set_pac_request
krb5_get_init_creds_opt_set_preauth_list
krb5_get_init_creds_opt_set_proxiable
krb5_get_init_creds_opt_set_renew_life
; new in 1.15
krb5_set_kdc_send_hook @433
krb5_set_kdc_recv_hook @434
+ krb5_get_init_creds_opt_set_pac_request @435