Commit Graph

49 Commits

Author SHA1 Message Date
Luke Howard
774f50b28b gss: move GSS pre-auth helpers to convenience lib
GSS pre-auth helpers do not belong in libgssapi, so move them to a separate
convenience library.
2021-08-27 15:20:07 +10:00
Luke Howard
49f3f5bd99 kdc: support for GSS-API pre-authentication
Add support for GSS-API pre-authentication to the KDC, using a simplified
variation of draft-perez-krb-wg-gss-preauth-02 that encodes GSS-API context
tokens directly in PADATA, and uses FX-COOKIE for state management.

More information on the protocol and implementation may be found in
lib/gssapi/preauth/README.md.
2021-08-12 17:37:01 +10:00
Luke Howard
18c18d84b1 gss: merge gss_name_to_oid and gss_mg_name_to_oid
The recently introduced gss_mg_name_to_oid() function supported looking up
dynamically loaded mechanisms by name, but did not support partial matches or
the legacy "Kerberos 5" name as supported by gss_name_to_oid().

Consolidate these into a single function, and also add support for dynamically
loaded mechanisms to gss_oid_to_name().

API behavior difference: the Kerberos mechanism is now referred to by "krb5"
rather tha "Kerberos 5", although for legacy compatibility gss_name_to_oid()
will recognize the old name. However, gss_oid_to_name() will return "krb5". The
anticipated impact is minimal as these are not standard GSS-APIs and do not
appear to have any public usage outside Heimdal.
2021-08-08 11:37:09 +10:00
Luke Howard
5966c00701 gss: add gss_mg_name_to_oid internal API
Add a new function for future internal use, gss_mg_name_to_oid(), which takes
either a dot-separated OID or a "short" mechanism name (such as
"sanon-x25519"), and returns a mechanism OID.
2021-08-08 10:34:28 +10:00
Luke Howard
4a7eb74374 gss: SAnon - the Simple Anonymous GSS-API mechanism
Add support for SAnon, a simple key agreement protocol that provides no
authentication of initiator or acceptor using x25519 ECDH key exchange.
See doc/standardization/draft-howard-gss-sanon-xx.txt for a protocol
description.
2020-04-25 23:19:30 -05:00
Luke Howard
3bfe62df6a gss: remove gss_release_cred_by_mech()
gss_release_cred_by_mech() was previously used by SPNEGO's implementation of
gss_set_neg_mechs(). This is now implemented in the mechanism glue. As we never
shipped gss_release_cred_by_mech(), it is safe to remove it and its exported
symbol.
2020-04-21 00:21:32 -05:00
Nicolas Williams
9f3d9e1a0a Add gss_duplicate_oid_set() 2020-04-21 00:13:50 -05:00
Luke Howard
7df0195c26 gss: fix downlevel Windows interop regression
The recent changes to SPNEGO removed support for GSS_C_PEER_HAS_UPDATED_SPNEGO,
through which the Kerberos mechanism could indicate to SPNEGO that the peer did
not suffer from SPNEGO conformance bugs present in some versions of Windows.*

This patch restores this workaround, documented in [MS-SPNG] Appendix A <7>
Section 3.1.5.1. Whilst improving interoperability with these admittedly now
unsupported versions of Windows, it does introduce a risk that Kerberos with
pre-AES ciphers could be negotiated in lieu of a stronger and more preferred
mechanism.

Note: this patch inverts the mechanism interface from
GSS_C_PEER_HAS_UPDATED_SPNEGO to GSS_C_INQ_PEER_HAS_BUGGY_SPNEGO, so that new
mechanisms (which did not ship with these older versions of Windows) are not
required to implement it.

* Windows 2000, Windows 2003, and Windows XP
2020-04-13 10:26:38 +10:00
Nicolas Williams
7bf4d76e75 krb5: Improve cccol sub naming; add gss_store_cred_into2()
- Formalize the TYPE:collection_name:subsidiary_name naming scheme for
   ccaches in ccache collections
    - KEYRING: ccaches are weird because they have one more optional field: the
      "anchor", so rather than just assume a naming convention everywhere, we
      add new functions as well
 - Add krb5_cc_{resolve,default}_sub() that allows one to specify a
   "subsidiary" ccache name in a collection separately from the
   collection name
 - Add krb5_cc_{resolve,default}_for() which take a principal name,
   unparse it, and use it as the subsidiary ccache name (with colons
   replaced)
 - Make kinit use the new interfaces
 - Add missing DIR ccache iteration functionality
 - Revamps test_cc
 - Add krb5_cc_get_collection() and krb5_cc_get_subsidiary()
 - Bump the ccops SPI version number
 - Add gss_store_cred_into2()
 - Make MEMORY:anonymous not linked into the global MEMORY ccache
   collection, and uses this for delegated cred handles

TBD:

 - Split this up into a krb5 change and gss mech_krb5 change?
 - Add krb5_cc_init_and_store() utility, per Greg's suggestion?
2020-03-02 17:48:04 -06:00
Luke Howard
4fb6a6adc9 gss: port NegoEx implementation from MIT
An implementation of draft-zhu-negoex-04 for MIT Kerberos was developed in
2011. This has been recently integrated, with many fixes from Greg Hudson. This
commit ports it to Heimdal. The implementation has been interoperability tested
with MIT Kerberos and Windows, using the GSS EAP mechanism developed as part of
the Moonshot project.

The SPNEGO code was also updated to import the state machine from Apple which
improves mechListMIC processing and avoids discarding initial context tokens
generated during mechanism probing, that can be used for optimistic tokens.

