]> git.ipfire.org Git - thirdparty/krb5.git/log
thirdparty/krb5.git
13 years agoRemove the UNICODE defines from wshelper
Alexey Melnikov [Thu, 22 Sep 2011 17:12:47 +0000 (18:12 +0100)] 
Remove the UNICODE defines from wshelper

wshelper is clearly not intended to use unicode:
wprintf is used extensively and exclusively to write to char[] buffers and
fields in dns structs are used as explicitly ASCII text.

Signed-off-by: Alexey Melnikov <aamelnikov@gmail.com>
ticket: 7210 (new)
tags: pullup

13 years agoBuild lib/krb5/ccache/ccapi on Windows only
Kevin Wasserman [Thu, 12 Jul 2012 20:27:08 +0000 (16:27 -0400)] 
Build lib/krb5/ccache/ccapi on Windows only

Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com>
ticket: 7209

13 years agoDefine USE_CCAPI_V3 in krb5/ccache on windows
Kevin Wasserman [Thu, 12 Jul 2012 20:23:21 +0000 (16:23 -0400)] 
Define USE_CCAPI_V3 in krb5/ccache on windows

USE_CCAPI_V3 provides cccol iteration support for ccapi.

Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com>
ticket: 7209 (new)
tags: pullup

13 years ago__func__ -> __FUNCTION__ in disp_status.c
Kevin Wasserman [Tue, 15 May 2012 18:23:59 +0000 (14:23 -0400)] 
__func__ -> __FUNCTION__ in disp_status.c

For MSVC compatibility

Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com>
ticket: 7208 (new)
tags: pullup

13 years agoDon't use syslog / LOG_DEBUG when they don't exist
Kevin Wasserman [Tue, 15 May 2012 18:38:05 +0000 (14:38 -0400)] 
Don't use syslog / LOG_DEBUG when they don't exist

Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com>
ticket: 7207 (new)
tags: pullup

13 years agoUse %i, not %s to Tprintf GetLastError()
Kevin Wasserman [Mon, 21 May 2012 11:40:43 +0000 (07:40 -0400)] 
Use %i, not %s to Tprintf GetLastError()

Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com>
ticket: 7206 (new)
tags: pullup

13 years agoRename 'free' -> 'free_func' in asn1_encode.c/.h
Kevin Wasserman [Tue, 15 May 2012 18:42:24 +0000 (14:42 -0400)] 
Rename 'free' -> 'free_func' in asn1_encode.c/.h

MSVC memory tracking tools do '#define free(p) _dbg_free(...)'.

Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com>
ticket: 7205 (new)
tags: pullup

13 years agoKFW win-mac.h fixes
Kevin Wasserman [Wed, 6 Jun 2012 22:22:22 +0000 (18:22 -0400)] 
KFW win-mac.h fixes

kfw: add int16_t, uint16_t typedefs to win-mac.h
uint16_t is used in chpw.c

include stdlib.h, crtdbg.h in win-mac.h

Allows leak-tracking using built-in msvc tools on windows.
crtdbg.h needs to come _after_ stdlib.h, but _before_ checking for
strdup.  Define DEBUG and CRTDBG_MAP_ALLOC for full tracking.

Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com>
ticket: 7204 (new)
tags: pullup

13 years agokfw add preauth_sam2 to OBJS for windows build
Kevin Wasserman [Wed, 6 Jun 2012 22:17:35 +0000 (18:17 -0400)] 
kfw add preauth_sam2 to OBJS for windows build

Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com>
ticket: 7203 (new)
tags: pullup

13 years agoClarify date-time format in admin documentation
Zhanna Tsitkov [Fri, 13 Jul 2012 20:09:39 +0000 (16:09 -0400)] 
Clarify date-time format in admin documentation

13 years agoFix typo in "Supported date and type formats" doc
Zhanna Tsitkov [Fri, 13 Jul 2012 18:23:59 +0000 (14:23 -0400)] 
Fix typo in "Supported date and type formats" doc

13 years agoFix error handling in allocate_princ()
Greg Hudson [Fri, 13 Jul 2012 16:03:08 +0000 (12:03 -0400)] 
Fix error handling in allocate_princ()

The most recent change could leak memory when trying to parse an
invalid principal because of a failure to use the cleanup handler.

13 years agoReplace // comment in ccdefname.c
Greg Hudson [Fri, 13 Jul 2012 07:39:00 +0000 (03:39 -0400)] 
Replace // comment in ccdefname.c

13 years agoNew "Supported date and time formats" document
Zhanna Tsitkov [Thu, 12 Jul 2012 19:19:27 +0000 (15:19 -0400)] 
New "Supported date and time formats" document

