Commit Graph

28523 Commits

Author SHA1 Message Date
Luke Howard
73fde33757 KCM: restore support for Solaris doors IPC mechanism (#379)
This patch restores support for the Solaris doors IPC mechanism, removed
from KCM when lib/ipc was added.
2018-05-13 15:31:13 +10:00
Luke Howard
fef64ade9f IPC: fail gracefully in heim_ipc_cred_get_XXX if cred is NULL (#382) 2018-05-12 14:42:25 +10:00
Luke Howard
0c51e7c6ab IPC: use getpeerucred() API correctly (#382)
The ucred_t argument must be initialized to zero otherwise it is assumed to
point to allocated memory. Also, the logic is inverted: getpeerucred()
returns zero on success, not failure.
2018-05-12 14:40:56 +10:00
Luke Howard
bd2c2eb8bd hcrypto WinCNG backend: zero rgb{Hash,Key}Object on reinit
In the interest of being paranoid, when a WinCNG crypto or digest
context is being reinitialized, zero out the backing store as well
as destroying the handle.
2018-05-12 13:54:15 +10:00
Luke Howard
934d5e09bf hcrypto PKCS#11 backend: Call C_Initialize() on every hcrypto call
This is required as the PKCS#11 library needs to be reinitialized after
forking. This was causing a problem with ipropd.

This fix appears to incur a repeatable 10ms performance penalty on aes-test.

Caching the initialization status using a once control and invalidating it
on fork provided no measurable performance benefit on Solaris 11. Other
approaches would not be thread-safe or would involve more intrusive code
changes, such as exposing heimbase's atomics.
2018-05-12 13:45:30 +10:00
Luke Howard
3224a282a6 hcrypto WinCNG backend: don't leak handles on crypto reinit
Similar fix to a88d0066, but for the WinCNG EVP backend. However this
is just a fix for leaking handles if the same EVP context is used with
a new key; there is no functionality issue as cipherstate is maintained
directly in the EVP context, not internally by WinCNG.
2018-05-11 21:31:34 +10:00
Luke Howard
bd0b6f8c2b hcrypto WinCNG backend: don't leak handles on digest reinit
Similar fix to 9518f296, but for the WinCNG EVP backend.
2018-05-11 21:06:27 +10:00
Luke Howard
9518f2965b hcrypto PKCS#11 backend: don't leak sessions on digest reinit
Clients of the EVP API can reinitialize message digest contexts
without destroying them. The PKCS#11 backend assumed they were
only used once, and was leaking session handles upon reinitialization.
This fix disposes of any existing PKCS#11 message digest context
in the initialization method.
2018-05-11 20:45:10 +10:00
Luke Howard
6a1bb95323 hcrypto PKCS#11 backend: allow digest update with NULL (#378)
In the PKCS#11 backend, add an assertion check to p11_md_update()
to validate that the data length is zero if the data is NULL.
2018-05-11 13:50:38 +10:00
Luke Howard
590be3d7da hcrypto PKCS#11 backend: allow digest update with NULL (#378)
Some callers of EVP_DigestUpdate (such as libntlm) pass NULL as the
data argument. PKCS#11 returns CKR_ARGUMENTS_BAD which may poison
the context. Pass an empty string to C_DigestUpdate work around this.
2018-05-11 13:16:44 +10:00
Luke Howard
a88d00660e Fix PKCS#11 hcrypto backend regression (#314, #315, #316, #317)
81c778e broke the PKCS#11 hcrypto backend broke for many cases as it did
not support cipherstate resetting. (Prior to 81c778e, which was to fix #194,
the PKCS#11 backend did not support cipherstate chaining across invocations.)

hcrypto backends that maintain cipherstate independently of the hcrypto
context IV field need to set EVP_CIPH_ALWAYS_CALL_INIT to avoid the two
diverging. Their init function should support resetting the cipherstate
independently of key scheduling.
2018-05-11 13:11:31 +10:00
Matt Selsky
a2822719e6 Fix typos in setup documentation 2018-04-19 15:54:31 -04:00
Daria Phoebe Brashear
44f90c2025 libedit: makelist should default to awk, but not force it
solaris needs gawk; we should allow the makefile to override awk
with gawk (or whatever else)
2018-04-19 15:52:06 -04:00
Daria Phoebe Brashear
d9425fecdf heim_verbose can't be used mid-stanza in shell commands
Solaris make won't allow @echo in a shell command string as there is no
command called @echo, and it passes the whole shell command to the shell
without poaching off the @ itself first
2018-04-19 13:12:59 -04:00
Daria Phoebe Brashear
b12e01035c gss: _locl.h files should include local copy of -private.h files
apparently some versions of heimdal installed mech private headers.
don't inadvertantly end up with it in your path from a previous version
2018-04-19 13:12:59 -04:00
Daria Phoebe Brashear
bc1b936a1d move _gssapi_make_mech_header to avoid need to prototype
move _gssapi_make_mech_header so it's declared before use
2018-04-19 13:12:59 -04:00
Daria Phoebe Brashear
7333c2c945 roken: parse_units returns void
despite the fact that the called function returns void,
returning a result here throws an error with solaris cc.

just call the function and don't return
2018-04-19 13:12:59 -04:00
Daria Phoebe Brashear
39b78ad6ce sunpro c defines __SUNPRO_C not __SUNPRO_CC
CC is the c++ compiler; C is the c compiler. use the correct define
2018-04-19 13:12:59 -04:00
Daria Phoebe Brashear
1da17c2f22 roken: test for auxv_t in whichever of auxv.h or sys/auxv.h we find
on solaris it's in sys/auxv.h; so a test for it only in auxv.h isn't
enough
2018-04-17 21:32:36 -04:00
Daria Phoebe Brashear
d82817d279 hcrypto: implement missed symbol renaming in camellia-ntt and rand
camellia-ntt had none of its symbols renamed into the hc_ namespace,
and rand's missed timer_method (while all other methods were done). rename
these like we do for others
2018-04-09 14:50:17 -04:00
Jeffrey Altman
dcc880cf7c roken: issuid always call rk_getauxval
Instead of calling getauxval(), always call rk_getauxval() to ensure consistent behavior within roken.
2018-04-04 12:54:13 -04:00
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