krb5.git
14 years agoUse gss_set_cred_option instead of (undeclared) gssspi_set_cred_option
Ken Raeburn [Sat, 2 Oct 2010 03:29:37 +0000 (03:29 +0000)]
Use gss_set_cred_option instead of (undeclared) gssspi_set_cred_option

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

14 years agoTry to require function declarations for GCC, as we already do for the
Ken Raeburn [Sat, 2 Oct 2010 03:29:34 +0000 (03:29 +0000)]
Try to require function declarations for GCC, as we already do for the
Sun compiler.

Change the cache variable name construction to distinguish "=" from
"-" in option names.  Prefer -Werror-implicit-function-declaration
over -Werror=implicit-function-declaration since in some versions of
GCC only the former works properly.

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

14 years agoAdd empty src/plugins/preauth/securid_sam2/deps to allow build to work again
Tom Yu [Fri, 1 Oct 2010 20:15:00 +0000 (20:15 +0000)]
Add empty src/plugins/preauth/securid_sam2/deps to allow build to work again

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

14 years agoAdd an error to be returned by a preauth mechanism indicating that the KDC should...
Sam Hartman [Fri, 1 Oct 2010 17:12:41 +0000 (17:12 +0000)]
Add an error to be returned by a preauth mechanism indicating that the KDC should not respond to a packet

* Do not generate an error response in this case
* Drop a TCP connection if we are not going to respond to it.

kdc: add KRB5KDC_ERR_DISCARD

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

14 years agoInitial securid2 support.
Sam Hartman [Fri, 1 Oct 2010 17:12:37 +0000 (17:12 +0000)]
Initial securid2 support.
builds but untested

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

14 years agoEnable sam_challenge_2 encoders
Sam Hartman [Fri, 1 Oct 2010 17:12:30 +0000 (17:12 +0000)]
Enable sam_challenge_2 encoders

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

14 years agoRemove support for the old pa-sam-challenge and pa-sam-response
Sam Hartman [Fri, 1 Oct 2010 17:12:26 +0000 (17:12 +0000)]
Remove support for the old pa-sam-challenge and pa-sam-response
preauth type per discussion on krbdev.  The pa-sam-challenge-2 code
remains in the client.

preauth: remove pa-sam-challenge

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

14 years agoImplement k5login_directory and k5login_authoritative options
Greg Hudson [Fri, 1 Oct 2010 15:56:30 +0000 (15:56 +0000)]
Implement k5login_directory and k5login_authoritative options

Add and document two new options for controlling k5login behavior.

ticket: 6792

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

14 years agoAdd a simple test harness for kuserok. Build it during make check but
Greg Hudson [Fri, 1 Oct 2010 13:44:12 +0000 (13:44 +0000)]
Add a simple test harness for kuserok.  Build it during make check but
don't run any automated tests for the moment.

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

14 years agoA cleaner impleentation of r24399 which adds two new auth context APIs
Greg Hudson [Fri, 1 Oct 2010 03:47:38 +0000 (03:47 +0000)]
A cleaner impleentation of r24399 which adds two new auth context APIs
(and is therefore less suitable for backporting to 1.8) but doesn't
reach inside the auth context structure in the krb5 mechanism code.

ticket: 6768

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

14 years agoGSSAPI forwarded credentials must be encrypted in session key
Greg Hudson [Fri, 1 Oct 2010 03:45:43 +0000 (03:45 +0000)]
GSSAPI forwarded credentials must be encrypted in session key

When IAKERB support was added, the krb5_mk_req checksum function
gained access to the send subkey.  This caused GSSAPI forwarded
credentials to be encrypted in the subkey, which violates RFC 4121
section 4.1.1 and is not accepted by Microsoft's implementation.
Temporarily null out the send subkey in the auth context so that
krb5_mk_ncred uses the session key instead.

ticket: 6768
target_version: 1.8.4
tags: pullup

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

14 years agoWhitespace
Greg Hudson [Thu, 30 Sep 2010 17:16:46 +0000 (17:16 +0000)]
Whitespace

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

14 years agoWhitespace
Greg Hudson [Thu, 30 Sep 2010 17:02:29 +0000 (17:02 +0000)]
Whitespace

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

