Commit Graph

28837 Commits

Author SHA1 Message Date
Nicolas Williams
99188ea797 Bump roken SONAME version (fix #279) 2019-01-04 12:49:58 -06:00
Nicolas Williams
26048694d7 One more Travis fix 2019-01-04 11:30:53 -06:00
Nicolas Williams
9b39978ddd Fix tests/plugin/windc.c 2019-01-04 11:26:28 -06:00
Luke Howard
7de958252c gssapi: add some Apple (c) notices for mechglue bugfix import
ad426d03 imported some minor bugfixes from the Darwin Heimdal-520 drop; a few
copyright notices were omitted in the merge, which are included here.
2019-01-04 21:30:10 +11:00
Nicolas Williams
99e98520ba Travis: only one core analysis command 2019-01-04 01:27:38 -06:00
Nicolas Williams
9a6436fe3c Fix Travis core analysis; do not cat config.log 2019-01-04 01:23:26 -06:00
Luke Howard
7fc79a393c gssapi: defensively initialize *out in gss_duplicate_cred() 2019-01-04 18:12:11 +11:00
Luke Howard
178588516d gssapi: refactor gss_duplicate_cred()
Refactor gss_duplicate_cred() to consolidate branches in copy_cred_element()
and eliminate use of GSS_S_UNAVAILABLE sentinel
2019-01-04 18:07:41 +11:00
Jeffrey Altman
b025f20eb4 kadmin: kadmind_dispatch incompatible pointer warning
warning: incompatible pointer types passing 'int *' to parameter
  of type 'size_t *' (aka 'unsigned long *') [-Wincompatible-pointer-types]

Change-Id: Id75b1b1c9b46b63ab61134f4f91b7c2909d87077
2019-01-04 01:47:11 -05:00
Jeffrey Altman
750cfc092c fix 00c590e4ff
Change-Id: I73623d71842086374ae58c6e751395fd6925a704
2019-01-04 01:41:23 -05:00
Luke Howard
e23b0a39d3 gssapi: argument validation fixes gss_store_cred_into() 2019-01-04 17:31:28 +11:00
Jeffrey Altman
9119136967 fix memory leaks
Change-Id: I18ad15dc802842324b3712f3f7833953434b1cf1
2019-01-04 01:22:20 -05:00
Jeffrey Altman
00c590e4ff fix null pointer dereference errors
Change-Id: I82a849afe9f432a1084ad2505ce88b1fe4d3d3af
2019-01-04 01:02:59 -05:00
Luke Howard
735039dbdc gssapi: implement gss_set_neg_mechs() (#495)
Implementation of gss_set_neg_mechs() and gss_get_neg_mechs() as defined in RFC
4178. New gss_release_cred_by_mech() API for dropping a credential from a
mechanism glue credential.
2019-01-04 15:50:11 +11:00
Luke Howard
dfaaf9c93f gssapi: honor acceptor credential in SPNEGO (#506)
SPNEGO uses the callback function acceptor_approved() in order to determine
which mechanisms to advertise to the initiator in the case that the initiator
sent an empty initial context token. Prior to this commit, that function was
not passed in the acceptor credential (if present), so always uses a default
credential. For correctness, we should only advertise the availability of
mechanisms for which we have a credential.
2019-01-04 15:49:44 +11:00
Nicolas Williams
d5536d4dd3 Fix wrong context bugs in kadmin randkey 2019-01-03 22:26:31 -06:00
Luke Howard
e739c4d0c2 windc: update test windc plugin to use new load SPI 2019-01-04 15:17:20 +11:00
Luke Howard
befe1b8f90 always load plugins with RTLD_LOCAL/RTLD_GROUP if available 2019-01-03 20:06:27 -06:00
Luke Howard
803efebca5 krb5, kadm5: refactor plugin API
Refactor plugin framework to use a single list of loaded plugins; add a new
plugin API where DSOs export a load function that can declare dependencies and
export multiple plugins; refactor kadm5 hook API to use krb5 plugin framework.

More information in krb5-plugin(7).
2019-01-03 20:06:27 -06:00
Luke Howard
e9b3b2326d gssapi: remove non-mech status from _gss_mg_error() from Heimdal-520
_gss_mg_error() should only handle mechanism-specific status codes which are
returned in minor_status. major_status has a global namespace.
2019-01-03 14:38:39 -06:00
Luke Howard
83f15553e0 gssapi: import mechglue allocation utility functions from Heimdal-520
Apple's Heimdal impelmentation uses a number of utility functions for
allocating names and credentials, to avoid calling malloc or calloc directly.
Import them.
2019-01-03 14:38:39 -06:00
Luke Howard
e0bb9c10ca gssapi: credential store extensions (#451)
Implement the GSS-API credential store API extensions defined by MIT here:

https://k5wiki.kerberos.org/wiki/Projects/Credential_Store_extensions

Note: we kill off gss_acquire_cred_ext() here. This was never a public API,
although mechanisms could have implemented it and I briefly used it in my
BrowserID prototype mechanism. gss_acquire_cred_ext_from() occupies the place
in the dispatch table where gss_acquire_cred_ext() used to, but this structure
was never visible outside Heimdal (i.e. it is only used by internal
mechanisms);

(Mechanisms that need to accept arbitrary key/value dictionaries from
applications should now implement gss_acquire_cred_from().)
2019-01-03 14:38:39 -06:00
Luke Howard
a7d42cdf6b gssapi: honor initiator credential in SPNEGO (#506)
SPNEGO uses the callback function initiator_approved() in order to determine
mechanism availability. Prior to this commit, is not passed in the initiator
credential, so it always uses a default credential. This breaks SPNEGO if a
non-default credential (such as one acquired with
gss_acquire_cred_with_password()) is used. This commit addresses this.
2019-01-03 23:25:30 +11:00
Luke Howard
2242b5bc5b gssapi: gss_krb5_set_allowable_enctypes prototype mismatch
gss_krb5_set_allowable_enctypes() was declared with an array of int32_t types
representing the enctype list, but the definition had an array of krb5_enctype.
Whilst these are likely the same size, they may not be. On the receiving end,
allocate an array of krb5_enctype.
2019-01-03 17:54:38 +11:00
Luke Howard
728650f3dd gssapi: canonicalize mech OID in gss_accept_sec_context() 2019-01-03 17:54:32 +11:00
Luke Howard
ad426d0385 gssapi: import bugfixes from Apple Heimdal-520
* check `ctx->gc_ctx` in `gss_inquire_context()`
* check `gm_inquire_cred != NULL` in `gss_inquire_context()`
* check `min_lifetime` in `gss_inquire_cred()`
* check `gm_inquire_cred_by_mech != NULL` in `gss_inquire_cred_by_mech()`
* set mech error in `gss_inquire_cred_by_oid()`
* don't clobber error in `gss_inquire_cred_by_oid()`
* don't pass NULL minor_status to `gss_krb5_free_lucid_sec_context()`
* allow NULL ccache in `gss_krb5_ccache_name()`
* NULL names OK in `_gss_find_mn()`
* allow empty names in `gss_import_name()` (removes `input_name_buffer` length
  check). to support ANONYMOUS.  in `gss_import_name()`, ignore mech name
  import failure as long as it's possible to import the name in some other
  mechanism
* better argument validation in `gss_export_sec_context()`
* in `gss_compare_name()`, check `mn2 != NULL`
* check `gss_add_oid_set_member()` return code in `gss_indicate_mechs()`
* in `gss_destroy_cred()`, set output cred handle to `GSS_C_NO_CREDENTIAL`
* cast size_t to OM_uint32 where required
2019-01-03 17:53:25 +11:00
Luke Howard
29fe69f95f gssapi: fix dlsym() return value casting
Fix warnings on Windows (and possibly other platforms) but appropriately
casting the return value of dlsym().
2019-01-03 17:53:15 +11:00
Luke Howard
f17e48f613 gssapi: gss_compare_name() both ways (#503)
In the case that one name has no MNs and the second name only has an MN, then
the order in which the two names are passed in matters, but it shouldn't. Run
the comparison both ways.
2019-01-03 16:27:31 +11:00
Nicolas Williams
1aedba7d6f Travis: cat failure logs, show core backtraces (fix #499) 2019-01-02 22:44:42 -06:00
Luke Howard
57df2ff1cc gssapi: ntlm mech should use _gss_ntlm_copy_cred() to dup cred 2019-01-02 20:23:18 -06:00
Jeffrey Altman
e787bd1bc1 kadmin: kadmin_dispatch free krb5_principals at function exit
Change-Id: Ic50a17abf10c7055574de2236cdf1d1469375d8b
2019-01-02 20:19:23 -06:00
Jeffrey Altman
092cd5e838 kadmin: kadmin_dispatch out of memory handling
Coverity determined that a NULL pointer segmentation fault could occur
if krb5_storage_emem() fails.  Use krb5_enomem() to set an error message
on the context and do not perform further krb5_storage operations.

Change-Id: I9587208e46c184bb061443a44581a32dd722de33
2019-01-02 20:19:23 -06:00
Nicolas Williams
ff7a969c32 Begin documenting [password_quality] configuration 2019-01-02 17:29:08 -06:00
Nicolas Williams
d8394c65b7 Add new kadmin/ktutil --keep* and --enctypes opts
- Add --keepold/keepallold/pruneall options to various kadmin/ktutil
   commands.  Default behavior to "prune old keys".

 - When setting keys for a service, we need to specify enctypes for it:

    - Always use kadm5_randkey_principal_3() instead of the older
      kadm5_randkey_principal().

    - Add krb5_string_to_keysalts2(), like MIT's krb5_string_to_keysalts(),
      but with a context, and simpler.

    - Add --enctypes options to various kadmin/ktutil commands.

    - Add [libdefaults] supported_enctypes param with enctype[:salttype]
      list.

    - Add [realms] realm supported_enctypes param with enctype[:salttype]
      list.

      Default to aes128-cts-hmac-sha1-96:normal.
2019-01-02 17:29:08 -06:00
Nicolas Williams
7b76d6719f Fix VC warning about enctypes 2019-01-02 13:56:04 -05:00
Nicolas Williams
6f7c0e53c8 Fix warning in lib/gssapi/test_acquire_cred.c 2019-01-02 13:56:04 -05:00
Nicolas Williams
7d5f955b51 Fix warning in lib/krb5/test_acl.c 2019-01-02 13:56:04 -05:00
Nicolas Williams
752c3a6139 Fix warning in lib/hcrypto/test_dh.c 2019-01-02 13:56:04 -05:00
Nicolas Williams
ffc4ac1d8d Fix warnings in ASN.1 template test 2019-01-02 13:56:04 -05:00
Nicolas Williams
7c449afbf8 Fix lib/roken test macro redefinition 2019-01-02 13:56:04 -05:00
Nicolas Williams
299fbf5dac Fix warning in roken test on Windows 2019-01-02 13:56:04 -05:00
Nicolas Williams
43a911eedc Fix bug in kadmin check warning message 2019-01-02 13:56:04 -05:00
Nicolas Williams
454e729e84 Make KADM5_* flags unsigned, fix warning 2019-01-02 13:56:04 -05:00
Nicolas Williams
a6e6916c1c Fix warning in sl compiler output
Use a cast through uintptr_t to un-const rather than a cast through
unsigned long.  This was caught by the Appeyor Windows build.
2019-01-02 13:56:04 -05:00
Jeffrey Altman
1dd38cc3de lib/hx509: declare and apply HX509_LIB_xxx macros
libhx509 is not built according to the same export and calling conventions
on Windows as the other libraries.  This change declares and applies
HX509_LIB_FUNCTION, HX509_LIB_NORETURN_FUNCTION, HX509_LIB_CALL and
HX509_LIB_VARIABLE to lib/hx509.

As a result of this change the calling convention for exported functions
will be __stdcall instead of __cdecl.

Change-Id: Ibc3f05e8088030ef7d13798f1d9c9b190bc57797
2019-01-02 10:23:39 -06:00
Jeffrey Altman
bec4818943 WIN32: hint noreturn functions
apply __declspec(noreturn) compiler hints to functions that
do not return.

Change-Id: I3c6c4703c7235d1df3e21dccad5272ea4cddfd36
2019-01-02 10:23:39 -06:00
Jeffrey Altman
4d57ee72f3 lib/wind: get-punycode-examples.py whitespace fix
Change-Id: I89e82539578fd9436ee735c124401fa019369eee
2019-01-02 10:23:39 -06:00
Jeffrey Altman
da6190ec03 lib/gssapi/ntlm: _gss_ntlm_allocate_ctx handle calloc failure
If a memory allocation failure occurs, return an error instead of
triggering a segmentation fault.

Change-Id: I38f5e88ca2f1ba7411b05a35b925168015261eb4
2019-01-01 15:05:31 -05:00
Jeffrey Altman
c1c98d3cfd lib/roken: is_special_auxv_p test for AT_HWCAP2
fix breakage introduced by 6341132175
("roken: fix build breakage, AT_HWCAP2 may be undefined (#446)").
Detected by Coverity.

Change-Id: Iefdb73d4392e5184a69a99208945ece6b7b8ecb3
2019-01-01 14:59:19 -05:00
Luke Howard
7098aa038b Windows: remove reference to NetInfo 2019-01-01 12:53:17 +11:00