Commit Graph

28378 Commits

Author SHA1 Message Date
Viktor Dukhovni
4b4036c9a6 Implement hierarchical referrals 2016-08-08 16:29:29 -05:00
Viktor Dukhovni
1501740952 Fix transit path validation
Also implement KDC hierarchical transit policy checks.  The "hier_capaths"
parameter defaults to "yes" in [libdefaults] or can be set explicitly in
[realms] per-realm.
2016-08-08 16:29:18 -05:00
Nicolas Williams
0561396c0a Add how-to-test example to kimpersonate.8 2016-08-08 14:14:04 -05:00
Nicolas Williams
ab61e1d395 Add --add and --referral options to kimpersonate 2016-08-08 14:14:04 -05:00
Nicolas Williams
345333c40a Document kimpersonate --ccache option 2016-08-08 14:14:04 -05:00
Nicolas Williams
41b6c829f7 Fix missing .El in krb5.conf.5 2016-08-08 14:14:04 -05:00
Nicolas Williams
6d1571a3c4 Fix --disable-afs-support disable lib/kafs 2016-08-04 18:51:23 -05:00
Jeffrey Altman
f027fc834d Merge pull request #190 from DavidMulder/windows_code_ifdefs
The evp-w32.h header should not be included on all platforms
2016-08-02 18:30:21 -04:00
David Mulder
2bee5966ab The evp-w32.h header should not be included on all platforms 2016-08-02 16:12:46 -06:00
Jeffrey Altman
f0f24fdbb2 Merge pull request #188 from DavidMulder/disable_afs
--disable-afs-support doesn't really disable afs
2016-08-02 16:50:15 -04:00
David Mulder
d8080162ea --disable-afs-support doesn't really disable afs 2016-08-02 12:58:26 -06:00
Love Hörnquist Åstrand
c7ed0b719d Merge pull request #185 from emaste/master
Remove duplicate symbols from libroken version-script.map
2016-07-21 21:02:11 +02:00
Ed Maste
8ef0071d96 Remove duplicate symbols from libhx509 version-script.map
Commit 7758a5d0 (r21331) added semiprivate function
_hx509_request_to_pkcs10 twice.
2016-07-21 14:39:37 -04:00
Ed Maste
54e85ad099 Remove duplicate symbols from libroken version-script.map
Commit efed5633 (r24759) prefixed some symbols with rk_, but
introduced 6 duplicate symbols in the version script (because the
rk_-prefixed versions of the symbols were already present).
2016-07-21 14:36:59 -04:00
Jeffrey Altman
6234073499 add missing principal types
Add the WELLKNOWN and NT-HST-DOMAIN principal types to the nametype
table and asn.1

Change-Id: Ife9c3860f375bac1a06152b0d261c63ec071a763
2016-07-17 00:44:50 -04:00
Viktor Dukhovni
2d32982ed4 Fix slave boostrap from incomplete master log
When the master's log does not contain the complete history, slaves
that bootstrap from scratch encountered a loop, because the master
falsely assumed a race with log truncation.
2016-07-07 23:00:29 -04:00
Jeffrey Altman
f32fd2d56d kdc: fix AD -> Heimdal x-realm trusts again
The HDB_F_ALL_KVNOS flag is not getting set in _kdc_db_fetch() if
kvno_ptr == NULL.  Fix the conditional to ensure that one of
HDB_F_ALL_KVNOS or HDB_F_KVNO_SPECIFIED is set in the flags field.

Prior to this change cross-realm TGS_REQ failed with KRB5_GENERIC_ERROR
and e-text "encryption key has bad length".  With this change, the
cross-realm TGS_REQ succeeds.

Change-Id: I4216137a192032544dfbdada12b5c377603ca4b6
2016-06-23 13:36:31 -04:00
Mikhail T
9f6baf00f6 lib/krb5: Implement krb5_c_random_make_octets correctly
The function, found in lib/krb5/mit_glue.c, is currently using
krb5_generate_random_keyblock(). This compiles because warning-level is
not high enough, but does not work. At runtime the
krb5_generate_random_keyblock() interprets the second argument as the
krb5_enctype (rather than a length of anything) and tries to verify it.

When the length does not match any known enctype, as usually happens, the
function fails and returns an error. If the length happened to correspond
to an enctype, the function would likely crash due to misinterpreting its
third argument as a valid krb5_keyblock.

The change uses krb5_generate_random_block() instead. This function does
not return anything -- upon detecting failure it will cause the entire
application to exist instead...