13 years agoTidy up configure options documentation
Ben Kaduk [Mon, 9 Jul 2012 20:02:29 +0000 (16:02 -0400)] 
Tidy up configure options documentation

Our only C++ code is under src/tests/misc/.

Infodir is only referenced in send-pr's makefile but not used
in any rules therein.

Docdir and its descendants ({html,dvi,pdf,ps}dir) are not used
in any install rules.

We do not have anything to install into libexecdir or sharedstatedir,
and oldincludedir simply has no effect.

13 years agoStandardize on commas after "e.g.", "i.e."
Ben Kaduk [Fri, 29 Jun 2012 18:50:36 +0000 (14:50 -0400)] 
Standardize on commas after "e.g.", "i.e."

It seems to be "more correct".

13 years agoSync configure options with configure
Ben Kaduk [Fri, 29 Jun 2012 18:33:20 +0000 (14:33 -0400)] 
Sync configure options with configure

We should try to stay coupled with the actual configure options, as
documented by 'configure --help'.
Remove an option which is no longer present and add several that
were missing.

13 years agoOnly list --enable-dns-for-realm once
Ben Kaduk [Fri, 29 Jun 2012 18:13:05 +0000 (14:13 -0400)] 
Only list --enable-dns-for-realm once

If we list something as "commonly used", we seem to not also
list it with the rest of the options.  This has the advantage
of not requiring us to remember to update two things for future
changes, but the disadvantage of requiring users to look in two
places for options.  Stick with the prevailing form for now.

13 years agoSort configure options
Ben Kaduk [Fri, 29 Jun 2012 18:10:07 +0000 (14:10 -0400)] 
Sort configure options

Stick to the order of 'configure --help' for most sections, but
sort environment variables alphabetically (since, e.g.,
configure --help does not list CPPFLAGS and there is not a good
way to add that).
Note that this does not add or remove any content, even though
some options are missing/extra.

13 years agoCleanup docs for DNS lookup configure options
Ben Kaduk [Wed, 27 Jun 2012 18:35:30 +0000 (14:35 -0400)] 
Cleanup docs for DNS lookup configure options

DNS lookups for KDCs have been unconditionally enabled in
configure since 2003; configure options only affect whether
DNS lookups are used for realm names.
Change the RST documentation of configure options to catch up.

13 years agoHandle huge /bin directories in libdb2 test
Tom Yu [Thu, 12 Jul 2012 18:26:15 +0000 (14:26 -0400)] 
Handle huge /bin directories in libdb2 test

The test suite for libdb2 uses /bin as a source of filenames and
contents for insertion into databases.  Fedora 17 (and possibly other
OSes) have /bin symlinked to /usr/bin, which can vastly increase the
number of files found, exceeding some limits of the test databases.
Truncate this list of files at 100 to prevent this problem.

ticket: 7201 (new)
status: pullup
target_version: 1.10.3

13 years agoCorrect comments in port-sockets.h
Greg Hudson [Thu, 12 Jul 2012 04:18:51 +0000 (00:18 -0400)] 
Correct comments in port-sockets.h

13 years agoAlways recreate acl files during dejagnu tests
Tom Yu [Thu, 12 Jul 2012 03:35:44 +0000 (23:35 -0400)] 
Always recreate acl files during dejagnu tests

The dejagnu tests create some persistent acl files containing
hostname-derived principal names.  These can get out of date if the
host has changed names since the last time the dejagnu tests were run,
causing failures (notably in iprop.exp).  To avoid this problem,
change the dejagnu tests to always create new acl files for each test
run.

ticket: 7200 (new)
tags: pullup
target_version: 1.10.3

13 years agoAdd comment documenting make_toolong_error()
Tom Yu [Thu, 12 Jul 2012 03:09:37 +0000 (23:09 -0400)] 
Add comment documenting make_toolong_error()

The KDC doesn't obviously call make_toolong_error(), but some code in
net-server.c (which is linked into the KDC) does.  Document this fact.

13 years agoAdd krb5int_cc_user_set_default_name
Kevin Wasserman [Sun, 6 May 2012 19:14:46 +0000 (15:14 -0400)] 
Add krb5int_cc_user_set_default_name

Set the default credential cache name for all processes for the current
user.  Currently implemented, for windows only, by setting
HKEY_CURRENT_USER\Software\MIT\Kerberos5:ccname to the specified
ccache name.  This will not override the environment variable 'KRB5CCNAME'.
It will override HKEY_LOCAL_MACHINE and 'indirect' registry values.

Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com>
ticket: 7199 (new)
tags: pullup

