]> git.ipfire.org Git - thirdparty/krb5.git/log
thirdparty/krb5.git
12 years agoRemove -b6 and -old dump formats
Greg Hudson [Mon, 4 Feb 2013 23:43:22 +0000 (18:43 -0500)] 
Remove -b6 and -old dump formats

Get rid of the code to dump and load -b6 and -old format dump files.
Loading these versions hasn't worked since at least 1.3.

ticket: 7564 (new)

12 years agoAdd more tests for dump and load
Greg Hudson [Mon, 4 Feb 2013 23:21:45 +0000 (18:21 -0500)] 
Add more tests for dump and load

Move the existing dump/load tests from t_general.py to a new script
t_dump.py.  Add additional tests using pre-created dumpfiles, to
exercise the -r18, -r13, -b7, and -ov formats.

bigredbutton: whitespace

12 years agoSimplify kdb5_util create using a null password
Greg Hudson [Mon, 4 Feb 2013 19:01:40 +0000 (14:01 -0500)] 
Simplify kdb5_util create using a null password

kadm5_create_principal now uses a random key if passed a null
password, so we don't need a multi-step process to create admin
principals when creating a database any more.

12 years agoFix kdb5_util dump.c uninitialized warnings
Greg Hudson [Fri, 1 Feb 2013 16:52:48 +0000 (11:52 -0500)] 
Fix kdb5_util dump.c uninitialized warnings

Some versions of clang report an uninitialized variable warning (which
we treat as an error) in process_k5beta_record.  Due to the if-ladder
style of the function, uninitialized tmpint values can be copied
around in certain error cases, although the garbage values would be
ultimately ignored.  As a minimal fix, initialize the tmpint
variables.

ticket: 7560 (new)
target_version: 1.11.1
tags: pullup

12 years agoSimplify LDAP password decoding
Greg Hudson [Fri, 1 Feb 2013 07:14:45 +0000 (02:14 -0500)] 
Simplify LDAP password decoding

Make dec_password a static function in ldap_service_stash.c and remove
some impedance mismatch with krb5_ldap_readpassword() by making it
operate on C strings and return a krb5_error_code.

12 years agoRefactor rellinks formatting in layout.html
Tom Yu [Fri, 18 Jan 2013 20:45:52 +0000 (15:45 -0500)] 
Refactor rellinks formatting in layout.html

12 years agoReduce copied code in layout.html
Tom Yu [Fri, 18 Jan 2013 04:29:59 +0000 (23:29 -0500)] 
Reduce copied code in layout.html

layout.html unneccesarily copied code from the parent
agogo/layout.html content block just to alter the sidebar.  Override
various subblocks of the sidebar instead.

12 years agoConsolidate style settings in kerb.css
Tom Yu [Fri, 18 Jan 2013 03:58:46 +0000 (22:58 -0500)] 
Consolidate style settings in kerb.css

Move style settings that were previously in layout.html to kerb.css.
Rename kerb.css kerb.css_t, making it a template, to allow
parameterized style settings to remain parameterized.

12 years agoFix "search" accesskey in layout.html
Tom Yu [Fri, 18 Jan 2013 03:42:23 +0000 (22:42 -0500)] 
Fix "search" accesskey in layout.html

The accesskey for the "search" link conflicted with the one for the
"contents" link.

ticket: 7559 (new)
target_version: 1.11.1
tags: pullup

12 years agoFix typos in layout.html
Tom Yu [Fri, 18 Jan 2013 03:39:57 +0000 (22:39 -0500)] 
Fix typos in layout.html

There were multiple misplaced semicolons, etc.

ticket: 7558 (new)
target_version: 1.11.1
tags: pullup

12 years agoFix h1 end tag in Sphinx header titles
Tom Yu [Thu, 17 Jan 2013 22:56:53 +0000 (17:56 -0500)] 
Fix h1 end tag in Sphinx header titles

A </h1> end tag was incorrectly written as <h1>.  Also adjust style
settings so that the resulting computed style remains the same for
div.rel.

ticket: 7557 (new)
target_version: 1.11.1
tags: pullup

12 years agoRemove partial LDAP client cert support
Greg Hudson [Thu, 31 Jan 2013 18:40:36 +0000 (13:40 -0500)] 
Remove partial LDAP client cert support

The LDAP KDB module has some code to interpret {FILE} values in stash
files, and set the service_cert_path/pass fields in the ldap context.
But there was no code to actually use those values to do client cert
authentication, so it wasn't useful.  Remove the partial
implementation.

12 years agoNew section: Contributing to Kerb documentation
Zhanna Tsitkov [Thu, 31 Jan 2013 16:39:44 +0000 (11:39 -0500)] 
New section: Contributing to Kerb documentation

12 years agoFix COPY_FIRST_CANONNAME hostent search
Viktor Dukhovni [Thu, 31 Jan 2013 03:58:50 +0000 (22:58 -0500)] 
Fix COPY_FIRST_CANONNAME hostent search

In fake-addrinfo.c, the COPY_FIRST_CANONNAME logic erroneously assumes
that h_name is the same as h_aliases[0].  Look at h_name before
h_aliases for an FQDN, since h_name is normally the
forward-canonicalized name and h_aliases are not.