Change-Id: I865a360037a513ce91abc7abba1dc554f844b464
2016-06-18 17:35:16 -04:00
Jeffrey Altman
b7cf5e7caf lib/krb5: do not fail set_config_files due to parse error
Follow Apple's lead and do not fail krb5_set_config_files() simply
because one of the files in the profile list fails to parse correctly.
Doing so can lead to hard to find failures and could lead to an end
user shooting themselves in the foot and no longer be able to login
to their system to fix it.

Parse as many of the files as we can.  Only fail krb5_set_config_files()
if init_context_from_config_file() fails.

Change-Id: I122664c6d707a5f926643808ba414bf4f681f8b8
2016-06-16 16:38:17 -04:00
Jeffrey Altman
cfc5b42bb1 Merge pull request #179 from abhinav-upadhyay/fix_month
Fix typo: Sepember -> September
2016-06-10 13:54:17 -05:00
Abhinav Upadhyay
1f89ce4973 Fix typo: Sepember -> September 2016-06-11 00:18:59 +05:30
Viktor Dukhovni
74f598e159 Set uber record nominal version when truncating
It needs to match the version of the last record saved and have a
reasonable timestamp.
2016-06-09 08:30:59 -04:00
Viktor Dukhovni
a5237e6940 Fix handling of uber record nominal version
When flushing the uber record, retain the current log version.  When the
uber record is the only (thus last) record in the log, return its nominal
version as the last version, not 0.  Upgrade the log if the current uber
record version number is not 0.
2016-06-09 07:04:01 -04:00
Nicolas Williams
316e0d2184 Store the canonical client princ in ipropd-slave
Otherwise we risk storing a name with the referral (empty) realm name,
which will then cause various knock-on effects, such as thinking that
the start_realm is "", and failing to find matching credentials in the
ccache.
2016-06-09 01:13:15 -04:00
Viktor Dukhovni
840dc40574 Refine name canonicalization
When storing credentials whose ticket principal is not equal to the
requested principal, store the ticket under both names not only when
the original realm is the referral realm, but more generally for any
difference at all.  This matches MIT behaviour.

Allow explicit name_canon rules to specify a realm to go with the
canonicalized hostname, if that realm is empty the effect is the
same "use-referrals"