Finally, to aid in testing, the GSS-API mechanism glue configuration file can
be changed using the environment variable GSS_MECH_CONFIG. This environment
variable name, along with the format of the configuration file, is compatible
with MIT (although it would be difficult for a single mechanism binary to
support both implementations).
2020-02-04 17:28:35 +11:00
Luke Howard
6af3ea9099 gss: merge enhanced Apple mechglue logging
Add _gss_mg_log() and friends for logging from within the mechanism glue and
SPNEGO. These APIs wrap around the libkrb5 logging APIs.
2020-02-04 17:28:35 +11: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
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
33ce593b6d gss_wrap/gss_unwrap_aead implementation
Signed-off-by: Nicolas Williams <nico@twosigma.com>
2016-02-05 18:01:15 -06:00
Luke Howard
07777511d1 implement gss_localname 2011-10-08 12:15:09 +11:00
Jeffrey Altman
27cc30d38e GSS_C_ATTR_LOCAL_LOGIN_USER
Be consistent with other GSSAPI global variables.  GSS_C_ATTR_LOCAL_LOGIN_USER
becomes a macro in gssapi.h that refers to an exported variable
__gss_c_attr_local_login_user

Change-Id: I2661d74cd0f760780f75b35f92d6b4f9112080dc
2011-07-21 11:46:15 -04:00
Luke Howard
79ff133ae9 make gss_acquire_cred_ext private 2011-05-20 14:31:08 +02:00
Luke Howard
e00ae9267f export gss_userok 2011-05-16 23:38:52 +02:00
Luke Howard
85918e7f12 gss_accept_sec_context disappeared from exports 2011-05-16 23:37:28 +02:00
Luke Howard
88e3968a9e implement gss_add_cred_with_password over gss_acquire_cred_ext 2011-05-14 17:57:09 +02:00
Luke Howard
48719d5651 shim acquire_cred_with_password SPI into acquire_cred_ext 2011-05-14 17:00:55 +02:00
Luke Howard
dfba868910 Merge branch 'master' into lukeh/acquire-cred-ex-moonshot-integ
Conflicts:
	lib/gssapi/Makefile.am
	lib/gssapi/mech/gss_acquire_cred_with_password.c
	lib/gssapi/test_context.c
	lib/gssapi/version-script.map
2011-05-14 16:48:49 +02:00
Luke Howard
02cf28e20b implement gss_acquire_cred_ex with password support
add missing SPIs to gss_mech_switch

s/acquire_cred_ex/acquire_cred_ext/g
2011-04-16 11:06:24 +02:00
Luke Howard
6c6e483e00 gss_authorize_localname implementation 2011-04-08 10:58:57 +10:00
Luke Howard
d116a78297 add missing exports 2011-03-21 23:53:17 +11:00
Love Hornquist Astrand
c05773d443 drop gss_name_any since it removed from the draft 2011-03-12 12:50:59 -08:00
Luke Howard
6ffdb884e8 Add naming extension SPIs
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2011-03-12 12:30:41 -08:00
Luke Howard
cace66a435 Add naming extension SPIs 2011-01-03 14:45:07 +11:00
Luke Howard
098148ac20 MIT SPI compat 2011-01-02 20:30:57 +11:00
Love Hornquist Astrand
d9d68e88d3 add oids that was missing 2010-11-27 11:12:08 -08:00
Love Hornquist Astrand
5991c4fc8c add gss_{name,oid} conversion functions 2010-11-26 08:37:47 -08:00
Love Hornquist Astrand
2e80dabd16 add gss_mo_* 2010-11-26 08:37:17 -08:00
Love Hornquist Astrand
11e7ed41fc export more 2010-11-25 19:20:06 -08:00
Love Hornquist Astrand
1021099f3d rename external so that they can be included in array and struct initializer 2010-07-22 20:47:04 -07:00
Love Hornquist Astrand
102087bd67 export GSS_KRB5_CRED_NO_CI_FLAGS_X, needed by samba 2010-01-02 17:48:26 +01:00
Love Hornquist Astrand
2e1ebf8598 add export/import cred 2009-07-29 23:12:16 +02:00
Love Hörnquist Åstrand
b56096178b add gss_wrap_iov_length and gss_release_iov_buffer
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24965 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-03-27 14:57:42 +00:00
Love Hörnquist Åstrand
fe5e9d2f06 sort
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24748 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-02-16 19:12:32 +00:00
Love Hörnquist Åstrand
301c445596 new function
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24068 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-12-11 04:52:20 +00:00
Love Hörnquist Åstrand
a9a96e407e Add gsskrb5_[gs]et_time_offset
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23484 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-08-11 09:58:12 +00:00
Love Hörnquist Åstrand
d1fff1d49c add krb5_gss_register_acceptor_identity
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23198 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-05-29 02:11:36 +00:00
Love Hörnquist Åstrand
9ec788771d Add gss_mg_collect_error;
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22602 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-02-21 16:04:58 +00:00
Love Hörnquist Åstrand
dc584c4410 secretly export _gsskrb5cfx_
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20493 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-04-21 07:56:20 +00:00
Love Hörnquist Åstrand
502fe527fc add more kerberos symbols
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20444 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-04-19 15:40:19 +00:00
Love Hörnquist Åstrand
33e2bd4751 add missing ;
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20442 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-04-19 15:35:34 +00:00
Love Hörnquist Åstrand
f35596983e drop gss_*
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20437 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-04-19 14:50:37 +00:00
Love Hörnquist Åstrand
415e2e2678 list all exported symbols explicitly, tag all other symbols as local.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20436 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-04-19 14:50:23 +00:00
Love Hörnquist Åstrand
411c25b0d7 export more symbols.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20416 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-04-19 06:25:07 +00:00
Love Hörnquist Åstrand
e256ec63d5 add version script if ld supports it
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20412 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-04-19 05:34:28 +00:00