]> git.ipfire.org Git - thirdparty/krb5.git/log
thirdparty/krb5.git
11 years agoUpdate for krb5-1.12-postrelease
Tom Yu [Wed, 11 Dec 2013 03:08:12 +0000 (22:08 -0500)] 
Update for krb5-1.12-postrelease

11 years agoUpdates for krb5-1.12 krb5-1.12-final
Tom Yu [Tue, 10 Dec 2013 21:48:54 +0000 (16:48 -0500)] 
Updates for krb5-1.12

11 years agomake depend
Tom Yu [Tue, 10 Dec 2013 21:48:14 +0000 (16:48 -0500)] 
make depend

11 years agoUpdate man pages
Tom Yu [Tue, 10 Dec 2013 17:33:07 +0000 (12:33 -0500)] 
Update man pages

11 years agoBetter keysalt docs
Tom Yu [Mon, 9 Dec 2013 20:48:02 +0000 (15:48 -0500)] 
Better keysalt docs

Add a new section to kdc_conf.rst to describe keysalt lists, and
update other documentation to better distinguish enctype lists from
keysalt lists.

(cherry picked from commit 23a75649277afc24a9dfea199689e18129fa390c)

ticket: 7608
version_fixed: 1.12
status: resolved

11 years agoFix error message quotations in install_kdc.rst
Tom Yu [Tue, 3 Dec 2013 19:47:51 +0000 (14:47 -0500)] 
Fix error message quotations in install_kdc.rst

Some error messages that kprop could print were quoted incorrectly in
install_kdc.rst.

Also fix minor typos.

(cherry picked from commit 68d7fcf11553c29a2e0c28a57896fbce4a3ef611)

ticket: 7785
version_fixed: 1.12
status: resolved

11 years agoUpdate for krb5-1.12-beta2-postrelease
Tom Yu [Wed, 27 Nov 2013 21:28:37 +0000 (16:28 -0500)] 
Update for krb5-1.12-beta2-postrelease

11 years agoUpdates for krb5-1.12-beta2 krb5-1.12-beta2
Tom Yu [Wed, 27 Nov 2013 20:54:45 +0000 (15:54 -0500)] 
Updates for krb5-1.12-beta2

11 years agoUpdate man pages
Tom Yu [Wed, 27 Nov 2013 20:54:27 +0000 (15:54 -0500)] 
Update man pages

11 years agoBump libgssrpc minor version
Tom Yu [Wed, 27 Nov 2013 20:15:14 +0000 (15:15 -0500)] 
Bump libgssrpc minor version

Bump minor version for the new log_badauth2 interfaces.

(cherry picked from commit af5f5d63efe938c568a33bfb64ba5154982d6fb2)

ticket: 7770
status: resolved

11 years agoCorrectly log IPv6 addresses in kadmind
Greg Hudson [Mon, 25 Nov 2013 16:46:47 +0000 (11:46 -0500)] 
Correctly log IPv6 addresses in kadmind

Define client_addr() in server_stubs.c and use it consistently in that
file and ipropd_svc.c to get the client address from a transport
handle.  In it, call getpeername() on the client socket and use
inet_ntop() on the result, instead of using inet_ntoa() on the IPv4
socket address.  Provide a log_badauth2 callback to GSSRPC, so that we
get a transport handle instead of an IPv4 socket address, and use
client_addr() within it instead of inet_ntoa().

(cherry picked from commit 5384f45e728957da20ecf82d8cf567945a2bbf6e)

ticket: 7770
version_fixed: 1.12
status: resolved

11 years agoAdd new versions of log_badauth gssrpc callbacks
Greg Hudson [Mon, 25 Nov 2013 16:33:35 +0000 (11:33 -0500)] 
Add new versions of log_badauth gssrpc callbacks

libgssrpc supports two callbacks for gss_accept_sec_context failures
on servers (one for AUTH_GSS and one for AUTH_GSSAPI), which are
IPv4-specific.  Provide an alternate version which supplies the
transport handle instead of the address, so that we can get the
address via the file descriptor for TCP connections.

(cherry picked from commit 4c57a429760a3b3aa89938a13708742675f9548b)

ticket: 7770

11 years agoUpdate doc for current kdb5_util dump version
Tom Yu [Fri, 22 Nov 2013 23:23:52 +0000 (18:23 -0500)] 
Update doc for current kdb5_util dump version

kdb5_util.rst incorrectly describes the current default dump format
version as 6 when it should be 7.  Reported by Jeff D'Angelo.

(cherry picked from commit f0d7309a20665ac16a22856e0c8cffdb156f2d24)

ticket: 7777
version_fixed: 1.12
status: resolved

11 years agoEdit ccache_def.rst
Greg Hudson [Fri, 22 Nov 2013 21:53:35 +0000 (16:53 -0500)] 
Edit ccache_def.rst

Re-fill to 70 columns.  Replace non-ascii apostrophes with ASCII ones.
Edit wording slightly.

(cherry picked from commit 482869d393807d02668cf49ce74666d682cf77a6)

ticket: 7776
version_fixed: 1.12
status: resolved

11 years agoAdded a new ccache doc to "Kerberos V5 concepts"
Zhanna Tsitkov [Fri, 22 Nov 2013 19:02:57 +0000 (14:02 -0500)] 
Added a new ccache doc to "Kerberos V5 concepts"

This is to add a short introductory document on credential
caches to the Concepts section of Kerberos documentation.

(cherry picked from commit 251f94621328277044e3ae1a10ecd3ddfdda1dbb)

ticket: 7776

11 years agoImprove default ccache name API documentation
Greg Hudson [Thu, 21 Nov 2013 22:30:54 +0000 (17:30 -0500)] 
Improve default ccache name API documentation

Document the lifetime and caching behavior of the
krb5_cc_default_name() return value.  Document that
krb5_cc_set_default_name() may be called with NULL to purge the cached
value.  Correct a typo in the krb5_cc_default() summary and explicitly
reference krb5_cc_default_name().

(cherry picked from commit 3e5fe754b9f9742d1c9b1564633d4172277166db)

ticket: 7775
version_fixed: 1.12
status: resolved