13 years agoImplement switch_to for ccapiv3
Kevin Wasserman [Sun, 6 May 2012 19:23:10 +0000 (15:23 -0400)] 
Implement switch_to for ccapiv3

krb5_stdccv3_switch_to() calls cc_ccache_set_default().
krb5_stdccv3_resolve() checks for NULL or empty residual and calls
cc_context_get_default_ccache_name() in those cases.

Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com>
ticket: 7198 (new)
tags: pullup

13 years agoTranslate WinSock errors to Posix counterparts
Kevin Wasserman [Fri, 20 Apr 2012 15:36:13 +0000 (11:36 -0400)] 
Translate WinSock errors to Posix counterparts

MSVC 2010 defines both Posix and WinSock error values so we can no longer
simply #define the Posix error values to be their WinSock counterpart.
This patch explicitly #includes <errno.h> in port-sockets.h and still
conditionally defines the Posix error values for compatibility with older
MSVC but also translates WinSock errors to Posix for MSVC 2010
compatibility.

The downside to this approach is that there are some Posix errors we
do not currently detect (e.g. EADDRINUSE) that are neither #defined nor
translated.  If we use one of those in the future but fail to update
TranslateWSAGetLastError() we'll once again be in the situation that the
windows build will compile but fail to work, possibly only when some rare
error condition occurs.

Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com>
ticket: 7197 (new)
tags: pullup

13 years agoAllow full ccache name in k5test's K5Realm.klist
Greg Hudson [Wed, 11 Jul 2012 19:33:02 +0000 (15:33 -0400)] 
Allow full ccache name in k5test's K5Realm.klist

13 years agoAutomatically create DIR ccache directories
Greg Hudson [Wed, 11 Jul 2012 17:22:09 +0000 (13:22 -0400)] 
Automatically create DIR ccache directories

If the directory for a DIR ccache doesn't exist yet, try to create it
(but not its parents) with mode 700.  Exercise this in test scripts by
not pre-creating directories.

ticket: 7196 (new)

13 years agoSphinx html: reorder admin/user commands index
Zhanna Tsitkov [Wed, 11 Jul 2012 14:55:25 +0000 (10:55 -0400)] 
Sphinx html: reorder admin/user commands index

13 years agoUpdated Example section in kdc.conf
Zhanna Tsitkov [Wed, 11 Jul 2012 14:35:20 +0000 (10:35 -0400)] 
Updated Example section in kdc.conf

13 years agoAdd *~ to .gitignore
Greg Hudson [Mon, 9 Jul 2012 16:40:57 +0000 (12:40 -0400)] 
Add *~ to .gitignore

This covers src/include/autoconf.h.in~ which can be created by
util/reconf.

13 years agoAvoid mapping GSSAPI minor code on success
Greg Hudson [Sun, 8 Jul 2012 04:31:59 +0000 (00:31 -0400)] 
Avoid mapping GSSAPI minor code on success

In gssint_import_internal_name, don't map the minor code from
mech->gss_duplicate_name if it returned successfully.  Fixes an
"unexpected non-zero minor status" error reported by SAP's gsstest
when it invokes gss_canonicalize_name().

ticket: 7194 (new)

13 years agoReject extra realm separators in principal names
Greg Hudson [Sun, 8 Jul 2012 04:25:06 +0000 (00:25 -0400)] 
Reject extra realm separators in principal names

Commit f609e5caff410cc8f71db7d95b4da219541437db accidentally omitted
the check for extra realm separators, leading to an assertion error
when parsing x@y@z or similar.  Restore the check.

13 years agoRevert "Document absolute times for 'kinit -s'"
Ben Kaduk [Fri, 6 Jul 2012 22:56:57 +0000 (18:56 -0400)] 
Revert "Document absolute times for 'kinit -s'"

This reverts commit 20f85a81151f69689e3c060e89852687eb6c5a3c.
The ability of 'kinit -s' to accept an absolute time is
intentionally undocumented and remains only for backwards
compatibility.
Leave a comment in the source to this effect, for future generations.

13 years agoAllow using locales when gettext is absent
Ben Kaduk [Fri, 6 Jul 2012 19:45:20 +0000 (15:45 -0400)] 
Allow using locales when gettext is absent

Previously, if configure did not detect dgettext(), we disabled
anything that smelled like localization, inadvertently including
setlocale().  Now that we use setlocale(LC_ALL, ""), we have
localized dates available as well as messages, so we should not
disable calls to setlocale() any more.
Since the routines from locale.h are only used in a relatively
small number of places, just include the header directly in those
files and remove it from k5-platform.h.