[ghudson@mit.edu: rewrote commit message]

ticket: 7556 (new)

12 years agoRevert previous change to process_tgs_req
Greg Hudson [Thu, 31 Jan 2013 07:15:59 +0000 (02:15 -0500)] 
Revert previous change to process_tgs_req

Commit c072b059ecff257e7600be0e86869decd135d422 did not have the
intended effect because, at the point where is_referral is set,
request->server has already been modified to contain server->princ.

ticket: 7555
status: open

12 years agoFix is_referral flag in KDC TGS code
Greg Hudson [Thu, 31 Jan 2013 06:26:22 +0000 (01:26 -0500)] 
Fix is_referral flag in KDC TGS code

A server response which is a cross-realm TGT is not a referral if it
was directly requested by the client.  Misclassifying such a response
as a referral means we don't mirror the request's name type, which has
been observed to break older Java clients.

ticket: 7555 (new)

12 years agoNote which release -x debug was added in
Greg Hudson [Tue, 29 Jan 2013 18:16:05 +0000 (13:16 -0500)] 
Note which release -x debug was added in

12 years agoFix prepend_err_str in LDAP KDB module
Greg Hudson [Tue, 29 Jan 2013 18:13:04 +0000 (13:13 -0500)] 
Fix prepend_err_str in LDAP KDB module

Use the oerr parameter to fetch the existing message.  Stop handling
oerr == 0, since no call sites were using it.  Free the old error
message before returning.

12 years agoAdd LDAP debug DB option
Greg Hudson [Tue, 29 Jan 2013 03:30:41 +0000 (22:30 -0500)] 
Add LDAP debug DB option

Add a DB option in the LDAP KDB module to turn on debugging messages.
Adapted from a patch by Zoran Pericic <zpericic@inet.hr>.

ticket: 7551 (new)

12 years agoRefactor LDAP DB option parsing code
Greg Hudson [Tue, 29 Jan 2013 01:15:01 +0000 (20:15 -0500)] 
Refactor LDAP DB option parsing code

krb5_ldap_open and krb5_ldap_create contain two large, almost
identical blocks of DB option processing code.  Factor it out into a
new function krb5_ldap_parse_db_params in ldap_misc.c, and simplify
the factored-out code.  Create a helper function to add server entries
and use it to simplify krb5_ldap_read_server_params as well as DB
option parsing.  Since the new DB option helper uses isspace instead
of isblank, we no longer require portability goop for isblank.

12 years agoMake kproplog handle underfull iprop logs
Greg Hudson [Fri, 25 Jan 2013 23:59:09 +0000 (18:59 -0500)] 
Make kproplog handle underfull iprop logs

kproplog currently assumes that an iprop log is full once it has
circled--which is true right now but will need to change for
hierarchical slaves.  Avoid this assumption by using the correct
index modulus in print_update whether or not the log is full.

Based on a patch from Richard Basch <basch@alum.mit.edu>.

12 years agoCheck for negative poll timeout in k5_sendto_kdc
Greg Hudson [Fri, 25 Jan 2013 18:11:27 +0000 (13:11 -0500)] 
Check for negative poll timeout in k5_sendto_kdc

ticket: 7553
target_version: 1.11.1
tags: pullup

12 years agoQuiet kpropd.c signed/unsigned comparison warnings
Nicolas Williams [Thu, 25 Oct 2012 17:36:26 +0000 (12:36 -0500)] 
Quiet kpropd.c signed/unsigned comparison warnings

[ghudson@mit.edu: simplify slightly]

12 years agoAdjust kdb5.c check for ulog being mapped
Greg Hudson [Thu, 24 Jan 2013 18:13:36 +0000 (13:13 -0500)] 
Adjust kdb5.c check for ulog being mapped

Check the ulog pointer, which is a little more direct, rather than the
ulogfd field.  (ulogfd is currently initialized to 0 prior to
ulog_map; we could fix that instead, but this feels simpler.)

12 years agoRemove ulog_check(); the ulog is not a DB journal
Nicolas Williams [Thu, 25 Oct 2012 23:26:10 +0000 (18:26 -0500)] 
Remove ulog_check(); the ulog is not a DB journal

The db2 DB is not power-fail safe.  There's no point trying to
replay an incompletely committed entry from the ulog at kadmind
startup time.  For that matter, even if the db2 DB was power-fail
safe there'd be no point replaying an uncommitted entry from the
ulog as the libkadm5srv app (nor any client of it, as in the case of
kadmind) will not have received any notice of success -- it'd be
wrong to complete that operation later when the user thought it'd
failed.

[ghudson@mit.edu: merge with master, adjust comment]

ticket: 7552 (new)

12 years agoPropagate policy changes over iprop via full dump
Greg Hudson [Wed, 23 Jan 2013 03:29:30 +0000 (22:29 -0500)] 
Propagate policy changes over iprop via full dump

Since iprop cannot carry policy changes, force a full resync to happen
each time a policy change occurs.  Based on a patch from
Richard Basch <basch@alum.mit.edu>.

ticket: 7522

12 years agoVerify iprop test results more thoroughly
Greg Hudson [Wed, 23 Jan 2013 03:12:51 +0000 (22:12 -0500)] 
Verify iprop test results more thoroughly