14 years agoUse a different construction for defaulting ks_tuple and n_ks_tuple in
Greg Hudson [Thu, 30 Sep 2010 17:01:30 +0000 (17:01 +0000)]
Use a different construction for defaulting ks_tuple and n_ks_tuple in
the libkadm5 server principal routines, to avoid repeated conditional
expressions.

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

14 years agoWhitespace and minor style changes
Greg Hudson [Thu, 30 Sep 2010 15:53:44 +0000 (15:53 +0000)]
Whitespace and minor style changes

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

14 years agoCorrect the admin documentation for auth_to_local
Greg Hudson [Thu, 30 Sep 2010 13:13:41 +0000 (13:13 +0000)]
Correct the admin documentation for auth_to_local

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

14 years agoFollow-on to r24258: initialize the new k5e1 error table where we
Greg Hudson [Wed, 29 Sep 2010 21:38:26 +0000 (21:38 +0000)]
Follow-on to r24258: initialize the new k5e1 error table where we
initialize the krb5 error table, and add initialize_k5e1_error_table
to the libkrb5 exports list for consistency with the other error
tables.

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

14 years agomake depend
Sam Hartman [Wed, 29 Sep 2010 21:29:25 +0000 (21:29 +0000)]
make depend
Add kadm5_hook test plugin to toplevel Makefile.in

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

14 years agoAutomated tests for kadm5_hook plugin
Sam Hartman [Wed, 29 Sep 2010 21:29:20 +0000 (21:29 +0000)]
Automated tests for kadm5_hook plugin

Include a k5test Python test and test plugin for the kadm5_hook interface.

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

14 years agokadm5_hook: new plugin interface
Sam Hartman [Wed, 29 Sep 2010 21:29:14 +0000 (21:29 +0000)]
kadm5_hook: new plugin interface

Implement http://k5wiki.kerberos.org/wiki/Projects/Kadmin_hook_interface

This provides an interface that allows a plugin to track kadmin
operations. This can be used for projects like the krb5-sync project.

ticket: 6791

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

14 years agoMake krb5_dbe_def_search_enctype skip key data entries with invalid
Greg Hudson [Tue, 28 Sep 2010 19:09:11 +0000 (19:09 +0000)]
Make krb5_dbe_def_search_enctype skip key data entries with invalid
enctypes instead of erroring out on them.  We had this behavior prior
to 1.8 (more by accident than by design), but it changed as a
side-effect of r23599.

ticket: 6790
target_version: 1.8.4
tags: pullup

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

14 years agoUse IAKERB OID header for all IAKERB messages including AP-REQ
Luke Howard [Mon, 27 Sep 2010 18:51:55 +0000 (18:51 +0000)]
Use IAKERB OID header for all IAKERB messages including AP-REQ

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

14 years agoDoxygen for k5-buf.h
Sam Hartman [Mon, 27 Sep 2010 17:16:47 +0000 (17:16 +0000)]
Doxygen for k5-buf.h

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

14 years agokpasswd: if a credential cache is present, use FAST
Sam Hartman [Mon, 27 Sep 2010 17:16:41 +0000 (17:16 +0000)]
kpasswd: if a credential cache is present, use FAST

If a credentials cache is available, use it as an armor cache to enable FAST negotiation for kpasswd. This requires an attacker to attack both the user's long-term key for the old password as well as the ticket used for the armor cache in order to attack the password change. Depending on how the armor ticket is obtained, this may provide limited value. However, it provides users an easy option if they are concerned about their current password. Users can kinit with one principal to help protect changing the password of another principal.

* krb5_get_init_creds_opt_set_fast_ccache: new API to set fast ccache based on a krb5_ccache object rather than a resolvable string

* kpasswd: always open the current credential cache even if not needed
  for determining the principal. If the cache has tickets, use it as
  an armor cache.

* tests/dejagnu/krb-standalone/kadmin.exp: Arrange to test new code path

ticket: 6786

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

14 years agoSimplify acquire_accept_cred very slightly, avoiding some long lines
Greg Hudson [Mon, 27 Sep 2010 03:46:57 +0000 (03:46 +0000)]
Simplify acquire_accept_cred very slightly, avoiding some long lines
and repeated macro calls.

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

14 years agoAdd gss_krb5_import_cred
Greg Hudson [Mon, 27 Sep 2010 03:39:22 +0000 (03:39 +0000)]
Add gss_krb5_import_cred

