Commit Graph

15803 Commits

Author SHA1 Message Date
Roland C. Dowdeswell
f0f07ff408 Use krb5_enomem() more consistently in lib/krb5. 2013-02-13 16:15:00 +08:00
Love Hornquist Astrand
6020e6c5b4 make http parser not exit out early 2013-02-10 23:20:37 -08:00
Love Hornquist Astrand
c1423a8eea redo plugin interface 2013-02-10 22:50:49 -08:00
Love Hornquist Astrand
9a5de87ca1 store response in right place 2013-02-10 22:50:10 -08: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
Love Hornquist Astrand
dff11de56b use new plugin system for locate kdc plugins (30 as-req/s faster for kdc-tester on MacBookAir5,2) 2012-12-27 12:23:29 +01:00
Roland C. Dowdeswell
7f5a628dc9 Optimise _krb5_n_fold() a bit.
All in lib/krb5/n-fold.c:

       1.  eliminate malloc/free from rr13() because it is always a
	   buffer of the same size called in a tight loop.

       2.  eliminate memcpy(3) from rr13() by bouncing back and forth
	   between two buffers buf1, buf2 instead of performing the
	   calculation into a tmp buffer and memcpy(3)ing the result
	   back into buf.

       3.  eliminate code cases from rr13() that I can visually determine
	   will never occur but I'm guessing that the compiler can't, i.e.

	       i.   now that we're no longer using malloc(3), rr13()
		    cannot fail, so make it void and avoid the if in
		    the calling routine checking its error code.  In
		    case you ask, yes, this made the tests run a little
		    faster,

	       ii.  rr13() has code for being passed a number of bits
		    not divisble by 8 but _krb5_n_fold() only passes
		    an int * 8.	 So, we eliminate this conditional and
		    the associated code.

       4.  we make rr13() take 2 destination buffers and copy the results
	   into both of them, we use this to eliminate another memcpy(3)
	   from the calling routine.  This appears to make it a bit faster
	   as well.
2012-12-25 13:49:03 +08:00
Roland C. Dowdeswell
ce5c231b23 Allow krb5_verify_init_creds() to take NULL opt arg.
Without dereferencing it.  krb5_verify_init_creds_opt * to be
precise.
2012-12-22 00:23:18 +08:00
Love Hornquist Astrand
087c859db6 add socket_set_nonblocking 2012-12-20 12:03:54 +01:00
Love Hornquist Astrand
6a442d5df9 guess that this is how arcfour prf works 2012-12-10 12:39:23 -08:00
Kumar Thangavelu
0cc458463d unning "kinit --fast-armor-cache=xxx" against a Win2K3 domain resulted in a crash with the attached backtrace. FAST is not supported with RC4 keys which are used in Win2K3. The code already handles this but the error code is not propagated up the stack.
Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2012-12-09 15:22:55 -08:00
Roland C. Dowdeswell
1b5b82183c In lib/hx509/cert.c, fix cases where errors are returned as certs.
In both hx509_cert_init() and hx509_cert_init_data(), there is an
output parameter for the error code but there are cases where the
error is used as a return value instead of the specified hx509_cert.
We fix these issues.  We also check if error is non-NULL and only
set the error in this case, allowing the functions to be called
with error == NULL without segfault.
2012-12-03 14:12:52 +08:00
Roland C. Dowdeswell
27dd8621fb Remove a couple of NULL deferences in lib/krb5/get_cred.c. 2012-12-03 14:10:12 +08:00
Love Hornquist Astrand
237ac68bb0 don't write out stack data in reply file 2012-11-27 21:58:06 -08:00
Love Hornquist Astrand
50055fe3c4 bound data returned to size of buffer 2012-11-27 21:58:06 -08:00
Love Hornquist Astrand
60472d48ea set vno to unconfuse coverity 2012-11-27 21:58:05 -08:00
Love Hornquist Astrand
c979a356f7 uninited memory free 2012-11-27 21:58:05 -08:00
Love Hornquist Astrand
b0ed05395a tell coverity that principal returns an allocated pointer 2012-11-27 21:58:05 -08:00
Love Hornquist Astrand
c12dc3fa9d tell coverity that ret_princ returns an allocated pointer 2012-11-27 21:58:05 -08:00
Love Hornquist Astrand
ed87e9b33a use after free 2012-11-27 21:58:04 -08:00
Love Hornquist Astrand
353ac10863 fix use after free 2012-11-27 21:58:04 -08:00
Love Hörnquist Åstrand
6294c36526 avoid -Wshadow 2012-11-22 17:27:21 -08:00
Love Hörnquist Åstrand
9ad763288d fix -Wshadow 2012-11-17 14:14:52 -08:00
Love Hörnquist Åstrand
1c17814e6f fix memset 2012-11-17 14:12:22 -08:00
Howard Chu
9f95207933 Add support for OpenLDAP libmdb 2012-10-07 16:47:45 -07:00
Love Hornquist Astrand
47c71b5971 rename KRB5_PLUGIN_KUSEROK since kuserok is a little bit too common 2012-10-07 11:28:28 -07:00
Love Hornquist Astrand
b45e4a6f98 require version >= 0 2012-10-07 11:13:17 -07:00
Love Hornquist Astrand
029de6cfa4 pass back an heim_error from hx509_cert_init 2012-10-07 06:33:13 -07:00
Love Hornquist Astrand
216bfa564d rename mdb to mitdb 2012-10-06 15:38:56 -07:00
Love Hornquist Astrand
65107e39ee fixup error messages 2012-10-01 09:54:13 -07:00
Love Hornquist Astrand
0a237dc778 don't use free'd string 2012-10-01 09:53:52 -07:00
Love Hornquist Astrand
d9aa1ff496 use configuration for db-dir 2012-10-01 09:50:46 -07:00
Marco Molteni
8cc9326f64 Document some GSS-API functions and fix some spelling errors. No code changes.
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2012-09-27 14:26:29 -07:00
Love Hornquist Astrand
9ba23d7da8 guess some code for SUN_PROC_POINT 2012-09-24 21:28:04 -07:00
Love Hornquist Astrand
db85d0998e include <stddef.h> so that we have a size_t
from metanest and https://github.com/heimdal/heimdal/issues/15
2012-09-23 10:56:16 -07:00
Love Hornquist Astrand
846f6e0e7b always produce a signature that is the size of the modulus 2012-09-11 20:45:43 -07:00
Philip Boulain
12f7c3248b dd include flags for test cases.
When building with OpenSSL at a custom prefix, some test cases will fail
 to compile due to missing include path compiler options. This patch adds
 them, as well as defining CPPFLAGS and LDADD for test_expr.

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2012-09-10 08:39:42 -07:00
Michael Meffie
4a438db29d drop __restrict some more, to please old compilers
Avoid the __restrict keyword in roken to appease older compilers.
2012-08-16 15:19:44 -04: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
Jeffrey Altman
571e7daab3 Revert "generated files must #include config if supported"
therefore #include config.h is not required.