Also fix segfault when no creds and debugging
2016-06-09 01:13:15 -04:00
Nicolas Williams
812b01b4ed Fix KDC segfault with OS X plugins
At least one "windc" plugin provided by OS X lacks a client_access()
entry point and caused the KDC to crash.  The KDC now checks for each
entry point in "windc" plugins and either falls back on alternative
default functionality or fails more gracefully than by crashing.
2016-06-09 01:13:15 -04:00
Nicolas Williams
2623cee389 Do not search system paths for non-ccapi plugins
On OS X anyways, since Heimdal cannot be built to replace the system
Kerberos implementation in OS X (even though it's based on Heimdal).

Heimdal plugins other than the CCAPI plugins have private ABIs with
strong coupling to the internals of the Heimdal libraries, thus using
system plugins in a non-system Heimdal is likely to end in tears (e.g.,
segfaults).

This means, for example, that OS X's plugins for PAC creation and
verification cannot be used by Heimdal.
2016-06-09 01:13:14 -04:00
Viktor Dukhovni
529a91d69a MacOS/X fixes 2016-06-09 01:13:14 -04:00
Viktor Dukhovni
ffd0dda237 Fix iprop against legacy master with full log
When the master's log has all entries from version 1 to now, and no
uber entry (legacy master), then new slaves will not pull version 1,
because their uber record has version 1.

The fix is to force the uber version to 0 always, and avoid adding a
truncate nop when doing a full prop.  The uber record now records the
database version even in the absence of any other log entries so that
we know what to pull going forward.
2016-06-09 01:03:10 -04:00
Viktor Dukhovni
7d9fcb46b9 Ensure newly allocated ccache handles are zeroed
Otherwise, type-independent fields such as `initialized` have
uninitialized values, and incorrect behaviour may result.
2016-06-02 02:40:50 -04:00
Patrik Lundin
abad8d5700 kdc: fix _kdc_db_fetch when non-zero kvno specified
Prior change 83011252d7 which fixed
cross-realm trusts from AD to Heimdal removed the assignment of
'*kvno_ptr' to 'kvno' in the case where a non-zero key version
number is supplied by the caller.  This breaks cross-realm trusts
from Heimdal to another realm.

This change restores the missing assignment.

Change-Id: Ic041d9d797ba4c8c0c567da55066ba5d3d1874bb
2016-05-20 09:02:33 -04:00
Andrew Bartlett
5ddff2c532 Merge pull request #176 from urisimchoni/signed-kvno
Revert "KVNOs are krb5uint32 in RFC4120, make it so"
2016-05-17 19:05:20 +12:00
Andrew Bartlett
7ad8c26d27 Merge pull request #177 from jelmer/reproducible
Don't put system architecture in generated headers.
2016-05-16 11:09:11 +12:00
Jelmer Vernooij
0113798b18 Don't put system architecture in generated headers.
Including HOST causes the build to be unreproducible.
2016-05-15 23:04:49 +00:00
Andrew Bartlett
2ff110cfa6 Merge pull request #154 from metze-samba/heimdal-for-upstream
lib/krb5: allow predefined PAC_{LOGON_NAME,PRIVSVR_CHECKSUM,SERVER_CH…
2016-05-14 22:32:13 +12:00
Andrew Bartlett
b01d527a35 Merge pull request #171 from jelmer/parallel
Fix parallel builds.
2016-05-14 22:28:25 +12:00
Andrew Bartlett
cc38a9f7d1 Merge pull request #174 from abhinav-upadhyay/fix-krb5.conf.5
Various fixes in kfb5.conf man page:
2016-05-14 22:26:43 +12:00
Roland C. Dowdeswell
4fb67dcbc1 Update .gitignore to catch some additional artefacts. 2016-05-12 16:53:36 -04:00
Roland C. Dowdeswell
82054b4b79 lib/hdb/hdb-mitdb.c: this was failing to build due to undefined variables. 2016-05-12 16:44:51 -04:00
Roland C. Dowdeswell
b49431e47a lib/hcrypto/Makefile.am: set automake option: subdir-objects 2016-05-12 15:18:38 -04:00
Uri Simchoni
f227586b80 tgs_build_reply: fix signed-unsigned mismatch
A KVNO is unsigned and this is reflected in the internal
interfaces. However, for compatibility reasons its encoding
is signed and this creates a pointer mismatch when passing a
kvno pointer to _kdc_db_fetch.

Signed-off-by: Uri Simchoni <uri@samba.org>
2016-05-08 07:58:11 +03:00
Viktor Dukhovni
1017a594ef Use OpenSSL include path as needed
For consistency make "-I" part of the macro value set by autoconf.

For now, don't attempt to handle OpenSSL rpath in cf/crypto.m4.
That's much easier by just setting LDFLAGS when running configure.
Otherwise too many Makefiles to edit and libtool and automake do
their best to undo the rpath.
2016-05-07 05:29:12 -04:00
Viktor Dukhovni
9393d53538 Actually capture libcrypto autoconf results
Also infer lib path not just include path, and set rpath if not from /usr.
Also need libcrypto for test_rand.
2016-05-07 02:36:34 -04:00
Viktor Dukhovni
131c8dd30e Export new ASN1 oid symbols and fix build
We added some new OID symbols in libasn1, make them public.

When an older Heimdal is already installed and its libraries don't
have some newly created symbols we run into build or test problems,
if libtool decides to use installed rather than just-built libraries.
This was happening with a few of test programs in libhx509.  Fixed.
2016-05-06 21:09:03 -04:00
Abhinav Upadhyay
1e085bb4da Various fixes in kfb5.conf man page:
Fix grammar at multiple places
Also, fix mdoc syntax at one place. There should be a space between the
section and the comma in the .Xr macro.
2016-04-28 15:50:48 +05:30
Jeffrey Altman
3de56adbcc Windows: Skip sha256 code sign if !CODESIGN
If we are not code signing we must define an action for _CODESIGN_SHA256
or the build system macros will be unbalanced.

Change-Id: I3c545de3c8ee809709defd12faeead358fde26dd
2016-04-23 20:58:25 -04:00
Jeffrey Altman
6c1ba82623 hcrypto: no openssl build requires evp-hcrypto.h include
When building evp-openssl.c without support for OpenSSL it is necessary
to include evp-hcrypto.h to define the HCRYPTO_FALLBACK functions.

Change-Id: Ifd51f9fcd2b1805a534a9f88992162818afffe7d
2016-04-23 19:03:56 -04:00
Jeffrey Altman
a4dae2513f Windows: add HCRYPTO_FALLBACK config to build system
HCRYPTO_FALLBACK is a required definition for building lib/hcrypto.
However, it wasn't added to the Windows build system.  This change
does so and enables fallback functionality.

Change-Id: I4a711c6da58e8832a61a3c0b2b8d9b10038425f0
2016-04-23 19:02:20 -04:00
Jeffrey Altman
c751314501 Windows: disable weak crypto
Weak crypto is disabled on every other system.  OpenAFS no longer
requires it and AuriStor doesn't need it.  Turn it off.

Change-Id: I6fab2328f71d1c38a655560ab0f83b8df9b53c73
2016-04-23 19:02:20 -04:00
Jelmer Vernooij
a460601ee3 Properly fix parallel builds. 2016-04-20 12:15:27 +00:00