In k5test.py, allow run_kadminl to take an environment argument.  In
t_iprop.py, perform some queries on the slaves after each propagation
to spot-check that it got modifications from master.  Use a helper
function to check serial numbers for conciseness.

12 years agoFix iprop log reinitialization
Greg Hudson [Tue, 22 Jan 2013 22:42:37 +0000 (17:42 -0500)] 
Fix iprop log reinitialization

If the master iprop log is reinitialized to serial number 0, slaves
will need to take a full dump--but after that happens, we need to know
whether the slave has taken that full dump, we we don't offering full
dumps indefinitely.

So, record a timestamp in kdb_last_time when we reinitialize the log
header, and compare the slave timestamp to kdb_last_time whenever it
has the current serial number, even if it's 0.  Test this by
performing a propagation with sno 0 in t_iprop.py and detecting
whether kpropd gets a second UPDATE_FULL_RESYNC_NEEDED response from
kadmind.

ticket: 7550 (new)

12 years agoModernize style of kdb_log.c
Greg Hudson [Tue, 22 Jan 2013 06:42:31 +0000 (01:42 -0500)] 
Modernize style of kdb_log.c

ulog_get_entries had an unreachable branch which was removed during
de-indentation.

12 years agoClean up iprop flow control in kdb5.c
Greg Hudson [Fri, 18 Jan 2013 07:01:55 +0000 (02:01 -0500)] 
Clean up iprop flow control in kdb5.c

Add a helper predicate to determine whether to log operations.  In the
predicate, check if the ulog is actually mapped.  Use a single cleanup
label in krb5_db_put_principal.  Use a cleanup label in
krb5_db_delete_principal instead of releasing resources individually
at each exit point.  Avoid locking and unlocking the ulog if we're not
logging (although it would be a no-op).

Based on a patch from Nico Williams <nico@cryptonector.com>.

12 years agoFix iprop safety net in kdb5_util load
Greg Hudson [Thu, 17 Jan 2013 17:49:57 +0000 (12:49 -0500)] 
Fix iprop safety net in kdb5_util load

The error message was missing a newline, and the exit behavior causes
the database to be destroyed.

ticket: 7370
target_version: 1.11.1
tags: pullup

12 years agoRevert previous ("Sphinx doc: consolidate...")
Tom Yu [Wed, 16 Jan 2013 22:45:41 +0000 (17:45 -0500)] 
Revert previous ("Sphinx doc: consolidate...")

This reverts commit 87634edc472cebde4a37d002b7006ed38a1b25c2.

That commit is not neutral with respect to the rendering of the HTML,
and causes the version built with the logo to look unacceptably
disordered.

12 years agoSphinx doc: consolidate style markup in kerb.css
Zhanna Tsitkov [Wed, 16 Jan 2013 20:38:31 +0000 (15:38 -0500)] 
Sphinx doc: consolidate style markup in kerb.css

12 years agoGet rid of krb5_read_realm_params
Greg Hudson [Wed, 16 Jan 2013 16:38:55 +0000 (11:38 -0500)] 
Get rid of krb5_read_realm_params

Read realm parameters directly from the profile in the KDC's
init_realm(), getting rid of the intermediate krb5_realm_params
structure.  Then get rid of krb5_realm_params and
krb5_read_realm_params, since nothing else uses it.

12 years agoRemove KDC macros for realm config fields
Greg Hudson [Sun, 13 Jan 2013 15:54:37 +0000 (10:54 -0500)] 
Remove KDC macros for realm config fields

Stop using macros to refer to kdc_realm_t fields, as they could
conflict with structure field names for the same.  Leave behind the
kdc_context and tgs_server macros for now.

12 years agoRemove unused krb5_realm_params fields
Greg Hudson [Tue, 15 Jan 2013 13:43:10 +0000 (08:43 -0500)] 
Remove unused krb5_realm_params fields

krb5_realm_params is only consumed by the KDC (everything else uses
kadm5_config_params), so only needs to contain fields used by the KDC.
Get rid of everything else.  Also get rid of realm_profile, which is
read in by KDC code but never used (and was never set anyway).

12 years agoHelp Sphinx to diff C-types for better x-reference
Zhanna Tsitkov [Mon, 14 Jan 2013 18:54:25 +0000 (13:54 -0500)] 
Help Sphinx to diff C-types for better x-reference

In some cases Doxygen xml output does not provide accurate classification
of the various C-types, thus preventing the full documentation x-referencing.
Give some hints to the Doxy/RST bridge.

12 years agoCorrect typo in krb5_responder_context_st descr
Zhanna Tsitkov [Mon, 14 Jan 2013 18:46:05 +0000 (13:46 -0500)] 
Correct typo in krb5_responder_context_st descr

responder_get_challenge() meant to be krb5_responder_get_challenge()

12 years agoClean up style of alt_prof.c
Greg Hudson [Sat, 12 Jan 2013 05:21:07 +0000 (00:21 -0500)] 
Clean up style of alt_prof.c

Get rid of K&R-style function headers, format code and comments
consistently according to current conventions, rename some variables
using idiomatic names, and de-indent some nested control blocks.

