Commit Graph

24 Commits

Author SHA1 Message Date
Jeffrey Altman
ec39b832ff kdc: fix kx509 service principal match
Each KDC is a kx509 server.  The service principal must be of the
form

  kca_service/<localhost.domain>@<DEFAULT_REALM>

where localhost.domain is the hostname returned by gethostname()
and <DEFAULT_REALM> is one of the realms for which the KDC has a service
principal "kca_service/<localhost.domain>".

The matching code was broken by a5e77c578e
when krb5_sname_to_principal() began to always return a referral
principal.

Since the second component is a host name update the default principal
type for service "kca_service" to be KRB5_NT_SRV_HST.

Change-Id: I6bd5f90b674ebb7220d8efafa6d339fdc21e1a07
2017-01-27 00:37:08 -05:00
Jeffrey Altman
303c62533f kdc: _kdc_do_kx509 fix use after free error
In _kdc_do_kx509() do not free 'principal' until after its last
use.  Move declaration to top of function and free it during the
common exit processing.

Introduced by 10a5976e45.

Change-Id: Iaf000eb090b0fa523f04a4864c6b17058d922995
2017-01-13 15:00:46 -05:00
Nicolas Williams
2c265a8182 Add option to require initial kca_service tickets
Default to TRUE, and allow setting it on a per-realm basis.
2013-12-05 16:00:21 -06:00
Nicolas Williams
5807540e1b Fix kx509 to include realm 2013-12-05 16:00:21 -06:00
Jeffrey Altman
ad995f9b69 kx509: Prevent double free
Patchset 750a09bca2 introduced the
potential for a double free of 'name'.

Change-Id: I23bd4ddb7d9b41cbb3948ab06245f4052b309971
2013-12-04 14:21:56 -05:00
James Lee
750a09bca2 kx509: Create certs for principals with slashes
kx509 fails to create certs for principals with slashes in them.  For
example:

    client% kinit foo/admin
    foo/admin@EXAMPLE.COM's Password:
    client% kx509
    Timed out waiting on KCA

The KCA reports: "Principal is not a user."  However, there is a use
case set out in this post:

https://thestaticvoid.com/post/2012/10/25/protecting-puppet-with-kerberos/

that would create a kx509 cert for a host principal for authenticating
against a secure HTTP service.  This commit modifies the certificate
creation code to allow principals with slashes in them.
2013-12-04 13:49:38 -05:00
Love Hornquist Astrand
1d84562886 add HDBGET: that only supports get, iteration doesnt really make sense for the HDB keytab except when dumping 2013-10-15 12:40:39 +02:00
Roland C. Dowdeswell
e8779d5d4a Add -Wshadow and deal with the warnings. 2012-02-21 11:17:55 +00:00
Love Hornquist Astrand
0879b9831a remove trailing whitespace 2011-05-21 11:57:31 -07:00
Love Hornquist Astrand
10a5976e45 Log what principal was used in the failure case 2009-12-22 07:36:01 +01:00
Love Hornquist Astrand
af61cd2eb4 Use hx509_context that build from krb5_context 2009-09-29 13:13:32 -07:00
Love Hörnquist Åstrand
8bdfc86327 Use OID variable instead of function.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25250 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-05-28 01:20:37 +00:00
Love Hörnquist Åstrand
6d379afd2a catch extra data
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25225 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-05-25 23:44:08 +00:00
Love Hörnquist Åstrand
2c12867d3e use struct
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24485 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-01-25 20:50:24 +00:00
Love Hörnquist Åstrand
973386c9ca make digest and kx509 optional
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24408 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-01-25 00:39:16 +00:00
Love Hörnquist Åstrand
b27e9cbb2e use krb5_data_alloc to allocate memory
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24085 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-12-11 04:56:35 +00:00
Love Hörnquist Åstrand
6937d41a02 remove trailing whitespace
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 09:21:03 +00:00
Love Hörnquist Åstrand
e172367898 switch to utf8 encoding of all files
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23814 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 08:53:55 +00:00
Love Hörnquist Åstrand
7fcd266fdd use krb5_set_error_message
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23316 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-06-23 04:32:32 +00:00
Love Hörnquist Åstrand
6541305988 Adapt to hx509_env changes.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22686 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-03-14 21:29:37 +00:00
Love Hörnquist Åstrand
9bb34fefc3 Use unsigned char * as argument to MD5_Update to please OpenSSL and gcc.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21607 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-07-17 07:04:52 +00:00
Love Hörnquist Åstrand
09eb1bfcb2 Don't use C99 syntax.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19992 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-20 09:06:18 +00:00
Love Hörnquist Åstrand
70056908b1 Issue certificates.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19909 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-14 23:16:14 +00:00
Love Hörnquist Åstrand
3572041050 Kx509server (external certificate genration).
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19545 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-12-28 21:03:53 +00:00