]> git.ipfire.org Git - thirdparty/krb5.git/log
thirdparty/krb5.git
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)

13 years agoUpdate Build Kerberos V5 doc section
Zhanna Tsitkov [Fri, 8 Jun 2012 16:33:49 +0000 (12:33 -0400)] 
Update Build Kerberos V5 doc section

ticket: 7126

13 years agoFix memory leak in dbentry_supports_enctype in KDC
Greg Hudson [Thu, 7 Jun 2012 17:15:27 +0000 (13:15 -0400)] 
Fix memory leak in dbentry_supports_enctype in KDC

The etypes list was never freed.  Also use k5_etypes_contains.

13 years agoRename and add to etype utility functions
Greg Hudson [Thu, 7 Jun 2012 16:58:26 +0000 (12:58 -0400)] 
Rename and add to etype utility functions

Rename krb5int_count_etypes and krb5int_copy_etypes to have k5_
prefixes, and make them available outside of libkrb5 (but not part of
the public API).  Add k5_etypes_contains to search an etype list, and
use it in krb5_is_permitted_enctype.

13 years agoRemove krb5_is_permitted_enctype_ext
Greg Hudson [Thu, 7 Jun 2012 16:41:48 +0000 (12:41 -0400)] 
Remove krb5_is_permitted_enctype_ext

It's an internal function (not in krb5.h or the libkrb5 export list)
and nothing uses it.

13 years agoDon't free caller's principal in vfy_increds
Greg Hudson [Wed, 6 Jun 2012 23:13:13 +0000 (19:13 -0400)] 
Don't free caller's principal in vfy_increds

#7125 took out the copy of the krb5_verify_init_creds server argument
but left in the corresponding free, so it was freeing a caller-owned
principal.  Reported by Russ Allbery.

ticket: 7162

13 years agoTry to make t_trace.c output consistent
Greg Hudson [Wed, 6 Jun 2012 20:37:02 +0000 (16:37 -0400)] 
Try to make t_trace.c output consistent

Attempt to choose tracing inputs in t_trace.c which will produce
consistent output across platforms and logins.  Re-enable the
comparison against the reference file.

13 years agoAdd control over session key enctype negotiation
Nicolas Williams [Mon, 4 Jun 2012 22:17:31 +0000 (17:17 -0500)] 
Add control over session key enctype negotiation

Adds a principal string attribute named "session_enctypes" which can
specify what enctypes the principal supports for session keys.  (For
what it's worth, this actually allows one to list des-cbc-md5 as a
supported session key enctype, though obviously this hardly matters
now.)

Add a [realms] section parameter for specifying whether to assume that
principals (which lack the session_enctypes attribute) support
des-cbc-crc for session keys.  This allows those who still need to use
allow_weak_crypto=true, for whatever reason, to start reducing the
number of tickets issued with des-cbc-crc session keys to clients
which still give des-cbc-crc preference in their default_tgs_enctypes
list.

[ghudson@mit.edu: Miscellaneous edits, cleanups, and fixes; refactored
test script; documented session_enctypes attribute]

13 years agoAllow daemon debugging in k5test.py
Greg Hudson [Wed, 6 Jun 2012 15:23:19 +0000 (11:23 -0400)] 
Allow daemon debugging in k5test.py

Allow --debug to be used for commands which start daemons, to make it
easier to debug startup issues.  After debugging a daemon, the script
will exit, since the daemon won't be running after the debugging
session is over.

13 years agoFix k5test.py hostname canonicalization
Greg Hudson [Tue, 5 Jun 2012 04:48:37 +0000 (00:48 -0400)] 
Fix k5test.py hostname canonicalization

