Commit Graph

28652 Commits

Author SHA1 Message Date
Daria Phoebe Brashear
6aece8ea06 getauxval: fall through to auxv gfter getauxval errno test
if when we need to determine if getauxval sets errno, we determine it doesn't
after getting a 0 return code, make sure we return a value, since we didn't
previously. fall through to code we'd otherwise have called in this case
above.
2018-04-04 12:54:13 -04:00
Jeffrey Altman
7ee3cc6855 Update parse_units.c 2018-04-04 11:27:23 -04:00
Harald Barth
7a2767e610 Make parse_units() handle trailing whitespace
Skipping any trailing whitespace characters
2018-04-04 11:27:23 -04:00
Matt Selsky
37979747bc Fix subject verb agreement in error message...
for krb5_ticket_get_authorization_data_type()

And remove FIXME in translation files.

Fix heimdal#361
2018-03-09 17:04:29 -05:00
Viktor Dukhovni
49d56916e1 Make slave-stats updates atomic 2017-12-13 17:33:28 -06:00
Viktor Dukhovni
bac9c1fe94 Use correct ret value in load error messages 2017-12-06 21:18:47 -05:00
Viktor Dukhovni
8ec4f23701 Hide principal names in errors with FAST 2017-12-05 19:01:04 -05:00
Viktor Dukhovni
1a6a6e462d Security: Avoid NULL structure pointer member dereference
This can happen in the error path when processing malformed AS
requests with a NULL client name.  Bug originally introduced on
Fri Feb 13 09:26:01 2015 +0100 in commit:

    a873e21d7c

    kdc: base _kdc_fast_mk_error() on krb5_mk_error_ext()

Original patch by Jeffrey Altman <jaltman@secure-endpoints.com>
2017-12-05 18:49:50 -05:00
Abhinav Upadhyay
abee4b3f68 Add comma between Nm entries 2017-11-04 16:56:43 -04:00
Daria Phoebe Brashear
9bae7d230c libedit: provide stub curses when none found
for cross-compiling for a GUI, being able to build the whole tree
despite having no curses is helpful; provide an interface which
just fails all calls
2017-10-30 18:41:22 -04:00
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