Commit Graph

162 Commits

Author SHA1 Message Date
Jeffrey Altman
1d4ebc0df7 lib/krb5: restore krb5_context_data field ordering to match 7.x
The struct krb5_context_data field can be passed to plugins
which might not be aware of the new structure layout.  To
reduce the risk of data corruption, fields must never be
removed, modified or reordered.  Old unused fields are marked
deprecated and new fields are appended to the end of the structure.

This change moves two fields that were added to master which
are not present in Heimdal 7.x:

fe43be8558 added config_include_depth.

5b39bd7c1d added no_ticket_store.

Change-Id: I28b157e128732324972c99b246a93a828bc077c1
2018-06-08 12:00:38 -04:00
Viktor Dukhovni
5b39bd7c1d New KRB5_NO_TICKET_STORE env var 2017-05-26 10:53:37 -05:00
Nicolas Williams
fe43be8558 Add include/includedir directives for krb5.conf 2017-02-27 18:15:59 -06:00
Nicolas Williams
bbaae5f43c Fix 32-bit time_t regression (#220) 2016-12-06 22:44:23 -06:00
Jeffrey Altman
a013e93e95 default life/renewlife time to KDC policy
Instead of imposing a default 10 hour ticket lifetime and 1 month renew
lifetime when requesting tickets, increase the default lifetime and
renew lifetime to 2147483647 seconds.  This ensures that in the absence
of any other configuration or command line parameters that the KDC will
determine the ticket lifetime and renew lifetime.

Change-Id: I52b6eeac1ee830a9bf4d0130e8f4ec7b70bc8694
Signed-off-by: Nicolas Williams <nico@twosigma.com>
2016-11-10 16:13:10 -06:00
Uri Simchoni
a3bece16c7 lib/krb5: keep a copy of config etypes in the context
When reading configuration file, keep an extra copy of
the encryption types, and use this when resetting the
encryption types to default.

GSSAPI always resets the enctypes to default before obtaining
a TGS, because the enctypes might have previously altered,
so this prevents changing the etypes from the configured ones
to the full set of supported etypes.

Signed-off-by: Uri Simchoni <uri@samba.org>
2016-09-30 08:37:06 -07:00
Jeffrey Altman
80f8325c64 lib/krb5: krb5_locl.h do not replicate roken.h
Move roken.h to the top of the header after config.h and remove the
includes that are duplicated by roken.h.

Change-Id: I33e29736519177f17c36e5c5948d7022011ab2b2
2016-04-17 17:19:53 -05:00
Nicolas Williams
1103fb19df Fix re-definition of keyex enum 2016-04-16 16:58:08 -05:00
Nicolas Williams
490337f4f9 Make OpenSSL an hcrypto backend proper
This adds a new backend for libhcrypto: the OpenSSL backend.

Now libhcrypto has these backends:

 - hcrypto itself (i.e., the algorithms coded in lib/hcrypto)
 - Common Crypto (OS X)
 - PKCS#11 (specifically for Solaris, but not Solaris-specific)
 - Windows CNG (Windows)
 - OpenSSL (generic)

The ./configure --with-openssl=... option no longer disables the use of
hcrypto.  Instead it enables the use of OpenSSL as a (and the default)
backend in libhcrypto.  The libhcrypto framework is now always used.

OpenSSL should no longer be used directly within Heimdal, except in the
OpenSSL hcrypto backend itself, and files where elliptic curve (EC)
crypto is needed.

Because libhcrypto's EC support is incomplete, we can only use OpenSSL
for EC.  Currently that means separating all EC-using code so that it
does not use hcrypto, thus the libhx509/hxtool and PKINIT EC code has
been moved out of the files it used to be in.
2016-04-15 00:16:17 -05:00
Nicolas Williams
c80816f9c3 krb5_context: embed mutex in structure
Instead of allocating a separate mutex object on the heap,
include the HEIMDAL_MUTEX in the krb5_context structure.

Change-Id: If6db484177410487176985e43e3b43e0f2166518
2016-04-10 17:05:07 -05:00
Jeffrey Altman
e8e9cd9710 krb5: Introduce KRB5_TKT_LIFETIME_DEFAULT
Instead of hard coding 10 hours as the default ticket lifetime within
lib/krb5/init_cred_pw.c init_cred(), add a preprocessor macro,
KRB5_TKT_LIFETIME_DEFAULT, that can be overridden at build time.

The value of KRB5_TKT_LIFETIME_DEFAULT is 10 hours if not previously
defined.

Change-Id: I63e729fedee8e8c6f542e4a4665de5f40db34c03
2015-04-16 20:40:21 -04:00
Nicolas Williams
487b6820f6 Revamp name canonicalization code 2015-03-24 11:49:58 -05:00
Jeffrey Altman
31a00d6647 ISPATHSEP and ISTILDE macros; Windows portability
Windows treats '\\' and '/' equivalently but we cannot control
the form that will be used by end users.  Introduce ISPATHSEP()
macro which tests only for '/' on UNIX and both on Windows.
Introduce ISTILDE() macro to test for '~'.   When testing for
'/' with strchr() or strrchr() add conditional checks for '\\' on
Windows.

Change-Id: Ia85e698fc88f15a6a71db649db5417f02ef7e5fe
2013-09-10 22:31:38 -04:00
Love Hornquist Astrand
f396f66523 add [libdefaults]fcache_strict_checking to gate the strict checking, defaults to on 2013-07-11 21:17:49 +02:00
Love Hornquist Astrand
a7e86affd8 add basic DIR support for file caches 2013-04-29 12:30:21 -07:00
Love Hornquist Astrand
58ff480763 rewrite send to kdc to be more agressive, try kdcs in paralell and easier to configure behavior 2013-02-10 19:02:52 -08:00
Roland C. Dowdeswell
3a30f3b0d1 Windows doesn't support poll(2) or fcntl(2) so #ifdef it out in send_to_kdc.c. 2012-08-14 22:50:33 +01:00
Roland C. Dowdeswell
842ca62336 Ensure that timeouts apply to TCP socket connexions.
Currently the Heimdal code calls connect(2) on TCP connexions to
the KDC without setting O_NONBLOCK.  This code implements a
timed_connect() function which will in the case of SOCK_STREAM
sockets put the socket into non-blocking mode prior to calling
connect and use select(2) to apply the configured timeout to connect
completion.  This does not entirely solve the problem of potential
timeouts in the code as it is still possible to block while writing
to the socket.  A proper implementation would also likely start
new connexions after a short interval before timing out existing
connexions and return the results from the first KDC which successfully
responds but we did not do that yet.

This patch is from heimdal-1-5-branch patches:

	5b55e4429caed27b32aac4bc5930f2672a43f273
	6b66321b271ee4672e70ad349ec796dd755cf897
	2e12c7f3e8dca7e1696ebd92199617ce413565e7

Squashed together along with a quick shadowed variable warning fix
to allow it to compile with --enable-developer.
2012-07-12 01:00:23 +01:00
Love Hornquist Astrand
0b02f05a19 error_buf is gone 2011-09-25 17:49:06 +02:00
Nicolas Williams
a7a8a7e95c Initial patch to add as-use-strongest-session-key and same for tgs krb5.conf parameters for the KDC. These control the session key enctype selection algorithm for the AS and TGS respectively: if TRUE then they prefer the strongest enctype supported by the client, the KDC and the target principal, else they prefer the first enctype fromt he client's list that is also supported by the KDC and the target principal.
Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2011-06-14 20:35:19 -07:00
Love Hornquist Astrand
e4580fe4cc add glue for krb5_einval 2011-05-18 22:00:37 -07:00
Asanka C. Herath
5b91a397f8 Increase KBR5_BUFSIZ to 2048 and use it in config_file.c 2010-11-24 15:33:19 -05:00
Asanka C. Herath
d3582b56c6 Define and use a path separator string
A colon can't be used to separate paths on Windows since they are used
in drive sepecification.  Define a macro that can be used as a path
separator string.  On Windows, this is defined as ";".  It is a ":"
everywhere else.
2010-11-24 15:32:56 -05:00
Simon Wilkinson
1d9072f026 krb5: reorganise crypto.c
lib/krb5/crypto.c was a large, monolithic block of code which made
it very difficult to selectively enable and disable particular
alogrithms.

Reorganise crypto.c into individual files for each encryption and
salt time, and place the structures which tie everything together
into their own file (crypto-algs.c)

Add a non-installed library (librfc3961) and test program
(test_rfc3961) which builds a minimal rfc3961 crypto library, and
checks that it is usable.
2010-11-03 11:12:24 +00:00
Love Hornquist Astrand
edc1c3e2a1 add heimbase.h 2010-10-27 20:43:15 -07:00
Love Hornquist Astrand
d893207413 add check-rd-req-server 2010-09-01 21:56:17 -07:00
Love Hornquist Astrand
687db64c56 Patch from Secure Endpoints/Asanka Herath for windows support 2009-12-21 08:45:28 +01:00
Love Hornquist Astrand
34cbe76fdc include <com_err.h> for com_right_r 2009-11-22 07:34:59 -08:00
Love Hornquist Astrand
28c9deebf1 edd extra flags 2009-11-22 00:14:57 -08:00
Love Hornquist Astrand
23d05643e1 Include <com_err.h> 2009-11-03 23:59:46 -08:00
Love Hornquist Astrand
1e65f30a2d drop hx509_context in krb5_id 2009-09-29 13:13:51 -07:00
Love Hornquist Astrand
1ac50627e6 add forward decl for hx509_certs_data 2009-09-29 11:29:20 -07:00
Love Hornquist Astrand
61cc35b83b include hx509_context in krb5_context 2009-09-29 09:23:37 -07:00
Love Hornquist Astrand
878eb853df Add debug_dest member 2009-09-07 20:38:29 -07:00
Love Hornquist Astrand
9f9783464c Don't make krb5_ccache point into krb5_context allocated memory
Don't make a copy of the krb5_cc_ops into krb5_context and hand that
out to callers of the api, this way its possible to free a krb5_context
w/o invalidating all krb5_ccaches that was allocated using that krb5_context
(also, it saves memory)
2009-09-01 12:22:16 -07:00
Love Hörnquist Åstrand
ab2a36de97 Add KRB5_CTX_F_HOMEDIR_ACCESS.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24937 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-03-25 15:36:03 +00:00
Love Hörnquist Åstrand
953fc83a9e add selected cert
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24708 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-02-14 20:14:45 +00:00
Love Hörnquist Åstrand
3767202e6e drop RCSID
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24359 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-01-25 00:31:10 +00:00
Love Hörnquist Åstrand
744ddd3a04 add krb5_gic_process_last_req
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24265 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-01-11 21:46:06 +00:00
Love Hörnquist Åstrand
49c15486ef remove krb_error from init_creds_opt
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24216 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-12-18 05:01:05 +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
48fdb5cb1b fix ifdef
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23746 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-07 21:11:09 +00:00
Love Hörnquist Åstrand
08686d1b69 glue for bindtextdomain
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23743 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-07 21:10:09 +00:00
Love Hörnquist Åstrand
02a6a32f82 Make i18n support compile.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23739 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-07 21:08:43 +00:00
Love Hörnquist Åstrand
1c4c9c7f55 toggle on HAVE_LIBINTL
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23736 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-07 21:07:53 +00:00
Love Hörnquist Åstrand
4f023f744b provide i18n hooks and renew krb5_create_checksum_iov from comments from metze
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23733 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-07 21:06:34 +00:00
Love Hörnquist Åstrand
fd7caae377 define HC_DEPRECATED_CRYPTO
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23613 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-08-17 15:57:05 +00:00
Love Hörnquist Åstrand
4384fb0209 use SOCK_CLOEXEC
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23517 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-08-11 10:01:38 +00:00
Love Hörnquist Åstrand
7b5981996c sprinle O_CLOEXEC, from Andrew Bartlett
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23474 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-07-28 08:49:43 +00:00