Add gss_krb5_import_cred from Heimdal; allows krb5 creds to be
acquired from a keytab or ccache into a GSSAPI credential without
using global process or thread variables.

Merged from the users/lhoward/import-cred branch.

ticket: 6785

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

14 years agoInitialize kdb5_ldap_util's context with kadm5_init_krb5_context, like
Greg Hudson [Wed, 22 Sep 2010 22:09:24 +0000 (22:09 +0000)]
Initialize kdb5_ldap_util's context with kadm5_init_krb5_context, like
kdb5_util does, in order to get the KDC profile settings as well as
the regular krb5 profile settings.

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

14 years agorelicense Sun RPC to 3-clause BSD-style
Tom Yu [Wed, 22 Sep 2010 21:50:48 +0000 (21:50 +0000)]
relicense Sun RPC to 3-clause BSD-style

Per e-mail from Wim Coekaerts, Oracle America authorizes the
relicensing of Sun RPC to 3-clause BSD-style.

ticket: 6784

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

14 years agoAdjust the k5login man page to have a slightly more neutral tone
Greg Hudson [Mon, 20 Sep 2010 18:25:18 +0000 (18:25 +0000)]
Adjust the k5login man page to have a slightly more neutral tone

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

14 years agoSlight revisions to create_workers() in the KDC:
Greg Hudson [Sun, 19 Sep 2010 12:03:18 +0000 (12:03 +0000)]
Slight revisions to create_workers() in the KDC:
* Use calloc() to allocate the pids array; squashes a Coverity false
  positive.
* Don't leak the pids array in worker processes.
* Use consistent terminology in comments.

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

14 years agoKDC worker processes feature
Greg Hudson [Fri, 17 Sep 2010 17:42:31 +0000 (17:42 +0000)]
KDC worker processes feature

Add support for a krb5kdc -w option which causes the KDC to spawn
worker processes which can process requests in parallel.  See also:
http://k5wiki.kerberos.org/wiki/Projects/Parallel_KDC

ticket: 6783

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

14 years agoAdd an extra arguments parameter to k5test's realm.start_kdc()
Greg Hudson [Fri, 17 Sep 2010 16:06:34 +0000 (16:06 +0000)]
Add an extra arguments parameter to k5test's realm.start_kdc()

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

14 years agoIn kinit_kdb_init(), ensure that we don't return an error with the
Greg Hudson [Fri, 17 Sep 2010 15:52:23 +0000 (15:52 +0000)]
In kinit_kdb_init(), ensure that we don't return an error with the
old, freed value of *pcontext still there--that would result in a
double free.

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

14 years agoFollow-on to r24315: remove get/set_mkey_list from export list of
Greg Hudson [Thu, 16 Sep 2010 17:38:30 +0000 (17:38 +0000)]
Follow-on to r24315: remove get/set_mkey_list from export list of
libkdb_ldap.

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

14 years agoIn the PKINIT OpenSSL crypto code, use a signed int to hold the result
Greg Hudson [Wed, 15 Sep 2010 22:43:00 +0000 (22:43 +0000)]
In the PKINIT OpenSSL crypto code, use a signed int to hold the result
of X509_get_ext_by_NID so we can detect negative return values.
Reported by nalin@redhat.com.

ticket: 6774

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

14 years agoWhitespace
Greg Hudson [Wed, 15 Sep 2010 20:07:39 +0000 (20:07 +0000)]
Whitespace

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

14 years agoAdd a license statement to the new extern.h in kinit, use an include
Greg Hudson [Wed, 15 Sep 2010 17:45:31 +0000 (17:45 +0000)]
Add a license statement to the new extern.h in kinit, use an include
blocker which does not impinge on the system's symbol namespace, and
use the recommended formatting for function prototypes.

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

14 years agoWhitespace
Greg Hudson [Wed, 15 Sep 2010 17:30:17 +0000 (17:30 +0000)]
Whitespace

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

14 years agoFormatting fix
Greg Hudson [Wed, 15 Sep 2010 17:22:57 +0000 (17:22 +0000)]
Formatting fix

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

14 years agokinit: add KDB keytab support
Sam Hartman [Wed, 15 Sep 2010 17:13:41 +0000 (17:13 +0000)]
kinit: add KDB keytab support

This implements
http://k5wiki.kerberos.org/Projects/What_does_God_need_with_a_password.
If the KDB keytab is selected by command line options, then kinit will
register the KDB keytab and open the database.  This permits an
administrator to obtain tickets as a user without knowing that user's
password.