13 years agoPass the user's CPPFLAGS in ALL_CFLAGS
Ben Kaduk [Fri, 6 Jul 2012 00:18:32 +0000 (20:18 -0400)] 
Pass the user's CPPFLAGS in ALL_CFLAGS

We need them if any headers we depend on are not in the default
search path (e.g., gettext.h).  These files are built for
'make check' but not for the normal build.

13 years agoDocument absolute times for 'kinit -s'
Ben Kaduk [Thu, 5 Jul 2012 18:34:56 +0000 (14:34 -0400)] 
Document absolute times for 'kinit -s'

kinit's -s argument takes a parameter, which is first interpreted
as a time interval ("deltat"), in the same format used for
the -l and -r arguments.  However, if that fails, the
time argument is interpreted as an absolute time, in one of
twelve different possible formats, some of which are subject to
localization via strptime().  Explicitly listing all twelve
possible interpretations is overkill, but give the user a hint that
absolute times are possible at all.

13 years agoEnable all localizations in main functions
Ben Kaduk [Thu, 5 Jul 2012 18:56:50 +0000 (14:56 -0400)] 
Enable all localizations in main functions

Bite the bullet and pass LC_ALL to setlocale() instead of just
LC_MESSAGES.  Calls to setlocale() itself were introduced in
fabbf9e443459e8c0161c84563690ed70c7f6a61 for ticket 6918, but
only for LC_MESSAGES since only localized strings were needed
and that was the most conservative option.
However, klist, kadmin, and kinit (and perhaps others) would benefit
from localized formats for times (i.e., LC_TIME).  If potentially
localized data is being sent on the wire, that is a bug that should
be fixed.  No such bugs are found with the current test suite, so we
are comfortable enabling LC_ALL at this time.

ticket: 7192

13 years agoRemove dead code
Ben Kaduk [Fri, 6 Jul 2012 00:56:51 +0000 (20:56 -0400)] 
Remove dead code

This (hair-raising) macro is not referenced anywhere in the tree,
so remove it and the associated comment.

13 years agoAdd ccinit and ccrefresh to .gitignore
Greg Hudson [Thu, 5 Jul 2012 17:15:26 +0000 (13:15 -0400)] 
Add ccinit and ccrefresh to .gitignore

13 years agoClarify diff between krb5.conf and kdc.conf files
Zhanna Tsitkov [Thu, 5 Jul 2012 15:29:16 +0000 (11:29 -0400)] 
Clarify diff between krb5.conf and kdc.conf files

13 years agoSimplify pkinit_server_verify_padata slightly
Greg Hudson [Thu, 5 Jul 2012 09:05:13 +0000 (05:05 -0400)] 
Simplify pkinit_server_verify_padata slightly

Eliminate the effectively unused variable tmp_as_req, and eliminate
two unnecessary conditionals for freeing pointers.

13 years agoSimplify and fix pkinit_as_req_create cleanup
Greg Hudson [Thu, 5 Jul 2012 09:02:38 +0000 (05:02 -0400)] 
Simplify and fix pkinit_as_req_create cleanup

Avoid dereferencing a null auth_pack pointer if we run out of memory
initializing info or auth_pack.  Eliminate an unnecessary switch by
just cleaning up all of the potentially allocated variables.

13 years agoFix minor memory leaks in PKINIT code
Greg Hudson [Thu, 5 Jul 2012 08:52:39 +0000 (04:52 -0400)] 
Fix minor memory leaks in PKINIT code

13 years agoFix PKINIT verify_kdc_eku trace logging
Greg Hudson [Thu, 5 Jul 2012 08:50:59 +0000 (04:50 -0400)] 
Fix PKINIT verify_kdc_eku trace logging

Test the value of the eku_accepted output parameter, not the pointer.

13 years agoCorrect an error in GSSAPI initiator cred docs
Greg Hudson [Tue, 3 Jul 2012 22:50:38 +0000 (18:50 -0400)] 
Correct an error in GSSAPI initiator cred docs

13 years agoFix typo in previous change to get_fq_hostname
Tom Yu [Tue, 3 Jul 2012 20:44:05 +0000 (16:44 -0400)] 
Fix typo in previous change to get_fq_hostname

ticket: 7086

13 years agoFix a minor memory leak in get_fq_hostname
Arlene Berry [Tue, 3 Jul 2012 19:20:54 +0000 (15:20 -0400)] 
Fix a minor memory leak in get_fq_hostname

ticket: 7086

13 years agoTake care with types in process_routing_update()
Ben Kaduk [Fri, 29 Jun 2012 15:35:41 +0000 (11:35 -0400)] 
Take care with types in process_routing_update()

