Commit Graph

29923 Commits

Author SHA1 Message Date
Luke Howard
06f8985c55 hdb: consolidate preauth audit event types
Instead of having distinct preauth success/failure events for different
mechanisms, have a single event; the mechanism can be disambiguated by querying
the HDB_REQUEST_KV_PA_NAME key.

Note: there is still an explicit event for long-term key-based success/failure
in order to help the backend implement lockout.

Audit failure (HDB_AUTH_EVENT_PREAUTH_FAILED) in the main preauth loop, rather
than in each mechanism. Success is still audited in the mechanism to allow
client pre-authentication success to be noted even if something subsequent
(e.g. encoding a reply, memory allocation) fails. The generic catch-all for
success remains.
2022-01-05 09:42:03 +11:00
Luke Howard
68c4fd6572 kdc: audit preauth event only at end of PA loop
Don't audit preauth event if the preauth mech returns
KRB5_KDC_ERR_MORE_PREAUTH_DATA_REQUIRED; only set the event on (final) failure
or success.
2022-01-05 09:37:55 +11:00
Luke Howard
d90718c9b6 base: set HEIM_JSON_F_NO_DATA_DICT in heim_audit_setkv_object()
Fixes pretty-printing data print to work with heim_audit_setkv_object() as well
as heim_audit_addkv_object().
2022-01-04 06:30:32 +00:00
Luke Howard
503cb27740 base: add heim_data_t support to heim_audit_trail()
Allow heim_audit_trail() to log heim_data_t types.
2022-01-04 17:17:56 +11:00
Luke Howard
2574648308 base: pretty-print heim_data_t when debug logging 2022-01-04 17:10:33 +11:00
Jeffrey Altman
bda5919f6b Windows: MSVC does not support 'restrict' keyword
Use of the C99 'restrict' keyword was introduced by
be708ca3cf
("gsskrb5: Add simple name attributes support")

Change-Id: I8272f595af53741ee7c59750bb2d388faeb01f8f
2022-01-03 22:46:08 -05:00
Luke Howard
466658e929 Revert "Windows 10 SDK build fixes"
This reverts commit ceef0a0089.
2022-01-04 14:44:13 +11:00
Luke Howard
6d505df510 gss: link test_names.exe against Heimdal DLL 2022-01-04 14:35:28 +11:00
Nicolas Williams
b102c3c27f krb5: Fix canon name w/ attrs issue 2022-01-03 20:39:12 -06:00
Nicolas Williams
9e683f3d9a asn1: Fix template decoration copy moar 2022-01-03 20:39:12 -06:00
Luke Howard
bb699fb819 kdc: audit requestor SID in altsecid GSS PA plugin 2022-01-04 02:30:42 +00:00
Luke Howard
efdd0bda24 base: export heim_audit_addkv_{number,object} 2022-01-04 02:22:23 +00:00
Luke Howard
d0c861a2d3 kdc: fix build regression in fixing Windows build
Fix regression introduced in 7bb00a40; need to pass -E KDC_LIB to make-proto.pl
in Makefile.am, as well as NTMakefile.
2022-01-04 13:14:06 +11:00
Luke Howard
daf1eacfdb base: cast int64_t to long long
In heim_audit_{add,set}kv_number, cast int64_t to long long/use %lld format
string, to avoid compiler warnings.
2022-01-04 13:12:41 +11:00
Luke Howard
7bb00a40ea kdc: fix Windows build 2022-01-04 13:08:35 +11:00
Luke Howard
a1fd5c176d kdc: fix misplaced semi-colons in ASTGS_REQUEST
ASTGS_REQUEST_DESC_COMMON_ELEMENTS should not terminate in a semi-colon;
the consuming structure should include it. This is consistent with
HEIM_SVC_REQUEST_DESC_COMMON_ELEMENTS. This fixes the build on Windows.
2022-01-04 13:07:18 +11:00
Luke Howard
4803969580 gssapi: add name_attrs.c to Windows build 2022-01-04 13:06:48 +11:00
Luke Howard
e0ea123e1c asn1: export CompositePrincipal on Windows
Export CompositePrincipal functions on Windows, because libasn1
functions are explictiyl exported (unlike with libtool).
2022-01-04 13:06:02 +11: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
3b7a17e8b1 base: heim_audit_{add,set}kv_number should take int64_t
heim_number_t holds int64_t, not intptr_t; adjust heim_audit_{add,set}kv_number
accordingly. The libkdc wrapper functions were previously updated.
2022-01-04 12:35:57 +11:00
Luke Howard
81708f9f39 base: add heim_audit_addkv_{number,object} 2022-01-04 12:35:55 +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
b0f0ed74e8 kdc: use attribute dictionary in altsec authorizer plugin 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
c8656863ba base: factor out addkv() array promotion logic 2022-01-04 09:07:10 +11:00
Luke Howard
ceef0a0089 Windows 10 SDK build fixes
Build without Win32.mak, and using Universal C Runtime (UCRT)