As a result kinit links against libkadm5srv and libkdb5. Discussion is
ongoing about whether this is desirable or about whether two versions
of kinit are required.

ticket: 6779

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

14 years agoRemove dead code from DAL and kdb plugins
Sam Hartman [Wed, 15 Sep 2010 17:13:34 +0000 (17:13 +0000)]
Remove dead code from DAL and kdb plugins

kdb: remove get/set_mkey_list

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

14 years agokdb: store mkey list in context and permit NULL mkey for kdb_dbe_decrypt_key_data
Sam Hartman [Wed, 15 Sep 2010 17:13:23 +0000 (17:13 +0000)]
kdb: store mkey list in context and permit NULL mkey for kdb_dbe_decrypt_key_data

Previously, code needed to run a loop to find the current master key,
possibly fetch a new master key list and try finding the master key
again around each key decryption.  This was not universally done;
there are cases where only the current master key was used.  In
addition, the correct ideom for decrypting key data is too complicated
and is potentially unavailable to plugins that do not have access to
the master key.  Instead, store the master key list in the dal_handle
whenever it is fetched and permit a NULL master key for
krb5_dbe_decrypt_key_data.

* Remove APIs for krb5_db_{get|set}_mkey_list
* krb5_db_fetch_mkey_list: memoize master key list in dal_handle
* krb5_db_free_mkey_list: don't free the memoized list; arrange for it to be freed later
* krb5_dbe_decrypt_key_data: Search for correct master key on NULL argument
* change call sites to take advantage

ticket: 6778

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

14 years agoIn the PKINIT OpenSSL code, ensure that appropriate cerficiate fields
Greg Hudson [Wed, 15 Sep 2010 17:10:05 +0000 (17:10 +0000)]
In the PKINIT OpenSSL code, ensure that appropriate cerficiate fields
have been set before using ku_reject.  Patch from nalin@redhat.com.

ticket: 6775

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

14 years agoUse correct CRL stack macros in pkinit OpenSSL code. Patch from Olaf
Greg Hudson [Wed, 15 Sep 2010 17:06:43 +0000 (17:06 +0000)]
Use correct CRL stack macros in pkinit OpenSSL code.  Patch from Olaf
Flebbe.

ticket: 6776

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

14 years agoWhitespace
Greg Hudson [Wed, 15 Sep 2010 16:51:31 +0000 (16:51 +0000)]
Whitespace

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

14 years agoFix warnings in encrypt_key and decrypt_key. Avoid a segfault if NULL
Sam Hartman [Wed, 15 Sep 2010 16:40:32 +0000 (16:40 +0000)]
Fix warnings in encrypt_key and decrypt_key. Avoid a segfault if NULL
master key is passed into default decryption function.

kdb: fix warnings

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

14 years agoIn krb5_sname_to_principal, correctly handle failures from
Greg Hudson [Wed, 15 Sep 2010 15:50:15 +0000 (15:50 +0000)]
In krb5_sname_to_principal, correctly handle failures from
krb5_build_principal.

ticket: 6777

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

14 years agoAllow a zero checksum type to be passed into krb5_k_verify_checksum_iov;
Luke Howard [Thu, 9 Sep 2010 15:54:32 +0000 (15:54 +0000)]
Allow a zero checksum type to be passed into krb5_k_verify_checksum_iov;
this indicates that the mandatory checksum type for the key is to be used.
This interface is necessary because there is no public interface through
which the mandatory checksum type for an encryption type can be determined.

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

14 years agokrb5_k_make_checksum will use the mandatory checksum type if 0 is
Luke Howard [Thu, 9 Sep 2010 15:39:47 +0000 (15:39 +0000)]
krb5_k_make_checksum will use the mandatory checksum type if 0 is
passed in as the checksum type; however krb5_k_make_checksum_iov
does not support this. Add the same logic for the behaviour is
consistent.

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

14 years agoAdd dummy camellia subdir to openssl back end makefile
Greg Hudson [Wed, 8 Sep 2010 17:38:22 +0000 (17:38 +0000)]
Add dummy camellia subdir to openssl back end makefile

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

14 years agoMake depend
Greg Hudson [Wed, 8 Sep 2010 03:51:31 +0000 (03:51 +0000)]
Make depend

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

