]> git.ipfire.org Git - thirdparty/krb5.git/log
thirdparty/krb5.git
11 years agoMove utility functions to hostrealm.c
Greg Hudson [Mon, 5 Aug 2013 20:05:27 +0000 (16:05 -0400)] 
Move utility functions to hostrealm.c

Move the remaining internal functions from hst_realm.c to hostrealm.c,
and get rid of hst_realm.c.

ticket: 7687

11 years agoUse hostrealm interface for realm mapping
Greg Hudson [Mon, 5 Aug 2013 19:57:29 +0000 (15:57 -0400)] 
Use hostrealm interface for realm mapping

Reimplement krb5_get_host_realm, krb5_get_fallback_host_realm, and
krb5_get_default_realm in terms of the hostrealm interface.  Three
built-in modules (dns, domain, and profile) implement the current
behavior.

ticket: 7687

11 years agoAdd hostrealm pluggable interface definition
Greg Hudson [Mon, 5 Aug 2013 18:43:24 +0000 (14:43 -0400)] 
Add hostrealm pluggable interface definition

ticket: 7687 (new)

12 years agoRemove KRB5_DNS_LOOKUP_KDC
Ben Kaduk [Wed, 14 Aug 2013 19:47:03 +0000 (15:47 -0400)] 
Remove KRB5_DNS_LOOKUP_KDC

It has been unconditionally activated by all supported build systems
for almost two years, and no complaints or issues have been reported.
In particular, aclocal.m4 has had an unconditional AC_DEFINE() since
3d708e55 in 2003, and win-pre.in has unconditionally set KRB5_USE_DNS_KDC
since 17ffebf7 in 2011.

While here, simplify some other DNS conditionals in win-pre.in where
only one branch was ever taken.

ticket: 7691 (new)

12 years agoFix windows build
Ben Kaduk [Wed, 14 Aug 2013 20:52:44 +0000 (16:52 -0400)] 
Fix windows build

This routine is now used in the gssapi library and must be exported
as such.

ticket: 7688

12 years agoRemove redundant domain_realm mappings
Ben Kaduk [Mon, 12 Aug 2013 17:47:42 +0000 (13:47 -0400)] 
Remove redundant domain_realm mappings

This fixes a long-standing documentation bug where we claimed that
a domain_realm mapping for a host name would not affect entries
under that domain name.  The code has always had the behavior where
a host name mapping implies the corresponding domain name mapping,
since the 1.0 release.

While here, replace media-lab with csail in example files, as the
media lab realm is no longer in use.  Also strip port 88 from KDC
specifications, and drop the harmful default_{tgs,tkt}_enctypes
lines from src/util/profile/krb5.conf.

Further cleanup on these files to remove defunct realms may be in order.

ticket: 7690 (new)
tags: pullup
target_version: 1.11.4

12 years agoFix localauth memory leak
Greg Hudson [Mon, 12 Aug 2013 19:17:20 +0000 (15:17 -0400)] 
Fix localauth memory leak

localauth modules were not freed by krb5_free_context(), causing a
memory leak.

12 years agoActually build t_enctypes
Tom Yu [Mon, 12 Aug 2013 19:19:36 +0000 (15:19 -0400)] 
Actually build t_enctypes

Commit 2e956074b228ff4df3b7462037ab69e4e88ffffe omitted adding a
dependency to the "all" target to force the build of the t_enctypes
test program.

ticket: 7688

12 years agoAdd trace logging for TXT lookups
Greg Hudson [Mon, 12 Aug 2013 18:29:28 +0000 (14:29 -0400)] 
Add trace logging for TXT lookups

Rename krb5_try_realm_txt_rr (an internal function despite the name)
and add a context parameter.  Generate trace logs when we successfully
look up a record and when a record is not found.

12 years agoFix gss_krb5_set_allowable_enctypes for acceptor
Greg Hudson [Tue, 6 Aug 2013 03:47:52 +0000 (23:47 -0400)] 
Fix gss_krb5_set_allowable_enctypes for acceptor

The acceptor implementation of gss_krb5_set_allowable_enctypes (added
in 1.9.1) is intended to restrict the acceptor subkey negotiated by
krb5_rd_req().  It uses the same approach as the initiator, calling
krb5_set_default_tgs_enctypes on the context.  This has the unwanted
side effect of restricting the encryption key of the ticket, because
krb5_decrypt_tkt_part has checked krb5_is_permitted_enctype on the
ticket encryption key since 1.8.

Instead, use krb5_auth_con_setpermetypes on the auth context.  This
list is only used for session key enctype negotiation.  Also add
automated tests to verify that gss_krb5_set_allowable_enctypes works
as desired.

ticket: 7688 (new)
target_version: 1.11.4
tags: pullup

12 years agoReport KDC response sizes in trace logs
Greg Hudson [Wed, 7 Aug 2013 18:16:18 +0000 (14:16 -0400)] 
Report KDC response sizes in trace logs

12 years agoUpdate config.guess and config.sub
Ben Kaduk [Fri, 26 Jul 2013 22:30:44 +0000 (18:30 -0400)] 
Update config.guess and config.sub

Copy in the latest config.guess and config.sub from upstream git
master as of 2013-07-26 (revision 79c4c50fc754d742286706b4db5ed8ce2a0de925).
Our previous version didn't recognize arm64.

Reported as Debian bug 717840.

ticket: 7683 (new)
tags: pullup
target_version: 1.11.4

