Commit Graph

28492 Commits

Author SHA1 Message Date
Daria Phoebe Brashear
0f5486eafc krb5: don't include plist support unless CoreFoundation is present
depending what's available when you compile for iOS it's possible to
be __APPLE__ and not have CF; actually test for it instead of blythely
assuming it can be used
2017-10-30 18:41:22 -04:00
Daria Phoebe Brashear
6428136e18 kinit: use result of security framework test to enable its use
we already test for the security framework. use the result of it
to decide if we want to enable its use
2017-10-30 18:41:22 -04:00
Viktor Dukhovni
e014662651 Further improve kdc child process management
- Simplify child process creation rate limit by moving
  select_sleep() to happen right after the parent fork().

- Consider child pid table slots to be empty if the pid is
  non-positive, rather than just -1 or just 0.

- Log warnings should we ever spawn a child with no free
  slot to track it, or reap a child that does not match
  a tracked slot.
2017-10-30 18:39:23 -04:00
Daria Phoebe Brashear
3bcc031939 hdb-mitdb: correct missing equals in initialization 2017-10-19 19:49:22 -04:00
Viktor Dukhovni
b860b70ada Fix missing rk_ prefix 2017-10-17 03:11:55 -04:00
Viktor Dukhovni
d2130e3312 Handle long lines in dump files 2017-10-11 17:13:07 -05:00
Nicolas Williams
496022fa37 Fix lib/roken parse_* warnings 2017-10-11 16:45:51 -05:00
Volker Lendecke
42fe2c2d85 lib/krb5: Harden _krb5_derive_key()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from Samba commit afd8c389c92e38aa59a55127b2594023561b2ddd)
2017-10-11 12:51:56 -05:00
Volker Lendecke
85b9992d9a lib/krb5: Harden ARCFOUR_sub{en,de}crypt()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from Samba commit c15464f886f9734982123d38594073601d49f151)
2017-10-11 12:51:56 -05:00
Stefan Metzmacher
6fa09c001f lib/krb5: use krb5_verify_checksum() in krb5_c_verify_checksum()
This allows the optimized checksum->verify() function to be used.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from Samba commit fb318ab0203297019c5e47c6bef4a9abfdeea8a5)
2017-10-11 12:51:56 -05:00
Stefan Metzmacher
641105bfbd lib/krb5: move checksum vs. enctype checks into get_checksum_key()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from Samba commit 05cc099499ef3a07d140981ef82937c842a3ffef)
2017-10-11 12:51:56 -05:00
Roland Hopferwieser
bcfe538228 kadmin/cpw: Add error code on password missmatch 2017-10-10 23:22:59 -04:00
Nicolas Williams
7d5f8bb051 Disable sync during kadmin load 2017-10-10 14:29:09 -05:00
Nicolas Williams
305dc81652 Disable sync during iprop receive_everything()
Doing an fsync per-record when receiving the complete HDB is a performance
disaster.  Among other things, if the HDB is very large, then one slave
receving a full HDB can cause other slaves to timeout and, if HDB write
activity is high enough to cause iprop log truncation, then also need full
syncs, which leads to a cycle of full syncs for all slaves until HDB write
activity drops.

Allowing the iprop log to be larger helps, but improving receive_everything()
performance helps even more.
2017-10-10 14:29:09 -05:00
Nicolas Williams
5bcbe2125b Add hdb_set_sync() method 2017-10-10 13:07:18 -05:00
Nicolas Williams
e3cc7dfb94 Set def page size for HDB SQLite3 backend to 8KB 2017-10-10 13:07:06 -05:00
Nicolas Williams
469366ddb8 Use date -r on BSD 2017-10-05 12:19:20 -05:00
Nicolas Williams
b2f6ba0fff Revert "lib: Fix printing a short into portstr"
This reverts commit ccb63bb0aa, which was
unnecessary and broke tests/kdc/check-kadmin (and other things).

