Commit Graph

27600 Commits

Author SHA1 Message Date
Jeffrey Altman
dba026b5ef Introduce and apply krb5_storage_from_socket
On Windows a file descriptor is an int value allocated by the
local module instance of the C Run Time Library.  A socket handle is a
SOCKET value allocated by a Winsock Provider for the requested family and
protocol.   These two values cannot be mixed and there is no mechanism for
converting between the two.   The _get_osfhandle() and _open_osfhandle()
functions can work with a standard HANDLE (file, pipe, etc) but cannot be
used for a SOCKET.

The Heimdal krb5_storage_from_fd() routine counted on the osf conversion
functions working on SOCKET values.  Since they do not any attempt to call
krb5_storage_from_fd() on a socket resulted in an assertion being thrown
by the C RTL.

Another problem is SOCKET value truncation when storing a 64-bit value
into a 32-bit int.

To address these problems a new krb5_storage_from_socket() routine is
introduced.  This routine setups a krb5_storage that stores a socket value
as a rk_socket_t and provides a set of helper routines that always use
network ready functions.

The krb5_storage_from_fd() routines no longer use net_read() and
net_write() but provide helpers that follow their logic so that pipes can
be processed.

All call sites that allocate a socket now store the socket as rk_socket_t
and call krb5_storage_from_socket().

All locations that previously called the bare close() on a socket value
now call rk_closesocket().

Change-Id: I045f775b2a5dbf5cf803751409490bc27fffe597
2014-02-04 23:20:08 -05:00
Nicolas Williams
fdabfd6040 Win32 dladdr() wasn't returning 0 in all failures 2014-02-04 15:43:28 -06:00
Nicolas Williams
2fd4c58338 dladdr() on Win32 should't leave dli_fname == NULL 2014-02-04 15:37:45 -06:00
Nicolas Williams
2820cd7716 Revert "Minor WIN32/POSIX bug in resolve_origin()"
This reverts commit c9985fc695.
2014-02-04 14:37:54 -06:00
Jeffrey Altman
6c4423cd46 kadm5: use rk_closesocket to close sockets
kadm5_c_destroy did not use rk_closesocket when cleaning up
the context.  This results in an exception on Windows since a
socket is not a file descriptor.

