Commit Graph

8 Commits

Author SHA1 Message Date
Luke Howard
2c8fa27224 gss: use _gss_secure_release_buffer_[set]
Use new helper APIs for securely zeroing and releasing buffers and buffer sets.
2020-04-15 16:23:17 +10:00
Luke Howard
31af9ba703 gss: use tail queue instead of singly linked list in mechglue
The GSS mechglue uses singly linked lists for mechanisms and mechanism objects,
to which new entries are inserted at the head. This breaks ordering of
mechanisms specified in OID sets and in /etc/gss/mech, as they will be back to
front. Use a tail queue instead so that new entries are inserted at the end.
2020-02-04 17:28:35 +11: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
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
Nicolas Williams
e6d1c10808 Rewrite gss_add_cred() (fix #413)
It turns out gss_add_cred() really needed a complete rewrite.  It's much
better to first have a gss_duplicate_cred() (which has been needed for
other reasons anyways), and use that when the input_cred_handle is not
GSS_C_NO_CREDENTIAL and output_cred_handle is not NULL, then mutate that
duplicate credential handle (or the input_cred_handle if
output_cred_handle is NULL).
2018-12-28 19:26:25 -06:00