windows: Check for APPVER, not VCVER for UCRT

When deciding whether UCRT is used (and thus no CRT merge modules), check for
Windows 10 rather than the version of Visual Studio, as we may be building with
an older SDK.
2022-01-03 09:25:18 -05:00
Jeffrey Altman
95021a3284 roken: ndbm_wrap support for db6
use the db6/db.h header if present on the system.
2022-01-03 18:09:08 +11:00
Jeffrey Altman
7cae05061a cf: check libdb-6 for db_create
787d9ceec9 ("check for db6/db.h")
added a check for the db6 header defining HAVE_DB6_DB_H but failed
to add a check for existence of db_create() in the libdb-6 library.
2022-01-03 18:09:08 +11:00
Jeffrey Altman
0fbd163640 cf: db.m4 remove db_create check in non-existent libdb5
The correct library name is libdb-5.
2022-01-03 18:09:08 +11:00
Luke Howard
77f33c1fde base: preserve multiple values in heim_audit_vaddkv()
Previously, if heim_audit_vaddkv() was called multiple times, values would be
concatenated; since changing the request kv type to a dictionary, only the most
recently set value was preserved.

Fix this by promoting multi-valued values to an array of values, which is
visualized in the same manner as it was prior to b1dcc1a4.
2022-01-03 16:35:36 +11:00
Luke Howard
2a2a83b712 base: fix string description of array-object type 2022-01-03 16:24:11 +11:00
Luke Howard
44a8cf1747 base: avoid unnecessary allocation of "reason" key
"reason" key is unused, don't allocate it
2022-01-03 16:19:49 +11:00
Luke Howard
097a3de44e kdc: don't cast away const in krb5plugin_kdc_ftable 2022-01-03 16:17:01 +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
a4c6b81ce9 kdc: add audit plugin API to windc API
Allow the windc plugin to also implement an audit callback. As part of this
change, both the HDB and windc audit function signatures are changed to return
void.
2022-01-03 16:17:01 +11:00
Luke Howard
98070b5eaa Revert "heimdal: handle referrals for 3 part DRSUAPI SPNs"
Active Directory/Samba-specific referral policy should be implemented by a
windc plugin, not in the main KDC code. It looks like it probably isn't
necessary at all if Samba wishes to bypass Heimdal's referral handling.

This reverts commit 6f0cafa6cf.
2022-01-03 16:17:01 +11:00
Luke Howard
3fa47f5a1a kdc: add referral_policy callback to windc plugin
Add a referral policy hook to the TGS as a more elegant way of resolving
referral detection for Samba). The hook can either rewrite the server_princ in
the request, or it can return an error to disable built-in referral processing.
2022-01-03 16:17:01 +11:00
Luke Howard
5cce73a6ef gss: expose canonical name from PAC if present
Expose canonical name via the canonical-name naming attribute.
2022-01-03 15:59:16 +11:00
Luke Howard
2a826d769f gss: expose PAC info buffers under urn:mspac:
Expose PAC info buffers using naming attributes prefixed with urn:mspac:,
aligned with MIT.
2022-01-03 15:59:16 +11:00
Nicolas Williams
66e256e672 krb5: Can't test KCM in test_cc 2022-01-02 22:16:06 -06:00
Nicolas Williams
73bb84c0f3 bx509d: Fix tests (log message diffs) 2022-01-02 21:37:43 -06:00
Nicolas Williams
7e311ea9bf gss: Fix test_names clang-13 build 2022-01-02 21:19:13 -06:00
Nicolas Williams
3f2b1007a3 base: Fix test_base clang-13 build 2022-01-02 21:16:36 -06:00
Nicolas Williams
8be05797cc httpkadmind: Use enum MHD_Result return type 2022-01-02 21:11:48 -06:00
Nicolas Williams
e328c0e496 bx509d: Use enum MHD_Result return type 2022-01-02 21:11:40 -06:00
Nicolas Williams
53e63d9ec9 kdc: Fix bx509d/httpkadmind (b1dcc1a47) 2022-01-02 21:11:07 -06:00
Nicolas Williams
bc7c73b5d7 hcrypto: Fix build with clang-13 2022-01-02 20:58:39 -06:00
Nicolas Williams
a849015350 roken: Fix mergesort_r() clang-13 build 2022-01-02 20:53:09 -06:00
Luke Howard
957633b793 kdc: remove unused rx.h header
We no longer support Kerberos 4, remove rx.h.
2022-01-03 13:12:03 +11:00