12 years agoFlesh out responder context doxygen markup
Greg Hudson [Sat, 12 Jan 2013 04:55:07 +0000 (23:55 -0500)] 
Flesh out responder context doxygen markup

12 years agoUse [out] more sparingly in doxygen markup
Greg Hudson [Fri, 11 Jan 2013 23:32:55 +0000 (18:32 -0500)] 
Use [out] more sparingly in doxygen markup

In krb5.hin doxygen markup, only use [out] or [in,out] when a function
changes the entire value of what the parameter points to, not when the
function mutates a larger object (especially an abstract object).

Also remove a couple of incorrect [in] annotations, change a few
parameter descriptions to be more consistent, and fix one typo.

12 years agoModify rst toolkit to handle "linebreak" tag
Zhanna Tsitkov [Fri, 11 Jan 2013 22:17:21 +0000 (17:17 -0500)] 
Modify rst toolkit to handle "linebreak" tag

12 years agoBetter doxygen markup for RESPONDER_QUESTION_OTP
Zhanna Tsitkov [Fri, 11 Jan 2013 20:40:28 +0000 (15:40 -0500)] 
Better doxygen markup for RESPONDER_QUESTION_OTP

Doxygen and, consequently, Sphinx gets confused with the
KRB5_RESPONDER_QUESTION_OTP comment layout.
Also, mark the output parameter of krb5_responder_set_answer().

12 years agoFix label conflicts in Sphinx documentation
Zhanna Tsitkov [Fri, 11 Jan 2013 20:22:23 +0000 (15:22 -0500)] 
Fix label conflicts in Sphinx documentation

12 years agoUpdate copyright year in prototype sources
Ben Kaduk [Fri, 11 Jan 2013 20:14:02 +0000 (15:14 -0500)] 
Update copyright year in prototype sources

12 years agoSimplify KDC host referral code
Greg Hudson [Fri, 11 Jan 2013 18:26:37 +0000 (13:26 -0500)] 
Simplify KDC host referral code

Remove some unnecessary optimizations to reduce code complexity.  Get
rid of krb5_match_config_pattern in favor of a simpler helper function
in do_tgs_req_c.  Get rid of KRB5_CONF_ASTERISK and just use "*"
instead.  Use a helper function to combine [kdcdefaults] and realm
subsection values of variables, and don't bother adding leading and
trailing spaces.  Consistently use the names "hostbased" and
"no_referral" to refer to variable values (with a "realm_" prefix for
structures which currently use it).

12 years agoTest multi-value host referral variables
Greg Hudson [Fri, 11 Jan 2013 18:15:43 +0000 (13:15 -0500)] 
Test multi-value host referral variables

host_based_services and no_host_referral are allowed to have multiple
relations in each place they appear, so alter a couple of the test
cases to exercise that.

12 years agoRemove manual kdc_realm tests
Greg Hudson [Fri, 11 Jan 2013 17:27:36 +0000 (12:27 -0500)] 
Remove manual kdc_realm tests

12 years agoTest KDC host-based referral support
Greg Hudson [Fri, 11 Jan 2013 17:25:56 +0000 (12:25 -0500)] 
Test KDC host-based referral support

Test the KDC host-based referral support in t_referral.py, using a new
harness to call krb5_get_credentials with a specified server name
type.  Also use this new harness for the #7483 regression test, to
avoid relying on an undocumented kvno extension.

12 years agoAdd k5test support for KDC special environments
Greg Hudson [Fri, 11 Jan 2013 17:17:12 +0000 (12:17 -0500)] 
Add k5test support for KDC special environments

Accept environment parameters in the K5Realm start_kdc and
start_kadmind methods, so that krb5kdc or kadmind can be started or
restarted with a modified configuration.

12 years agoClean up k5_locate_server error handling
Greg Hudson [Fri, 11 Jan 2013 17:06:37 +0000 (12:06 -0500)] 
Clean up k5_locate_server error handling

profile_get_values() cannot return success with an empty list of
values, so don't bother counting them.  Return 0 from
locate_srv_conf_1 if no profile values exist and from
dns_locate_server if we decide not to make a SRV query.  Adjust
k5_locate_server to match the new helper behavior, and return
KRB5_REALM_UNKNOWN if neither profile nor DNS come up with any answers
(not KRB5_REALM_CANT_RESOLVE, which doesn't make sense now that we're
deferring KDC hostname resolution).

12 years agoFix no_host_referral concatention in KDC
Greg Hudson [Fri, 11 Jan 2013 15:13:25 +0000 (10:13 -0500)] 
Fix no_host_referral concatention in KDC

If no_host_referral is set in both [kdcdefaults] and the realm
subsection, we're supposed to concatenate their values.  But the logic
in handle_referral_params would overwrite the value with the
non-concatenated realm value.  Similar bugs of this nature were fixed
in 639c9d0f5a7c68dc98a2a452abc05ca32443cddf (r22037) but this one was
missed.

ticket: 7539 (new)
target_version: 1.11.1
tags: pullup

12 years agoUpdate the Copyright year to 2012-2013
Zhanna Tsitkov [Fri, 11 Jan 2013 15:58:26 +0000 (10:58 -0500)] 
Update the Copyright year to 2012-2013

