Greg Hudson [Tue, 13 Oct 2009 19:43:17 +0000 (19:43 +0000)]
Fix preauth looping in krb5_get_init_creds
In 1.7, krb5_get_init_creds will continue attempting the same built-in
preauth mechanism (e.g. encrypted timestamp) until the loop counter
maxes out. Until the preauth framework can remember not to retry
built-in mechanisms, only continue with preauth after a PREAUTH_FAILED
error resulting from optimistic preauth.
Greg Hudson [Thu, 8 Oct 2009 12:59:33 +0000 (12:59 +0000)]
In krb5_c_verify_checksum, avoid the structure copy of *data since we
don't care about data->magic. Squashes a bunch of unimportant
Coverity defects. (May not be the correct long-term solution.)
Greg Hudson [Thu, 8 Oct 2009 12:58:56 +0000 (12:58 +0000)]
In krb5_calculate_checksum (a compatibility routine), initialize
key.enctype to ENCTYPE_NULL. This will predictably fail to match a
keyed hash's enctype, which may not be the best behavior, but is
better than unpredictably failing to match it.
Greg Hudson [Sat, 3 Oct 2009 18:07:44 +0000 (18:07 +0000)]
Update the crypto derived key support code to conform to most of the
current coding practices (except lack of tabs). Use the helper
functions k5alloc, zapfree, and find_enctype to reduce code size.
Greg Hudson [Sat, 3 Oct 2009 16:03:15 +0000 (16:03 +0000)]
Update the crypto API glue to conform to most of the current coding
practices (except lack of tabs). Use the helper functions k5alloc,
zapfree, and find_enctype to reduce code size.
Zhanna Tsitkov [Thu, 1 Oct 2009 21:46:57 +0000 (21:46 +0000)]
Crypto modularity proj: Populate openssl/des dir.
To avoid breaking the export list some functions (mostly mit_xxx) are left in place with the disabled functionality.
Crypto modularity proj: SHS_INFO structure is defined differently for crypto impl's. Files hash_sha1.c and yhash.h are affected by this difference. Move hash_provider into the backend
The following bigredbutton is used to suppress svn complains about the trailing spaces in the moved/copied dirs.
bigredbutton: whitespace
Remove OBJS.ST from SUBDIROBJLISTS so that running make does not
rebuild shared library when running make from the top. (make
otherwise thinks that OBJS.ST depends on "all-recurse" - which does
not exist, and rebuilds it all the time.
Add keytab_local.c to the kadmin client SRCS variable, so that we
generate dependencies for its object file. This change causes
kadmin.local to be properly rebuilt when keytab.c changes.
Clean up krb5_get_credentials:
* Use the current coding practice for output parameters.
* Rename the helper function krb5_get_credentials_core to
krb5int_construct_matching_creds and document it.
* Don't fail out if we fail to cache intermediate tgts.
* Simplify conditional logic and variable handling. ncreds is now
always a temporary holder for the resulting credentials.
Improve the mechanism used for addprinc -randkey. In the kadmin
server, if the password is null when creating a principal, treat that
as a request for a random key. In the kadmin client, try using the
new method for random key creation and then fall back to the old one.
Fix addprinc -randkey when policy requires multiple character classes
The fix for ticket #6074 (r20650) caused a partial regression of
ticket #115 (r9210) because the dummy password contained only one
character class. As a minimal 1.7 fix, use all five character classes
in the dummy password.
Remove autoconf.h on "make distclean".
Check for the presence of a build in the src tree for "make depend".
Suggest "make distclean" when "make depend" detects a build in the
src tree or an attempt to make depend in the src tree.
Create DB headers before recursing for "make depend" in
plugins/kdb/db2/libdb2, to restore the r22486 functionality ("make
depend" in an unbuilt source tree) after r22572 (predictable "make
depend" output for DB headers).
Ken Raeburn [Tue, 15 Sep 2009 06:17:17 +0000 (06:17 +0000)]
Check __BIG_ENDIAN__ and __LITTLE_ENDIAN__ to determine endianness.
In fallback code, check ia64 platforms for hpux vs everything else;
HP-UX uses big-endian mode.
In ksetpwd (a program we don't yet install), don't display the new
password to stderr. Cherry-picked from Luke's s4u branch since it's
an unrelated change.
Supply canonical name if present in LDAP iteration
In the presence of aliases, LDAP iteration was supplying the first
principal it found within the expected realm, which is not necessarily
the same as the canonical name. If the entry has a canonical name
field, use that in preference to any of the principal names.
Supply LDAP service principal aliases to non-referrals clients
In the LDAP back end, return aliases when the CLIENT_REFERRALS_ONLY
flag isn't set (abusing that flag to recognize a client name lookup).
Based on a patch from Luke Howard.
Greg Hudson [Fri, 28 Aug 2009 21:22:10 +0000 (21:22 +0000)]
Clean up a little bit of test suite spew in env-setup: first, when
using BSD options with ps, they should not be prefixed with a '-';
second, the Linux ps supports both BSD and System V options, so change
the structure of the tests not to warn when both forms work.
Greg Hudson [Fri, 28 Aug 2009 21:02:51 +0000 (21:02 +0000)]
Update a kadm5 testing library function which was calling
kadm5_get_principal without a mask argment. This was causing many
lib/kadm5 tests to fail, but the failures weren't being recorded
properly, so "make check" was still exiting successfully.
Tom Yu [Fri, 28 Aug 2009 20:29:24 +0000 (20:29 +0000)]
Remove bogus conditional from tcl_kadm5_randkey_principal(), which was
causing unparse_keyblocks() to get stack garbage as num_keys when
num_var was "null", thus overrunning the end of the array.
Greg Hudson [Fri, 28 Aug 2009 16:00:54 +0000 (16:00 +0000)]
Disable the COPY_FIRST_CANONNAME workaround on Linux glibc 2.4 and
later, since it leaks memory on fixed glibc versions. We will still
leak memory on glibc 2.3.4 through 2.3.6 (e.g. RHEL 4) but that's
harder to detect.
Greg Hudson [Thu, 27 Aug 2009 13:40:50 +0000 (13:40 +0000)]
Memory leak in spnego accept_sec_context error path
If the underlying mechanism's accept_sec_context returns an error, the
spnego accept_sec_context was leaving allocated data in
*context_handle, which is incorrect for the first call according to
RFC 2744.
Fix this by mirroring some code from the spnego init_sec_context,
which always cleans up the half-constructed context in case of error.
This is allowed (though not encouraged) by RFC 2744 for second and
subsequent calls; since we were already doing it in init_sec_context,
it seems simpler to do that than keep track of whether this is a first
call or not.
Ken Raeburn [Fri, 21 Aug 2009 22:37:55 +0000 (22:37 +0000)]
Rename db2 header files db.h and db-config.h in the source tree, so
that there will always be only one version of each name in the include
path (namely, the copy made in the build tree, or the generated db.h
if not using the in-tree one). This should fix some minor problems
with different dependency lists generated on different systems.
Sort and uniquify dependency header names before doing substitutions,
as well as after. Look for the db2 headers listed in sorted order.
Don't copy db-ndbm.h into the build tree; let libdb2 find it from the
source tree only.
Ken Raeburn [Fri, 21 Aug 2009 18:32:50 +0000 (18:32 +0000)]
Change "vague-errors" compile-time conditionals into run-time
conditionals, based on a variable initialized based on the
compile-time conditional (but probably eventually set from the config
file or command line).
Greg Hudson [Mon, 17 Aug 2009 19:40:48 +0000 (19:40 +0000)]
Modify kadm5 initializers to accept krb5 contexts
Add krb5_context parameters to all kadm5 initialization functions.
This allows extended error information to be retrieved by the caller
when an error is returned.