12 years agoCorrect an error in kdb.h comments
Greg Hudson [Mon, 5 Aug 2013 18:12:39 +0000 (14:12 -0400)] 
Correct an error in kdb.h comments

The check_policy functions return com_err codes, not protocol codes,
so use a com_err constant in the example.

12 years agoRemove unused function arguments in cc_keyring.c
Simo Sorce [Fri, 2 Aug 2013 01:28:06 +0000 (21:28 -0400)] 
Remove unused function arguments in cc_keyring.c

The credential serialization functions do not operate on a ccache, so
do not need it as an argument.

[ghudson@mit.edu: clarified commit message, rewrapped shortened lines]

12 years agoFix leak in krb5_krcc_unparse_cred on error
Greg Hudson [Fri, 2 Aug 2013 15:37:40 +0000 (11:37 -0400)] 
Fix leak in krb5_krcc_unparse_cred on error

Based on a patch from simo@redhat.com.

12 years agoDocument krb5_db_iterate restriction on writing
Greg Hudson [Wed, 31 Jul 2013 22:51:18 +0000 (18:51 -0400)] 
Document krb5_db_iterate restriction on writing

12 years agoDon't reopen the KDB in update_princ_encryption
Greg Hudson [Wed, 31 Jul 2013 22:49:13 +0000 (18:49 -0400)] 
Don't reopen the KDB in update_princ_encryption

kdb5_util update_princ_encryption iterates over the KDB and writes
modified entries.  With the DB2 back end, the first write operation
has to upgrade the lock and reopen the DB, which resets the cursor
state.  Take out an explicit write lock before iterating to avoid this
step.

ticket: 7684 (new)

12 years agoRemove old comments in sendto_kdc.c
Robbie Harwood (frozencemetery) [Mon, 22 Jul 2013 20:16:35 +0000 (16:16 -0400)] 
Remove old comments in sendto_kdc.c

The commented code in question is present in set_conn_state_msg_length
which is called immediately after the comments.

[ghudson@mit.edu: clarified commit message]

12 years agoRemove is_udp field in sendto_kdc.c conn_state
Robbie Harwood (frozencemetery) [Mon, 22 Jul 2013 20:11:41 +0000 (16:11 -0400)] 
Remove is_udp field in sendto_kdc.c conn_state

This field is redundant with addr.type.

[ghudson@mit.edu: removed extraneous changes; clarified commit
message]

12 years agoAdd base64 functions to libkrb5support exports
Robbie Harwood (frozencemetery) [Mon, 22 Jul 2013 20:20:46 +0000 (16:20 -0400)] 
Add base64 functions to libkrb5support exports

This was previously not an issue because nothing outside of
libkrb5support used them.

12 years agoDon't ask empty responder questions in PKINIT
Nalin Dahyabhai [Fri, 19 Jul 2013 15:33:20 +0000 (11:33 -0400)] 
Don't ask empty responder questions in PKINIT

When putting together the set of identity prompts for a responder
challenge, if we don't need a PIN or password of some kind, don't ask
an empty question.

[ghudson@mit.edu: squashed commits, modified commit message, merged
PKCS11 test with current Python script]

12 years agoLoad import/export cred functions from GSS modules
Simo Sorce [Sat, 20 Jul 2013 17:20:43 +0000 (13:20 -0400)] 
Load import/export cred functions from GSS modules

When the import/export credential feature was implement the related
functions were added to struct gss_config, but the initialization
function that dynamically loads modules was not changed to see if
the plugin being loaded provided such functions.

This will allow non-builtin mechanism and interposer mechanism to
implement custom import/export credential extensions if they wish.

ticket: 7682

12 years agoLoad cred store functions from GSS modules
Simo Sorce [Sat, 20 Jul 2013 17:19:19 +0000 (13:19 -0400)] 
Load cred store functions from GSS modules

When the credential store feature was implement the related functions
were added to struct gss_config, but the initialization function that
dynamically loads modules was not changed to see if the plugin being
loaded provided such functions.

This will allow non-builtin mechanism and interposer mechanism to
implement custom credential store extensions if they wish.

ticket: 7682

12 years agoAllow self-service for kadmin purgekeys RPC
Greg Hudson [Fri, 19 Jul 2013 14:08:08 +0000 (10:08 -0400)] 
Allow self-service for kadmin purgekeys RPC

Make the purgekeys RPC allow self-service, like the chpass and chrand
RPCs.

ticket: 7681 (new)

12 years agoClean up and improve PKINIT test script
Greg Hudson [Fri, 19 Jul 2013 14:00:05 +0000 (10:00 -0400)] 
Clean up and improve PKINIT test script

Don't create a bunch of identically configured realms; just reuse the
same one.  Remove a redundant assignment from the soft-pkcs11.so
check.  Move the pkinit_identity setting from krb5.conf to kdc.conf,
since it's only used by the KDC.  Add a test for trying anonymous
PKINIT when it isn't configured.  Check for a specific error message
when testing restricted anonymous PKINIT.

12 years agoCombine PKINIT test scripts
Greg Hudson [Fri, 19 Jul 2013 00:46:35 +0000 (20:46 -0400)] 
Combine PKINIT test scripts

12 years agoFix doc build after PKINIT responder changes
Greg Hudson [Thu, 18 Jul 2013 17:02:35 +0000 (13:02 -0400)] 
Fix doc build after PKINIT responder changes