12 years agoGet rid of adm.h
Greg Hudson [Thu, 10 Jan 2013 17:43:57 +0000 (12:43 -0500)] 
Get rid of adm.h

adm.h predates the ovsec kadm5 integration.  It contains a bunch of
obsolete defines and a redundant definition of krb5_realm_params.  Get
rid of it, and include <kadm5/admin.h> where we currently include it.

12 years agoReconfigure MIT Kerb Features doc: dont use tables
Zhanna Tsitkov [Thu, 10 Jan 2013 18:53:41 +0000 (13:53 -0500)] 
Reconfigure MIT Kerb Features doc: dont use tables

Also, update references to the existing documents.

12 years agomake depend
Greg Hudson [Thu, 10 Jan 2013 17:46:26 +0000 (12:46 -0500)] 
make depend

Mostly this gets rid of the trailing space on line 2 after
bb76891f5386526bdf91bc790c614fc9296cb5fa.

12 years agoFold kadm5 internal policy functions into callers
Greg Hudson [Wed, 9 Jan 2013 07:07:05 +0000 (02:07 -0500)] 
Fold kadm5 internal policy functions into callers

kadm5_create_policy and kadm5_modify_policy had _internal variants in
libkadm5srv (but not libkadm5clnt) which only existed to protect the
policy_refcnt field from modification over the wire.  Now that
policy_refcnt is no longer used, we don't need the separation.

Bump the library soname since this is technically an ABI change.

12 years agoTest more policy features
Greg Hudson [Wed, 9 Jan 2013 00:57:41 +0000 (19:57 -0500)] 
Test more policy features