read(2) returns an ssize_t, not an int.  We want to compare this
value against several unsigned size_ts, so make a local copy.
Also cast to int for printing; size_t can be wider than int, but
these values should be small.

13 years agoClean up const usage for supported_kdf_alg_ids
Ben Kaduk [Wed, 27 Jun 2012 21:02:01 +0000 (17:02 -0400)] 
Clean up const usage for supported_kdf_alg_ids

The previous declaration had redundant consts and missed making
the actual pointers stored in the array const.

13 years agoPass empty string instead of NULL to printf-like
Ben Kaduk [Wed, 27 Jun 2012 23:10:16 +0000 (19:10 -0400)] 
Pass empty string instead of NULL to printf-like

13 years agoRemove unused variable
Ben Kaduk [Wed, 27 Jun 2012 23:04:00 +0000 (19:04 -0400)] 
Remove unused variable

13 years agoMinor cleanups relating to size_t being unsigned
Ben Kaduk [Wed, 27 Jun 2012 20:35:20 +0000 (16:35 -0400)] 
Minor cleanups relating to size_t being unsigned

In order to use -1 as a sentinel value, we should explicitly cast
to make it clear what we are doing.  It might be better to use
a less convoluted sentinel value such as SIZE_T_MAX, though.

Additionally, since size_t is unsigned and at least as wide as
an int, a loop with int index variable that compares against a
size_t for its termination check could become an infinite loop.
Make the loop index size_t for consistency.

13 years agoUse consistent types for overflow comparison
Ben Kaduk [Wed, 27 Jun 2012 20:00:16 +0000 (16:00 -0400)] 
Use consistent types for overflow comparison

Unsigned long might not be 32-bits, in which case the overflow check
fails for a 32-bit kdb_sno_t.  Cast from -1 explicitly as a more
robust check.

13 years agoAvoid unsigned/signed comparison in loop condition
Ben Kaduk [Wed, 27 Jun 2012 19:38:47 +0000 (15:38 -0400)] 
Avoid unsigned/signed comparison in loop condition

The gid_len length is declared as an unsigned int, and loop
index 'i' is a signed int.  This could manifest as an infinite
loop if gid_len is very large.  In practice, gid_len should be small,
but make 'i' the same type for consistency.

13 years agoImprove printf handling of size_t args
Ben Kaduk [Wed, 27 Jun 2012 19:14:00 +0000 (15:14 -0400)] 
Improve printf handling of size_t args

The %*s format takes two arguments, a precision length/width and
an actual string; the length is specified as a signed integer.
The size_t length field of the gss_buffer_desc type is an unsigned
type, which must be cast or otherwise converted to a signed type
to match the format string expectations.
I do not think that the length will approach SIZE_T_MAX in practice,
due to buffer constraints, so do not include handling for the
edge case.

There is a '%zu' format string for printing size_ts, but it is not
available everywhere (e.g., AIX).  Instead, use the
unsigned long long abomination.

13 years agoResolve no-previous-prototype warning in os/cm.c
Ben Kaduk [Wed, 27 Jun 2012 18:28:16 +0000 (14:28 -0400)] 
Resolve no-previous-prototype warning in os/cm.c

The warning is
../../../../krb5/src/lib/krb5/os/cm.c:43: warning: no previous prototype for 'k5
_getcurtime'
which occurs because
int k5_getcurtime(struct timeval *tvp)
is defined (and used) in cm.c but there is no forward declaration.
Include the os-proto.h (internal) header which declares this function
to eliminate the warning.  k5_getcurtime() is the first declaration in
cm.c, so there is not an ABI concern.

The only other consumer of k5_getcurtime(), sendto_kdc.c, already includes
os-proto.h, so this issue is purely cosmetic.

13 years agoIncrease MAX_DGRAM_SIZE
Greg Hudson [Mon, 2 Jul 2012 22:25:40 +0000 (18:25 -0400)] 
Increase MAX_DGRAM_SIZE

Accept UDP datagrams up to 64K in size.  We should still detect when
an oversized datagram comes in by comparing against the maximum size,
but this is trivial and covers 90% of the practical issues.

ticket: 6566
status: open

13 years agoAdd krb5_kt_client_default to krb5_32.def
Greg Hudson [Mon, 2 Jul 2012 20:40:38 +0000 (16:40 -0400)] 
Add krb5_kt_client_default to krb5_32.def

13 years agoFix kdc_free_lookaside() krb5_context usage
Greg Hudson [Mon, 2 Jul 2012 18:36:05 +0000 (14:36 -0400)] 
Fix kdc_free_lookaside() krb5_context usage