14 years agoDon't build the built-in Camellia block cipher code if Camellia-CCM
Greg Hudson [Wed, 8 Sep 2010 03:48:05 +0000 (03:48 +0000)]
Don't build the built-in Camellia block cipher code if Camellia-CCM
enctypes aren't enabled.

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

14 years agoX509_verify_cert can return without setting cert_ctx.current_cert. If
Greg Hudson [Wed, 8 Sep 2010 03:15:49 +0000 (03:15 +0000)]
X509_verify_cert can return without setting cert_ctx.current_cert.  If
it does, don't dereference a null pointer when creating the pkiDebug
message.

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

14 years agoMerge the camellia-ccm branch to trunk. Since there are no IANA
Greg Hudson [Tue, 7 Sep 2010 17:54:15 +0000 (17:54 +0000)]
Merge the camellia-ccm branch to trunk.  Since there are no IANA
assignments for Camellia-CCM enctypes or cksumtypes yet, they are
disabled in a default build.  They can be made available by defining
(via CPPFLAGS) local-use enctype numbers for the enctypes and
cksumtypes.

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

14 years agoEnsure valid key in krb5int_yarrow_cipher_encrypt_block
Ezra Peisach [Sat, 4 Sep 2010 21:46:53 +0000 (21:46 +0000)]
Ensure valid key in krb5int_yarrow_cipher_encrypt_block

Under low memory conditions (or when testing memory allocation failures),
the key pointer will be 0 - and not initialized. Test and return failure
before deref a NULL.

ticket: 6772

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

14 years agoFix memory leaks in kdb5_verify
Ezra Peisach [Sat, 4 Sep 2010 21:43:04 +0000 (21:43 +0000)]
Fix memory leaks in kdb5_verify

Minor leaks.  Just cleaning up code.

ticket: 6771

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

14 years agoIn k5_pwqual_load(), if the last vtable initializer fails, return 0
Greg Hudson [Sat, 4 Sep 2010 14:50:27 +0000 (14:50 +0000)]
In k5_pwqual_load(), if the last vtable initializer fails, return 0
and not its exit value.

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

14 years agoFix output argument ordering and handling in k5_pwqual_load()
Greg Hudson [Fri, 3 Sep 2010 22:24:25 +0000 (22:24 +0000)]
Fix output argument ordering and handling in k5_pwqual_load()

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

14 years agoPrevent a double free in k5_pwqual_load()
Greg Hudson [Fri, 3 Sep 2010 22:21:39 +0000 (22:21 +0000)]
Prevent a double free in k5_pwqual_load()

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

14 years agoclean up memory leak and potential unused variable in crypto tests
Ezra Peisach [Fri, 3 Sep 2010 02:43:21 +0000 (02:43 +0000)]
clean up memory leak and potential unused variable in crypto tests

t_prf.c:  Ensure prfsz is set before use (not exercised in current tests)

t_short.c: Fix memory leak

ticket: 6769

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

14 years agoProperly search for MANDATORY-FOR-KDC authdata elements. Reported by
Greg Hudson [Thu, 2 Sep 2010 15:35:25 +0000 (15:35 +0000)]
Properly search for MANDATORY-FOR-KDC authdata elements.  Reported by
Mike Roszkowski.

ticket: 6764
tags: pullup
target_version: 1.8.4

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

14 years agoOops, pwqual_combo wasn't supposed to make it out of the plugins2
Greg Hudson [Wed, 1 Sep 2010 21:16:05 +0000 (21:16 +0000)]
Oops, pwqual_combo wasn't supposed to make it out of the plugins2
branch.  Delete it.

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

14 years agoPassword quality pluggable interface
Greg Hudson [Wed, 1 Sep 2010 16:40:22 +0000 (16:40 +0000)]
Password quality pluggable interface

Merge branches/plugins2 to trunk.  Adds a password quality pluggable
interface described in this project page:

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

ticket: 6765

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

14 years agoMake the new profile tcl tests work with tcl 8.3
Greg Hudson [Tue, 31 Aug 2010 21:37:51 +0000 (21:37 +0000)]
Make the new profile tcl tests work with tcl 8.3

ticket: 6761

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

14 years agoMake relative plugin module paths be interpreted as relative to
Greg Hudson [Mon, 30 Aug 2010 16:20:34 +0000 (16:20 +0000)]
Make relative plugin module paths be interpreted as relative to
LIBDIR/krb5/plugins.