Add tests to t_policy.py for password quality enforcement, password
history (apart from the existing #7099 regression test), and for
references to nonexistent policies.

12 years agoConsolidate policy tests into t_policy.py
Greg Hudson [Tue, 8 Jan 2013 20:32:39 +0000 (15:32 -0500)] 
Consolidate policy tests into t_policy.py

Create a combined script for policy-related tests, and fold in the
existing lockout, password history, and allowed-keysalts tests.

12 years agoAllow principals to refer to nonexistent policies
Greg Hudson [Tue, 8 Jan 2013 20:20:45 +0000 (15:20 -0500)] 
Allow principals to refer to nonexistent policies

Stop using and maintaining the policy_refcnt field, and do not try to
prevent deletion of a policy which is still referenced by principals.
Instead, allow principals to refer to policy names which do not exist
as policy objects; treat those principals as having no associated
policy.

In the kadmin client, warn if addprinc or modprinc tries to reference
a policy which doesn't exist, since the server will no longer error
out in this case.

ticket: 7385

12 years agoStop loading policy for pw_expiration in LDAP
Greg Hudson [Mon, 7 Jan 2013 20:22:26 +0000 (15:22 -0500)] 
Stop loading policy for pw_expiration in LDAP

populate_krb5_db_entry() performs a subsidiary LDAP search to load the
password policy, which it uses to update the pw_expiration field.
This has some minimal value (it causes pw_expiration values in
principals to auto-update whenever the pw_max_life field of a policy
changes), but it's complicated, expensive, and inconsistent with the
DB2 back end.  Get rid of it.

ticket: 7535 (new)

12 years agoRename ccache configuration macros
Zhanna Tsitkov [Wed, 9 Jan 2013 17:03:13 +0000 (12:03 -0500)] 
Rename ccache configuration macros

KRB5_CONF_ prefix should be used for the krb5/kdc.conf parameters.
Use KRB5_CC_CONF_ prefix for cache configuration variables.

12 years agoUpdate release numbers, refs in feature list doc
Zhanna Tsitkov [Wed, 9 Jan 2013 15:36:12 +0000 (10:36 -0500)] 
Update release numbers, refs in feature list doc

At the moment the latest release number is 1.11 and the  supported releases
are 1.10 and 1.9.
Also, update some references to the documents and fix typos.

12 years agoIn MIT feature list doc update release number,refs
Zhanna Tsitkov [Tue, 8 Jan 2013 22:13:50 +0000 (17:13 -0500)] 
In MIT feature list doc update release number,refs

12 years agoError on void pointer arithmetic with gcc
Greg Hudson [Wed, 9 Jan 2013 15:21:00 +0000 (10:21 -0500)] 
Error on void pointer arithmetic with gcc

Add -Werror=pointer-arith to the gcc warning flags.  The equivalent
was added to the Solaris compiler flags in
2dc1ef4078acd7ca463a8eee2ef20de54e672f37 (r21886).

12 years agoFix void pointer arithmetic in oid_ops.c
Greg Hudson [Wed, 9 Jan 2013 15:07:27 +0000 (10:07 -0500)] 
Fix void pointer arithmetic in oid_ops.c

When asserting that out has advanced the expected number of bytes in
generic_gss_str_to_oid, avoid adding to oid->elements, which is a void
pointer.  Instead subtract from out and compare.

ticket: 7524

12 years agoDocument "first introduced version" in conf files
Zhanna Tsitkov [Mon, 7 Jan 2013 19:52:37 +0000 (14:52 -0500)] 
Document "first introduced version" in conf files

For the config options that were introduced starting from release 1.9,
specify the release number.

12 years agoFix various result checks
Nickolai Zeldovich [Mon, 7 Jan 2013 06:37:19 +0000 (01:37 -0500)] 
Fix various result checks

Correct three cases where the wrong expression was checked to see if
an allocation function returned null.

[ghudson@mit.edu: commit message, patch splitting]

ticket: 7534
target_version: 1.11.1
tags: pullup

12 years agoFix initial call to svcraw_create
Nickolai Zeldovich [Mon, 7 Jan 2013 06:33:15 +0000 (01:33 -0500)] 
Fix initial call to svcraw_create

gssrpc raw services could not work because svcraw_create did not set
svcraw_private after allocating memory for it.

[ghudson@mit.edu: commit message, patch splitting]

ticket: 7534

12 years agoInstall pkg-config data files
Greg Hudson [Thu, 3 Jan 2013 18:47:01 +0000 (13:47 -0500)] 
Install pkg-config data files

Add seven data files for pkg-config, corresponding to the five modules
supported by krb5-config.  For krb5 and krb5-gssapi, we also provide
mit- versions for callers desiring to distinguish between our
implementation and Heimdal's.

Based on a patch from Stef Walter <stefw@gnome.org>.

ticket: 7529 (new)

12 years agoMove krb5-config to new src/build-tools directory
Greg Hudson [Thu, 3 Jan 2013 16:07:15 +0000 (11:07 -0500)] 
Move krb5-config to new src/build-tools directory

In preparation for adding a bunch of pkg-config data files, move
krb5-config into a new source tree subdirectory containing tools we
provide as outputs to other build systems.

12 years agoFix gss_str_to_oid and gss_oid_to_str edge cases
Greg Hudson [Tue, 1 Jan 2013 05:23:43 +0000 (00:23 -0500)] 
Fix gss_str_to_oid and gss_oid_to_str edge cases

Neither function correctly handled OIDs whose second arc exceeds 47
(theoretically possible if the first arc is 2).  gss_str_to_oid had
additional problems: it used scanf, it didn't consistently protect
against read overrun if the input buffer wasn't null-terminated, and
it could get confused by + or - characters in the first two arcs.  Fix
gss_oid_to_str and rewrite gss_str_to_oid.

Also add a test program.

ticket: 7524 (new)

12 years agoFix a small memory leak in util_errmap
Greg Hudson [Mon, 31 Dec 2012 22:21:46 +0000 (17:21 -0500)] 
Fix a small memory leak in util_errmap

Calls to gssint_mecherrmap_map_errcode would result in calling
mecherror_copy with a zero-length mech OID, which would result in an
OID with 0 for length and malloc(0) for elements.  On platforms which
return non-null from malloc(0), gssint_mecherrmap_destroy() wouldn't
free the elements pointer.

Avoid calling malloc(0) and don't use the length field to decide
whether to free an elements pointer.

12 years agoFix gss_str_to_oid for OIDs with zero-valued arcs
Luke Howard [Sun, 30 Dec 2012 15:36:25 +0000 (10:36 -0500)] 
Fix gss_str_to_oid for OIDs with zero-valued arcs

gss_str_to_oid wasn't outputting any bytes for a zero-valued arc.  It
should output one byte with value 0.

[ghudson@mit.edu: commit message]

ticket: 7523 (new)
target_version: 1.11.1
tags: pullup

12 years agoFix DPRINT in ipropd_svc.c
Guillaume Rousse [Tue, 1 Jan 2013 06:40:34 +0000 (01:40 -0500)] 
Fix DPRINT in ipropd_svc.c

cea0b28045b262b1098f17f17f78b2efbf89a6c1 contained an incorrect
definition of DPRINT.  Fix it.

[ghudson@mit.edu: commit message]

ticket: 7525 (new)
target_version: 1.11.1
tags: pullup

12 years agoDelete timestamp_to_sfstring sprintf fallback
Tom Yu [Fri, 21 Dec 2012 21:07:28 +0000 (16:07 -0500)] 
Delete timestamp_to_sfstring sprintf fallback

The final fallback for krb5_timestamp_to_sfstring() is an explicit
European date-order format string passed to sprintf().  This can be
confused with a conventional US date format.  Because we attempt to
build a strftime() replacement anyway, and we try passing some
unambiguous ISO 8601 date and time formats to strftime(), remove this
final fallback.

ticket: 7518 (new)

12 years agoAdd more formats to krb5_timestamp_to_sfstring
Tom Yu [Fri, 21 Dec 2012 20:45:53 +0000 (15:45 -0500)] 
Add more formats to krb5_timestamp_to_sfstring

krb5_timestamp_to_string() can produce ambiguous dates.  The final
fallback, "%d/%m/%Y %R", contains a European order date format that
can be confused with a US date format.  Add some additional strftime()
format strings, including locale-dependent formats and some ISO 8601
formats.  Remove the hardcoded strftime() format that had an ambiguous
date order.

ticket: 7458
target_version: 1.11
tags: pullup

12 years agoUse krb5_init_creds_context as clpreauth rock
Greg Hudson [Fri, 21 Dec 2012 17:20:43 +0000 (12:20 -0500)] 
Use krb5_init_creds_context as clpreauth rock

The clpreauth rock had become a collection of alias pointers into the
init_creds context structure.  Get rid of it and just pass the context
(suitably casted) to clpreauth modules.  Simplify the signatures of
k5_preauth(), k5_preauth_tryagain(), process_pa_data(), and
fill_response_items() by referencing fields from the init_creds
context.

Since we can't use the non-nullity of rock->selected_preauth_type to
determine whether to record the selected preauth type, k5_preauth now
reports it in an output parameter, and get_in_tkt.c decides whether or
not to record it.

12 years agoInitialize ret in process_pa_data
Greg Hudson [Fri, 21 Dec 2012 21:18:34 +0000 (16:18 -0500)] 
Initialize ret in process_pa_data

If the for loop never consults any preauth modules and must_preauth is
false, we might never set ret, so we need to initialize it.  The bug
was introduced in 5c23bce0e8d3328bb36bc85ee10cfac486b8ae9b and is
detected by some versions of gcc with -O2.

12 years agoFix signed overflow check in k5_ucs2s_to_utf8s
Greg Hudson [Thu, 20 Dec 2012 19:20:37 +0000 (14:20 -0500)] 
Fix signed overflow check in k5_ucs2s_to_utf8s

Signed overflow must be checked before it happens, since modern
versions of gcc will optimize out checks of the result.  Reported by
Nickolai Zeldovich <nickolai@csail.mit.edu>.

ticket: 7511

12 years agoRemove inoperative null checks in KDC code
Greg Hudson [Thu, 20 Dec 2012 19:19:16 +0000 (14:19 -0500)] 
Remove inoperative null checks in KDC code

In prepare_error_tgs, kdc_free_rstate, and kdc_fast_handle_error,
remove unnecessary null checks.  The callers avoid passing null
states, and in each case we've already dereferenced the pointer
earlier.  Reported by Nickolai Zeldovich <nickolai@csail.mit.edu>.

ticket: 7511

12 years agoAvoid null dereference in BDB dbtree error case
Greg Hudson [Thu, 20 Dec 2012 19:17:45 +0000 (14:17 -0500)] 
Avoid null dereference in BDB dbtree error case

An error case in __bt_first would deference a null pointer.  This is
an old upstream BDB bug.  Use a separate variable to hold the result
of mpool_get() until it has been checked.  Reported by Nickolai
Zeldovich <nickolai@csail.mit.edu>.

ticket: 7511

12 years agoFix clntraw_create initialization
Greg Hudson [Thu, 20 Dec 2012 19:00:37 +0000 (14:00 -0500)] 
Fix clntraw_create initialization

clntraw_create has been broken since inception; on the first call, it
would compute invalid values of xdrs and client and dereference them.
Fix that.  (This is pretty strong evidence that no one has ever used
it.)  Reported by Nickolai Zeldovich <nickolai@csail.mit.edu>.

ticket: 7511

12 years agoSimplify k5test.py environments
Greg Hudson [Sun, 16 Dec 2012 21:55:29 +0000 (16:55 -0500)] 
Simplify k5test.py environments

The initial k5test.py design, copied from the dejagnu suite, is to
create config files and environments for four expected roles: client,
server, master, and slave.  This approach exaggerates the complexity
of the common case, where the configurations don't need to vary, and
limits us to having just one slave for kprop/iprop tests.

Instead, create just one configuration by default, and add a
special_env() method which sets up a differently configured
environment for the few test cases which need one.  The run_as_*()
methods are collapsed into just run(), which accepts an optional
argument for the environment returned by special_env().

12 years agoGet rid of KRB5_KDB_SRV_TYPE_PASSWD
Greg Hudson [Mon, 19 Nov 2012 04:48:59 +0000 (23:48 -0500)] 
Get rid of KRB5_KDB_SRV_TYPE_PASSWD

Nothing was using KRB5_KDB_SRV_TYPE_PASSWD, so get rid of it.
(kpasswdd is part of kadmind and interacts with the KDB using
KRB5_KDB_SRV_TYPE_ADMIN.)

12 years agoGenerate dependencies for kdb5_ldap_util
Greg Hudson [Sun, 18 Nov 2012 20:58:05 +0000 (15:58 -0500)] 
Generate dependencies for kdb5_ldap_util

12 years agoRemove LDAP realm krbTicketPolicyReference code
Greg Hudson [Sun, 18 Nov 2012 20:48:08 +0000 (15:48 -0500)] 
Remove LDAP realm krbTicketPolicyReference code

ldap_realm.c had some code intended to handle a
krbTicketPolicyReference from a krbRealmContainer object, but there
wasn't enough of it to ever do anything.  Remove it.

12 years agoSimplify LDAP KDB module container DN handling
Greg Hudson [Sun, 18 Nov 2012 18:59:48 +0000 (13:59 -0500)] 
Simplify LDAP KDB module container DN handling

Outside of krb5_ldap_read_krbcontainer_params and
krb5_ldap_create_krbcontainer, no fields of
krb5_ldap_krbcontainer_params were used except for the DN.  There was
code to create a krbTicketPolicyReference attribute (which would fail
because the schema doesn't allow that attribute, and was never
exercised because kdb5_ldap_util would never set the parameter) and to
read fields like max ticket life from the referenced ticket policy,
but those fields were never used.

Eliminate the structure and just store the container DN in
krb5_ldap_context.  Continue creating the container object when
creating a realm (by calling krb5_ldap_create_krbcontainer
unconditionally; it now exits successfully if the container already
exists), but don't ever read it.

12 years agoRemove unneeded code in krb5_ldap_put_principal
Greg Hudson [Sun, 18 Nov 2012 01:24:11 +0000 (20:24 -0500)] 
Remove unneeded code in krb5_ldap_put_principal

krb5_ldap_put_principal contained some conditionals for the case where
entry->princ is NULL, but only after entry->princ was dereferenced
unconditionally.  It's not necessary to handle this case, so don't.

12 years agoRemove unused functions in the LDAP KDB module
Greg Hudson [Sun, 18 Nov 2012 01:19:43 +0000 (20:19 -0500)] 
Remove unused functions in the LDAP KDB module

12 years agoDon't output trailing whitespace in depfix.pl
Greg Hudson [Thu, 20 Dec 2012 16:27:49 +0000 (11:27 -0500)] 
Don't output trailing whitespace in depfix.pl

All of our deps files have a trailing space in the first line,
originating from depfix.pl.  This space triggers the whitespace
checker when generating a new deps file.  Get rid of the trailing
whitespace in the script; the change will be reflected in the deps
files the next time they are regenerated.

12 years agoPass through module errors when preauthenticating
Greg Hudson [Sun, 28 Oct 2012 15:31:37 +0000 (11:31 -0400)] 
Pass through module errors when preauthenticating

If we are responding to a KDC_ERR_PREAUTH_REQUIRED and cannot
preauthenticate, report the error from the first real preauth type we
tried.

k5_preauth() now accepts a boolean input indicating that it must
succeed on a real preauth type, instead of returning a boolean saying
whether or not it did.

ticket: 7517 (new)

12 years agoRename internal preauth functions
Greg Hudson [Sat, 27 Oct 2012 19:29:48 +0000 (15:29 -0400)] 
Rename internal preauth functions

The preauth functions are internal to libkrb5, so use the k5_ prefix,
don't use KRB5_CALLCONV, and prototype them in int-proto.h.  Also
remove krb5_do_preauth from the Unix libkrb5 export list.

Reorder the k5_preauth() and k5_preauth_tryagain() arguments for more
consistency with the clpreauth interface, and put the output padata
arguments at the end.

Rename any remaining uses of "kcontext" to "context" in preauth2.c.

12 years agoMake clpreauth flags function optional
Greg Hudson [Sat, 27 Oct 2012 15:55:36 +0000 (11:55 -0400)] 
Make clpreauth flags function optional

With one exception (KRB5_PADATA_PKINIT_KX), every padata type
processed by a clpreauth module is now a real preauthentication type.
Reduce the amount of boilerplate required for a clpreauth module by
making the flags method optional if all of the preauth types
advertised by the module are real.

12 years agoUse a proper consumer interface for clpreauth
Greg Hudson [Tue, 23 Oct 2012 17:02:12 +0000 (13:02 -0400)] 
Use a proper consumer interface for clpreauth

In preauth2.c, use wrapper functions for calls to clpreauth functions.
Get rid of the expanded-out module table, instead using a helper
function to find the handle for a preauth type.  Replace use counts
with a list of previously processed pa types.  Check for pa type
conflicts when loading clpreauth modules.

12 years agoSeparate clpreauth and kdcpreauth interfaces
Greg Hudson [Sun, 21 Oct 2012 23:37:14 +0000 (19:37 -0400)] 
Separate clpreauth and kdcpreauth interfaces

Since there is no overlap between the clpreauth and kdcpreauth
interface declarations, there's no particular reason to combine them
into one header.  For backward compatibility and convenience, leave
behind a preauth_plugin.h which includes both.

12 years agoSave extended messages across fallback to master
Greg Hudson [Sun, 21 Oct 2012 20:14:59 +0000 (16:14 -0400)] 
Save extended messages across fallback to master

In krb5_get_init_creds_password and krb5_get_init_creds_keytab, save
the extended error before retrying against the master KDC, and restore
that state if returning the error from the original request.

12 years agoAdd functions to save and restore error state
Greg Hudson [Sun, 21 Oct 2012 04:49:05 +0000 (00:49 -0400)] 
Add functions to save and restore error state

12 years agoSimplify error message retrieval
Greg Hudson [Sun, 21 Oct 2012 00:16:19 +0000 (20:16 -0400)] 
Simplify error message retrieval

Eliminate the scratch_buf field of struct error_info and just return a
non-localized constant error message if we can't allocate a copy of
the real one.  Also rely on a conformant strerror().

12 years agoStyle cleanup for internal error handling
Greg Hudson [Sat, 20 Oct 2012 20:52:29 +0000 (16:52 -0400)] 
Style cleanup for internal error handling

Fix style issues in kerrs.c and errors.c.  Rename error handling
functions to use shorter k5_ prefix.  Eliminate an inoperable
krb5int_set_error() call in gic_opte_alloc and convert the other
call to use krb5_set_error_message().