Change-Id: I9ebddad61f0199acb495a0773925df4f41e4fef2
2014-02-03 15:40:32 -05:00
Jeffrey Clark
cc1faff15f Simple hdb plugin test
Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2014-01-31 08:49:55 +01:00
Jeffrey Clark
c1c7da7f79 Fix compiling hdb ldap as a module
Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2014-01-31 08:49:51 +01:00
Love Hörnquist Åstrand
d8d0e659ce make sure h is set at when we find a match, from [GITHUB #54] 2014-01-31 08:45:29 +01:00
Ingo Schwarze
b7d384392b fix the kswitch(1) manual prologue
Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2014-01-31 08:38:04 +01:00
Gustavo Zacarias
f76e8d5710 roken-h-process: use Getopt::Std, getopts.pl is deprecated
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2014-01-31 08:33:39 +01:00
Love Hörnquist Åstrand
1c698d298c Merge pull request #57 from jelmer/gitignore-update
Update .gitignore with generated files.
2014-01-19 16:41:28 -08:00
Jelmer Vernooij
4028bc3b70 Update .gitignore with generated files. 2014-01-20 00:38:54 +00:00
Nico Williams
cf6f9cc613 Merge pull request #56 from jelmer/kcm-fix-sigterm
Fix handling of SIGINT/SIGTERM in kcm.
2014-01-18 23:58:46 -08:00
Jelmer Vernooij
95bc8aca4a Fix handling of SIGINT/SIGTERM in kcm.
Debian-Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=654349
2014-01-18 21:33:39 +00:00
Viktor Dukhovni
bb895bdd90 Fix k5login_authoritative
In the previous implementation when .k5login or .k5login.d existed
and k5login_authoritative was false, no further plugins were tried.
Also when k5login_authoritative was true and .k5login did not match,
the directory was never tried.
2014-01-08 21:46:06 -05:00
Luke Howard
788d39b3ce set m->gm_mech.gm_name 2014-01-04 16:31:01 +11:00
Luke Howard
4ff005a6a4 gm_mech_oid must be set
mechanism credentials created by dynamically loaded mechanisms do not work
because the gm_mech_oid field is unset for such mechanisms (instead, only
gm_mech.gm_mech_oid is).
2014-01-04 15:58:10 +11:00
Russ Allbery
22c7f07ed8 Add symbol versioning for libkadm5clnt
In order to support plugins for kadmin that use libkadm5srv, the
libkadm5clnt library has to be versioned to avoid hijacking all
of the function calls that should go to the server library.  Omit
the _kadm5_ clients from the public interface, and version
everything else.

Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2013-12-23 13:20:26 +01:00
Love Hörnquist Åstrand
27c3ada0f6 Merge pull request #53 from jelmer/kadm-pc
Also add heimdal-kadm-{server,client} pc files that are co-installable with MIT.
2013-12-22 12:11:22 -08:00
Nicolas Williams
c9985fc695 Minor WIN32/POSIX bug in resolve_origin() 2013-12-13 13:28:51 -06:00
Arran Cudbard-Bell
f604e424d1 Issue #491: bus error in resolve_origin()
resolve_origin attempts to insert '\0' into a field from a DL_info
struct, causes BUS error.

Signed-off-by: Nicolas Williams <nico@cryptonector.com>
2013-12-13 13:27:57 -06:00
Nicolas Williams
38a92f759d Add kx509 parameters to verify_krb5_conf.c 2013-12-10 00:47:11 -06:00
Jelmer Vernooij
6076a828d4 Add heimdal-kadm-{client,server} with kadm-{client,server} depending on
them.
2013-12-07 20:43:04 +00:00
Nicolas Williams
318f89d602 Document kx509 parameters 2013-12-05 16:00:21 -06: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
Love Hörnquist Åstrand
d069763ac1 add --policy documentation 2013-12-04 11:31:29 -08: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
Love Hörnquist Åstrand
b20e7fa4d0 use heimdal-krb5 instead of krb5 as dependency 2013-12-04 11:16:15 -08:00
Love Hörnquist Åstrand
ef8119a8cc spelling 2013-12-04 11:15:30 -08:00
Love Hörnquist Åstrand
66769e8299 Merge pull request #46 from jelmer/krb5-pc
Add heimdal-krb5.pc file, with krb5.pc depending on it.
2013-12-04 11:09:34 -08:00
Love Hörnquist Åstrand
9e86558ed4 Merge pull request #50 from MrStaticVoid/kx509-allow-slash-in-principal-name
kx509: Create certs for principals with slashes
2013-12-04 11:08:00 -08: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 Hörnquist Åstrand
6b2ebfcf8a Merge pull request #48 from pettai/master
Allow validation of kdigest stuff
2013-11-28 14:33:03 -08:00
Fredrik Pettai
418fdb7f79 Also validate kdigest hacks
Add validation of the kdigest configuration parameters
2013-11-28 14:14:11 +01:00
Nicolas Williams
b20bb509bd Fix never valid error condition in KDC
The TGS was incorrectly using authtime to compute renew_till for new
tickets, which was in turn leading to endtime potentially being equal to
starttime, which caused the TGS to return KRB5KDC_ERR_NEVER_VALID.

This happens when the TGT renewal lifetime is longer than the max renew
lifetime of any other services, after that much time (target services'
max renew life) passes.  The TGT is still good but TGS-REQs fail.
2013-11-26 16:57:19 -06:00
Jelmer Vernooij
87a0e11a80 Add heimdal-krb5.pc file, with krb5.pc depending on it.
This makes it easier to install Heimdal and MIT kerberos on
the same system by just providing the heimdal-krb5.pc file;
the krb5.pc file is provided by both.

This is similar to what's done with heimdal-gssapi.pc/krb5-gssapi.pc.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2013-11-24 14:39:14 +00:00
Love Hörnquist Åstrand
91a2802779 Merge pull request #45 from jelmer/hx509-heimbase
Include heimbase.h in hx509.h; required for heim_err_t.
2013-11-20 05:13:26 -08:00
Nicolas Williams
fdcb8f3862 Fix callers of heim_ntlm_encode_type3; make build 2013-11-20 01:20:01 -06:00
Nicolas Williams
2f7eec7d2c Add very large MIT KDB princ entry for testing
Constructed by doing repeated kadmin.local cpw commands with a policy
with -history 9.
2013-11-20 01:08:22 -06:00
Nicolas Williams
9e084ca1d7 Fix MIT dump entry parsing bug that forced 2048 sz 2013-11-20 01:08:22 -06:00
Nicolas Williams
2c16b0da30 Be verbose about MIT dump entry parsing failures 2013-11-20 01:07:54 -06:00
Nicolas Williams
e9d21aeffc Fix bug in loading MIT dumps 2013-11-20 01:07:54 -06:00
Jelmer Vernooij
906922b990 Include heimbase.h in hx509.h; required for heim_err_t.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
2013-11-20 00:42:26 +00:00
Love Hörnquist Åstrand
bd661203cf test type1 encodings 2013-11-18 15:43:44 +01:00
Love Hörnquist Åstrand
576f103203 try to use the right domain/hostname offset/ucs2 encoding
reported by Joe Mason
2013-11-17 17:43:47 +01:00
Love Hörnquist Åstrand
3af1b3a8a6 use constants 2013-11-17 17:03:10 +01:00
Love Hörnquist Åstrand
cde59c543d bump libheimntlm to the version from OSX 10.9 Mavericks 2013-11-17 13:15:55 +01:00
Ross L Richardson
22a5077835 Minor language problems 2013-11-17 12:48:41 +01:00
Love Hörnquist Åstrand
7d163f234b check that e have sane values 2013-10-30 22:29:19 -07:00