Commit Graph

27 Commits

Author SHA1 Message Date
Joseph Sutton
d5ad04a7f3 kdc: Add function to add encrypted padata
Since plugins no longer have a way of accessing the 'ek' member of the
request structure, this function provides a way for a plugin to add
encrypted padata to the response.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2022-03-08 18:58:17 +11:00
Stefan Metzmacher
8495f63bc3 kdc: provide kdc_request_get_explicit_armor_{clientdb,client,pac}()
_kdc_fast_check_armor_pac() already checks the PAC of the armor,
but it should also remember it if it's an TGS-REQ with explicit armor.

This will allow the kdc pac hooks to generate a compound identity PAC
with PAC_TYPE_DEVICE_INFO.

Signed-off-by: Stefan Metzmacher <metze@samba.org>

Closes: #967
2022-03-03 10:10:29 +11:00
Luke Howard
144caf67fa kdc: add wrappers for heimbase object accessors
Add libkdc wrappers for heimbase object accessors so plugins can use audit and
request attribute APIs without consuming libheimbase. Exposed API surface is
minimal and is limited to reading array collections, and reading/creating base
and custom types.
2022-01-28 17:24:57 -06:00
Luke Howard
ec24edf700 kdc: add accessor functions for KDC request structure
Add accessor functions for use by Samba and other plugin developers.
Documentation is in kdc/kdc-accessors.h.
2022-01-20 17:23:24 +11:00
Luke Howard
94ed961d02 kdc: make auditing API public
Samba plugins will need to use auditing API without including krb5-private.h,
so make the auditing APIs public.
2022-01-18 16:09:50 +11:00
Luke Howard
4befd3e355 kdc: remove krb5_ prefix for KDC attribute functions
We will use the kdc_ rather than krb5_kdc_ prefix for new public APIs exported
from libkdc. Amend the recently introduced
request_{get,set,copy,delete}_attribute APIs to conform.
2022-01-17 23:50:04 -05:00
Luke Howard
d77e9988ec kdc: add _kdc_audit_addkv_{number,object}
Wrappers for new auditing functions in libheimbase.
2022-01-04 12:37:39 +11:00
Luke Howard
ce58eb9081 kdc: annotate libkdc Windows function annotations
Annotate libkdc APIs with KDC_LIB_{CALL,FUNCTION} to ensure correct calling
convention and optimized DLL importing on Windows.

Ensure Windows and libtool export tables are consistent.
2022-01-04 12:27:43 +11:00
Luke Howard
a8ff420b16 kdc: add attribute dictionary to kdc_request_t
Add a heim_dict_t to the KDC request structure for use by pre-authentication
mechanisms and plugins.
2022-01-04 12:27:43 +11:00
Luke Howard
b27026996a base: s/addkv_{bool,number,object}/setkv
Now heim_audit_addkv() correctly supports multiple values, the other functions
that (by design) replace existing values with a single value should use the
heim_audit_setkv prefix.

A subsequent commit could add variants that support multiple values for
non-string types.
2022-01-04 09:07:10 +11:00
Luke Howard
fcff5933ad kdc: rename windc to kdc plugin
Rename the "windc" plugin API to the more general "kdc" plugin API, for two
reasons: the Heimdal KDC uses the Windows PAC even when not emulating a domain
controller, and the plugin API has accreted methods that are not specific to
emulating a domain controller (such as referral_policy and finalize_reply).
2022-01-03 16:17:01 +11:00
Luke Howard
e15e711b13 kdc: remove auth_event_details audit key
The auth event details audit key (formerly, parameter to auth_status)
contained, variously, an encryption type name; a PKINIT client certificate
name; or, a GSS initiator name. Audit these instead using individual keys that
reflect the values' contents.
2022-01-02 15:25:52 +11:00
Luke Howard
cc0874d410 kdc: preserve value types in auditing
Preserve integer/boolean audit values as their native types; convert to strings
when logging only. This commit goes some way towards unifying the two auditing
APIs.
2022-01-02 15:25:52 +11:00
Luke Howard
b1dcc1a474 kdc: refactor Samba-specific auditing API in terms of existing API
Make Samba-specific HDB auth status API a wrapper on the existing auditing API,
with a view towards unifying the two APIs in a future commit.

The term "auth status" is replaced with "auth event", and the HDB auth_status
method is replaced with a more general purpose audit method which has access to
the entire request structure.
2022-01-02 15:25:52 +11:00
Nicolas Williams
1d5062b167 kdc: Modernize kx509 logging too 2019-12-11 19:34:36 -06:00
Nicolas Williams
608c2876d4 kdc: Fix audit_addkv() typos and reason handling
Now we'll put the "reason=..." last in the log lines and we won't escape
spaces -- just newlines and other control characters.  This makes
reading log lines much easier without complicating parsing of log lines
because interior key=value pairs do get whitespace escaped or removed.
2019-12-10 22:14:38 -06:00
Nicolas Williams
58848fce7b kdc: Add missing exports 2019-12-10 17:23:46 -06:00
Nicolas Williams
575c67806b Add bx509d 2019-12-04 21:34:44 -06:00
Luke Howard
ac544a6da6 kdc: export kdc_get_instance() for windc plugins 2019-01-05 10:48:04 +11:00
Love Hornquist Astrand
b746f1ce34 add _kdc_db_fetch and _kdc_free_ent for digest-service 2011-01-30 12:12:30 -08:00
Andrew Bartlett
79bf21032a Add new external function krb5_kdc_pkinit_config()
This starts up the pkinit configuration and sets some default values,
and is needed in a seperate function so Samba4 can call it from it's
own KDC wrapper.

Andrew Bartlett

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2010-11-11 20:42:51 -08:00
Love Hornquist Astrand
51717efb34 Export kdc_check_flags, requested by Jelmer Vernooij in Debian bug #56275 2010-01-02 17:51:57 +01:00
Love Hornquist Astrand
55db6909fe _kdc_pk_initialize needs to be exported for kdc-replay
prompted by patch from Gabor Gombas <gombasg@sztaki.hu>
2009-11-25 05:08:44 -08:00
Love Hörnquist Åstrand
c561d08c04 export get_dbinfo as krb5_kdc_set_dbinfo and call from users. This to allows libkdc users to to specify their own databases
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21110 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-18 10:52:20 +00:00
Love Hörnquist Åstrand
501beea27a add new symbols
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20978 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-07 15:28:40 +00:00
Love Hörnquist Åstrand
628db42656 rename windc_init to krb5_kdc_windc_init
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20559 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-04-24 16:00:07 +00:00
Love Hörnquist Åstrand
f892256e21 version script for libkdc
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20550 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-04-24 11:43:54 +00:00