ticket: 6763

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

14 years agoFix a resource leak in the profile include support
Greg Hudson [Sun, 29 Aug 2010 22:35:41 +0000 (22:35 +0000)]
Fix a resource leak in the profile include support

ticket: 6761

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

14 years agoAdd simple automated tests for account lockout support
Greg Hudson [Sun, 29 Aug 2010 15:39:08 +0000 (15:39 +0000)]
Add simple automated tests for account lockout support

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

14 years agoFix an account lockout error-handling regression by converting the
Greg Hudson [Sun, 29 Aug 2010 15:32:04 +0000 (15:32 +0000)]
Fix an account lockout error-handling regression by converting the
result of krb5_db_check_policy_as/tgs from a krb5_error_code to a
protocol error number.

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

14 years agoAdd plugin.o to T_ETYPES_OBJS because init_ctx.o needs it now
Tom Yu [Fri, 27 Aug 2010 18:01:14 +0000 (18:01 +0000)]
Add plugin.o to T_ETYPES_OBJS because init_ctx.o needs it now

ticket: 6763

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

14 years agoNew plugin infrastructure
Greg Hudson [Fri, 27 Aug 2010 04:29:11 +0000 (04:29 +0000)]
New plugin infrastructure

Merge domain-independent plugin framework code from branches/plugins2,
leaving out the password quality interface.

ticket: 6763

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

14 years agoAdd an expansion error table for libkrb5, since krb5_err.et is full
Greg Hudson [Thu, 26 Aug 2010 16:59:37 +0000 (16:59 +0000)]
Add an expansion error table for libkrb5, since krb5_err.et is full

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

14 years agord_req_decoded: clarify behavior in comment
Sam Hartman [Wed, 25 Aug 2010 23:31:59 +0000 (23:31 +0000)]
rd_req_decoded: clarify behavior in comment

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

14 years agoRevise the profile include design so that included files are
Greg Hudson [Wed, 25 Aug 2010 18:22:53 +0000 (18:22 +0000)]
Revise the profile include design so that included files are
syntactically independent of parent files.

ticket: 6761

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

14 years agoCorrect a comment
Greg Hudson [Tue, 24 Aug 2010 22:57:40 +0000 (22:57 +0000)]
Correct a comment

ticket: 6761

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

14 years agoIn the LDAP KDB module's populate_krb5_db_entry, fix the checks for
Greg Hudson [Tue, 24 Aug 2010 22:45:37 +0000 (22:45 +0000)]
In the LDAP KDB module's populate_krb5_db_entry, fix the checks for
the KDB_PRINC_EXPIRE_TIME_ATTR and KDB_PWD_EXPIRE_TIME_ATTR flags so
that they properly succeed when the flags are set.  Bug report from
Rob Crittenden, patch from nalin@redhat.com.

ticket: 6762

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

14 years agoadd profile include support
Greg Hudson [Tue, 24 Aug 2010 21:52:32 +0000 (21:52 +0000)]
add profile include support

Add support for "include" and "includedir" directives in profile files.
See http://k5wiki.kerberos.org/wiki/Projects/Profile_Includes for more
details.

ticket: 6761

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

14 years agoFail properly when profile can't be accessed
Greg Hudson [Mon, 23 Aug 2010 22:03:25 +0000 (22:03 +0000)]
Fail properly when profile can't be accessed

Make profile_init() return EACCESS or EPERM if one of those errors was
encountered when failing to open any of the specified profile files.
This causes krb5_init_os_context() to fail properly when krb5.conf is
unreadable, instead of treating that situation like a nonexistent
krb5.conf.

The library will continue to soldier on if one profile file is
readable and another is not.  This is deliberate as of r14116, whether
or not it's a good idea.

ticket: 6760

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

14 years agoAllow krb5_gss_register_acceptor_identity to unset keytab name
Greg Hudson [Thu, 19 Aug 2010 16:38:30 +0000 (16:38 +0000)]
Allow krb5_gss_register_acceptor_identity to unset keytab name

krb5_gss_register_acceptor_identity sets a mutex-locked global (not
thread-specific) variable containing a keytab name.  This change
allows the variable to be unset by passing a null value.

A more elegant long-term solution to the problem is Heimdal's
gss_krb5_import_cred function.

