]> git.ipfire.org Git - thirdparty/krb5.git/log
thirdparty/krb5.git
12 years agoFix a memory leak in krb5_get_init_creds_keytab
Greg Hudson [Thu, 28 Feb 2013 23:55:31 +0000 (18:55 -0500)] 
Fix a memory leak in krb5_get_init_creds_keytab

lookup_etypes_for_keytab was not freeing the keytab entries it
iterated over.  Reported by nalin@redhat.com.

ticket: 7586
target_version: 1.11.2
tags: pullup

12 years agoAdd krb5_free_enctypes API
Greg Hudson [Wed, 27 Feb 2013 22:29:16 +0000 (17:29 -0500)] 
Add krb5_free_enctypes API

Rename krb5_free_ktypes to krb5_free_enctypes and add it to the public
API.

ticket: 7584

12 years agoAdd missing .gitignore entries and clean rules
Greg Hudson [Wed, 27 Feb 2013 21:33:28 +0000 (16:33 -0500)] 
Add missing .gitignore entries and clean rules

ticket: 7585

12 years agoFix windows build
Ben Kaduk [Mon, 25 Feb 2013 18:12:33 +0000 (13:12 -0500)] 
Fix windows build

Catch up to the split of preauth_plugin.h into client and
kdc specific portions.  While here, use copy's /y flag to suppress
an override-confirmation prompt (though we do not list any dependencies
for this target at the moment, so no such prompt will be generated).

Do not disable library finalizers for windows, erroneously disabled
in 4538146e1452e0966164119cefb0804993ce6bbb.

12 years agoUpdate acknowledgments in README
Tom Yu [Thu, 21 Feb 2013 19:38:58 +0000 (14:38 -0500)] 
Update acknowledgments in README

Also update copyright years.

12 years agoFix fd leak in DIR ccache cursor function
Greg Hudson [Thu, 21 Feb 2013 17:36:07 +0000 (12:36 -0500)] 
Fix fd leak in DIR ccache cursor function

If dcc_ptcursor_next reached the end of a directory, it called free()
on the directory handle instead of closedir(), causing the directory
fd to be leaked.  Call closedir() instead.

ticket: 7573
target_version: 1.11.1
tags: pullup

12 years agoFix memory leak closing DIR ccaches
Greg Hudson [Wed, 20 Feb 2013 17:06:12 +0000 (12:06 -0500)] 
Fix memory leak closing DIR ccaches

A ccache type's close function is supposed to free the cache container
as well as the type-specific data.  dcc_close was not doing so,
causing a small memory leak each time a ccache is created or
destroyed.

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

12 years agoAllow multi-hop SAM-2 exchanges
Greg Hudson [Sun, 17 Feb 2013 17:44:45 +0000 (12:44 -0500)] 
Allow multi-hop SAM-2 exchanges

Prior to 1.11, it was possible to do SAM-2 preauth exchanges with
multiple hops by sending repeated preauth-required errors with
different challenges (which is not the way multi-hop exchanges are
described in RFC 6113, but it can still work).  This stopped working
when SAM-2 was converted to a built-in module.  Make it work again.

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

12 years agoCleaner fix for #7570
Ben Kaduk [Fri, 15 Feb 2013 16:41:27 +0000 (11:41 -0500)] 
Cleaner fix for #7570

Remove variables and labels which are no longer needed.

12 years agoPKINIT null pointer deref [CVE-2013-1415]
Xi Wang [Thu, 14 Feb 2013 23:17:40 +0000 (18:17 -0500)] 
PKINIT null pointer deref [CVE-2013-1415]

Don't dereference a null pointer when cleaning up.

The KDC plugin for PKINIT can dereference a null pointer when a
malformed packet causes processing to terminate early, leading to
a crash of the KDC process.  An attacker would need to have a valid
PKINIT certificate or have observed a successful PKINIT authentication,
or an unauthenticated attacker could execute the attack if anonymous
PKINIT is enabled.

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

This is a minimal commit for pullup; style fixes in a followup.
[kaduk@mit.edu: reformat and edit commit message]

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

12 years agoConvert success in krb5_chpw_result_code_string
Jonathan Reams [Fri, 15 Feb 2013 07:11:57 +0000 (02:11 -0500)] 
Convert success in krb5_chpw_result_code_string

Result code 0 used to be converted properly by krb5_set_password,
though not krb5_change_password; this changed in 1.10 when
krb5int_setpw_result_code_string was folded into
krb5_chpw_result_code_string.  Restore the old behavior, and make it
apply to krb5_change_password as well, by making
krb5_chpw_result_code_string convert result code 0.

[ghudson@mit.edu: commit message]

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

12 years agoModernize k5buf
Greg Hudson [Thu, 14 Feb 2013 16:41:10 +0000 (11:41 -0500)] 
Modernize k5buf

