Commit Graph

28559 Commits

Author SHA1 Message Date
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
Viktor Dukhovni
2d968c5c88 Fix test-auxval typos hidden by platform dependence 2017-05-27 00:08:00 -05:00
Nicolas Williams
122cdc578e Fix some krb5_storage_write() usages 2017-05-26 23:24:30 -04:00
Nicolas Williams
2c542ce8b1 Better corrupt keytab recovery? 2017-05-26 23:24:30 -04:00
Nicolas Williams
a7e585c85e Fix storage usage in lib/krb5/keytab_file.c 2017-05-26 23:24:30 -04:00
Nicolas Williams
48c137f355 Use stdio for keytab operations
Unlike the ccache, we can't lock less because of the way in which keytab
entries are removed: by negating their length.  Also unlike ccaches, we
hold locks across the entirety of keytab iteration.
2017-05-26 23:24:30 -04:00
Nicolas Williams
322b166c37 Use stdio, lock less to make FILE ccache faster
Use stdio.  Don't lock to read -- we only ever rename new ccaches into
place, or overwrite endtimes to delete entries, or overwrite part of the
realm name of cc config entries.

Dropping locks around ccache iterator stepping strongly implied that we
don't expect truncation, that we only expect appends (and the
overwriting done to delete entries).

Don't unlock -- let close(2) do it, thus making fewer system calls.
2017-05-26 23:24:30 -04:00
Nicolas Williams
c01c48e0f4 Add stdio-based krb5_storage 2017-05-26 23:24:30 -04:00
Nicolas Williams
123f702001 lib/roken: add fseeko()/ftello() 2017-05-26 23:24:30 -04:00
Nicolas Williams
3fb30ff0a6 Fix fd_store() return value for short writes 2017-05-26 23:24:30 -04:00
Nicolas Williams
e17cbff0ae Fix fd_fetch() return value for short reads 2017-05-26 23:24:30 -04:00
Nicolas Williams
c551ad9458 Fix Appveyor build: lib/hx509 2017-05-26 23:24:30 -04:00
Nicolas Williams
5a13323b68 Fix Appveyor build: lib/asn1 2017-05-26 23:24:30 -04:00
Nicolas Williams
715cb46de6 Fix Appveyor build: lib/com_err 2017-05-26 23:24:30 -04:00
Nicolas Williams
4a9591af92 Quiet windows warning about struct passwd 2017-05-26 23:24:30 -04:00
Nicolas Williams
e0dbb59a48 Appveyor: save artifacts on failure 2017-05-26 23:24:30 -04:00
Viktor Dukhovni
5b39bd7c1d New KRB5_NO_TICKET_STORE env var 2017-05-26 10:53:37 -05:00
Aleksei Martynov
a666bf165e Fix memory leak in _gss_ntlm_release_cred.
ntlm_cred is always allocated with calloc, so we need to free the cred
object too, similarly to what _gsskrb5_release_cred does.
2017-05-22 12:05:00 -05:00
Nicolas Williams
23ad4341f8 Add markdown README, build badges 2017-05-16 19:31:09 -05:00
Nicolas Williams
4fe6c93ccd Fix copy_cred_cache usage 2017-05-16 16:44:32 -05:00
Nicolas Williams
8419017e3a Travis: use --enable-maintainer-mode 2017-05-16 13:05:20 -05:00
Nicolas Williams
28934a3bc8 Revert "roken: refactor rk_getauxval"; broke build
This reverts commit cb1ab5b5fc.
2017-05-16 13:05:20 -05:00
Roland C. Dowdeswell
e65db603bf Issue 282: fix tolower_ascii in lib/krb5/principal.c. 2017-05-16 11:51:33 -05:00
Jeffrey Altman
6f3ab01c75 check return copy_Realm, copy_PrincipalName, copy_EncryptionKey
The ASN.1 functions copy_Realm(), copy_PrincipalName() and
copy_EncryptionKey() can fail.  Check the return and perform error
handling as appropriate.

Change-Id: I2b3629d19db96eb41d1cd554cef1dca99745e753
2017-04-29 15:24:42 -04:00
Jeffrey Altman
cb1ab5b5fc roken: refactor rk_getauxval
Refactor rk_getauxval() to remove duplicate code and to ensure
that a value is always returned.

Change-Id: I3b452dbc11802169e2c96e7ad16e714e7a880450
2017-04-29 13:55:25 -04:00
Jeffrey Altman
029d32580a fix calls to memset_s
In random_password() and DES3_string_to_key(), do not call
memset_s() with the sizeof a pointer.

Change-Id: I7dd49b9f717e1cb5c262f2d375d2b85be82cd2db
2017-04-29 13:55:24 -04:00
Jeffrey Altman
02ea07f93d gssapi: remove dead code
Remove assignment of a variable to itself.

Identified by AppChecker.

Change-Id: I94012849d8200dc91394a8548e72c61404d7e5b6
2017-04-29 01:06:00 -04:00
Jeffrey Altman
12afd9c4b7 include field separators in comparison
When comparing the first component of a multi-component
string that uses a field separator (e.g., '/' or ':'), be sure
to include the separator in the comparison to ensure that the
comparison does not succeed due to a prefix match.

Change-Id: Ieec3e73cb015a83bb652ec11cd7d83e57755c3d2
2017-04-29 01:05:59 -04:00
Jeffrey Altman
93518bfab4 use memset_s
lib roken includes support for memset_s() but it was not applied
to the Heimdal source tree.

Change-Id: I8362ec97a9be50205bb2d398e65b629b88ce1acd
2017-04-29 01:05:59 -04:00
Jeffrey Altman
85acd57c8a base: fix error_cmp
Fix the numeric error value comparison performed by error_cmp().

Identified by AppChecker and previously fixed by Darwin.

Change-Id: I0a72fd381bef0b34b7e7d155bfff03ab4196d38e
2017-04-29 01:05:58 -04:00
Jeffrey Altman
18f3115f78 roken: fix rk_getauxval missing stack variable
if defined(HAVE_GETAUXVAL) && !defined(GETAUXVAL_SETS_ERRNO) the
stack variable declaration for 'a' is missing:

  const auxv_t *a

Declare 'a' so that Heimdal can build again.

Change-Id: If64dd497f240688b76f3dd6139ac68c2ff149a0e
2017-04-29 01:05:57 -04:00
Roland C. Dowdeswell
2e01930cf7 krb5_kt_next_entry() needs to operate on a zero'd krb5_keytab_entry. 2017-04-25 10:22:58 -05:00
Jeffrey Altman
dcd3e45e02 kinit: fix 13c8a2c212
In 13c8a2c212 permits fclose() to
be issued on 'stdin' and forgets to use the N_() macro for text
strings.

Change-Id: I5e9ac1354da8dcff5277c39e4784a768ad76afdd
2017-04-24 17:46:52 -04:00
Viktor Dukhovni
c02af7b3bb Avoid another potential check-iprop race.
Though a race was never observed, the re-sync, slave DB deletion,
master changes and restart did not take into account late changes
in the master before slave down.
2017-04-18 16:54:48 -05:00