Use the provided krb5_context, not kdc_context, which isn't valid when
kdc_free_lookaside() is called.

13 years agoComment fall-throughs in iakerb switch statement
Greg Hudson [Mon, 2 Jul 2012 17:22:37 +0000 (13:22 -0400)] 
Comment fall-throughs in iakerb switch statement

13 years agoFix minor memory leaks in acquire_cred.c
Greg Hudson [Mon, 2 Jul 2012 17:21:04 +0000 (13:21 -0400)] 
Fix minor memory leaks in acquire_cred.c

13 years agoCheck sort_enctypes return value in gic_keytab
Greg Hudson [Mon, 2 Jul 2012 16:49:22 +0000 (12:49 -0400)] 
Check sort_enctypes return value in gic_keytab

13 years agoMinor rst markup fix
Zhanna Tsitkov [Mon, 2 Jul 2012 18:08:32 +0000 (14:08 -0400)] 
Minor rst markup fix

13 years agoInclude all default etypes in gic_keytab requests
Greg Hudson [Mon, 2 Jul 2012 16:46:59 +0000 (12:46 -0400)] 
Include all default etypes in gic_keytab requests

Revert 18b02f3e839c007fff54fc9b693f479b7563ec73 in the KDC.  Instead,
when making an initial request with a keytab, transmit the whole
default_tkt_enctypes list, but sorted with the enctypes we have in the
keytab first.  That way the KDC should prefer enctypes which we have
keys for (for both reply key and session key), but the other enctypes
are still available for use as ticket session keys.

ticket: 7190

13 years agoAdd client keytab initiation support
Greg Hudson [Fri, 22 Jun 2012 16:48:26 +0000 (12:48 -0400)] 
Add client keytab initiation support

Support acquiring GSSAPI krb5 credentials by fetching initial
credentials using the client keytab.  Credentials obtained this way
will be stored in the default ccache or collection, and will be
refreshed when they are halfway to expiring.

ticket: 7189 (new)

13 years agoDocument GSSAPI name type behavior
Greg Hudson [Sat, 30 Jun 2012 01:45:26 +0000 (21:45 -0400)] 
Document GSSAPI name type behavior

Separate out the general interpretation of GSSAPI name types by the
krb5 mechanism from the specific behavior of host-based and principal
name types when used as acceptor names.

13 years agoAdd krb5_kt_client_default API
Greg Hudson [Fri, 15 Jun 2012 15:14:39 +0000 (11:14 -0400)] 
Add krb5_kt_client_default API

The default client keytab is intended to be used to automatically
acquire initial credentials for client applications.  The current
hardcoded default is a placeholder, and will likely change before
1.11.

Add test framework settings to ensure that a system default client
keytab doesn't interfere with tests, and to allow tests to be written
to deliberately use the default client keytab.

Add documentation about keytabs to the concepts section of the RST
docs, and describe the default client keytab there.

ticket: 7188 (new)

13 years agoGet default cred only once in gss-krb5 initiator
Greg Hudson [Mon, 2 Jul 2012 04:57:34 +0000 (00:57 -0400)] 
Get default cred only once in gss-krb5 initiator

In the regular krb5 code path, only get a default krb5 cred for the
initial token, since we don't need the cred for mutual_auth anyway.

In the IAKERB mechanism, cache the default cred in iakerb_ctx_id_rec
so we don't have to construct it again for each token.  Also, get an
IAKERB default cred, not a regular krb5 cred (a bug which is harmless
now, but becomes more of a problem with keytab initiation changes).

13 years agoTry harder to make keytab-based AS requests work
Greg Hudson [Sun, 1 Jul 2012 18:19:56 +0000 (14:19 -0400)] 
Try harder to make keytab-based AS requests work

When making a keytab-based AS request, a client has to choose between
sending its reply key enctype preference list (the enctypes it has in
the keytab) and its session key enctype preference list (all of the
enctypes it supports).  Heimdal and MIT krb5 1.11 clients send the
reply key preference list.  If this list doesn't overlap with the
server principal keys (say, because the krbtgt principal has only a
DES key), then the AS request will fail.

Try to make this work by making the KDC optimistically pick the first
permitted enctype in the request as the session key, even though it
can't be certain that other KDCs in the realm support that enctype.

Make sure to exercise this case in t_keytab.py by doing a multipass
keytab kinit test.

ticket: 7190 (new)

13 years agoRemove an outdated reference to DES in klist help
Greg Hudson [Fri, 29 Jun 2012 21:21:24 +0000 (17:21 -0400)] 
Remove an outdated reference to DES in klist help