This reverts commit 9be792055c.
2012-08-12 16:05:04 -04:00
Roland C. Dowdeswell
be5afdbf7f Make concurrent builds work.
To stop the errors when building concurrently, we make a number of
changes:

        1.  stop including generated files in *_SOURCES,

        2.  make *-protos.h and *-private.h depend on the *_SOURCES,

        3.  make all objects depend on *-{protos,private}.h,

        4.  in a few places change dir/header.h to $(srcdir)/dir/header.h,

This appears to work for me with make -j16 on a 4-way box.
2012-08-08 00:04:04 +01:00
Andrew Tridgell
d9d8e94d66 heimdal: fixed -Werror=format error in com_err
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2012-08-02 14:43:52 +02:00
Jeffrey Altman
b8a53329fc Windows: rk_wcsdup allocator
patchset 3fe5572840 should have
replaced wcsdup().

Change-Id: Ib1e09477b430525267c6c930d7c4ab29858a68bb
2012-07-20 09:40:22 -04:00
Jeffrey Altman
0686ad5ece Windows: rk_strdup allocator
patchset 3fe5572840 should have
replaced strdup().

Change-Id: I7af7b3e953e379fb23fccd9fa7a9e02c354c2dc4
2012-07-20 00:50:47 -04:00
Roland C. Dowdeswell
13a6ac59ad Fix memory leak in hx509_context_init().
OpenSSL_add_all_algorithms() should only be run once per application
or it will cause data structures to expand.  It's not a classic
memory leak as all of the memory will be free(3)d when EVP_cleanup()
is called but as we are a library we cannot call this.  We provide
a short term fix here which is using heim_base_once_f() to ensure
that we only call it once.

But the long term fix should be to stop using OpenSSL_add_all_algorithms()
entirely because it both has side effects outside our library and
the caller may destroy our OpenSSL global variables by calling
EVP_cleanup() on his own.  It is suboptimal to have potential
interactions between our library and other code in this way.
2012-07-17 19:38:46 +01:00
Nicolas Williams
54e6e8d99d Fix Makefile.am issue with test_expand_toks 2012-07-16 18:24:10 -05:00
Nicolas Williams
dadcf3beb4 Fix bug in _krb5_expand_path_tokensv() 2012-07-15 01:30:09 -05:00
Nicolas Williams
17c6516620 Make test_store.c build w/o warnings and run 2012-07-15 00:55:08 -05: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
Roland C. Dowdeswell
7aaeafb72b Typo and separate formatting error in lib/com_err/com_err.3.
Reported by jklowden@schemamania.org and jdf@NetBSD.org via NetBSD in:

http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=46651
2012-07-04 21:53:36 +01:00