host->port happens to be an unsigned short, so that promotion to an integer in
the snprintf() call is safe in that the promoted value will still be
non-negative, and no larger than an unsigned short's maximum value.  We're
still assuming that 7 bytes is sufficient to hold the text representation of
that maximum value, which indeed it is, assuming sizeof(unsigned short) == 2
and CHAR_BIT == 8, which are fair assumptions here.  A better patch, if we
needed it, would be to just make portstr[] an array of 11 char, or perhaps make
it a VLA (but we can't yet use VLAs, I don't think, because of older Windows
systems that must be supported still).
2017-10-05 10:43:42 -05:00
Nicolas Williams
6d27e00489 Make builds reproduceable (#336) 2017-09-29 12:37:30 -05:00
Quanah Gibson-Mount
e7879208e4 Fixes https://github.com/heimdal/heimdal/issues/310, use PF_UNIX instead
of PF_LOCAL
2017-09-25 18:31:42 -05:00
David Mulder
2548b3b8aa Solaris 8 x86 uses ->d_fd not ->dd_fd or dirfd() 2017-09-25 18:26:35 -05:00
Francisco Blas (klondike) Izquierdo Riera
d6979fcc40 Allow LDAP modifications for entry creation
Heimdal will refuse to create new entries when an entry already exists even
if said entry has no kerberos info and is a new entry.

This patch fixes this issue by allowing object modifications even if the
flags disallow them when we are inserting a new principal on the database.

Signed-off-by: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org>
2017-09-25 18:24:23 -05:00
Quanah Gibson-Mount
f4bb4df4a6 Fixes https://github.com/heimdal/heimdal/issues/308 2017-09-25 18:22:45 -05:00
Quanah Gibson-Mount
05d527706a Cleanup 2017-09-25 18:21:59 -05:00
Quanah Gibson-Mount
e007cdd0f4 Fixes https://github.com/heimdal/heimdal/issues/309 2017-09-25 18:21:59 -05:00
Russ Allbery
c3b3c2ec8e Close memory leak in external_passwd_quality
If the external password quality program returned a failure
message, the unparsed form of the principal name was never
freed.  Free it.
2017-09-25 18:18:55 -05:00
Russ Allbery
7b15a833a3 Set default principal for password change to credential client
The default client principal for krb5_set_password, if the
principal argument were NULL, was krb5_get_default_principal.  But
krb5_set_password requires credentials for the password change service
be passed in, and those credentials are already associated with a
client principal that's much more likely to be the correct choice for
a default.  Use that principal instead of krb5_get_default_principal.
2017-09-25 18:17:01 -05:00
Andreas Schneider
ccb63bb0aa lib: Fix printing a short into portstr
The size of portstr is too small to print an integer and we should print
a short anyway.

This fixes building with GCC 7.1
2017-09-25 18:16:18 -05:00
Stefan Metzmacher
a79b59ba27 kdc: fix dh->q allocation check in get_dh_param()
Thanks to Doug Nazar <nazard@nazar.ca> for spotting this!

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12986

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2017-09-25 18:10:29 -05:00
Roland C. Dowdeswell
8c18131c13 Have roken.h #include <util.h> to find emalloc on some platforms. 2017-09-25 18:01:19 -05:00
Viktor Dukhovni
aef3843b55 Add missing semicolons 2017-08-23 17:06:29 -04:00
Viktor Dukhovni
766e6cda8a Avoid potential memory leak in krb5_sendto_set_hostname
If the hostname was already set, a typo in a test meant we were not
freeing it.  While we're at it, handle the unlikely possibility that
the existing pointer is passed as the new value.
2017-08-23 15:10:38 -05:00
Viktor Dukhovni
d73ec2510a Try to avoid parse_{time,units,flags} symbol conflicts
On Debian stretch systems PAM modules linked against Heimdal run into
symbol conflicts with parse_time() in systemd libraries.  We redefine
parse_time() and friends to rk_parse_time(), ... while keeping the old
names for ABI compatibility with existing clients.

The legacy names should eventually be droppped.
2017-08-23 15:09:11 -05:00
Jeffrey Altman
237cd892d9 kdc: unused pid element is (pid_t)-1 not zero
When the termination of a child process is observed by reap_kid() it
clears the pids[] element by assigning it the invalid pid value
(pid_t)-1. However, start_kdc() assumes that the unused pid[[] element
value is 0.  As a result, each pid[] element's associated child process
can only be restarted once since start_kdc() will not be able to locate
an unused element.

This change alters start_kdc() to initialize all elements of pids[] to
(pid_t)-1 and use that as the marker for unused elements.  By doing so
start_kdc() can properly record child process pids and indefinitely
restart child processes as necessary.

Change-Id: Ia93c9284ab21289994eca7fc9cf1278be7c00683
2017-07-27 22:03:51 -05:00
Quanah Gibson-Mount
b787491942 Fixes https://github.com/heimdal/heimdal/issues/294 2017-07-22 11:36:41 -04:00
Viktor Dukhovni
3910c23378 Retain ret != 0 when capaths finds no match. 2017-07-12 07:27:31 -04:00
Jeffrey Altman
6dd3eb836b CVE-2017-11103: Orpheus' Lyre KDC-REP service name validation
In _krb5_extract_ticket() the KDC-REP service name must be obtained from
encrypted version stored in 'enc_part' instead of the unencrypted version
stored in 'ticket'.  Use of the unecrypted version provides an
opportunity for successful server impersonation and other attacks.

Identified by Jeffrey Altman, Viktor Duchovni and Nico Williams.

Change-Id: I45ef61e8a46e0f6588d64b5bd572a24c7432547c
2017-07-10 16:51:25 -04:00
Nicolas Williams
0fc03c5c6b Travis: fix cpp-coveralls invocation 2017-05-30 12:34:46 -05:00
Nicolas Williams
49ec30d87d Travis: re-enable gcov build 2017-05-29 01:19:43 -05:00
Nicolas Williams
07c34504a6 Fix gcov build 2017-05-29 01:18:48 -05:00
Nicolas Williams
2c913b4bf7 Fix typo in d999ac7 2017-05-29 00:49:58 -05:00
Nicolas Williams
d2b1b74f04 Travis: disable gcov build for now 2017-05-28 17:42:51 -05:00
Nicolas Williams
3973d4fc5f Travis: use clang and gcc 2017-05-28 16:58:39 -05:00
Nicolas Williams
0f93e3ec52 Travis: fix OS X build 2017-05-28 16:58:39 -05:00
Nicolas Williams
d05f701b8b Travis: build on OS X too 2017-05-28 16:58:39 -05:00
Nicolas Williams
de7a1911cd Travis: attempt gcov build 2017-05-28 16:58:39 -05:00
Nicolas Williams
f5660e82ea Travis: use make -j3 2017-05-28 16:58:39 -05:00
Nicolas Williams
b46ebe35e2 Travis: send coverity build email to builders 2017-05-28 16:58:39 -05:00
Nicolas Williams
d999ac7026 Quiet warning about rk_getprocauxval() 2017-05-28 16:58:38 -05:00
Viktor Dukhovni
8a0186c5b9 Fix missing wait_for in check-iprop 2017-05-28 16:58:02 -05:00