Add new types and constants to the apiref index files.

12 years agoTest that password preauth works without PKINIT
Nalin Dahyabhai [Wed, 17 Jul 2013 17:03:59 +0000 (13:03 -0400)] 
Test that password preauth works without PKINIT

Before we test authenticated PKINIT, slip in a test to check that
password-based preauthentication still works when the KDC is offering
PKINIT, but the client has no PKINIT credentials.

12 years agoTeach the responder test helper about OTP
Nalin Dahyabhai [Mon, 8 Jul 2013 21:54:23 +0000 (17:54 -0400)] 
Teach the responder test helper about OTP

12 years agoAdd the error to some PKINIT NSS debug messages
Nalin Dahyabhai [Wed, 3 Jul 2013 21:11:09 +0000 (17:11 -0400)] 
Add the error to some PKINIT NSS debug messages

12 years agoAdd tests for PKINIT using responder functionality
Nalin Dahyabhai [Wed, 3 Jul 2013 21:10:55 +0000 (17:10 -0400)] 
Add tests for PKINIT using responder functionality

We now also test that the PKINIT challenge looks like we expect it to
look, that PKINIT fails if we don't provide a response or a prompter
callback, and that PKINIT succeeds with a response provided using either
the raw responder API or the PKINIT responder functions.

One thing that we don't check is which specific error code we get when
PKINIT fails:  the OpenSSL and NSS versions return different error codes
(some mixture of EIO, ENOMEM, ENOENT, and KRB5KDC_ERR_PREAUTH_FAILED)
when they encounter trouble loading client credentials.

ticket: 7680

12 years agoAdd a helper for testing PKINIT and responder cb
Nalin Dahyabhai [Mon, 15 Jul 2013 17:30:00 +0000 (13:30 -0400)] 
Add a helper for testing PKINIT and responder cb

ticket: 7680

12 years agoAdd non-JSON APIs for PKINIT responder items
Nalin Dahyabhai [Mon, 15 Jul 2013 17:37:00 +0000 (13:37 -0400)] 
Add non-JSON APIs for PKINIT responder items

Add wrappers for the JSON-oriented APIs for PKINIT responder items,
modeled after the API we provide for OTP items:

* krb5_responder_pkinit_get_challenge() returns the list of
  identities for which we need PINs
* krb5_responder_pkinit_challenge_free() frees the structure that
  was returned by krb5_responder_pkinit_get_challenge()
* krb5_responder_pkinit_set_answer() sets the answer to the PIN for
  one of the identities

[ghudson@mit.edu: style cleanup; added comment pointing to main body
of PKINIT module]

ticket: 7680

12 years agoSupport PKINIT OpenSSL deferred identity prompting
Nalin Dahyabhai [Fri, 28 Jun 2013 21:12:39 +0000 (17:12 -0400)] 
Support PKINIT OpenSSL deferred identity prompting

Add a password to the set of things that we can pass to a PEM password
callback and the function we use for loading PKCS12 bundles.  If we're
meant to defer identity prompts, just store the name of the identity
which we're loading.  Otherwise, if we're passed a password, use it.
Otherwise, use the prompter callback.

Add a password to the set of things that we can pass to the function
that we use for logging in to PKCS11 tokens, too, but if we're deferring
identity prompts, just return the identity name without doing anything
else.  If not, and we're passed a password, use that.  Otherwise, try to
use the prompter callback to get one.

ticket: 7680

12 years agoSupport PKINIT NSS deferred identity prompting
Nalin Dahyabhai [Mon, 8 Jul 2013 20:49:16 +0000 (16:49 -0400)] 
Support PKINIT NSS deferred identity prompting

The password callback which we usually supply to NSS already gets a
pointer to the pkinit_identity_crypto_context structure, but it needs to
be passed the name of the identity for which it's being called.