13 years agoCorrect and clarify keytab API documentation
Greg Hudson [Fri, 29 Jun 2012 21:20:21 +0000 (17:20 -0400)] 
Correct and clarify keytab API documentation

13 years agoRename gss-krb5 cred tgt_expire field
Greg Hudson [Wed, 27 Jun 2012 20:04:32 +0000 (16:04 -0400)] 
Rename gss-krb5 cred tgt_expire field

The tgt_expire field is used to store non-TGT expiry times in a couple
of cases: when the ccache has no TGT, and after we've obtained a cred
for the target service.  Rename it to just "expire" to be less
misleading.

13 years agoScan ccache more efficiently in gss_acquire_cred
Greg Hudson [Wed, 27 Jun 2012 19:52:21 +0000 (15:52 -0400)] 
Scan ccache more efficiently in gss_acquire_cred

Avoid rereading the ccache in order to find the impersonator config
entry.  Instead, check each entry as we scan through the first time.

13 years agoSimplify password storage in krb5_gss_cred_id_rec
Greg Hudson [Wed, 27 Jun 2012 16:36:15 +0000 (12:36 -0400)] 
Simplify password storage in krb5_gss_cred_id_rec

The password is always zero-terminated, so we can store it as a char *
instead of a krb5_data.

13 years agoClarify module names in host_config
Greg Hudson [Tue, 26 Jun 2012 16:28:26 +0000 (12:28 -0400)] 
Clarify module names in host_config

Explicitly state that a module name will usually be the same as the
shared object name, but doesn't have to be.

13 years agoFix another plugin example in host_config
Greg Hudson [Mon, 25 Jun 2012 19:50:25 +0000 (15:50 -0400)] 
Fix another plugin example in host_config

13 years agoRestore some spaces in trval
Tom Yu [Mon, 25 Jun 2012 19:17:02 +0000 (15:17 -0400)] 
Restore some spaces in trval

This is a cosmetic change to reintroduce some space characters that
cff6ea939f061d17a5742a04b8eeb2905c1813dc removed, e.g. between the tag
and the length or short value.

13 years agoCorrectly document module setting in host_config
Greg Hudson [Mon, 25 Jun 2012 19:26:24 +0000 (15:26 -0400)] 
Correctly document module setting in host_config

The module variable must take the form modname:path, which was not
reflected in the example or described in the text.

13 years agoFix crash on invalid DIR ccache primary file
Greg Hudson [Mon, 25 Jun 2012 15:19:56 +0000 (11:19 -0400)] 
Fix crash on invalid DIR ccache primary file

If read_primary_file() fails with an error other than ENOENT, abort
cache resolution rather than dereferencing a null pointer.  Reported
by Oliver Loch.

ticket: 7185
target_version: 1.10.3
tags: pullup

13 years agoEliminate trailing whitespace in trval output
Greg Hudson [Fri, 22 Jun 2012 18:47:16 +0000 (14:47 -0400)] 
Eliminate trailing whitespace in trval output

Modify the trval output slightly so that the reference trval output
files don't containing trailing whitespace, to make them friendlier to
our git hooks.  (The pkinit and ldap trval reference files now contain
a leading blank line, which isn't very elegant, but avoiding that
requires too much Makefile.in complexity.)  Also correct a typo.

13 years agoSimplify acquire_cred.c
Greg Hudson [Fri, 15 Jun 2012 22:06:43 +0000 (18:06 -0400)] 
Simplify acquire_cred.c

struct acquire_cred_args was used purely to pass arguments to
acquire_cred (a static function), and had no advantages for that
purpose over positional arguments.

13 years agoFix config check in krb5_cccol_have_content
Greg Hudson [Tue, 19 Jun 2012 01:40:44 +0000 (21:40 -0400)] 
Fix config check in krb5_cccol_have_content

krb5_is_config_principal should be invoked on creds.server, not
creds.client.

ticket: 7173

13 years agoLimit size of lookaside cache
Greg Hudson [Sat, 16 Jun 2012 15:38:57 +0000 (11:38 -0400)] 
Limit size of lookaside cache

Add a preprocessor constant LOOKASIDE_MAX_SIZE (defaulting to 10MB)
which limits the total size of the lookaside cache entries.  Purge
stale entries in kdc_insert_lookaside instead of kdc_check_lookaside,
and when doing so, continue purging non-stale entries until the total
cache size (including the new entry) is within the size constraint.

13 years agoFlatten KDC lookaside cache entries
Greg Hudson [Sat, 16 Jun 2012 15:23:14 +0000 (11:23 -0400)] 
Flatten KDC lookaside cache entries