Rename the krb5int_buf_ family of functions to use the k5_ prefix for
brevity.  Reformat some k5buf implementation code to match current
practices.

12 years agoAdd k5_json_array_fmt and use it in export_cred.c
Greg Hudson [Tue, 12 Feb 2013 02:07:54 +0000 (21:07 -0500)] 
Add k5_json_array_fmt and use it in export_cred.c

Add a template-based array constructor for convenient marshalling of
structured values as JSON array values.  Use it to simplify
export_cred.c.

12 years agoMake internal JSON functions return error codes
Greg Hudson [Tue, 30 Oct 2012 21:17:45 +0000 (17:17 -0400)] 
Make internal JSON functions return error codes

Return error codes (0, ENOMEM, or EINVAL) from JSON support functions
instead of returning results directly.  This makes error handling
simpler for functions which assemble JSON objects and then return a
krb5_error_code values.  Adjust all callers.  Use shims in
export_cred.c to minimize changes there; it will be redesigned
internally in a subsequent commit.

12 years agoFix RFC 5587 const pointer typedefs
Greg Hudson [Tue, 12 Feb 2013 02:13:15 +0000 (21:13 -0500)] 
Fix RFC 5587 const pointer typedefs

gss_const_ctx_id_t, gss_const_cred_id_t, and gss_const_name_t are
supposed to be const pointers to the appropriate structures, not the
structures themselves.  These are not used by any prototypes yet, and
no application would have any reason to use them as they are, so it
should be safe to change them within the public header.

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

12 years agoAdd and use k5memdup, k5memdup0 helpers
Greg Hudson [Sat, 9 Feb 2013 05:43:35 +0000 (00:43 -0500)] 
Add and use k5memdup, k5memdup0 helpers

Add k5-int.h static functions to duplicate byte ranges, optionally
with a trailing zero byte, and set an error code like k5alloc does.
Use them where they would shorten existing code.

12 years agoSimplify TGS request construction
Greg Hudson [Fri, 8 Feb 2013 06:59:19 +0000 (01:59 -0500)] 
Simplify TGS request construction

Move krb5int_make_tgs_request from gc_via_tkt.c into send_tgs.c,
combine it with krb5int_make_tgs_request_ext (which nothing else
called), and rename the combined function to k5_make_tgs_req.  Also
use a typedef for the pacb callback.

12 years agoModernize send_tgs.c
Greg Hudson [Fri, 8 Feb 2013 05:18:50 +0000 (00:18 -0500)] 
Modernize send_tgs.c

Bring send_tgs.c up to date with current coding practices.  No
functional changes.

12 years agoReplace i_vector with cstate in auth context
Greg Hudson [Sun, 3 Feb 2013 19:44:22 +0000 (14:44 -0500)] 
Replace i_vector with cstate in auth context

Use a proper cipher state in the auth context structure, and free it
when the auth context is freed.  Simplify mk_priv/rd_priv accordingly.

12 years agoDesupport krb5_auth_con_setivector
Greg Hudson [Tue, 5 Feb 2013 17:43:53 +0000 (12:43 -0500)] 
Desupport krb5_auth_con_setivector

ticket: 7565 (new)

12 years agoAdd kprop Python tests
Greg Hudson [Sun, 3 Feb 2013 17:25:10 +0000 (12:25 -0500)] 
Add kprop Python tests

Create a K5Realm.kprop_port method so test scripts can invoke kprop
usefully, and create a simple Python test script exercising the same
kprop functionality as the dejagnu suite's kprop.exp.

12 years agoMake kprop/kpropd work with RC4 session key
Greg Hudson [Sun, 3 Feb 2013 18:21:34 +0000 (13:21 -0500)] 
Make kprop/kpropd work with RC4 session key

In krb5_auth_con_initivector and mk_priv/rd_priv, stop assuming that
the enctype's block size is the size of the cipher state.  Instead,
make and discard a cipher state to get the size.

ticket: 7561
target_version: 1.11.1
tags: pullup

12 years agoModernize dump.c
Greg Hudson [Tue, 5 Feb 2013 03:44:45 +0000 (22:44 -0500)] 
Modernize dump.c

Reformat and simplify dump.c code according to current coding
standards.  No functional changes except for some error messages.

12 years agoRefactor dump.c
Greg Hudson [Wed, 6 Feb 2013 19:49:09 +0000 (14:49 -0500)] 
Refactor dump.c

When dumping, use a common iterator function to unpack the dump_args
structure, unparse and filter the principal name, and convert master
keys.  Add helper functions to dump and load the "octets or -1" format
used for optional binary fields in the current dump format.

12 years agoReorder dump.c
Greg Hudson [Tue, 5 Feb 2013 05:31:23 +0000 (00:31 -0500)] 
Reorder dump.c

Without changing anything (except to make a few internal functions
static), reorder dump.c to bottom-up order so that forward function
declarations aren't needed.

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