If it gets a name, and it's deferring prompting, just add the identity
to the list of deferred identity prompts (the password callback wouldn't
have been called if its result wasn't needed), and either return NULL
(as an indication that we couldn't get a password) or an empty string (a
value which we know is invalid) if that's handier.

Otherwise, check for a password that's been stashed for its use for that
identity, and return a copy of it if one's found.  If none of that
works, try to use the prompter callback to ask for the password.

ticket: 7680

12 years agoPass PKINIT identity prompts to the responder cb
Nalin Dahyabhai [Mon, 15 Jul 2013 17:11:00 +0000 (13:11 -0400)] 
Pass PKINIT identity prompts to the responder cb

Use the list of deferred identity prompts and warnings, which we have
after calling pkinit_identity_initialize(), to build a list of questions
to supply to responder callbacks.

Before calling pkinit_identity_prompt() to actually load identities that
are protected, save any passwords and PINs which a responder callback
may have supplied.

Because pkinit_client_prep_questions() can be called multiple times, and
we don't want to try to load all of our identities each of those times,
take some steps to ensure that we only call pkinit_identity_initialize()
and pkinit_identity_prompt() once per request.

ticket: 7680

12 years agoMake the PKINIT NSS path also check for NULL certs
Nalin Dahyabhai [Tue, 9 Jul 2013 18:13:16 +0000 (14:13 -0400)] 
Make the PKINIT NSS path also check for NULL certs

When called to free identity information, do what the OpenSSL-based
version does, and error out if the identity information is NULL.

12 years agoUse PKCS11_MODNAME for NSS PKINIT by default
Nalin Dahyabhai [Fri, 28 Jun 2013 21:12:39 +0000 (17:12 -0400)] 
Use PKCS11_MODNAME for NSS PKINIT by default

Do what the OpenSSL-using code paths do, and load PKCS11_MODNAME if no
module is specified when we're told to use a PKCS11 identity.

12 years agoAdd support for PKINIT deferring identity prompts
Nalin Dahyabhai [Fri, 28 Jun 2013 21:12:39 +0000 (17:12 -0400)] 
Add support for PKINIT deferring identity prompts

Learn to manage a list of deferred identities, for which we want to
prompt for passwords or PINs, in pkinit_identity_crypto_context
structures, along with their associated token flags.  These are opaque
outside of pkinit_crypto_openssl and pkinit_crypto_nss, so both
implementations need to provide wrapper functions that can be called
from elsewhere in the module to populate and query the lists.

ticket: 7680

12 years agoSplit pkinit_identity_initialize into two phases
Nalin Dahyabhai [Fri, 28 Jun 2013 21:12:39 +0000 (17:12 -0400)] 
Split pkinit_identity_initialize into two phases

Split part of pkinit_identity_initialize() into a second piece named
pkinit_identity_prompt().  Have each piece pass a new boolean flag to
crypto_load_certs() to indicate if it should defer prompting for a
password/PIN for client identities that require one.  If the flag isn't
set, then crypto_load_certs() should attempt to use a responder-supplied
value, or call the prompter if there isn't one.

ticket: 7680

12 years agoFix OTP KDC module get_string error handling
Greg Hudson [Wed, 17 Jul 2013 16:14:13 +0000 (12:14 -0400)] 
Fix OTP KDC module get_string error handling

If cb->get_string returns 0 with no result in otp_edata, make sure we
set retval to avoid sending an empty OTP hint.  If cb->get_string
returns an error code in otp_verify, avoid masking that code.

12 years agoClarify and improve k5_json_object_set
Greg Hudson [Tue, 16 Jul 2013 22:09:55 +0000 (18:09 -0400)] 
Clarify and improve k5_json_object_set

Document that k5_json_object_set can be used to overwrite an existing
key, and make it possible to remove a key by setting it to NULL.

12 years agoAdd kadmin support for principals without keys
Greg Hudson [Tue, 9 Jul 2013 14:58:49 +0000 (10:58 -0400)] 
Add kadmin support for principals without keys

Add kadmin support for "addprinc -nokey", which creates a principal
with no keys, and "purgekeys -all", which deletes all keys from a
principal.  The KDC was modified by #7630 to support principals
without keys.

ticket: 7679 (new)

12 years agoAvoid allocating zero key_data structures
Greg Hudson [Mon, 15 Jul 2013 16:20:26 +0000 (12:20 -0400)] 
Avoid allocating zero key_data structures

When we allocate space for an array of key_data structures, make sure
we allocate at least one, so we don't spuriously fail on platforms
where malloc(0) returns NULL.  Where we use malloc, use k5calloc
instead.  Where we use krb5_db_alloc or realloc, just allocate an
extra entry.

12 years agoFix a leak when parsing PKINIT cert SANs with NSS
Nalin Dahyabhai [Tue, 9 Jul 2013 22:29:41 +0000 (18:29 -0400)] 
Fix a leak when parsing PKINIT cert SANs with NSS

When retrieving the list of a certificate's subjectAltName values, we
weren't freeing some of the temporary memory we used.

12 years agoFix minor leaks in klist
Greg Hudson [Mon, 15 Jul 2013 15:14:24 +0000 (11:14 -0400)] 
Fix minor leaks in klist

When walking the cache, if we skip a cred because it's a config entry,
make sure to free it.  Also free the result of krb5_cc_get_principal.
Based on a patch from Nalin Dahyabhai.

12 years agoDon't leak PKINIT CMS signed data certs and CRLs
Nalin Dahyabhai [Thu, 11 Jul 2013 02:17:58 +0000 (22:17 -0400)] 
Don't leak PKINIT CMS signed data certs and CRLs

The stacks of certificates and CRLs that we retrieve from CMS objects
include newly-owned references to the certificates and CRLs, so when we
go to free them, we need to remember to free those.

[ghudson@mit.edu: minor formatting change; removed unrelated style fix]

12 years agoDon't leak the reply key's memory during PKINIT
Nalin Dahyabhai [Tue, 9 Jul 2013 21:20:27 +0000 (17:20 -0400)] 
Don't leak the reply key's memory during PKINIT

12 years agoUse pipe instead of sigwait for krad tests
Greg Hudson [Mon, 15 Jul 2013 01:17:39 +0000 (21:17 -0400)] 
Use pipe instead of sigwait for krad tests

We've never used sigwait() before, and it has some problems on Solaris
10 (a nonconformant prototype by default, and experimentally it didn't
seem to work correctly with _POSIX_PTHREAD_SEMANTICS defined).  Use a
pipe instead.  Make t_daemon.py less chatty on stdout to avoid filling
the pipe buffer.

12 years agoFix minor type issues in krad tests
Greg Hudson [Sun, 14 Jul 2013 23:28:08 +0000 (19:28 -0400)] 
Fix minor type issues in krad tests

Use unsigned char for test encodings, since the initializers use
values greater than 127.

12 years agoUse k5calloc instead of k5alloc where appropriate
Greg Hudson [Fri, 12 Jul 2013 00:39:51 +0000 (20:39 -0400)] 
Use k5calloc instead of k5alloc where appropriate

Wherever we use k5alloc with a multiplication in the size parameter,,
use the new k5calloc helper function instead.

12 years agoAdd k5calloc internal helper function
Greg Hudson [Thu, 11 Jul 2013 23:47:33 +0000 (19:47 -0400)] 
Add k5calloc internal helper function

Letting calloc() do multiplication helps avoid overflow bugs, so
provide an internal k5calloc() helper which accepts both calloc
arguments, and reimplement k5alloc() in terms of it.

12 years agoFix skip logic in t_otp.py
Greg Hudson [Thu, 11 Jul 2013 23:44:11 +0000 (19:44 -0400)] 
Fix skip logic in t_otp.py

Reorder (and trim) the imports in t_otp.py so that k5test is pulled in
before we try to import pyrad and multiprocessing.  Otherwise
success() isn't defined in the case where we decide to skip the entire
test script.

12 years agoAdd server-side otp preauth plugin
Nathaniel McCallum [Wed, 3 Apr 2013 16:38:05 +0000 (12:38 -0400)] 
Add server-side otp preauth plugin

This plugin implements the proposal for providing OTP support by
proxying requests to RADIUS. Details can be found inside the
provided documentation as well as on the project page.

http://k5wiki.kerberos.org/wiki/Projects/OTPOverRADIUS

ticket: 7678

12 years agoAdd libkrad
Nathaniel McCallum [Thu, 4 Apr 2013 17:39:21 +0000 (13:39 -0400)] 
Add libkrad

The new library libkrad provides code for the parsing of RADIUS packets
as well as client implementation based around libverto.  This library
should be considered unstable.

ticket: 7678 (new)

12 years agoMention old preauth header file in docs
Greg Hudson [Wed, 10 Jul 2013 15:13:31 +0000 (11:13 -0400)] 
Mention old preauth header file in docs

The previous commit updated the header file references for 1.12 in the
clpreauth and kdcpreauth plugin interface documentation.  Add a
parenthetical so that the reference is still useful for prior
releases.

12 years agoReference correct preauth header files
Greg Hudson [Mon, 1 Jul 2013 16:12:10 +0000 (12:12 -0400)] 
Reference correct preauth header files

The clpreauth and kdcpreauth header files are split up for 1.12.  In
clpreauth.rst and kdcpreauth.rst, reference the correct header files
for each.

12 years agoAdd test case for CVE-2013-1417
Tom Yu [Fri, 28 Jun 2013 19:34:17 +0000 (15:34 -0400)] 
Add test case for CVE-2013-1417

ticket: 7670 (new)
tags: pullup
target_version: 1.11.4

12 years agoKDC null deref due to referrals [CVE-2013-1417]
Tom Yu [Fri, 21 Jun 2013 21:58:25 +0000 (17:58 -0400)] 
KDC null deref due to referrals [CVE-2013-1417]

An authenticated remote client can cause a KDC to crash by making a
valid TGS-REQ to a KDC serving a realm with a single-component name.
The process_tgs_req() function dereferences a null pointer because an
unusual failure condition causes a helper function to return success.

While attempting to provide cross-realm referrals for host-based
service principals, the find_referral_tgs() function could return a
TGS principal for a zero-length realm name (indicating that the
hostname in the service principal has no known realm associated with
it).

Subsequently, the find_alternate_tgs() function would attempt to
construct a path to this empty-string realm, and return success along
with a null pointer in its output parameter.  This happens because
krb5_walk_realm_tree() returns a list of length one when it attempts
to construct a transit path between a single-component realm and the
empty-string realm.  This list causes a loop in find_alternate_tgs()
to iterate over zero elements, resulting in the unexpected output of a
null pointer, which process_tgs_req() proceeds to dereference because
there is no error condition.

Add an error condition to find_referral_tgs() when
krb5_get_host_realm() returns an empty realm name.  Also add an error
condition to find_alternate_tgs() to handle the length-one output from
krb5_walk_realm_tree().

The vulnerable configuration is not likely to arise in practice.
(Realm names that have a single component are likely to be test
realms.)  Releases prior to krb5-1.11 are not vulnerable.

Thanks to Sol Jerome for reporting this problem.

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

ticket: 7668 (new)
tags: pullup
target_version: 1.11.4

12 years agoDocument dict_file format
Greg Hudson [Mon, 1 Jul 2013 16:07:39 +0000 (12:07 -0400)] 
Document dict_file format

Briefly describe the format of the kadmin dictionary file in
kdc_conf.rst.

12 years agoInstall localauth_plugin.h
Greg Hudson [Mon, 1 Jul 2013 15:40:27 +0000 (11:40 -0400)] 
Install localauth_plugin.h

The localauth pluggable interface was added on master in February, but
we neglected to install its header file.

12 years agoInstall ccselect_plugin.h
Greg Hudson [Mon, 1 Jul 2013 15:31:13 +0000 (11:31 -0400)] 
Install ccselect_plugin.h

The ccselect pluggable interface was added in release 1.10, but we
neglected to install its header file.

ticket: 7671 (new)
target_version: 1.11.4
tags: pullup

12 years agoUpdate windows README for VS2012/Windows SDK 8
Ben Kaduk [Fri, 28 Jun 2013 16:08:13 +0000 (12:08 -0400)] 
Update windows README for VS2012/Windows SDK 8

The Windows SDK 8 dropped the command-line build environment, so
provide instructions for building with the Visual Studio (2012)
command-line build environment.

ticket: 7669 (new)
queue: kfw
tags: pullup
target_version: 1.11.4

12 years agoRequire Windows Installer 4.5 or higher
Ben Kaduk [Wed, 26 Jun 2013 20:30:41 +0000 (16:30 -0400)] 
Require Windows Installer 4.5 or higher

As advised by the VC 11 merge modules.

Windows Installer 4.5 requires Windows Server 2008, Windows Vista, Windows XP
with Service Pack 2 (SP2) and later, or Windows Server 2003 with Service
Pack 1 (SP1) and later.  I believe we already enforce these restrictions
manually elsewhere, so this should not restrict our set of valid target
machines.

ticket: 7667 (new)
queue: kfw
tags: pullup
target_version: 1.11.4

12 years agoWiX support for building with VS 2012
Ben Kaduk [Wed, 26 Jun 2013 19:11:37 +0000 (15:11 -0400)] 
WiX support for building with VS 2012

The merge modules need to reference VC110 paths.
Use a variable for VC100 versus VC110 so that we don't copy a lot
of boilerplate around.

ticket: 7666 (new)
queue: kfw
tags: pullup
target_version: 1.11.4

12 years agoFix uninitialized variable bugs
Greg Hudson [Thu, 27 Jun 2013 22:41:04 +0000 (18:41 -0400)] 
Fix uninitialized variable bugs

The previous few commits introduced a couple of bugs where variables
could be used without being initialized.  Fix them.

12 years agoAdd tests for pwqual modules and plugin ordering
Greg Hudson [Fri, 14 Jun 2013 19:28:06 +0000 (15:28 -0400)] 
Add tests for pwqual modules and plugin ordering

Create a test module for the pwqual interface, and script to exercise
the built-in and test modules through kadmin.local.  Also create a
test harness to display the order of pwqual modules for the current
configuration, and use it to test the plugin module ordering
guarantees.

ticket: 7665

12 years agoRely on module ordering for localauth
Greg Hudson [Fri, 14 Jun 2013 05:55:27 +0000 (01:55 -0400)] 
Rely on module ordering for localauth

Register built-in localauth modules in the order we want them used by
default, and document accordingly.

ticket: 7665

12 years agoProvide plugin module ordering guarantees
Greg Hudson [Fri, 14 Jun 2013 05:33:26 +0000 (01:33 -0400)] 
Provide plugin module ordering guarantees

Rewrite the plugin internals so that modules have a well-defined
order--either the order of enable_only tags, or dynamic modules
followed by the built-in modules in order of registration.

ticket: 7665 (new)

12 years agoFix spin loop reading from KDC TCP socket
Viktor Dukhovni [Tue, 25 Jun 2013 16:27:42 +0000 (12:27 -0400)] 
Fix spin loop reading from KDC TCP socket

In the k5_sendto code for reading from a TCP socket, detect
end-of-stream when reading the length.  Otherwise we can get stuck in
an infinite loop of poll() and read().

[ghudson@mit.edu: commit message]

ticket: 7508
target_version: 1.11.4
tags: pullup

12 years agoBuild with Visual Studio 2012
Ben Kaduk [Mon, 24 Jun 2013 22:19:45 +0000 (18:19 -0400)] 
Build with Visual Studio 2012

It's more aggressive about enforcing that keywords are not macros
in C++ mode, and has bumped the MFC version to 11.

Keep compatibility with older versions of Visual Studio, appropriately
conditionalized.

ticket: 7664 (new)
tags: pullup
target_version: 1.11.4

12 years ago[Leash] Notify the user of password change success
Ben Kaduk [Mon, 24 Jun 2013 19:56:54 +0000 (15:56 -0400)] 
[Leash] Notify the user of password change success

ticket: 7440
tags: pullup
target_version: 1.11.4

12 years agoFix timing edge cases in t_renew.py
Greg Hudson [Sun, 16 Jun 2013 20:42:00 +0000 (16:42 -0400)] 
Fix timing edge cases in t_renew.py

When we are testing maximum renewable lifetimes, the KDC might process
the request at a later time than the request time (typically by no
more than one second).  So we need to ask for a ticket lifetime longer
than the maximum renewable lifetime, not equal to it, or we risk
getting a just-barely-renewable ticket instead of a non-renewable one.
Also fix a couple of typos in comments.

12 years agoFix sentinel position in sample u2u server
Greg Hudson [Thu, 13 Jun 2013 15:06:23 +0000 (11:06 -0400)] 
Fix sentinel position in sample u2u server

Print "Server started" after calling listen(), or there wil be a race
where the client tries to connect before there is a listen queue and
gets ECONNREFUSED.

12 years agoFix various warnings
Greg Hudson [Fri, 7 Jun 2013 19:17:31 +0000 (15:17 -0400)] 
Fix various warnings

12 years agoRefactor KDC renewable ticket handling
Greg Hudson [Thu, 6 Jun 2013 18:44:30 +0000 (14:44 -0400)] 
Refactor KDC renewable ticket handling

Create a new helper to compute the renewable lifetime for AS and TGS
requests.  This has some minor behavior differences:

* We only issue a renewable ticket if the renewable lifetime is greater
  than the normal ticket lifetime.

* We give RENEWABLE precedence over RENEWABLE-OK in determining the
  requested renewable lifetime, instead of sometimes doing the
  reverse.

* We use the client's maximum renewable life for TGS requests if we
  have looked up its DB entry.

* Instead of rejecting requests for renewable tickets (if the client
  or server principal doesn't allow it, or a TGS request's TGT isn't
  renewable), issue non-renewable tickets.

ticket: 7661 (new)

12 years agoAdd t_init_creds to .gitignore
Greg Hudson [Thu, 6 Jun 2013 18:53:23 +0000 (14:53 -0400)] 
Add t_init_creds to .gitignore

12 years agoUse KDC clock skew for AS-REQ timestamps
Greg Hudson [Sun, 2 Jun 2013 05:22:38 +0000 (01:22 -0400)] 
Use KDC clock skew for AS-REQ timestamps

Calculate request timestamps each time we encode a request, and use
the adjusted current time when calculating them, including adjustments
resulting from preauth-required errors early in the AS exchange.

As a side effect, this reverts one of the changes in commit
37b0e55e21926c7875b7176e24e13005920915a6 (#7063); we will once again
use the time adjustment from any ccache we read before the AS
exchange, if we don't have a more specific adjustment from a
preauth-required error.

Based on a patch from Stef Walter.

ticket: 7657 (new)

12 years agoRefactor AS-REQ nonce and timestamp handling
Greg Hudson [Sun, 2 Jun 2013 04:31:04 +0000 (00:31 -0400)] 
Refactor AS-REQ nonce and timestamp handling

Create helper functions to set the request nonce and to set the
request timestamp.  Don't bother picking a nonce in
restart_init_creds_loop since we will just pick a new one in
init_creds_step_request.  Create a library-internal function to get
the current time with possible adjustment from a preauth-required
error.  Only set ctx->request_time in one place (just before encoding
each request).  Remove unused parameters from stash_as_reply.

Partially based on a patch from Stef Walter.

12 years agoUntabify and reindent t_authpkinit.py
Greg Hudson [Mon, 3 Jun 2013 19:38:08 +0000 (15:38 -0400)] 
Untabify and reindent t_authpkinit.py

12 years agoFix spurious clock skew caused by preauth delay
Greg Hudson [Sun, 2 Jun 2013 19:36:40 +0000 (15:36 -0400)] 
Fix spurious clock skew caused by preauth delay

Commit 37b0e55e21926c7875b7176e24e13005920915a6 (#7063) prevented
clock skew caused by preauth delay by recording the time of the
initial request.  However, it failed to take into account delay
between requests due to prompting during preauthentication.  Fix this
by recording the request time for each request.

ticket: 7656 (new)

12 years agoClean up dangling antecedent in allow_weak_crypto
Ben Kaduk [Fri, 31 May 2013 16:48:46 +0000 (12:48 -0400)] 
Clean up dangling antecedent in allow_weak_crypto

The "previous three lists" are not previous any more.
Say explicitly which three lists, and make the parenthetical bind
to the correct noun.

ticket: 7655 (new)
tags: pullup
target_version: 1.11.4

12 years agoClarify retiring-des based on user feedback
Ben Kaduk [Fri, 31 May 2013 16:40:10 +0000 (12:40 -0400)] 
Clarify retiring-des based on user feedback

Explain why DES keys should be removed from principals, and clarify
that allow_weak_crypto overrides all other configuration.

ticket: 7654 (new)
tags: pullup
target_version: 1.11.4

12 years agoDocument preauth flags for service principals
Ben Kaduk [Thu, 30 May 2013 22:49:36 +0000 (18:49 -0400)] 
Document preauth flags for service principals

These flags are overloaded to mean different things for clients and
servers; previously we only documented the client behavior.

ticket: 7653 (new)
tags: pullup
target_version: 1.11.4

12 years agoFix warnings in dbtest.c
Gilles Espinasse [Fri, 31 May 2013 17:04:36 +0000 (13:04 -0400)] 
Fix warnings in dbtest.c

Check return values of read() and write().  Avoid some unsigned
comparisons.  Cast a ptrdiff_t value to int for use with %d in a
format string.

[ghudson@mit.edu: rewrap long lines; fix one more warning; commit
message]

12 years agoLink dbtest with libkrb5support
Greg Hudson [Fri, 31 May 2013 16:47:34 +0000 (12:47 -0400)] 
Link dbtest with libkrb5support

In a static build, linking dbtest could fail on platforms where libdb2
depends on krb5support (platforms without a native mkstemp).  Reported
by Gilles Espinasse <g.esp@free.fr>.

ticket: 7651

12 years agoProperly handle use_master in k5_init_creds_get
Greg Hudson [Thu, 30 May 2013 15:39:54 +0000 (11:39 -0400)] 
Properly handle use_master in k5_init_creds_get

If we make multiple requests in an initial creds exchange, the
krb5_sendto_kdc call in k5_init_creds_get may flip the use_master
value from 0 to 1 if it detects that the response was from a master
KDC.  Don't turn this into a requirement for future requests during
the same exchange, or we may have trouble following AS referrals.
Reported by Sumit Bose.

ticket: 7650

12 years agoChange message macro for configure selection
Gilles Espinasse [Wed, 29 May 2013 16:13:57 +0000 (12:13 -0400)] 
Change message macro for configure selection

AC_MSG_RESULT is to print result after AC_MSG_CHECKING.
AC_MSG_NOTICE is to deliver message to user.
So use AC_MSG_NOTICE for --with options.

Remove overquoting too.

ticket: 7648

12 years agoFix non-builtin crypto module builds
Greg Hudson [Wed, 29 May 2013 05:20:19 +0000 (01:20 -0400)] 
Fix non-builtin crypto module builds

Commit 4b0985f8573840838bcfa8ec1df3dcd39a3dbf15 went a bit too far in
pruning the placeholder makefiles for the openssl and nss crypto
modules.  We need enough boilerplate to create OBJS.SH in each
directory.

12 years agoMake empty passwords work via init_creds APIs
Greg Hudson [Thu, 23 May 2013 19:33:58 +0000 (15:33 -0400)] 
Make empty passwords work via init_creds APIs

In the gak_data value used by krb5_get_as_key_password, separate the
already-known password from the storage we might have allocated to put
it in, so that we no longer use an empty data buffer to determine
whether we know the password.  This allows empty passwords to work via
the API.

Remove the kadm5 test which explicitly uses an empty password.

Based on a patch from Stef Walter.

ticket: 7642

12 years agoFix rc4 string-to-key on unterminated inputs
Greg Hudson [Fri, 24 May 2013 17:16:52 +0000 (13:16 -0400)] 
Fix rc4 string-to-key on unterminated inputs

The internal UTF-8 to UCS-2 conversion functions did not properly
respect their length arguments, instead assuming that the input string
is terminated with a zero bytes.  As a result,
krb5int_arcfour_string_to_key could fail on unterminated inputs.  Fix
the underlying support functions to read their inputs only up to the
specified length.

ticket: 7643 (new)

12 years agoDon't warn or error on variadic macros
Greg Hudson [Sat, 25 May 2013 18:35:41 +0000 (14:35 -0400)] 
Don't warn or error on variadic macros

Our portability assumptions now allow the use of variadic macros, so
don't warn or error on them.

12 years agoAdd AES-NI support on Linux
Greg Hudson [Sun, 5 May 2013 01:52:21 +0000 (21:52 -0400)] 
Add AES-NI support on Linux

If yasm and cpuid.h are present on a Linux i686 or x64 system, compile
the modified Intel AES-NI assembly sources.  In the builtin AES enc
provider, check at runtime whether the CPU supports AES-NI
instructions and use the assembly functions if so.

12 years agoAdjust AESNI sources for krb5 tree
Greg Hudson [Sat, 4 May 2013 23:09:38 +0000 (19:09 -0400)] 
Adjust AESNI sources for krb5 tree

Remove functions we don't need.  Add macros to redefine functions with
an appropriate namespace prefix.

12 years agoAdd Intel AESNI assembly files
Greg Hudson [Wed, 24 Apr 2013 17:04:19 +0000 (13:04 -0400)] 
Add Intel AESNI assembly files

Add assembly files from the Intel AESNI Sample Library, version 1.2,
which implement AES encryption using AES-NI instructions.  Trailing
whitespace was removed.

12 years agoRefactor AES, Camellia builtin enc providers
Greg Hudson [Tue, 7 May 2013 00:23:09 +0000 (20:23 -0400)] 
Refactor AES, Camellia builtin enc providers

In preparation for AES-NI support, adjust the block encryption helpers
in the AES enc provider so that the cache is only touched by helpers,
and reframe the CTS operations in terms of CBC operations.  Change the
Camellia enc provider as well for consistency.

12 years agoSimplify crypto IOV helpers
Greg Hudson [Mon, 6 May 2013 04:43:27 +0000 (00:43 -0400)] 
Simplify crypto IOV helpers

Expand the concept of an IOV block state into a cursor which remembers
the IOV set being iterated over, the block size, and both input and
output positions.  Eliminate the no-copy inline block getter for now,
but provide helpers to grab contiguous chains of blocks from a cursor.
Also provide an inline helper to sum the total length of an iov chain.

12 years agoFix krb5_rd_req usage in user-to-user sample app
Greg Hudson [Wed, 22 May 2013 05:57:36 +0000 (01:57 -0400)] 
Fix krb5_rd_req usage in user-to-user sample app

Pass the server principal to krb5_rd_req so it can do proper transited
checking.

12 years agoClarify krb5_rd_req documentation
Greg Hudson [Wed, 22 May 2013 05:55:12 +0000 (01:55 -0400)] 
Clarify krb5_rd_req documentation

For the user-to-user case, document that callers should pass a server
principal to krb5_rd_req.  For the keytab case, more accurately
document which keytab keys are tried against the ticket.

ticket: 7641 (new)
target_version: 1.11.3
tags: pullup

12 years agoFix transited handling for GSSAPI acceptors
Greg Hudson [Mon, 20 May 2013 15:03:04 +0000 (11:03 -0400)] 
Fix transited handling for GSSAPI acceptors

The Acceptor Names project (#6855) extended krb5_rd_req so that it can
accept a "matching principal" in the server parameter.  If the
matching principal has an empty realm, rd_req_decoded_opt attempted to
do transited checking with an empty server realm.

To fix this, always reset server to req->ticket->server for future
processing steps if we decrypt the ticket using a keytab.
decrypt_ticket replaces req->ticket->server with the principal name
from the keytab entry, so we know this name is correct.

Based on a bug report and patch from nalin@redhat.com.

ticket: 7639
target_version: 1.11.3
tags: pullup