ticket: 6758

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

14 years agoAdd GIC option for password/account expiration callback
Greg Hudson [Thu, 12 Aug 2010 17:41:41 +0000 (17:41 +0000)]
Add GIC option for password/account expiration callback

Add a new GIC option to specify a callback to receive password and
account expiration times found in an AS reply.

See also:
http://k5wiki.kerberos.org/wiki/Projects/Password_expiration_API

ticket: 6755

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

14 years agoIn AS replies, set the key-expiration field to the minimum of account
Greg Hudson [Thu, 12 Aug 2010 17:39:09 +0000 (17:39 +0000)]
In AS replies, set the key-expiration field to the minimum of account
and password expiration time as specified in RFC 4120.  Reported by
Mary Cushion <mary@eiger.demon.co.uk>.

ticket: 2032

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

14 years agoCorrect the documentation for the start_kadmind keyword in k5test.py
Greg Hudson [Thu, 12 Aug 2010 17:15:17 +0000 (17:15 +0000)]
Correct the documentation for the start_kadmind keyword in k5test.py

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

14 years agoRemove two unused source files in lib/gssapi/generic
Greg Hudson [Thu, 12 Aug 2010 14:28:13 +0000 (14:28 +0000)]
Remove two unused source files in lib/gssapi/generic

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

14 years agoMove the password expiry warning code out of
Greg Hudson [Tue, 10 Aug 2010 19:02:23 +0000 (19:02 +0000)]
Move the password expiry warning code out of
krb5_get_init_creds_password() into a helper function.

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

14 years agoUse xdr_int32 instead of xdr_u_int in xdr_krb5_enctype(), since
Greg Hudson [Mon, 26 Jul 2010 18:19:49 +0000 (18:19 +0000)]
Use xdr_int32 instead of xdr_u_int in xdr_krb5_enctype(), since
enctypes are signed 32-bit values.  Wire representation does not
change.

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

14 years agoFix XDR decoding of large values in xdr_u_int
Greg Hudson [Mon, 26 Jul 2010 18:18:57 +0000 (18:18 +0000)]
Fix XDR decoding of large values in xdr_u_int

Our ancient RPC value internally decodes 32-bit wire values into a
signed long, which is then casted to the appropriate type.
xdr_u_int() contains a check intended to catch wire values that don't
fit into a u_int on platforms with 16-ints, but on platforms with
64-bit longs it was failing on values of 2^31 or larger because the
sign-extended value appeared larger than UINT_MAX.  Fix the check by
casting the value to uint32_t before comparing.

This bug, in combination with a poor choice of types in
kadm_rpc_xdr.c's xdr_krb5_enctype(), prevented negative enctype values
from being transported properly in kadmin's change_password command
result.

ticket: 6753

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

14 years agoAddendum to r24200: fix kdb5_ldap_util call site of
Greg Hudson [Wed, 21 Jul 2010 20:37:51 +0000 (20:37 +0000)]
Addendum to r24200: fix kdb5_ldap_util call site of
krb5_ldap_lib_init.

ticket: 6749

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

14 years agoRevert the part of r24157 which added the dal_version argument to the
Greg Hudson [Wed, 21 Jul 2010 19:01:35 +0000 (19:01 +0000)]
Revert the part of r24157 which added the dal_version argument to the
init_library interface.  Instead use the already existing maj_ver
field of the DAL vtable to detect incompatibilities.  Since maj_ver
is a short int, use an incrementing number instead of a date for the
major version.

ticket: 6749

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

14 years agoGet the kdb_hdb module to compile again. Probably still buggy,
Greg Hudson [Tue, 20 Jul 2010 08:52:41 +0000 (08:52 +0000)]
Get the kdb_hdb module to compile again.  Probably still buggy,
particularly around the master key logic.

ticket: 6749

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

14 years agoIn kdb5_util's kdb5_ldap_create(), add back the assignment of
Greg Hudson [Mon, 19 Jul 2010 10:05:13 +0000 (10:05 +0000)]
In kdb5_util's kdb5_ldap_create(), add back the assignment of
rblock.key which was erroneously removed in r24162.

ticket: 6749

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

14 years agoAllow Microsoft HMAC-MD5 checksum types to use non-RC4 keys
Greg Hudson [Mon, 19 Jul 2010 05:01:45 +0000 (05:01 +0000)]
Allow Microsoft HMAC-MD5 checksum types to use non-RC4 keys

