Commit Graph

28837 Commits

Author SHA1 Message Date
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
Viktor Dukhovni
69bb29ea29 Fix check-iprop race
Creation of a random key HDB entry takes 3 updates, not one.  Instead of
hard-coding this magic count, wait for the appearance of the expected
entry with no "invalid" flag among its attributes.
2017-04-18 10:04:56 -05:00
Nicolas Williams
63a4c0d665 su also doesn't need issuid() 2017-04-17 18:02:30 -04:00
Nicolas Williams
7dfad1ab0b Use secure_getenv() instead of issuid() 2017-04-17 18:02:30 -04:00
Nicolas Williams
cf4efe8de6 Add secure_getenv.c 2017-04-17 18:02:30 -04:00
Nicolas Williams
90110f5553 Revamp issuid() 2017-04-17 18:02:30 -04:00
Nicolas Williams
650ffdc964 Revamp lib/roken/getauxval.c 2017-04-17 18:02:30 -04:00
Viktor Dukhovni
c7f54ae85a Fix error in last-minute tgt referral tweak 2017-04-14 15:26:26 -04:00
Viktor Dukhovni
1c6e1d5b1a Improve referral processing for TGTs
When using referrals to obtain krbtgt/A@B we're really looking for a
path to krbtgt/B first, and only then a ticket for krbtgt/A.
2017-04-13 18:11:52 -05:00
Viktor Dukhovni
a4fb8984dd Do not ignore realm when checking for expected ticket or referral 2017-04-13 18:11:52 -05:00
Viktor Dukhovni
10f3ab0f2a Never store TGT "aliases"
When obtaining a remote TGT krbtgt/REALM2@REALM2, an intermediate
cross-realm TGT obtained for krbtgt/REALM2@REALM1 is not equivalent
to the TGT we seek, and must not be stored under its name.
2017-04-13 18:11:52 -05:00
Viktor Dukhovni
f468c2fed1 Use actual Ticket to construct AP-REQ
When the cred passed krb5_build_ap_req() has a different name for the actual
ticket (e.g., because the entry came from a ccache with an alias name as the
entry name) then we were putting a Ticket on the wire with the name from the
cred rather than from the Ticket in the cred.  We don't think this is intended
or desirable.  The server should see the Ticket _exactly_ as minted by the KDC.

Perhaps AP-REQ should have used an OCTET STRING to contain the Ticket given that
Ticket is a PDU, which would make a byte-for-byte copy trivial, but as it is it
uses Ticket instead.  Therefore this commit has it decode the Ticket from the
cred and then C struct assign that value to the AP-REP's ticket field -- this
then copies the Ticket as exactly as vended.
2017-04-13 18:11:52 -05:00
Viktor Dukhovni
b1e699103f Fix transit path validation CVE-2017-6594
Commit f469fc6 (2010-10-02) inadvertently caused the previous hop realm
to not be added to the transit path of issued tickets.  This may, in
some cases, enable bypass of capath policy in Heimdal versions 1.5
through 7.2.

Note, this may break sites that rely on the bug.  With the bug some
incomplete [capaths] worked, that should not have.  These may now break
authentication in some cross-realm configurations.
2017-04-13 18:06:39 -05:00
Viktor Dukhovni
d5dd5aab19 Update NEWS for Heimdal 7.2 2017-04-13 18:06:35 -05:00
Nicolas Williams
f867a12aa9 Test rk_get*auxval() 2017-03-31 18:56:04 -05:00
Nicolas Williams
707b2372d2 Further improvements to issuid() 2017-03-31 18:56:04 -05:00
Viktor Dukhovni
26a0332e3c Update SQLite to 3.17.0 2017-03-19 18:55:51 -04:00
Jeffrey Altman
23ee804e9d lib/krb5: krb5_config_parse_file_multi use after free
If the file is not a regular file, the 'fname' buffer will be freed
before it is passed to the krb5_set_error_message() routine.  That
this is true is not obvious from code inspection but 'newfname'
and 'fname' refer to the same memory.

Change-Id: I7780eae9ceaf01b245df488a2f7d7f406770864f
2017-03-18 15:22:33 -04:00
Nicolas Williams
d8a112ae1a Fix lib/hdb make race 2017-03-17 13:20:06 -05:00
Viktor Dukhovni
7c18507ccd Avoid make dist fail when doxyout/ does not exist 2017-03-17 12:47:39 -04:00
Viktor Dukhovni
aad3b229ae Fix off by 1 write. 2017-03-17 11:51:30 -04:00
Viktor Dukhovni
6b285e67e5 Avoid expr in non-portable comparison
The output of `wc -l` includes leading white-space, and at least
in FreeBSD 11, `expr 1 + "$foo"` fails when "$foo" (captured as
`wc -l` output) has leading whitespace.  Instead, just emit one
more line for "wc" to count.
2017-03-16 11:41:19 -04:00
Viktor Dukhovni
14135e90aa Add rationale comments for conditional yyparse redefinition 2017-03-15 19:15:57 -04:00