11 years agoCorrect kadm5.acl back-reference documentation
Greg Hudson [Thu, 21 Nov 2013 21:22:48 +0000 (16:22 -0500)] 
Correct kadm5.acl back-reference documentation

In kadm5.acl, *N in the target principal name refers to the Nth
wildcard in the acting principal pattern, not the Nth component.

(cherry picked from commit 39bac22ed7f5ff583e92d082b34f0c5a2a3cad4c)

ticket: 7774
version_fixed: 1.12
status: resolved

11 years agoClarify lockout replication issues in docs
Greg Hudson [Mon, 18 Nov 2013 23:59:17 +0000 (18:59 -0500)] 
Clarify lockout replication issues in docs

In the "KDC replication and account lockout" section of lockout.rst,
specifically call out kprop and incremental propagation as the
mechanisms which do not replicate account lockout state, and add a
note that KDCs using LDAP may not be affected by that section's
concerns.

(cherry picked from commit 8eb9e6fe1b01faa875dcf91b618ad4cd7793438a)

ticket: 7773
version_fixed: 1.12
status: resolved

11 years agoRemove dangling --with-kdc-kdb-update references
Greg Hudson [Sun, 17 Nov 2013 17:37:09 +0000 (12:37 -0500)] 
Remove dangling --with-kdc-kdb-update references

This configure option hasn't done anything since 1.8, so don't mention
it in configure --help or the documentation.  The disable_last_success
and disable_lockout DB options are now used to turn it off.

(cherry picked from commit 0b3225d63f50d4e6297be5d751cae1d3368fcdb1)

ticket: 7771 (new)
version_fixed: 1.12
status: resolved

11 years agoAdd support to store time offsets in cc_keyring
Simo Sorce [Thu, 14 Nov 2013 22:23:59 +0000 (17:23 -0500)] 
Add support to store time offsets in cc_keyring

The code follows the same model used for the memory ccache type.  Time
offsets are stored in each credential cache in a special key just like
the principal name.  Legacy session caches do not store timestamps as
legacy code would fail when iterating over the new offset key.

[ghudson@mit.edu: minor formatting changes; note legacy session
exception in commit message]

(cherry picked from commit fb4817a32d0c369049e0868468dd2eb75487630d)

ticket: 7768
version_fixed: 1.12
status: resolved

11 years agoSet expiration time on keys and keyrings
Simo Sorce [Fri, 15 Nov 2013 21:36:05 +0000 (16:36 -0500)] 
Set expiration time on keys and keyrings

By setting the timeout based on the credetial's timeout we let the
system automatically cleanup expired credentials.

[ghudson@mit.edu: simplified code slightly]

(cherry picked from commit 29e60c5b7ac0980606971afc6fd6028bcf0c7f0f)

ticket: 7769
version_fixed: 1.12
status: resolved

11 years agoEnforce minimum PBKDF2 iteration count
Tom Yu [Fri, 15 Nov 2013 21:11:32 +0000 (16:11 -0500)] 
Enforce minimum PBKDF2 iteration count

Also add a testing interface to allow weak iteration counts.
(Published test vectors use weak iteration counts.)

(cherry picked from commit 7a7736a3ea321aeb4b281ae2712e27becb00d720)

ticket: 7465
version_fixed: 1.12
status: resolved

11 years agoCatch more strtol() failures when using KEYRINGs
Nalin Dahyabhai [Mon, 11 Nov 2013 18:10:08 +0000 (13:10 -0500)] 
Catch more strtol() failures when using KEYRINGs

When parsing what should be a UID while resolving a KEYRING ccache
name, don't just depend on strtol() to set errno when the residual
that we pass to it can't be parsed as a number.  In addition to
checking errno, pass in and check the value of an "endptr".

[ghudson@mit.edu: simplified slightly]

(cherry picked from commit 5ac159e220297a8f62dd5edcec6f9b988b0627ea)

ticket: 7764
version_fixed: 1.12
status: resolved

11 years agoUpdate for krb5-1.12-beta1-postrelease
Tom Yu [Fri, 8 Nov 2013 23:16:34 +0000 (18:16 -0500)] 
Update for krb5-1.12-beta1-postrelease

11 years agoUpdates for krb5-1.12-beta1 krb5-1.12-beta1
Tom Yu [Fri, 8 Nov 2013 17:36:33 +0000 (12:36 -0500)] 
Updates for krb5-1.12-beta1

11 years agoUpdate man pages
Tom Yu [Fri, 8 Nov 2013 18:23:27 +0000 (13:23 -0500)] 
Update man pages

11 years agoClarify realm and dbmodules configuration docs
Greg Hudson [Wed, 6 Nov 2013 18:33:04 +0000 (13:33 -0500)] 
Clarify realm and dbmodules configuration docs

In kdc_conf.rst, add examples showing how to configure a realm
parameter and a database parameter.  Document that the default DB
configuration section is the realm name, and use that in the example.
Move the db_module_dir description to the end of the [dbmodules]
documentation since it is rarely used and could confuse a reader about
the usual structure of the section.

(cherry picked from commit 689d769c10c53bd4fa40e82421c89b96cc86cbae)

ticket: 7759
version_fixed: 1.12
status: resolved

12 years agoMulti-realm KDC null deref [CVE-2013-1418]
Tom Yu [Mon, 4 Nov 2013 18:44:29 +0000 (13:44 -0500)] 
Multi-realm KDC null deref [CVE-2013-1418]

If a KDC serves multiple realms, certain requests can cause
setup_server_realm() to dereference a null pointer, crashing the KDC.

CVSSv2: AV:N/AC:M/Au:N/C:N/I:N/A:P/E:POC/RL:OF/RC:C

A related but more minor vulnerability requires authentication to
exploit, and is only present if a third-party KDC database module can
dereference a null pointer under certain conditions.

(cherry picked from commit 5d2d9a1abe46a2c1a8614d4672d08d9d30a5f8bf)

ticket: 7755
version_fixed: 1.12
status: resolved

12 years agoClarify kpropd standalone mode documentation
Greg Hudson [Wed, 30 Oct 2013 22:22:00 +0000 (18:22 -0400)] 
Clarify kpropd standalone mode documentation