r25844 (#7124) stopped using AI_ADDRCONFIG when canonicalizing
hostnames in sn2princ.  So we need to also stop using it in k5test.c's
_get_hostname() or we could come up with a different result on a
system where forward and reverse resolution via IPv4 and IPv6 produce
different results.  That in turn causes a t_gssapi.py test (the one
using the un-canonicalized hostname) to fail, because libkrb5 looks
for a different host principal than k5test.py put in the keytab.

13 years agoFix uninitialized memory errors in t_trace.c
Greg Hudson [Tue, 5 Jun 2012 04:43:49 +0000 (00:43 -0400)] 
Fix uninitialized memory errors in t_trace.c

13 years agoDisable trace test comparison for now
Greg Hudson [Tue, 5 Jun 2012 03:56:22 +0000 (23:56 -0400)] 
Disable trace test comparison for now

The t_trace output isn't consistent from run to run.  To fix "make
check", disable the comparison against the reference file until we can
make the output consistent.

13 years agoFix trace log unit test
Greg Hudson [Mon, 4 Jun 2012 15:23:00 +0000 (11:23 -0400)] 
Fix trace log unit test

Only use common denominator Bourne shell syntax for exporting
environment variables.  Don't rely on /dev/stdout working.  Compare
the output with a reference file to detect changes, instead of just
sending it to stdout.

13 years agoFix -DDEBUG compilation errors
Henry B. Hotz [Mon, 4 Jun 2012 14:56:38 +0000 (10:56 -0400)] 
Fix -DDEBUG compilation errors

ticket: 7150

13 years agoFail from gss_acquire_cred if we have no keytab
Greg Hudson [Mon, 4 Jun 2012 00:46:30 +0000 (20:46 -0400)] 
Fail from gss_acquire_cred if we have no keytab

If a caller tries to acquire krb5 acceptor creds with no desired name
and we have no keytab keys, fail from gss_acquire_cred instead of
deferring until gss_accept_sec_context.

ticket: 7159 (new)

13 years agoUse first mech's status in gss_acquire_cred
Greg Hudson [Mon, 4 Jun 2012 00:39:08 +0000 (20:39 -0400)] 
Use first mech's status in gss_acquire_cred

If we can't acquire creds for any mech in gss_acquire_cred, return the
status of the first mech instead of the last mech, as it's more useful
in the typical case (where the first mech is krb5 and the last mech is
SPNEGO).  This error reporting is not ideal when the user was
expecting to use some mech other than krb5, but it's about as good as
things were prior to #6894.

ticket: 6973

13 years agoImprove error message from krb5_kt_have_content
Greg Hudson [Mon, 4 Jun 2012 00:35:53 +0000 (20:35 -0400)] 
Improve error message from krb5_kt_have_content

13 years agoRemove outdated comment in k5test.py
Greg Hudson [Mon, 4 Jun 2012 00:06:43 +0000 (20:06 -0400)] 
Remove outdated comment in k5test.py

13 years agoAdd krb5_kt_have_content API
Greg Hudson [Sat, 2 Jun 2012 18:06:58 +0000 (14:06 -0400)] 
Add krb5_kt_have_content API

Add the krb5_kt_have_content API from Heimdal, which can be used to
test whether a keytab exists and contains entries.  Add tests to
t_keytab.c.

There is a deviation from Heimdal in the function signature.
Heimdal's signature returns a krb5_boolean at the moment, because the
Heimdal implementation actually returns a krb5_error_code.  These are
generally the same type anyway (int).

ticket: 7158 (new)

13 years agoTighten up error checking in t_keytab.c
Greg Hudson [Sat, 2 Jun 2012 17:54:12 +0000 (13:54 -0400)] 
Tighten up error checking in t_keytab.c

When checking for specific error codes, using CHECK() meant that we
wouldn't properly fail if we got error code 0.  Define and use a
CHECK_ERR() to test for a specific error code, and define CHECK() in
terms of it.

13 years agoSphinx HTML: Collapse l4 in ToC in the sidebar
Zhanna Tsitkov [Fri, 1 Jun 2012 17:19:29 +0000 (13:19 -0400)] 
Sphinx HTML: Collapse l4 in ToC in the sidebar

Also,
- resize the width of the document vs sidebar;
- decrease padding in the sidebar;
- mark current l2 in ToC in the sidebar.

13 years agoUse correct profile var in krb5_get_tgs_ktypes
Greg Hudson [Fri, 1 Jun 2012 13:52:20 +0000 (09:52 -0400)] 
Use correct profile var in krb5_get_tgs_ktypes

In r21879, when we converted to using KRB5_CONF macros for profile
variable names, we made a typo in krb5_get_tgs_ktypes and erroneously
started using default_tkt_enctypes instead of default_tgs_enctypes for
TGS requests.  Fix the typo and return to the documented behavior.

ticket: 7155
target_version: 1.10.3
tags: pullup

13 years agoUse a hash table in the KDC lookaside cache
Greg Hudson [Thu, 24 May 2012 06:07:18 +0000 (02:07 -0400)] 
Use a hash table in the KDC lookaside cache

Add a hash table to kdc/replay.c for fast lookup of incoming packets.
Continue to keep a time-ordered linked list of all entries for fast
expiry of stale entries.  The preprocessor constant
LOOKASIDE_HASH_SIZE can be used to change the size of the hash table.

13 years agoAdd a copy of the BSD <sys/queue.h> as k5-queue.h
Greg Hudson [Wed, 30 May 2012 02:46:48 +0000 (22:46 -0400)] 
Add a copy of the BSD <sys/queue.h> as k5-queue.h

queue.h implements various types of linked lists as cpp macros,
without needing any library support.

13 years agoNull pointer deref in kadmind [CVE-2012-1013]
Richard Basch [Tue, 29 May 2012 18:07:03 +0000 (14:07 -0400)] 
Null pointer deref in kadmind [CVE-2012-1013]

The fix for #6626 could cause kadmind to dereference a null pointer if
a create-principal request contains no password but does contain the
KRB5_KDB_DISALLOW_ALL_TIX flag (e.g. "addprinc -randkey -allow_tix
name").  Only clients authorized to create principals can trigger the
bug.  Fix the bug by testing for a null password in check_1_6_dummy.

CVSSv2 vector: AV:N/AC:M/Au:S/C:N/I:N/A:P/E:H/RL:O/RC:C

[ghudson@mit.edu: Minor style change and commit message]

ticket: 7152
target_version: 1.10.2
tags: pullup

13 years agoFix TRACE_GET_CRED_VIA_TKT_EXT format string
Greg Hudson [Thu, 24 May 2012 17:19:17 +0000 (13:19 -0400)] 
Fix TRACE_GET_CRED_VIA_TKT_EXT format string

13 years agoFix S4U user identification in preauth case
Greg Hudson [Thu, 24 May 2012 17:03:26 +0000 (13:03 -0400)] 
Fix S4U user identification in preauth case

In 1.10, encrypted timestamp became a built-in module instead of a
hardcoded padata handler.  This changed the behavior of
krb5_get_init_creds as invoked by s4u_identify_user such that
KRB5_PREAUTH_FAILED is returned instead of the gak function's error.
(Module failures are not treated as hard errors, while hardcoded
padata handler errors are.)  Accordingly, we should look for
KRB5_PREAUTH_FAILED in s4u_identify_user.

On a less harmful note, the gak function was returning a protocol
error code instead of a com_err code, and the caller was testing for a
different protocol error code (KDC_ERR_PREAUTH_REQUIRED) which could
never be returned by krb5_get_init_creds.  Clean up both of those by
returning KRB5_PREAUTH_FAILED from the gak function and testing for
that alone.

Reported by Michael Morony.

ticket: 7136
target_version: 1.10.2
tags: pullup

13 years agoConvert DEBUG_REFERRALS to TRACE_* framework
W. Trevor King [Fri, 18 May 2012 01:26:36 +0000 (21:26 -0400)] 
Convert DEBUG_REFERRALS to TRACE_* framework

The referrals debugging code under DEBUG_REFERRALS ceased building
correctly at some point.  Convert this debugging code to use the
tracing framework instead, including adding new trace macros to
k5-trace.h.

ticket: 7151

13 years agoAdd tests for trace.c formatting
W. Trevor King [Fri, 18 May 2012 01:12:49 +0000 (21:12 -0400)] 
Add tests for trace.c formatting

This improves the previously minimal test coverage of "trace.c".

ticket: 7151

13 years agoAdd support for "{ptype}" trace format specifier
W. Trevor King [Fri, 18 May 2012 01:10:20 +0000 (21:10 -0400)] 
Add support for "{ptype}" trace format specifier

Add the "{ptype}" trace format specifier, for principal name types.
Also document the new option in the "k5-trace.h" comments.

ticket: 7151

13 years agoDocument "{keytab}" trace format specifier
W. Trevor King [Fri, 18 May 2012 01:07:07 +0000 (21:07 -0400)] 
Document "{keytab}" trace format specifier

13 years agoModified the Sphinx HTML page layout
Zhanna Tsitkov [Wed, 23 May 2012 19:59:24 +0000 (15:59 -0400)] 
Modified the Sphinx HTML page layout

1. The Feedback button is moved into the footer;
2. The default page/doc width are set to 960px;

13 years agoExport gss_mech_krb5_wrong from libgssapi_krb5
Greg Hudson [Tue, 22 May 2012 17:45:18 +0000 (13:45 -0400)] 
Export gss_mech_krb5_wrong from libgssapi_krb5

Although there are few legitimate reasons to use gss_mech_krb5_wrong,
it's declared in the public header and exported in the Windows DLL.
So export it from the Unix library as well.

ticket: 7148 (new)
target_version: 1.10.2
tags: pullup

13 years agoMake doc/coding-style point to wiki page
Tom Yu [Tue, 22 May 2012 16:46:21 +0000 (12:46 -0400)] 
Make doc/coding-style point to wiki page

The old doc/coding-style file was out of date; replace its content
with a pointer to the wiki page.

ticket: 7147 (new)

13 years agoExport krb5_set_trace_callback/filename
Greg Hudson [Mon, 21 May 2012 05:39:14 +0000 (01:39 -0400)] 
Export krb5_set_trace_callback/filename

krb5_set_trace_callback and krb5_set_trace_filename were added to
krb5.h in krb5 1.9, but were mistakenly left out of the library export
lists.  Add them now.  Reported by Russ Allbery.

ticket: 7143
target_version: 1.10.2
tags: pullup

13 years agoFix "(empty" typo in "{etypes}" handler in trace.c
W. Trevor King [Wed, 16 May 2012 23:09:46 +0000 (19:09 -0400)] 
Fix "(empty" typo in "{etypes}" handler in trace.c

ticket: 7137

13 years agoFix "(null" typo in "{key}" handler in trace.c
W. Trevor King [Wed, 16 May 2012 21:11:12 +0000 (17:11 -0400)] 
Fix "(null" typo in "{key}" handler in trace.c

ticket: 7134

13 years agoCorrect the name of krb5int_trace in comments
Tom Yu [Fri, 18 May 2012 00:05:22 +0000 (20:05 -0400)] 
Correct the name of krb5int_trace in comments

Patch from W. Trevor King.

ticket: 7133

13 years agoAdd missing $(LIBS) to some shared libraries
Tom Yu [Thu, 17 May 2012 23:32:41 +0000 (19:32 -0400)] 
Add missing $(LIBS) to some shared libraries

Add $(LIBS) to the $(SHLIB_EXPLIBS) for some shared libraries which
did not previously include it, which prevented gcov from working
properly in some cases.

Patch from W. Trevor King.

ticket: 7138

13 years agoRemove mention of util/autoconf
Tom Yu [Thu, 17 May 2012 18:18:27 +0000 (14:18 -0400)] 
Remove mention of util/autoconf

We no longer use our own customized version of autoconf, so remove
mentions of the src/util/autoconf directory where that used to be.

Reported by W. Trevor King.

ticket: 7139 (new)

13 years agoMake mkrel work on non-master branches
Tom Yu [Tue, 15 May 2012 19:15:07 +0000 (15:15 -0400)] 
Make mkrel work on non-master branches

Appending "--" to the git checkout arguments appears to prevent it
from automatically creating a local branch from the remote.  Also
correct the default git URL and clean up a spurious find warning.

13 years agoUpdate CHANGES file generation for Git
Tom Yu [Mon, 14 May 2012 23:14:54 +0000 (19:14 -0400)] 
Update CHANGES file generation for Git

Use the correct git log invocation for generating the CHANGES file.

13 years agoUpdate patchlevel.h for Git repository
Tom Yu [Mon, 14 May 2012 22:39:17 +0000 (18:39 -0400)] 
Update patchlevel.h for Git repository

Use "master", not "trunk", as RELTAG now.

13 years agoAdd missing newline to sn2princ debug message
Greg Hudson [Mon, 14 May 2012 19:24:02 +0000 (15:24 -0400)] 
Add missing newline to sn2princ debug message

Patch from wking@tremily.us.

ticket: 7131

13 years agoConvert util/mkrel to use git instead of svn
Greg Hudson [Mon, 14 May 2012 19:06:51 +0000 (15:06 -0400)] 
Convert util/mkrel to use git instead of svn

13 years agoCheck alloc_data result in krb5int_old_encrypt
Greg Hudson [Sun, 13 May 2012 19:42:50 +0000 (15:42 -0400)] 
Check alloc_data result in krb5int_old_encrypt

13 years agoClean up a redundant assignment in libprofile
Greg Hudson [Sun, 13 May 2012 19:38:06 +0000 (15:38 -0400)] 
Clean up a redundant assignment in libprofile

13 years agoAvoid extern inline in asn1buf.h
Greg Hudson [Sun, 13 May 2012 17:15:34 +0000 (13:15 -0400)] 
Avoid extern inline in asn1buf.h

Avoid using extern inline in asn1buf.h, as there are two conflicting
sets of semantics (gnu89's and C99's).  gcc defaults to the gnu89
semantics, which we were using, while clang defines __GNUC__ but
defaults to the C99 semantics.  To simplify things, use static inline
instead, like we do in k5-int.h.

13 years agoDon't stomp minor code in spnego_gss_acquire_cred
Greg Hudson [Sun, 13 May 2012 17:12:06 +0000 (13:12 -0400)] 
Don't stomp minor code in spnego_gss_acquire_cred

When spnego_gss_acquire_cred passes through a failure status from the
mechglue, it overwrites the minor code with a call to
gss_release_oid_set().  Use a temporary minor status for that and a
related call.

13 years agoRemove find-missing-eol-prop and fix-eol-prop
Greg Hudson [Sat, 12 May 2012 23:03:47 +0000 (19:03 -0400)] 
Remove find-missing-eol-prop and fix-eol-prop

Remove two Subversion-specific scripts which are no longer necessary
now that the master repository is in git.

13 years agoAdd a .gitgnore file
Greg Hudson [Sat, 12 May 2012 22:56:59 +0000 (18:56 -0400)] 
Add a .gitgnore file

13 years agoNull-terminate components of parsed principals
Greg Hudson [Sat, 12 May 2012 16:54:06 +0000 (12:54 -0400)] 
Null-terminate components of parsed principals

The rewritten krb5_parse_name didn't null-terminate components or
realms of principals, while the old one did.  Fix the new one to do so
as well.

This means KRB5_PRINCIPAL_PARSE_IGNORE_REALM allocates one byte for
the realm instead of leaving it as empty_data(), so we need to free
the realm in build_in_tkt_name() before copying in the client realm.

13 years agoOmit start time in common AS requests
Greg Hudson [Fri, 11 May 2012 18:07:30 +0000 (18:07 +0000)] 
Omit start time in common AS requests

MIT and Heimdal KDCs ignore the start time for non-postdated ticket
requests, but AD yields an error if the start time is in the KDC's
future, defeating the kdc_timesync option.  Omit the start time if the
caller did not specify a start time offset.

This change reenables the client check for too much clock skew in the
KDC reply in the non-timesync configuration.  That check had been
unintentionally suppressed since the introduction of the
get_init_creds interfaces.  Adjust the t_skew test script to expect
the new error behavior.

Code changes from stefw@gnome.org with slight modifications.

ticket: 7130

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25864 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoAvoid requiring default realm for in_tkt_service
Greg Hudson [Thu, 10 May 2012 17:34:14 +0000 (17:34 +0000)] 
Avoid requiring default realm for in_tkt_service

Use the new KRB5_PRINCIPAL_PARSE_IGNORE_REALM flag when parsing
in_tkt_service arguments in get_init_cred functions, since we're going
to overwrite the realm anyway.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25863 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoAdd krb5_parse_name flag to ignore realm
Greg Hudson [Thu, 10 May 2012 17:34:10 +0000 (17:34 +0000)] 
Add krb5_parse_name flag to ignore realm

The flag KRB5_PRINCIPAL_PARSE_IGNORE_REALM causes krb5_parse_name to
return the principal with an empty realm whether or not a realm is
present in the name.

ticket: 7129

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25862 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoRewrite krb5_parse_name
Greg Hudson [Thu, 10 May 2012 17:34:07 +0000 (17:34 +0000)] 
Rewrite krb5_parse_name

krb5_parse_name started out a bit unwieldy, and has become more so
with the introduction of flags.  Rewrite it using two passes (allocate
and fill), each broken out into its own helper, and a wrapper which
handles the realm flags.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25861 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoMake password change work without default realm
Greg Hudson [Thu, 10 May 2012 17:34:01 +0000 (17:34 +0000)] 
Make password change work without default realm

This fix is not very general or clean, but is suitable for backporting
because it is minimally invasive.  A more comprehensive fix will
follow.

ticket: 7127
target_version: 1.10.2
tags: pullup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25860 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoAdd no-op macro for ngettext for non-NLS builds
Greg Hudson [Wed, 9 May 2012 19:27:49 +0000 (19:27 +0000)] 
Add no-op macro for ngettext for non-NLS builds

r25857 (#7128) uses ngettext, which means we need a no-op macro for it
when we're building without NLS support.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25859 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoConstify get_init_creds string input params
Greg Hudson [Wed, 9 May 2012 17:55:27 +0000 (17:55 +0000)] 
Constify get_init_creds string input params

The get_init_creds functions take read-only string input parameters
for passwords and initial ticket services.  Make these const char *
parameters instead of just char * parameters, for caller convenience.

Reported by rra@stanford.edu.

ticket: 7121

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25858 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoAdd API to interpret changepw result strings
Greg Hudson [Wed, 9 May 2012 17:40:38 +0000 (17:40 +0000)] 
Add API to interpret changepw result strings

Active Directory returns structured policy information in the
nominally UTF-8 result string field of a password change reply.  Add a
new API krb5_chpw_message() to convert a result string into a
displayable message, interpreting policy information if present.

Patch from stefw@gnome.org with changes.

ticket: 7128

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25857 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoConstify krb5int_utf8_normalize input parameter
Greg Hudson [Wed, 9 May 2012 17:40:32 +0000 (17:40 +0000)] 
Constify krb5int_utf8_normalize input parameter

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25856 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoFirst pass at PKINIT client trace logs
Greg Hudson [Tue, 8 May 2012 03:04:22 +0000 (03:04 +0000)] 
First pass at PKINIT client trace logs

Trace basic decisions about PKINIT client protocol processing.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25855 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoImprove traced error messages from PKINIT client
Greg Hudson [Tue, 8 May 2012 03:04:15 +0000 (03:04 +0000)] 
Improve traced error messages from PKINIT client

If we have no configured PKINIT client identity, or if we fail to
create a certificate chain, set a reasonable error code (not EINVAL or
ENOMEM) and a useful error message to appear in trace log output.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25854 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoImprove display of error code 0 in trace output
Greg Hudson [Tue, 8 May 2012 03:04:12 +0000 (03:04 +0000)] 
Improve display of error code 0 in trace output

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25853 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoUse variadic macros to simplify k5-trace.h
Greg Hudson [Tue, 8 May 2012 03:04:07 +0000 (03:04 +0000)] 
Use variadic macros to simplify k5-trace.h

Also fix the facility to make it possible to trace log without
including k5-int.h.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25852 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoProcess param/defname node for "#define".
Zhanna Tsitkov [Sat, 5 May 2012 17:03:50 +0000 (17:03 +0000)] 
Process param/defname node for "#define".

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25851 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoFor typedef documents in Sphinx do not add short description to the titles
Zhanna Tsitkov [Sat, 5 May 2012 15:41:00 +0000 (15:41 +0000)] 
For typedef documents in Sphinx do not add short description to the titles

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25850 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoAdd generalized definition of krb5_ui_4 and krb5_int32 to the documentation for bette...
Zhanna Tsitkov [Sat, 5 May 2012 15:35:51 +0000 (15:35 +0000)] 
Add generalized definition of krb5_ui_4 and krb5_int32 to the documentation for better cross-referencing. Do not include internal structure krb5_cc_ops into Sphinx documentation

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25849 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoModernize style in vfy_increds.c
Greg Hudson [Thu, 3 May 2012 21:43:47 +0000 (21:43 +0000)] 
Modernize style in vfy_increds.c

Make vfy_increds.c consistently use newer coding conventions.  Also
add a copyright statement.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25848 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoMake verify_init_creds work with existing ccache
Greg Hudson [Thu, 3 May 2012 21:43:42 +0000 (21:43 +0000)] 
Make verify_init_creds work with existing ccache

As the file ccache implementation currently stands, we don't want to
turn off TC_OPENCLOSE on a file cache we're writing to, or it will be
opened read-only and stores to it will fail.  Reported by Russ
Allbery.

ticket: 5126

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25847 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoThe new version of Doxygen (1.7.6.1) produces different xml output around the <initia...
Zhanna Tsitkov [Thu, 3 May 2012 20:28:02 +0000 (20:28 +0000)] 
The new version of Doxygen (1.7.6.1) produces different xml output around the <initializer> node. Adopt the script to the change.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25846 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoTry all host keys by default in vfy_increds
Greg Hudson [Thu, 3 May 2012 19:42:43 +0000 (19:42 +0000)] 
Try all host keys by default in vfy_increds

Factor out the core code of krb5_verify_init_creds into a helper, add
new helper functions to retrieve the list of unique host principals
from a keytab, and make krb5_verify_init_creds drive the helper once
per host principal.

Augment the test harness and test cases to better test the new
behavior.  Add a k5test method to retrieve an NFS principal for the
test realm for the sake of the new test cases.

ticket: 7125

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25845 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoIn sn2princ, getaddrinfo without AI_ADDRCONFIG
Greg Hudson [Thu, 3 May 2012 15:15:51 +0000 (15:15 +0000)] 
In sn2princ, getaddrinfo without AI_ADDRCONFIG

When canonicalizing a principal, use AI_CANONNAME alone in the hint
flags for getaddrinfo, for two reasons.  First, it works around a gnu
libc bug where getaddrinfo does a PTR lookup for the canonical name
(we tried to work around this in r24977 bug the addition of
AI_ADDRCONFIG caused the same problem as the use of AF_INET).  Second,
an IPv4-only host should be able create a principal for an IPv6-only
host even if it can't contact the host.

This does result in extra AAAA queries in the common case (IPv4-only
host contacting IPv4-only service), which is unfortunate.  But we need
to leave that optimization up to the platform at this point.

ticket: 7124

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25844 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoClarify profile pluggable interface documentation
Greg Hudson [Wed, 2 May 2012 18:38:33 +0000 (18:38 +0000)] 
Clarify profile pluggable interface documentation

Explain how profile plugin modules integrate with libkrb5, since it's
a bit different than usual.  Also fix a broken note.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25843 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoSimplify krb5_do_preauth
Greg Hudson [Mon, 30 Apr 2012 23:33:45 +0000 (23:33 +0000)] 
Simplify krb5_do_preauth

Now that krb5_do_preauth has many fewer moving parts, simplify its
flow control.  Also remove an unused output parameter from
run_preauth_plugins.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25842 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoGet rid of built-in preauth types table
Greg Hudson [Mon, 30 Apr 2012 23:33:43 +0000 (23:33 +0000)] 
Get rid of built-in preauth types table

Turn the last two entries of the pa_types table into helper functions
which we invoke before the loop.  Then, get rid of the part of the
loop which consults the pa_types table.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25841 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoSimplify preauth2 helper functions using realloc
Greg Hudson [Mon, 30 Apr 2012 23:33:38 +0000 (23:33 +0000)] 
Simplify preauth2 helper functions using realloc

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25840 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoUse correct name-type in TGS-REQs for 2008R2 RODCs
Tom Yu [Fri, 27 Apr 2012 22:40:21 +0000 (22:40 +0000)] 
Use correct name-type in TGS-REQs for 2008R2 RODCs

Correctly set the name-type for the TGS principals to KRB5_NT_SRV_INST
in TGS-REQs.  (Previously, only AS-REQs had the name-type set in this
way.)  Windows Server 2008 R2 read-only domain controllers (RODCs)
insist on having the correct name-type for the TGS principal in
TGS-REQs as well as AS-REQs, at least for the TGT-forwarding case.

Thanks to Sebastian Galiano for reporting this bug and helping with
testing.

ticket: 7120
target_version: 1.10.2
tags: pullup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25839 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoSplit up and fix get_etype_info
Greg Hudson [Fri, 27 Apr 2012 21:11:08 +0000 (21:11 +0000)] 
Split up and fix get_etype_info

The addition of afs3-salt processing in get_etype_info made it overly
large, so split out the pw-salt/afs3-salt processing into a separate
function.  Also fix two dumb bugs.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25838 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoStop using SALT_TYPE_AFS_LENGTH
Greg Hudson [Fri, 27 Apr 2012 21:11:04 +0000 (21:11 +0000)] 
Stop using SALT_TYPE_AFS_LENGTH

In krb5_init_creds_ctx and krb5_clpreauth_rock_st, use a boolean to
track whether we're still using the default salt instead of
overloading salt.length.  In preauth2.c, process afs3 salt values like
we would in krb5int_des_string_to_key, and set an s2kparams indicator
instead of overloading salt.length.  Also use an s2kparams indicator
in kdb_cpw.c's add_key_pwd.  Remove the s2k code to handle overloaded
salt lengths, except for a sanity check.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25837 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoFix TRACE_PREAUTH_SALT format string
Greg Hudson [Fri, 27 Apr 2012 21:11:00 +0000 (21:11 +0000)] 
Fix TRACE_PREAUTH_SALT format string

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25836 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoDraft initial credentials API documentation
Tom Yu [Fri, 27 Apr 2012 20:39:13 +0000 (20:39 +0000)] 
Draft initial credentials API documentation

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25835 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoRefactor client etype-info handling in preauth2.c
Greg Hudson [Fri, 27 Apr 2012 17:13:23 +0000 (17:13 +0000)] 
Refactor client etype-info handling in preauth2.c

Pull etype-info2, etype-info, pw-salt, and afs3-salt handling out of
the pa_types loop into a new helper function get_etype_info().

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25834 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoEnsure null termination of AFS salts
Greg Hudson [Fri, 27 Apr 2012 17:04:24 +0000 (17:04 +0000)] 
Ensure null termination of AFS salts

Use krb5int_copy_data_contents_add0 when copying a pa-pw-salt or
pa-afs3-salt value in pa_salt().  If it's an afs3-salt, we're going to
throw away the length and use strcspn in krb5int_des_string_to_key,
which isn't safe if the value is unterminated.

ticket: 2545

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25833 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoMake it easier to test SAM-2 client code
Greg Hudson [Thu, 26 Apr 2012 21:47:05 +0000 (21:47 +0000)] 
Make it easier to test SAM-2 client code

Add a method to the securid_sam2 plugin, built with alternate
compile-time flags, which supplies a plain-text challenge to the
client to be used as the OTP value.  This lets us manually exercise
the SAM-2 client code and a little bit of the KDC code.

securid_make_sam_challenge_2_and_cksum is moved into the method-
independent code and renamed.  get_securid_edata_2 has its sc2b
parameter removed as it was not used by the caller.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25832 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoConvert SAM-2 preauth mechanism to a module
Greg Hudson [Thu, 26 Apr 2012 21:47:02 +0000 (21:47 +0000)] 
Convert SAM-2 preauth mechanism to a module

Move the last real preauth mechanism, SAM-2, from the pa_types table
to a built-in module.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25831 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoRemove orphaned Apple PKINIT support
Greg Hudson [Thu, 26 Apr 2012 21:46:57 +0000 (21:46 +0000)] 
Remove orphaned Apple PKINIT support

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25830 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoRearrange navigation buttons in the HTML header
Zhanna Tsitkov [Thu, 26 Apr 2012 13:11:09 +0000 (13:11 +0000)] 
Rearrange navigation buttons in the HTML header

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25829 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoAdd kadmin ACL enforcement tests
Greg Hudson [Thu, 26 Apr 2012 04:34:25 +0000 (04:34 +0000)] 
Add kadmin ACL enforcement tests

Add a Python script to test the enforcement of kadm5.acl
specifications, including wildcards and restrictions.

ticket: 7097

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25828 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoAllow clearpolicy restriction for kadmin addprinc
Greg Hudson [Thu, 26 Apr 2012 04:34:20 +0000 (04:34 +0000)] 
Allow clearpolicy restriction for kadmin addprinc

Although the kadmin client never generates a KADM5_POLICY_CLR mask bit
with addprinc, the bit will be set if a kadm5.acl line imposes the
-clearpolicy restriction.  Relax the sanity checking in
kadm5_create_principal_3 to allow KADM5_POLICY_CLR as long as
KADM5_POLICY is not also set.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25827 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoAdd k5test.py helpers for running kadmin
Greg Hudson [Thu, 26 Apr 2012 04:34:15 +0000 (04:34 +0000)] 
Add k5test.py helpers for running kadmin

Add K5Realm.prep_kadmin() to create a ccache and K5Realm.run_kadmin()
to run a kadmin query using it.  Modify t_stringattr.py to use these
helpers instead of its own.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25826 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoFlip the default of start_kadmind in k5test.py
Greg Hudson [Thu, 26 Apr 2012 04:33:48 +0000 (04:33 +0000)] 
Flip the default of start_kadmind in k5test.py

Very few Python tests need kadmind, so it makes more sense to have to
turn it on than to have to turn it off.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25825 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoMinor cleanup (mostly to remove the "Contents" section titles)
Zhanna Tsitkov [Wed, 25 Apr 2012 19:15:30 +0000 (19:15 +0000)] 
Minor cleanup (mostly to remove the "Contents" section titles)

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25824 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoUse "agogo" HTML theme (with some modifications) for the Sphinx documentation. Do...
Zhanna Tsitkov [Wed, 25 Apr 2012 19:10:41 +0000 (19:10 +0000)] 
Use "agogo" HTML theme (with some modifications) for the Sphinx documentation. Do not show the ReST source files

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25823 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoClear preauth use counts for each AS request
Greg Hudson [Wed, 25 Apr 2012 17:20:20 +0000 (17:20 +0000)] 
Clear preauth use counts for each AS request

Initialize use_count fields in krb5_preauth_request_context_init,
which is invoked before each AS request.  Previously they were
initialized only in krb5_init_preauth_context, which is only invoked
once per krb5 library context.

ticket: 7119
target_version: 1.10.2
tags: pullup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25822 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoAdd KRB5_TRACE test case
Greg Hudson [Tue, 24 Apr 2012 17:04:29 +0000 (17:04 +0000)] 
Add KRB5_TRACE test case

In t_general.py, run kinit with KRB5_TRACE enabled and make sure we
see some basic strings in the resulting file.

ticket: 7113

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25821 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoAdjust t_general.py organization
Greg Hudson [Tue, 24 Apr 2012 17:04:21 +0000 (17:04 +0000)] 
Adjust t_general.py organization

Move some tests out of the multipass_realms loop since they aren't
enctype-dependent.  Fix the success message not to mention kvno
wrapping.  Don't start kadmind in the multipass_realms loop since we
don't use it.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25820 dc483132-0cff-0310-8789-dd5450dbe970

13 years agoTry all history keys to decrypt password history
Greg Hudson [Tue, 24 Apr 2012 01:05:41 +0000 (01:05 +0000)] 
Try all history keys to decrypt password history

A database created prior to 1.3 will have multiple password history
keys, and kadmin prior to 1.8 won't necessarily choose the first one.
So if there are multiple keys, we have to try them all.  If none of
the keys can decrypt a password history entry, don't fail the password
change operation; it's not worth it without positive evidence of
password reuse.

ticket: 7099

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25819 dc483132-0cff-0310-8789-dd5450dbe970