In PAC signatures, the hmac-md5 checksum type can be used with AES
keys.  Make this work by removing the enc field from the hmac-md5 and
md5-hmac checksum types, and adding a check in
krb5int_hmacmd5_checksum() for a null key or a key which is longer
than the hash block size (64 bytes for MD5).  The checksum algorithm
only uses the key bits; it does invoke the cipher.

The checksum type names are kind of wrong, but we'll leave them alone
for compatibility.  The descriptions are updated.

ticket: 6751
target_version: 1.8.3
tags: pullup

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

14 years agoIn the DAL documentation, describe how a module can supply referral
Greg Hudson [Mon, 19 Jul 2010 04:30:47 +0000 (04:30 +0000)]
In the DAL documentation, describe how a module can supply referral
encrypted padata.

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

14 years agoAdd check_allowed_to_delegate to the DAL with a corresponding libkdb5
Greg Hudson [Thu, 15 Jul 2010 04:18:00 +0000 (04:18 +0000)]
Add check_allowed_to_delegate to the DAL with a corresponding libkdb5
API, replacing the last method (CHECK_ALLOWED_TO_DELEGATE) of
db_invoke.  Remove db_invoke since it no longer has any methods.

ticket: 6749

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

14 years agoAddendum to r24182: Fix a comment referencing the db_invoke
Greg Hudson [Thu, 15 Jul 2010 03:17:08 +0000 (03:17 +0000)]
Addendum to r24182: Fix a comment referencing the db_invoke
SIGN_DB_AUTHDATA method.

ticket: 6749
status: open

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

14 years agoAdd refresh_config to the DAL with a corresponding libkdb5 API,
Greg Hudson [Thu, 15 Jul 2010 03:12:57 +0000 (03:12 +0000)]
Add refresh_config to the DAL with a corresponding libkdb5 API,
replacing the REFRESH_POLICY method of db_invoke.

ticket: 6749
status: open

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

14 years agoAddendum to r24185: make audit_as_req return void, since it's an
Greg Hudson [Tue, 13 Jul 2010 16:09:01 +0000 (16:09 +0000)]
Addendum to r24185: make audit_as_req return void, since it's an
informational method and we're not going to do anything with the
result.

ticket: 6749
status: open

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

14 years agoAdd audit_as_req to the DAL with a corresponding libkdb5 API,
Greg Hudson [Tue, 13 Jul 2010 15:53:23 +0000 (15:53 +0000)]
Add audit_as_req to the DAL with a corresponding libkdb5 API,
replacing the AUDIT_AS_REQ method of db_invoke.  Remove the
AUDIT_TGS_REQ method of db_invoke without adding a replacement, as
there was no KDC support for it.  (It can be added at a later time if
necessary.)

ticket: 6749
status: open

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

14 years agoAdd check_policy_as and check_policy_tgs to the DAL table with
Greg Hudson [Tue, 13 Jul 2010 00:53:46 +0000 (00:53 +0000)]
Add check_policy_as and check_policy_tgs to the DAL table with
corresponding libkdb5 APIs, replacing the CHECK_POLICY_AS and
CHECK_POLICY_TGS methods of db_invoke.

ticket: 6749
status: open

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

14 years agoAdd check_transited_realms to the DAL table with a corresponding
Greg Hudson [Mon, 12 Jul 2010 18:53:54 +0000 (18:53 +0000)]
Add check_transited_realms to the DAL table with a corresponding
libkdb5 API, replacing the CHECK_TRANSITED_REALMS method of db_invoke.

ticket: 6749
status: open

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

14 years agoAdd sign_authdata to the DAL table with a corresponding libkdb5 API,
Greg Hudson [Mon, 12 Jul 2010 18:33:05 +0000 (18:33 +0000)]
Add sign_authdata to the DAL table with a corresponding libkdb5 API,
replacing the SIGN_AUTH_DATA method of db_invoke.

ticket: 6749
status: open

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

14 years agoAddendum to r24180: make sure osa_adb_get_policy sets its output
Greg Hudson [Fri, 9 Jul 2010 12:25:50 +0000 (12:25 +0000)]
Addendum to r24180: make sure osa_adb_get_policy sets its output
parameter in all cases, per coding standards.

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