The kpropd -S option is no longer needed to run kpropd in standalone
mode, but its functionality is not deprecated; standalone mode is
automatically activated when appropriate.  Clarify the kpropd
documentation on standalone mode to avoid giving the impression that
the mode is deprecated.

(cherry picked from commit bfec0671ca6df811453d46a2f47afc7168b980fc)

ticket: 7751
version_fixed: 1.12
status: resolved

12 years agoDocument master key rollover
Greg Hudson [Fri, 25 Oct 2013 16:30:48 +0000 (12:30 -0400)] 
Document master key rollover

Add a new section to database.rst documenting the procedure for
rolling the master key.

(cherry picked from commit e4b5d426a1e1e00367cc44a9619535ab71b20393)

ticket: 7732
version_fixed: 1.12
status: resolved

12 years agoImprove LDAP KDB initialization error messages
Greg Hudson [Mon, 28 Oct 2013 15:23:11 +0000 (11:23 -0400)] 
Improve LDAP KDB initialization error messages

In krb5_ldap_initialize, don't just blat the LDAP error into the
extended message; give an indication of which LDAP operation we were
trying to do and show what parameters we gave to it.

(Also, krb5_set_error_message can handle a null context argument, so
don't bother to check before calling.)

(cherry picked from commit 5a77bb85294f37d1dfa4c7faedfdfb0d7faaf8dc)

ticket: 7739
version_fixed: 1.12
status: resolved

12 years agoUse correct default principal for kadmin -n
Greg Hudson [Mon, 28 Oct 2013 17:33:05 +0000 (13:33 -0400)] 
Use correct default principal for kadmin -n

Use WELLKNOWN/ANONYMOUS@realm as the default principal for kadmin -n,
just like we do for kinit -n.

(cherry picked from commit a30a82abc72c2a1a8d25948fe9cd1af49eaf62ec)

ticket: 7741
version_fixed: 1.12
status: resolved

12 years agoAccept anonymous GSS names in kadmind
Greg Hudson [Mon, 28 Oct 2013 17:09:15 +0000 (13:09 -0400)] 
Accept anonymous GSS names in kadmind

The krb5 implementation of gss_display_name() reports the name type as
GSS_C_NT_ANONYMOUS if the client uses an anonymous principal.  Accept
this name type in gss_name_to_string and gss_to_krb5_name so that
anonymous kadmin can work.

Also improve code hygiene: call gss_name_to_string from
gss_to_krb5_name to reduce code repetition; use gss_oid_equal instead
of pointer comparison for name types; and don't assume that the
gss_display_name result buffer is zero-terminated.

(cherry picked from commit 664f0d779ddc0aaf54a118a98a21ce7d53d81e08)

ticket: 7740
version_fixed: 1.12
status: resolved

12 years agoFix decoding of mkey kvno in mkey_aux tl-data
Greg Hudson [Sun, 27 Oct 2013 00:17:10 +0000 (20:17 -0400)] 
Fix decoding of mkey kvno in mkey_aux tl-data

krb5_dbe_lookup_mkey_aux was decoding a 16-bit value directly into an
int, resulting in the wrong value on big-endian platforms.  The
consequences are mostly invisible because we ignore this field and try
all mkey_aux nodes in krb5_def_fetch_mkey_list.

(cherry picked from commit 64ec2941af1561ef06e7e885b2ffb65a675516ce)

ticket: 7738
version_fixed: 1.12
status: resolved

12 years agoReset key-generation parameters for each enctype
Ben Kaduk [Fri, 25 Oct 2013 18:00:29 +0000 (14:00 -0400)] 
Reset key-generation parameters for each enctype

In add_key_pwd, initialize s2k_params to NULL inside the loop over
enctypes instead of outside the loop, so that if the afs3 salt type
is used it does not contaminate later enctype/salt pairs in the list.

(cherry picked from commit 381cf01afb13ad28de0927de37f8e1d12749bf49)

ticket: 7733
version_fixed: 1.12
status: resolved

12 years agoCorrectly activate master keys in pre-1.7 KDBs
Greg Hudson [Thu, 24 Oct 2013 16:51:18 +0000 (12:51 -0400)] 
Correctly activate master keys in pre-1.7 KDBs

Starting with 1.7, databases are created with actkvno tl-data in the
K/M entry which gives the initial master key version an activation
time of 0.  A database created before 1.7 will not have this tl-data,
but we should behave in the same way as we do for a more recent
database.

Move the actkvno list synthesis code from krb5_dbe_fetch_act_key_list
to krb5_dbe_lookup_actkvno so it applies to kdb5_util commands as well
as libkadm5.  Synthesize the same list as we would have initialized
the KDB with, with an activation time of 0 for the earliest master
key.

(cherry picked from commit ec560fac83912abaa15fb158101c8174497081c5)

ticket: 7686
version_fixed: 1.12
status: resolved

12 years agoDon't cache active master key list in kadmind
Greg Hudson [Wed, 23 Oct 2013 22:56:20 +0000 (18:56 -0400)] 
Don't cache active master key list in kadmind

"kdb5_util use_mkey" should not require a kadmind restart to take
effect.  At the cost of fetching the K/M principal once for each key
change operation, make kadmind use the current active master key list
for each operation.

(cherry picked from commit 74c1420ea4dffc1105247e362decf608440751ae)

ticket: 7685
version_fixed: 1.12
status: resolved

12 years agoReload master keys to find active mkey if needed
Greg Hudson [Wed, 23 Oct 2013 22:56:14 +0000 (18:56 -0400)] 
Reload master keys to find active mkey if needed

Refactor krb5_dbe_find_act_mkey and make it reload the master key list
if it doesn't find a master key matching the active mkvno.

(cherry picked from commit f9d6353922393936ab7125d1f04e577857909a99)

ticket: 7685

12 years agoUse active master key in update_princ_encryption
Greg Hudson [Wed, 23 Oct 2013 15:55:19 +0000 (11:55 -0400)] 
Use active master key in update_princ_encryption

kdb5_util update_princ_encryption should update to the active master
key version, not the most recent.

(cherry picked from commit 4ccc18bc3ddc49d0fd0d2de00ec91c0fa44c53a8)

ticket: 6507
version_fixed: 1.12
status: resolved

12 years agoFix typos in kdb5_util master key command outputs
Greg Hudson [Mon, 21 Oct 2013 20:46:15 +0000 (16:46 -0400)] 
Fix typos in kdb5_util master key command outputs

kdb5_util list_mkeys was beginning lines with "KNVO" instead of
"KVNO".  kdb5_util purge_mkeys was displaying "follwing" instead of
"following" for both dry-run and normal cases.

(cherry picked from commit 7fee58ccadf1b61eec9a8c62f47dac43986e2ad1)

ticket: 7730
version_fixed: 1.12
status: resolved

12 years agoDiscuss cert expiry, no-key princs in PKINIT docs
Greg Hudson [Mon, 14 Oct 2013 22:14:00 +0000 (18:14 -0400)] 
Discuss cert expiry, no-key princs in PKINIT docs

In pkinit.rst, add "-days" options to the example commands for
creating certificate and briefly discuss the issue of expiration dates
so that the administrator thinks about it.  In troubleshoot.rst, add
an entry for the "certificate has expired" error which results from
PKINIT (when linked with OpenSSL) when a certificate has expired.

(cherry picked from commit f3977b6883f0172a2af9006522a1b35546f86749)

ticket: 7719
version_fixed: 1.12
status: resolved

12 years agoUse protocol error for PKINIT cert expiry
Greg Hudson [Mon, 14 Oct 2013 21:02:31 +0000 (17:02 -0400)] 
Use protocol error for PKINIT cert expiry

If we fail to create a cert chain in cms_signeddata_create(), return
KRB5KDC_ERR_PREAUTH_FAILED, which corresponds to a protocol code,
rather than KRB5_PREAUTH_FAILED, which doesn't.  This is also more
consistent with other error clauses in the same function.

(cherry picked from commit cd59782cb32b79e4001a86b0fe47af8b6275ef0c)

ticket: 7718
version_fixed: 1.12
status: resolved

12 years agoFix gss_accept_sec_context error tokens
Greg Hudson [Tue, 8 Oct 2013 21:07:34 +0000 (17:07 -0400)] 
Fix gss_accept_sec_context error tokens

A GSS krb5 error response contains a KRB-ERROR message, which is
required to have a server principal name, although few recipients
actually use it.  Starting in 1.3, accept_sec_context would fail to
encode the error in the GSS_C_NO_NAME/GSS_C_NO_CREDENTIAL case
(introduced by #1370) because cred->princ (which became
cred->name->princ in 1.8) is unset.

This problem got worse in 1.10 because we stopped setting the server
field in all cases due to the changes for #6855.  In 1.11 the problem
got worse again when a misguided change to the mechglue started
discarding output tokens when the mechanism returns an error; the
mechglue should only do so when it itself causes the error.

Fix krb5 gss_accept_sec_context by unconditionally decoding the AP-REQ
and using krb5_rd_req_decoded, and then using the requested ticket
server in the KRB-ERROR message.  Fix the mechglue
gss_accept_sec_context by reverting that part of commit
56feee187579905c9101b0cdbdd8c6a850adcfc9.  Add a test program which
artificially induces a replay cache failure (the easiest failure we
can produce which has an associated RFC 4120 error code) and checks
that this can be communicated back to the initiator via an error
token.

(cherry picked from commit c547bc16f2ab6ee66c076ef944c3fbac8a66f5d4)

ticket: 1445
version_fixed: 1.12
status: resolved

12 years agoAdd missing entries to tests/gssapi Makefile.in
Greg Hudson [Tue, 8 Oct 2013 16:35:51 +0000 (12:35 -0400)] 
Add missing entries to tests/gssapi Makefile.in

Some test sources files, objects, or programs were missing from SRCS,
OBJS, all, check-pytests, or clean.  t_oid was also out of order in a
couple of places.

(cherry picked from commit e547a515f837a7c59c0fe73d192a374593b70263)

ticket: 7722 (new)
version_fixed: 1.12
status: resolved

12 years agoChange KRB5KDC_ERR_NO_ACCEPTABLE_KDF to 100
Greg Hudson [Wed, 9 Oct 2013 17:37:17 +0000 (13:37 -0400)] 
Change KRB5KDC_ERR_NO_ACCEPTABLE_KDF to 100

draft-ietf-krb-wg-pkinit-alg-agility-07 specifies
KDC_ERR_NO_ACCEPTABLE_KDF as 82, but this value conflicts with
KRB_AP_ERR_PRINCIPAL_UNKNOWN from RFC 6111.  The former value has been
reassigned to 100 to fix the conflict.  Use the correct value.

We believe that this error won't crop up in practice for a long time
(when SHA-2 has been superceded by other hash algorithms and people
are desupporting it), by which time implementations will mostly have
been upgraded to use the new value.

(cherry picked from commit 2938851a5ec77ab68bcd1f5cfd07991c7ccabea6)

ticket: 7715
version_fixed: 1.12
status: resolved

12 years agoFix GSSAPI krb5 cred ccache import
Greg Hudson [Mon, 7 Oct 2013 13:51:56 +0000 (09:51 -0400)] 
Fix GSSAPI krb5 cred ccache import

json_to_ccache was incorrectly indexing the JSON array when restoring
a memory ccache.  Fix it.

Add test coverage for a multi-cred ccache by exporting/importing the
synthesized S4U2Proxy delegated cred in t_s4u2proxy_krb5.c; move
export_import_cred from t_export_cred.c to common.c to facilitate
this.  Make a note in t_export_cred.py that this case is covered in
t_s4u.py.

(cherry picked from commit 48dd01f29b893a958a64dcf6eb0b734e8463425b)

ticket: 7706
version_fixed: 1.12
status: resolved

12 years agoUpdate for krb5-1.12-alpha1-postrelease
Tom Yu [Fri, 11 Oct 2013 22:44:30 +0000 (18:44 -0400)] 
Update for krb5-1.12-alpha1-postrelease

12 years agoUpdates for krb5-1.12-alpha1 krb5-1.12-alpha1
Tom Yu [Fri, 11 Oct 2013 18:47:39 +0000 (14:47 -0400)] 
Updates for krb5-1.12-alpha1

12 years agoUpdate man pages
Tom Yu [Fri, 11 Oct 2013 19:48:50 +0000 (15:48 -0400)] 
Update man pages

12 years agomake depend
Tom Yu [Fri, 11 Oct 2013 19:11:35 +0000 (15:11 -0400)] 
make depend

12 years agoFix audit test module initialization
Greg Hudson [Sun, 6 Oct 2013 00:13:39 +0000 (20:13 -0400)] 
Fix audit test module initialization

Check if the fopen result is NULL, not whether it's less than zero.

(cherry picked from commit 5036f91e7b61a73a1ec2d39ce1cc6bbf60dd82ab)

ticket: 7713
version_fixed: 1.12
status: resolved

12 years agoKDC Audit infrastructure and plugin implementation
Zhanna Tsitkov [Sat, 20 Jul 2013 19:47:42 +0000 (15:47 -0400)] 
KDC Audit infrastructure and plugin implementation

Per project http://k5wiki.kerberos.org/wiki/Projects/Audit

The purpose of this project is to create an Audit infrastructure to monitor
security related events on the KDC.

The following events are targeted in the initial version:
- startup and shutdown of the KDC;
- AS_REQ and TGS_REQ exchanges.  This includes client address and port, KDC
  request and request ID, KDC reply, primary and derived ticket and their
  ticket IDs, second ticket ID, cross-realm referral, was ticket renewed and
  validated, local policy violation and protocol constraints, and KDC status
  message.

Ticket ID is introduced to allow to link tickets to their initial TGT at any
stage of the Kerberos exchange. For the purpose of this project it is a private
to KDC ticket ID: each successfully created ticket is hashed and recorded
into audit log. The administrators can correlate the primary and derived
ticket IDs after the fact.

Request ID is a randomly generated alpha-numeric string. Using this ID an
administrator can easily correlate multiple audit events related to a single
request. It should be informative both in cases when the request is sent to
multiple KDCs, or to the same KDC multiple times.

For the purpose of testing and demo of the Audit, the JSON based modules are
implemented: "test" and "simple" audit modules respectively.
The file plugins/audit/j_dict.h is a dictionary used in this implememtations.

The new Audit system is build-time enabled and run-time pluggable.

[kaduk@mit.edu: remove potential KDC crashes, minor reordering]

ticket: 7712
target_version: 1.12

12 years agoBe smarter about installing debug symbols
Ben Kaduk [Tue, 2 Jul 2013 20:45:59 +0000 (16:45 -0400)] 
Be smarter about installing debug symbols

We know when we're going to generate debug symbols, so only attempt
to install them when we know they should be present.

This eliminates the need to tell make to ignore errors from the shell
on these steps.

ticket: 7317
tags: pullup
target_version: 1.11.4

12 years agoUse better URL for kerberos documentation
Ben Kaduk [Tue, 2 Jul 2013 20:02:43 +0000 (16:02 -0400)] 
Use better URL for kerberos documentation

We have added a krb5-latest symlink for the latest stable release,
which is preferred to the krb5-current link (which points to a nightly
build of master).

ticket: 7673 (new)
ticket: 7493
queue: kfw
tags: pullup
target_version: 1.11.4

12 years agoRemove OldCC/rpc.cxx
Ben Kaduk [Mon, 1 Jul 2013 18:22:58 +0000 (14:22 -0400)] 
Remove OldCC/rpc.cxx

It is only linked on one place, which does not use any of the
exported routines, since an alternate implementation is linked first.

Remove the dead code and reduce the number of warnings omitted by
the build process.

12 years agoUse new-style variable expansion for light.exe
Ben Kaduk [Fri, 28 Jun 2013 22:08:21 +0000 (18:08 -0400)] 
Use new-style variable expansion for light.exe

With WiX 3.x, the preprocessor candle.exe expands variables using
$(); the linker light.exe expands localization and similar variables
using !(), though it accepts the $() form and prints a warning.

Switch to using the expected form to silence the warnings.

ticket: 7390
tags: pullup
target_version 1.11.4

12 years agoRemove unneeded variable enc_tkt_transited
Ben Kaduk [Fri, 4 Oct 2013 16:58:30 +0000 (12:58 -0400)] 
Remove unneeded variable enc_tkt_transited

There's no need to use an intermediate variable to initialize the
contents of enc_tkt_reply.transited.

Instead of setting each field to zero individually (and misspelling NULL),
use memset and set the one field which is being initialized to a nonzero
value explicitly.

12 years agoZero out stack variables in process_tgs_req()
Ben Kaduk [Thu, 3 Oct 2013 17:57:40 +0000 (13:57 -0400)] 
Zero out stack variables in process_tgs_req()

It is general good hygeine, preventing stack garbage from accidentally
leaking out into other consumers.

Don't bother with variables that are only used in a single place, but
do initialize the 'magic' field of nolrentry before it is used.

12 years agoUse constant-time comparisons for checksums
Greg Hudson [Wed, 2 Oct 2013 21:58:06 +0000 (17:58 -0400)] 
Use constant-time comparisons for checksums

12 years agoAdd an internal constant-time comparison function
Greg Hudson [Wed, 2 Oct 2013 21:55:28 +0000 (17:55 -0400)] 
Add an internal constant-time comparison function

k5_bcmp acts similarly to the deprecated Unix bcmp() function,
returning zero if two memory regions are equal and nonzero if they are
not.  It is implemented such that it should take the same amount of
time regardless of how many bytes are equal within the memory regions.

12 years agoConditionally test KEYRING ccache type
Greg Hudson [Sat, 28 Sep 2013 20:29:36 +0000 (16:29 -0400)] 
Conditionally test KEYRING ccache type

If the keyctl command is found and klist recognizes the KEYRING
credential cache type, then run several tests against keyring ccaches:
the collection test program in lib/krb5/ccache, the command-line
collection tests in tests/t_ccache.py, and some new tests to verify
legacy session cache behavior.  Much of the Python code in t_ccache.py
is moved into a new function named "collection_test" so we can run it
once against a DIR collection and once against a KEYRING collection.

Also: fix a memory leak in the collection test program; add a test for
iteration when the default cache name is a subsidiary name; use a
process keyring ccache in t_cc.c to avoid leaving behind empty
collections in the session keyring after each test run.

Adapted from a patch by simo@redhat.com.

ticket: 7711

12 years agoSupport new KEYRING anchor names and big_key keys
Greg Hudson [Sat, 28 Sep 2013 18:12:58 +0000 (14:12 -0400)] 
Support new KEYRING anchor names and big_key keys

Add support for the new anchor names persistent, user, and session.
The persistent anchor attempts to use a persistent keyring for a
specified uid, and falls back to the user keyring if it cannot; the
collection is stored at a fixed name within the persistent or user
keyring.  The session anchor uses the session keyring without legacy
semantics.

For all keyring types except legacy, attempt to use the "big_key" key
type on systems which have keyctl_get_persistent.  (They are
essentially unrelated features, but were added at the same time.)
This key type is stored in a kernel tmpfs and can store larger
tickets.

Since kernel commit 96b5c8fea6c0861621051290d705ec2e971963f1, new keys
created by add_key() only have VIEW permission for the user, and the
rest of the permissions require "possession," which means there is a
path from the thread, process, or session keyring to the key.  For the
user and persistent anchor types, we link the collection into the
process keyring to ensure that we have a possession rights on the
collection.

Adapted from a patch by simo@redhat.com.

ticket: 7711

12 years agoAdd collection support for KEYRING ccache type
Greg Hudson [Fri, 27 Sep 2013 22:45:29 +0000 (18:45 -0400)] 
Add collection support for KEYRING ccache type

Augment the KEYRING ccache type to support collection semantics
similar to those of the DIR type.  For keyrings with no anchor prefix,
maintain compatibility with old code by linking the initial primary
cache directly from the session keyring and naming it after the
collection.

See http://k5wiki.kerberos.org/wiki/Projects/Keyring_collection_cache
for more information.  Adapted from a patch by simo@redhat.com.

ticket: 7711 (new)

12 years agoClarify variable names in cc_keyring.c
Greg Hudson [Thu, 26 Sep 2013 16:23:23 +0000 (12:23 -0400)] 
Clarify variable names in cc_keyring.c

Consistently use "cache_name" and "cache_id" to talk about the name
and ID of the keyring containing the cache.  In krb5_krcc_resolve, use
"residual" for the residual string as we are no longer using it for
the cache keyring name, and use "anchor_id" for the keyring identified
by the prefix to make it clear that it is not the cache keyring.

Adapted from a patch by simo@redhat.com.

12 years agoDefer KEYRING key creation until initialize
Greg Hudson [Thu, 26 Sep 2013 15:40:13 +0000 (11:40 -0400)] 
Defer KEYRING key creation until initialize

If we resolve a KEYRING cache and the key does not exist, wait until
initialize time to create it, to avoid wasting precious kernel memory
on a cache which might not ever be created.  Properly error out if
store_cred or start_seq_get is called on an uninitialized cache, as we
would for a FILE cache.

Adapted from a patch by simo@redhat.com.

12 years agoAdd "which" function to k5test
Greg Hudson [Sat, 28 Sep 2013 18:56:22 +0000 (14:56 -0400)] 
Add "which" function to k5test

Add a utility function in k5test.py to look for a command in the
executable path, and remove it from t_kdb.py.

12 years agoImprove kinit output credential cache selection
Greg Hudson [Thu, 26 Sep 2013 09:38:46 +0000 (05:38 -0400)] 
Improve kinit output credential cache selection

If kinit chooses a client principal based on anything other than the
current default ccache's principal name, apply collection rules if
possible.  When applying collection rules, if we don't find an
existing cache for the client principal, use the default cache if it
is uninitialized, instead of creating a new one.

ticket: 7689

12 years agoSupport authoritative KDB check_transited methods
Greg Hudson [Wed, 25 Sep 2013 14:40:23 +0000 (10:40 -0400)] 
Support authoritative KDB check_transited methods

In kdc_check_transited_list, consult the KDB module first.  If it
succeeds, treat this as authoritative and do not use the core
transited mechanisms.  Modules can return KRB5_PLUGIN_NO_HANDLE to
fall back to core mechanisms.

ticket: 7709

12 years agoAdd ccache collection tests using API
Greg Hudson [Tue, 24 Sep 2013 16:20:17 +0000 (12:20 -0400)] 
Add ccache collection tests using API

Create a new test program in lib/krb5/ccache named t_cccol.c which
verifies collection semantics using the API.  Run it with an empty DIR
collection in t_cccol.py.

12 years agoFactor out krb5int_random_string() routine
Zhanna Tsitkov [Tue, 24 Sep 2013 14:13:26 +0000 (10:13 -0400)] 
Factor out krb5int_random_string() routine

Make krb5int_random_string() function available outside ccache code.
Move it into a separate file under lib/krb5/krb hierarchy.

12 years agoRe-factoring of service processing code in AS-REQ
Zhanna Tsitkov [Mon, 23 Sep 2013 21:25:13 +0000 (17:25 -0400)] 
Re-factoring of service processing code in AS-REQ

Take one step toward re-factoring of the KDC code:
keep the service principal related code in one place.

The code pattern was changed from:
   - unparse client -
   - unparse service -
   - db_get_ client -
   - client referrals -
   - db_get_ service -
   - validate policies etc
into:
   - unparse client -
   - db_get_ client -
   - client referrals -
   - unparse service -
   - db_get_ service -
   - validate policies etc

12 years agoErr codes in KRB_ERROR protocol messages are < 128
Zhanna Tsitkov [Thu, 19 Sep 2013 17:11:15 +0000 (13:11 -0400)] 
Err codes in KRB_ERROR protocol messages are < 128

If the error code is out of [0,127] range, assign it to KRB_ERR_GENERIC.
This fix is to correct the previous behavior with [0,128] range.
For more information see  krb5_err.et

12 years agoFix literal blocks in gssapi.rst
Tom Yu [Fri, 20 Sep 2013 19:20:01 +0000 (15:20 -0400)] 
Fix literal blocks in gssapi.rst

Some literal blocks in the new AEAD and IOV documentation in
gssapi.rst started with ":" instead of "::", causing documentation
build errors.

12 years agoUse macros instead of magic numbers in json.c
Zhanna Tsitkov [Thu, 19 Sep 2013 14:00:41 +0000 (10:00 -0400)] 
Use macros instead of magic numbers in json.c

Avoid using "magic numbers" for better maintainability.

12 years agoRelease krb5-1.9 is not supported anymore
Zhanna Tsitkov [Thu, 19 Sep 2013 13:20:07 +0000 (09:20 -0400)] 
Release krb5-1.9 is not supported anymore

Release 1.9.5 was the last planned release for the krb5-1.9 series.

12 years agoDocument AEAD and IOV GSSAPI extensions
Greg Hudson [Mon, 16 Sep 2013 17:04:27 +0000 (13:04 -0400)] 
Document AEAD and IOV GSSAPI extensions

12 years agoAdd GSSAPI IOV MIC functions
Greg Hudson [Sun, 8 Sep 2013 01:13:48 +0000 (21:13 -0400)] 
Add GSSAPI IOV MIC functions

Add gss_get_mic_iov, gss_get_mic_iov_length, and gss_verify_mic_iov
functions, which work similarly to the corresponding IOV wrap
functions.  Add a new buffer type GSS_IOV_BUFFER_TYPE_MIC_TOKEN for
the destination buffer.

Most of the internal code for this was already present, and just
needed to be fixed up and adjusted to use the new buffer type for the
MIC token.

ticket: 7705 (new)

12 years agoCorrect comments in ccselect_plugin.h
Zhanna Tsitkov [Wed, 18 Sep 2013 20:18:11 +0000 (16:18 -0400)] 
Correct comments in ccselect_plugin.h

Some text mistakenly referred to password quality plugin.

12 years agoGet rid of G_VFY_TOKEN_HDR_IGNORE_SEQ_SIZE
Greg Hudson [Sun, 8 Sep 2013 18:10:37 +0000 (14:10 -0400)] 
Get rid of G_VFY_TOKEN_HDR_IGNORE_SEQ_SIZE

This flag was introduced in the mskrb-integ merge but is not actually
used after r21742--while kg_unseal_iov_token sets it in vfyflags for
DCE-style contexts, it doesn't actually pass vfyflags to
g_verify_token_header or otherwise use it.  Moreover, the flag is not
necessary there; we correctly set input_length to the header length
(without data, padding, or trailer) for v1 tokens in a DCE-style
context.

12 years agoUse gss_release_iov_buffer in t_iov.c
Greg Hudson [Fri, 6 Sep 2013 15:16:00 +0000 (11:16 -0400)] 
Use gss_release_iov_buffer in t_iov.c

12 years agoAdd tests for GSS IOV and AEAD interfaces
Greg Hudson [Wed, 4 Sep 2013 18:23:27 +0000 (14:23 -0400)] 
Add tests for GSS IOV and AEAD interfaces

Add a new test program t_iov.c which tests various combinations of
wrapping and unwrapping using the IOV and AEAD interfaces.  Run it
with and without SPNEGO in each enctype configuration.

12 years agoFactor out context establishment in GSS tests
Greg Hudson [Thu, 5 Sep 2013 17:34:44 +0000 (13:34 -0400)] 
Factor out context establishment in GSS tests

Add a new helper to common.c which runs gss_init_sec_context and
gss_accept_sec_context in a loop, and use it in test programs instead
of the open-coded one-token or two-token exchanges.

12 years agoAdd a flag to prevent all host canonicalization
Greg Hudson [Thu, 5 Sep 2013 22:30:02 +0000 (18:30 -0400)] 
Add a flag to prevent all host canonicalization

If dns_canonicalize_hostname is set to false in [libdefaults],
krb5_sname_to_principal will not canonicalize the hostname using
either forward or reverse lookups.

ticket: 7703 (new)

12 years agoStop modifying TGS requests for referrals
Greg Hudson [Fri, 30 Aug 2013 16:19:44 +0000 (12:19 -0400)] 
Stop modifying TGS requests for referrals

It is no longer necessary to modify request->server when we receive a
referral.  The uses of request->server break down as follows:

* Matching against previously issued tickets (e.g. for renewals).  We
  now explicitly disallow referrals for requests where we need to do
  that.

* Using only the realm (e.g. for transited checking).  Referrals are
  cross-realm TGS entries within the same realm as the requested
  server principal, so this does not change.

* Comparing to a local TGS principal (for restrict_anonymous_to_tgt
  enforcement).  Local TGS principals are not treated as referrals, so
  the sense of this comparison will not change if we use the original
  request.

* Setting the sname and realm fields of a KRB-ERROR response.  RFC
  4120 and 6806 do not specify what we should put here for referrals
  or aliases and we are not aware of any uses of this field by
  clients, so putting the requested server principal here should be
  okay.

12 years agoExplicitly prevent referrals for certain requests
Greg Hudson [Fri, 30 Aug 2013 16:14:00 +0000 (12:14 -0400)] 
Explicitly prevent referrals for certain requests

For ticket modification requests (such as renewals), u2u requests, and
S4U2Self requests, the requested server principal is expected to match
a previously issued ticket.  If that principal no longer exists, we
must fail the request; we cannot issue a referral.  We are currently
doing that by rewriting request->server to the referral principal,
which causes the match against the ticket to fail.  Since we would
like to stop modifying the request, we must explicitly prevent
referrals in these cases.

We don't find out whether a request is S4U2Self until after we've
looked up the server principal, so for now we have to make a
retroactive check for a referral after calling
kdc_process_s4u2self_req.

12 years agoTighten up referral recognition in KDC TGS code
Greg Hudson [Thu, 29 Aug 2013 22:17:29 +0000 (18:17 -0400)] 
Tighten up referral recognition in KDC TGS code

In do_tgs_req(), treat the search_sprinc() result as a referral only
if it is a cross-TGS principal and it doesn't match the requested
server principal.  This change fixes two corner cases: (1) when a
client requests a cross-realm TGT, we won't squash the name type in
the response; and (2) if we are serving multiple realms out of the
same KDB, we will properly handle aliases to any local-realm TGT, not
just the one for the configured realm name.

ticket: 7555

12 years agoFix FAST critical option bit checking
Greg Hudson [Sat, 31 Aug 2013 15:46:58 +0000 (11:46 -0400)] 
Fix FAST critical option bit checking

The FAST option bits 0-15 are intended to be critical--if they are
present and a KDC does not support them, the KDC is supposed to fail
the request.  Because of an incorrect constant, we were erroneously
recognizing bits 24-31 as critical.  Fix the constant.

ticket: 7701 (new)

12 years agoSupport FAST hide-client-names option
Greg Hudson [Sat, 31 Aug 2013 15:45:48 +0000 (11:45 -0400)] 
Support FAST hide-client-names option

In the KDC, if we see the hide-client-names option, identify the
client as the anonymous principal in KDC-REP and KRB-ERROR responses.
The actual client name is present in encrypted FAST elements.

ticket: 7700 (new)

12 years agoMake it possible to renew aliased service tickets
Greg Hudson [Thu, 29 Aug 2013 15:15:02 +0000 (11:15 -0400)] 
Make it possible to renew aliased service tickets

We always allow aliases in the service principal when processing
AS-REQs and TGS-REQs.  If the ticket we issued is presented back to us
in a TGS-REQ as a header ticket for renewal or similar, we should
allow aliases when looking up its key to decode the AP-REQ.

ticket: 7699 (new)

12 years agoDon't change realm in find_alternate_tgs
Greg Hudson [Thu, 29 Aug 2013 13:07:57 +0000 (09:07 -0400)] 
Don't change realm in find_alternate_tgs

If a client makes a TGS request for a cross-realm TGS within a
different realm from the one we normally serve (e.g. the KDC realm is
X, and a client makes a TGS request for the server krbtgt/Y@Z), look
for alternate TGS principals within the requested server realm, not
the realm we normally serve.

This change shouldn't break any working well-formed TGS requests,
because changing the realm would trigger a failure in check_tgs_tgt.
It may fix some corner cases when multiple realms are served out of
the same KDB.  But primarily, this change makes referrals and aliases
easier to reason about, by eliminating a case where server->princ has
a different realm from request->server after the call to
search_sprinc().

12 years agoAdd test for alias to local TGS
Greg Hudson [Wed, 28 Aug 2013 22:40:18 +0000 (18:40 -0400)] 
Add test for alias to local TGS

12 years agoDon't treat local krbtgt principal as referral
Greg Hudson [Wed, 28 Aug 2013 22:39:55 +0000 (18:39 -0400)] 
Don't treat local krbtgt principal as referral

If we look up a principal and in the KDB and get back the local TGS
principal, the KDC should treat this as an alias, not a referral, and
should therefore issue a ticket for the requested principal rather the
canonical name.

ticket: 7698

12 years agoAdd tests for service aliases using LDAP module
Greg Hudson [Wed, 28 Aug 2013 17:04:36 +0000 (13:04 -0400)] 
Add tests for service aliases using LDAP module

12 years agoFix KDC reply service principal for aliases
Greg Hudson [Wed, 28 Aug 2013 16:11:40 +0000 (12:11 -0400)] 
Fix KDC reply service principal for aliases

If a client requests a service ticket for the alias of a service
principal, RFC 6806 section 6 requires that the KDC issue a ticket
which appears to be for the alias and not for the canonical name.
After calling search_sprinc(), only replace request->server with
server->princ if the latter is a TGT; this will be the case for an
alternate cross-realm TGT or a host referral, but not for a simple
service alias.

ticket: 7698
target_version: 1.11.4
tags: pullup

12 years agoClarify flag handling in dump.c
Greg Hudson [Tue, 27 Aug 2013 16:23:12 +0000 (12:23 -0400)] 
Clarify flag handling in dump.c

Get rid of "flags" bitfields and just use boolean values, to make the
internal contracts for dump and load functions more precise.  Rename
"add_update" to "iprop_load" and reverse its sense.

12 years agoUpdate ulog state after promoting DB when loading
Greg Hudson [Mon, 26 Aug 2013 19:12:56 +0000 (15:12 -0400)] 
Update ulog state after promoting DB when loading

If we are doing a full load, do not touch the ulog header until after
we promote the temporary DB to live.  This avoids the same bugs as the
#7588 fix, but more robustly.  Based on a patch from Richard Basch.

ticket: 7695

12 years agoOmit signedpath if no_auth_data_required is set
Greg Hudson [Tue, 20 Aug 2013 00:01:03 +0000 (20:01 -0400)] 
Omit signedpath if no_auth_data_required is set

The no_auth_data_required bit was introduced to suppress PACs in
service tickets when the back end supports them.  Make it also
suppress AD-SIGNEDPATH, so that the ~70-byte expansion of the ticket
can be avoided for services which aren't going to do constrained
delegation.

ticket: 7697 (new)

12 years agoSimplify krb5_krcc_start_seq_get
Simo Sorce [Fri, 9 Aug 2013 00:10:56 +0000 (20:10 -0400)] 
Simplify krb5_krcc_start_seq_get

This code can be simplified (and a potential race avoided) by using
keyctl_read_alloc() and letting it allocate the necessary memory.
This also allows to remove a helper function that is not used anymore
as well as make the code more readable.  The only penalty is that we
have two allocations instad of one.

[ghudson@mit.edu: trivial simplifications]

12 years agoRemove unused counter in keyring ccache
Simo Sorce [Thu, 8 Aug 2013 23:52:46 +0000 (19:52 -0400)] 
Remove unused counter in keyring ccache

numkeys is never really used in the single cache data structure.
Every time a new iteration is started, numkeys is recalculated anyway,
and then only the copy held in the cursor is used.  Remove it from the
cache data and keep it only in the cursor.

[ghudson@mit.edu: clarified commit message]

12 years agoRemove unused _gssd_keyring_ids_ feature
Simo Sorce [Thu, 8 Aug 2013 19:43:54 +0000 (15:43 -0400)] 
Remove unused _gssd_keyring_ids_ feature

This feature was intended to be used by gssd to access users' keyring
credentials, but it was never used.

[ghudson@mit.edu: clarified commit message]