Use krb5_data structures instead of pointers in the entry structure,
reducing the number of memory allocations.

13 years agoHandle PKINIT DH replies with no certs
Greg Hudson [Thu, 21 Jun 2012 21:20:29 +0000 (17:20 -0400)] 
Handle PKINIT DH replies with no certs

If a PKINIT Diffie-Hellman reply contains no certificates in the
SignedData object, that may be because the signer certificate was a
trust anchor as transmitted to the KDC.  Heimdal's KDC, for instance,
filters client trust anchors out of the returned set of certificates.
Match against idctx->trustedCAs and idctx->intermediateCAs to handle
this case.  This fix only works with OpenSSL 1.0 or later; when built
against OpenSSL 0.9.x, the client will still require a cert in the
reply.

Code changes suggested by nalin@redhat.com.

ticket: 7183

13 years agoSimplify bld_princ.c
Greg Hudson [Thu, 21 Jun 2012 21:12:50 +0000 (17:12 -0400)] 
Simplify bld_princ.c

13 years agoRemove orphaned KfM code
Greg Hudson [Thu, 21 Jun 2012 20:53:43 +0000 (16:53 -0400)] 
Remove orphaned KfM code

13 years agoDocument how to free krb5_cc_get_full_name result
Greg Hudson [Wed, 20 Jun 2012 15:14:08 +0000 (11:14 -0400)] 
Document how to free krb5_cc_get_full_name result

Also, in klist, use the appropriate libkrb5 free functions for
krb5_cc_get_full_name and krb5_unparse_name_results.  Reported by
Kevin Wasserman.

ticket: 7179

13 years agoMinor reformating for better Sphinx HTML output
Zhanna Tsitkov [Tue, 19 Jun 2012 14:59:59 +0000 (10:59 -0400)] 
Minor reformating for better Sphinx HTML output

No content was changed.

13 years agoRemove CRs from options2configure.rst
Greg Hudson [Mon, 18 Jun 2012 19:55:24 +0000 (15:55 -0400)] 
Remove CRs from options2configure.rst

options2configure.rst had CRLF newlines, and should have LF newlines
like everything else.

13 years agoDocument version for new API functions
Zhanna Tsitkov [Fri, 15 Jun 2012 15:16:36 +0000 (11:16 -0400)] 
Document version for new API functions

13 years agoFail from gss_acquire_cred if we have no creds
Greg Hudson [Thu, 14 Jun 2012 18:15:05 +0000 (14:15 -0400)] 
Fail from gss_acquire_cred if we have no creds

If a caller tries to acquire krb5 initiator creds with no desired name
and we have no credentials in the cache collection, fail from
gss_acquire_cred intead of deferring until gss_init_sec_context.

ticket: 7160

13 years agoAdd krb5_cccol_have_content API
Greg Hudson [Thu, 14 Jun 2012 17:53:09 +0000 (13:53 -0400)] 
Add krb5_cccol_have_content API

Add a new API to determine whether any krb5 credentials are available
in the ccache collection.  Add tests to t_cccol.py.

ticket: 7173 (new)

13 years agoFix spelling of "start_time" in previous
Tom Yu [Thu, 14 Jun 2012 22:22:28 +0000 (18:22 -0400)] 
Fix spelling of "start_time" in previous

13 years agoDocument allowed time formats for kinit and ksu
Zhanna Tsitkov [Thu, 14 Jun 2012 18:46:10 +0000 (14:46 -0400)] 
Document allowed time formats for kinit and ksu

13 years agoRemove krb5int_cc_os_default_name
Greg Hudson [Mon, 11 Jun 2012 13:30:20 +0000 (09:30 -0400)] 
Remove krb5int_cc_os_default_name

krb5int_cc_os_default_name has been unused since #6955 removed the
call to it in cccursor.c.  Get rid of it.

13 years agoClean up default_an_to_ln and fix a minor leak
Greg Hudson [Fri, 8 Jun 2012 22:40:22 +0000 (18:40 -0400)] 
Clean up default_an_to_ln and fix a minor leak

The default realm could be leaked if the principal had the wrong
number of components.  Reported by Russ Allbery.

ticket: 7161

13 years agoRemove big-endian gss-krb5 support
Greg Hudson [Fri, 8 Jun 2012 21:02:28 +0000 (17:02 -0400)] 
Remove big-endian gss-krb5 support

The big_endian flag in krb5_gss_ctx_id_rec is there for
interoperability with a really ancient implementation which we believe
is no longer in use.  Get rid of it and the code to handle it.

ticket: 7166 (new)