krb5.git
14 years agoMinimal support for updating history key
Greg Hudson [Thu, 11 Feb 2010 16:07:08 +0000 (16:07 +0000)]
Minimal support for updating history key

Add minimal support for re-randomizing the history key:

* cpw -randkey kadmin/history now works, but creates only one key.
* cpw -randkey -keepold kadmin/history still fails.
* libkadm5 no longer caches the history key.  Performance impact
  is minimal since password changes are not common.
* randkey no longer checks the newly randomized key against old keys,
  and the disabled code to do so in setkey/setv4key is gone, so now
  only kadm5_chpass_principal_3 accesses the password history.

ticket: 6660
target_version: 1.8
tags: pullup

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

14 years agoImplement gss_set_neg_mechs
Greg Hudson [Wed, 10 Feb 2010 23:44:18 +0000 (23:44 +0000)]
Implement gss_set_neg_mechs

Implement gss_set_neg_mechs in SPNEGO by intersecting the provided
mech set with the mechanisms available in the union credential.  As
we now need space to hold the mech set, the SPNEGO credential is now
a structure and not just a mechglue credential.

t_spnego.c is a test program which exercises the new logic.  Like the
other GSSAPI tests, it is not run as part of "make check" at this
time.

ticket: 6658
target_version: 1.8
tags: pullup

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

14 years agoFollowon fixes to r23712:
Greg Hudson [Wed, 10 Feb 2010 01:55:36 +0000 (01:55 +0000)]
Followon fixes to r23712:
* A few formatting fixes.
* Fix unlikely leak in kdc_handle_protected_negotiation: if
  add_pa_data_element with copy == FALSE fails, it's still the
  caller's responsibility to free pa.contents.
* Fix pre-existing (since r23465) leak of reply_encpart.enc_padata in
  process_as_req.
* Call add_pa_data_element with copy == TRUE in
  return_referral_enc_padata since we are passing memory owned by the
  database entry.

ticket: 6656

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

14 years agokrb5int_fast_free_state segfaults if state is null
Sam Hartman [Tue, 9 Feb 2010 19:15:12 +0000 (19:15 +0000)]
krb5int_fast_free_state segfaults if state is null

krb5int_fast_free_state fails if state is null.  INstead it should
simply return Reorganization of the get_init_creds logic has created
situations where the init_creds loop can fail between the time when
the context is initialized and the fast state is initialized.

ticket: 6657
target_version: 1.8
tags: pullup

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

14 years agoenc_padata can include empty sequence
Sam Hartman [Tue, 9 Feb 2010 19:15:07 +0000 (19:15 +0000)]
enc_padata can include empty sequence

There are two issues with return_enc_padata.
1)  It often will return an empty sequence of enc_padata rather than not including the field
2) FAST negotiation is double supported in the referral tgs path and not supported in the non-referral path

Rewrite the return_enc_padata logic to:

* Split  out referral interactions with kdb into its own function
* Use add_pa_data_element

ticket: 6656
target_version: 1.8
tags: pullup

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

14 years agoConsistently place $(LDFLAGS) after $(SHLIB_EXPFLAGS) when building
Greg Hudson [Fri, 5 Feb 2010 21:46:35 +0000 (21:46 +0000)]
Consistently place $(LDFLAGS) after $(SHLIB_EXPFLAGS) when building
shared libraries.  Previously we sometimes failing to use $(LDFLAGS)
at all, and at other times were putting it before $(SHLIB_EXPFLAGS)
where it could pick up tree-internal libraries from outside the build
tree.

ticket: 6643
target_version: 1.8
tags: pullup

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

14 years agoApply patch from Arlene Berry to handle the case where a mechanism
Tom Yu [Fri, 5 Feb 2010 20:52:42 +0000 (20:52 +0000)]
Apply patch from Arlene Berry to handle the case where a mechanism
implements set_cred_option but does not implement the requested
option.

ticket: 6601
tags: pullup
target_version: 1.8

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

14 years agoFix cross-realm handling of AD-SIGNEDPATH
Greg Hudson [Fri, 5 Feb 2010 03:43:54 +0000 (03:43 +0000)]
Fix cross-realm handling of AD-SIGNEDPATH

Avoid setting AD-SIGNEDPATH when returning a cross-realm TGT.
Previously we were avoiding it when answering a cross-realm client,
which was wrong.

Don't fail out on an invalid AD-SIGNEDPATH checksum; just don't trust
the ticket for S4U2Proxy (as if AD-SIGNEDPATH weren't present).

ticket: 6655
target_version: 1.8
tags: pullup

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

14 years agoApply patch from Arlene Berry to avoid segfault if a mech
Tom Yu [Fri, 5 Feb 2010 03:25:49 +0000 (03:25 +0000)]
Apply patch from Arlene Berry to avoid segfault if a mech
gss_inquire_context returns GSS_C_NO_NAME for the target name.

ticket: 6600
tags: pullup
target_version: 1.8

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

14 years agoApply patch from Arlene Berry to return a comparable static OID object
Tom Yu [Fri, 5 Feb 2010 03:05:42 +0000 (03:05 +0000)]
Apply patch from Arlene Berry to return a comparable static OID object
instead of the application-passed (probably dynamically allocated)
OID, to avoid use-after-free problems.

ticket: 6598
tags: pullup
target_version: 1.8

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

14 years agoFix greet_server build
Greg Hudson [Wed, 3 Feb 2010 19:55:05 +0000 (19:55 +0000)]
Fix greet_server build

Fix the export list for the greet_server plugin.

ticket: 6654
target_version: 1.8
tags: pullup

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

14 years agoClean up error handling in krb5int_make_tgs_request_ext, closing some
Greg Hudson [Tue, 2 Feb 2010 00:37:33 +0000 (00:37 +0000)]
Clean up error handling in krb5int_make_tgs_request_ext, closing some
unlikely memory leaks.

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

14 years agoset_default_enctype_var should filter not reject weak enctypes
Tom Yu [Mon, 1 Feb 2010 21:48:19 +0000 (21:48 +0000)]
set_default_enctype_var should filter not reject weak enctypes

With allow_weak_crypto=false, set_default_enctype_var() (helper
function for krb5_set_default_tgs_enctypes(), etc.) was rejecting any
application-provided enctype list that contained any weak enctype even
when valid strong enctypes were present.  This broke some Samba
things.  Filter the weak enctypes instead.  Add test cases.

Reported to Debian by Holger Isenberg. (Debian bug #566977)
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=566977
Thanks to Simo Sorce for testing.

ticket: 6653
tags: pullup
target_version: 1.8

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

14 years agoCorrect the DAL documentation of
Greg Hudson [Mon, 1 Feb 2010 17:18:23 +0000 (17:18 +0000)]
Correct the DAL documentation of
KRB5_KDB_METHOD_CHECK_ALLOWED_TO_DELEGATE; proxy is the target
service, not the delegating service.

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

14 years agoFix minor error-handling bug in r23676
Greg Hudson [Sun, 31 Jan 2010 21:04:48 +0000 (21:04 +0000)]
Fix minor error-handling bug in r23676

ticket: 6650

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

14 years agoCorrect the DAL documentation for how modules should handle referrals
Greg Hudson [Fri, 29 Jan 2010 23:51:00 +0000 (23:51 +0000)]
Correct the DAL documentation for how modules should handle referrals

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

14 years agoMake decryption of master key list more robust
Greg Hudson [Fri, 29 Jan 2010 01:22:17 +0000 (01:22 +0000)]
Make decryption of master key list more robust

krb5_def_fetch_mkey_list was incorrectly filtering mkey_aux entries
when searching the list for an entry which can be decrypted with the
stashed master key.  This bug was masked in most cases by the mkvno
heuristic.

Remove the mkvno heuristic, since performance is not an issue for this
rarely-performed operation, and remove the incorrect enctype
comparison in the brute-force search.

ticket: 6652
target_version: 1.8
tags: pullup

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

14 years agoHandle migration from pre-1.7 databases with master key kvno != 1
Greg Hudson [Thu, 28 Jan 2010 21:39:31 +0000 (21:39 +0000)]
Handle migration from pre-1.7 databases with master key kvno != 1

krb5_dbe_lookup_mkvno assumes an mkvno of 1 for entries with no
explicit tl_data.  We've seen at least one pre-1.7 KDB with a master
kvno of 0, violating this assumption.  Fix this as follows:

* krb5_dbe_lookup_mkvno outputs 0 instead of 1 if no tl_data exists.
* A new function krb5_dbe_get_mkvno translates this 0 value to the
  minimum version number in the mkey_list.  (krb5_dbe_lookup_mkvno
  cannot do this as it doesn't take the mkey_list as a parameter.)
* Call sites to krb5_dbe_lookup_mkvno are converted to
  krb5_dbe_get_mkvno, except for an LDAP case where it is acceptable
  to store 0 if the mkvno is unknown.

ticket: 6650
target_version: 1.7.1
tags: pullup

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

14 years agoUpdate the LDAP dependencies for r23674
Greg Hudson [Wed, 27 Jan 2010 22:17:12 +0000 (22:17 +0000)]
Update the LDAP dependencies for r23674

ticket: 6649

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

14 years agoGet rid of kdb_ext.h and allow out-of-tree KDB plugins
Greg Hudson [Wed, 27 Jan 2010 03:52:52 +0000 (03:52 +0000)]
Get rid of kdb_ext.h and allow out-of-tree KDB plugins

Move the contents of kdb_ext.h into kdb.h, since there is no meaningful
"extensions" category of DB interfaces now that this stuff is in our
tree.  Allows out-of-tree KDB plugins to be built since we install
kdb.h.

ticket: 6649
target_version: 1.8
tags: pullup

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

14 years agodefine MIN() in lib/gssapi/krb5/prf.c
Tom Yu [Tue, 26 Jan 2010 22:55:07 +0000 (22:55 +0000)]
define MIN() in lib/gssapi/krb5/prf.c

Apply patch from Doug Engert to define MIN(), which was causing prf.c
to fail compilation on Solaris.  (The definition was probably leaking
from sys/param.h, included indirectly somehow.)

ticket: 6648
target_version: 1.8
tags: pullup

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

14 years agoApply patch from Arlene Berry to plug a memory leak
Tom Yu [Tue, 26 Jan 2010 18:43:29 +0000 (18:43 +0000)]
Apply patch from Arlene Berry to plug a memory leak

ticket: 6599
target_version: 1.8
tags: pullup

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

14 years agoIn the DAL comments, document KRB5_KDB_INCLUDE_PAC, and correct the
Greg Hudson [Mon, 25 Jan 2010 18:15:46 +0000 (18:15 +0000)]
In the DAL comments, document KRB5_KDB_INCLUDE_PAC, and correct the
documentation of the S4U flags to indicate that they affect PAC
generation.

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

14 years agoDocument the DAL interface in comments, as an aid to module
Greg Hudson [Mon, 25 Jan 2010 04:12:21 +0000 (04:12 +0000)]
Document the DAL interface in comments, as an aid to module
implementors.

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

14 years agoAdd krb5_allow_weak_crypto API
Greg Hudson [Tue, 19 Jan 2010 23:35:39 +0000 (23:35 +0000)]
Add krb5_allow_weak_crypto API

Add an API to allow apps to override the profile setting of
allow_weak_crypto, so that aklog can work with krb5 1.8 out of the box
until OpenAFS finishes migrating away from DES.

ticket: 6645
target_version: 1.8
tags: pullup

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

14 years agoChange basename of libkadm5 libraries to avoid Heimdal conflict
Greg Hudson [Tue, 19 Jan 2010 18:44:57 +0000 (18:44 +0000)]
Change basename of libkadm5 libraries to avoid Heimdal conflict

ticket: 6644

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

14 years agoIn kinit_anonymous, fail out if we receive a password request from
Greg Hudson [Tue, 19 Jan 2010 17:20:45 +0000 (17:20 +0000)]
In kinit_anonymous, fail out if we receive a password request from
kinit, instead of hanging.

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

14 years agoMake history key exempt from permitted_enctypes
Greg Hudson [Thu, 14 Jan 2010 16:09:24 +0000 (16:09 +0000)]
Make history key exempt from permitted_enctypes

In kdb_init_hist, just use the first key entry in the kadmin/history
entry.  This makes the history key work even if the enctype is
disallowed by allow_weak_crypto=false or other configuration.

ticket: 6640
tags: pullup
target_version: 1.8

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

14 years agoAdd test program for decryption of overly short buffers
Greg Hudson [Tue, 12 Jan 2010 21:59:58 +0000 (21:59 +0000)]
Add test program for decryption of overly short buffers

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

14 years agoUse keyed checksum type for DES FAST
Greg Hudson [Tue, 12 Jan 2010 01:07:48 +0000 (01:07 +0000)]
Use keyed checksum type for DES FAST

DES enctypes have unkeyed mandatory-to-implement checksums.  Since
FAST requires a keyed checksum, we must pick something else in that
case.

ticket: 6633
target_version: 1.7
tags: pullup

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

14 years agoSimplify and fix FAST check for keyed checksum type
Greg Hudson [Tue, 12 Jan 2010 01:05:37 +0000 (01:05 +0000)]
Simplify and fix FAST check for keyed checksum type

Use krb5_c_is_keyed_checksum to detect unkeyed checksums when handling
FAST requests.  The old check was broken for 1.8 because
krb5_c_verify_checksum got pickier about invalid keyblocks.

ticket: 6632
target_version: 1.8
tags: pullup

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

14 years agoGroup together the funtions related to the supplying options to preauth plugin modules.
Zhanna Tsitkov [Mon, 11 Jan 2010 15:19:42 +0000 (15:19 +0000)]
Group together the funtions related to the supplying options to preauth plugin modules.
Also, removed krb5int_ prefix from the names of some static functions in gic_opt.c.s

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

14 years ago(memory leak)
Ezra Peisach [Sun, 10 Jan 2010 04:31:51 +0000 (04:31 +0000)]
(memory leak)

ktest_make_sample_ad_signedpath_data: Do not initialize client field twice.

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

14 years agoMove krb5_authdata_export_authdata into the separate file for better code modularity
Zhanna Tsitkov [Sun, 10 Jan 2010 02:12:55 +0000 (02:12 +0000)]
Move krb5_authdata_export_authdata into the separate file for better code modularity

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

14 years agokrb5int_pbkdf2_hmac_sha1 fails to set enctype on keyblock
Ezra Peisach [Sat, 9 Jan 2010 16:02:13 +0000 (16:02 +0000)]
krb5int_pbkdf2_hmac_sha1 fails to set enctype on keyblock

krb5int_pbkdf2_hmac_sha1 fails to set enctype on a termporary keyblock
- resulting in valgrind picking up on a conditional branch w/ unset
value. Initialize value.

ticket: 6630
tags: pullup

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

14 years agoFix t_locate_kdc.c test program after r23613 when krb5_ prefix was removed from the...
Zhanna Tsitkov [Fri, 8 Jan 2010 19:53:34 +0000 (19:53 +0000)]
Fix t_locate_kdc.c test program after r23613 when krb5_ prefix was removed from the names of the static functions in locate_kdc.c

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

14 years agoMove kdc related functionality from pac.c into pac_sign.c
Zhanna Tsitkov [Fri, 8 Jan 2010 19:35:40 +0000 (19:35 +0000)]
Move kdc related functionality from pac.c into pac_sign.c

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

14 years agokrb5int_dk_string_to_key fails to set enctype
Ezra Peisach [Fri, 8 Jan 2010 14:54:04 +0000 (14:54 +0000)]
krb5int_dk_string_to_key fails to set enctype

Failure to set the enctype before invoking krb5_k_create_key results in
potential memory leak.

ticket: 6628
tags: pullup

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

14 years agoSet enctype in crypto_tests to prevent memory leaks
Ezra Peisach [Fri, 8 Jan 2010 03:43:37 +0000 (03:43 +0000)]
Set enctype in crypto_tests to prevent memory leaks

The key caching is causing memory leaks if enctype is not set as the
enctype specific cleanup handlers are not called.

ticket: 6627
tags: pullup

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

14 years agoRestore interoperability with 1.6 addprinc -randkey
Greg Hudson [Fri, 8 Jan 2010 02:43:21 +0000 (02:43 +0000)]
Restore interoperability with 1.6 addprinc -randkey

The arcfour string-to-key operation in krb5 1.7 (or later) disagrees
with the dummy password used by the addprinc -randkey operation in
krb5 1.6's kadmin client, because it's not valid UTF-8.  Recognize the
1.6 dummy password and use a random password instead.

ticket: 6626
tags: pullup
target_version: 1.8

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

14 years agoyarrow code does not initialize keyblock enctype and uses unitialized value
Ezra Peisach [Fri, 8 Jan 2010 02:12:24 +0000 (02:12 +0000)]
yarrow code does not initialize keyblock enctype and uses unitialized value

The yarrow code uses a keyblock that is partially initialized. This results
in krb5_k_free_key trying to look up the enctype to call the free handler.

One of the valgrind reports: (there are several paths)

==26701== Conditional jump or move depends on uninitialised value(s)
==26701==    at 0x40E9AF0: find_enctype (etypes.h:81)
==26701==    by 0x40E9C9E: krb5_k_free_key (key.c:91)
==26701==    by 0x40D641A: krb5int_yarrow_cipher_init (ycipher.c:49)
==26701==    by 0x40D593A: yarrow_gate_locked (yarrow.c:578)
==26701==    by 0x40D5349: krb5int_yarrow_output_Block (yarrow.c:423)
==26701==    by 0x40D581B: yarrow_output_locked (yarrow.c:553)
==26701==    by 0x40D5667: krb5int_yarrow_output (yarrow.c:513)
==26701==    by 0x40EBD2D: krb5_c_random_make_octets (prng.c:112)
==26701==    by 0x40D4119: krb5int_old_encrypt (old_aead.c:97)
==26701==    by 0x40E9696: krb5_k_encrypt_iov (encrypt_iov.c:42)
==26701==    by 0x8049554: main (t_encrypt.c:206)
==26701==

ticket: 6625
tags: pullup

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

14 years agokrb5int_derive_key results in cache with uninitialized values
Ezra Peisach [Fri, 8 Jan 2010 01:51:19 +0000 (01:51 +0000)]
krb5int_derive_key results in cache with uninitialized values

krb5int_derive_key creates a temporary keyblock to add to the derived cache.
krb5_k_free_key will iterate over the derived keys and for ones with cache will
lookup the enctype for the key_cleanup handler.

Unfortunatly, there isn't a keyblock init function that does not allocate the
keyblock - as I suspect this problem will appear in other places.

The valgrind log of this problem is:

==7281== Conditional jump or move depends on uninitialised value(s)
==7281==    at 0x40E9AE8: find_enctype (etypes.h:81)
==7281==    by 0x40E9C96: krb5_k_free_key (key.c:91)
==7281==    by 0x40E9C52: krb5_k_free_key (key.c:86)
==7281==    by 0x40EBB00: krb5_c_prf (prf.c:87)
==7281==    by 0x40E7B1B: prf_plus (cf2.c:77)
==7281==    by 0x40E7CE6: krb5_c_fx_cf2_simple (cf2.c:125)
==7281==    by 0x804899C: main (t_cf2.c:70)
==7281==

with memory leaks.

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

14 years agoWhen retrieving the kadmin/history key, accept any enctype, as the
Greg Hudson [Thu, 7 Jan 2010 20:57:02 +0000 (20:57 +0000)]
When retrieving the kadmin/history key, accept any enctype, as the
current master key enctype may not match the one the KDB was created
with.

ticket: 6546
status: open

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

14 years agoMove krb5_auth_con_getauthenticator into copy_athctr.c as a better logical location
Zhanna Tsitkov [Thu, 7 Jan 2010 19:17:55 +0000 (19:17 +0000)]
Move krb5_auth_con_getauthenticator into copy_athctr.c as a better logical location

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

14 years agoRevert change to Makefile.in that ended up not being needed
Sam Hartman [Thu, 7 Jan 2010 18:35:15 +0000 (18:35 +0000)]
Revert change to Makefile.in that ended up not being needed

ticket: 6624

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

14 years agoautomated tests for anonymous pkinit
Sam Hartman [Thu, 7 Jan 2010 18:32:20 +0000 (18:32 +0000)]
automated tests for anonymous pkinit

Implement tests for anonymous pkinit.  A certificate and private key
are checked in; these tests will stop working in 2023.

Note that r23602 needs to be pulled up before this ticket.

ticket: 6624
target_version: 1.8
tags: pullup

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

14 years agoAlways treat anonymous as preauth required
Sam Hartman [Thu, 7 Jan 2010 18:32:15 +0000 (18:32 +0000)]
Always treat anonymous as preauth required

Always treat the WELLKNOWN/ANONYMOUS principal as requiring pre-authentication.  The anonymous draft depends on a pre-auth exchange to invoke pkinit.

ticket: 6623
target_version: 1.8
tags: pullup

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

14 years agoMake preauth_module_dir override, rather than supplement, the
Greg Hudson [Thu, 7 Jan 2010 17:26:58 +0000 (17:26 +0000)]
Make preauth_module_dir override, rather than supplement, the
built-in path list, to avoid problems with running the same preauth
module twice.

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

14 years agoUse a distinct pass/fail string for kinit_fast so its failures can be
Greg Hudson [Thu, 7 Jan 2010 17:07:36 +0000 (17:07 +0000)]
Use a distinct pass/fail string for kinit_fast so its failures can be
distinguished from kinit's.

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

14 years agoAdd miising files from rev #23593
Zhanna Tsitkov [Thu, 7 Jan 2010 14:52:11 +0000 (14:52 +0000)]
Add miising files from rev #23593

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

14 years agoMake krb5_dbe_def_search_enctype more consistent about when it returns
Greg Hudson [Wed, 6 Jan 2010 23:44:04 +0000 (23:44 +0000)]
Make krb5_dbe_def_search_enctype more consistent about when it returns
KRB5_KDB_NO_PERMITTED_KEY.  Now it will return that error if it sees
any non-permitted enctypes which match the search criteria.

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

14 years agoMove copyright and other notices to NOTICE
Tom Yu [Wed, 6 Jan 2010 23:25:53 +0000 (23:25 +0000)]
Move copyright and other notices to NOTICE

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

14 years agoDon't return KRB5_KDB_NO_PERMITTED_KEY from
Greg Hudson [Wed, 6 Jan 2010 23:14:14 +0000 (23:14 +0000)]
Don't return KRB5_KDB_NO_PERMITTED_KEY from
krb5_dbe_def_search_enctype if we previously returned results (i.e. if
*start > 0).

ticket: 6622
target_version: 1.8
tags: pullup

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

14 years agoDivide copy_auth.c into three files based on the functionality. Namely,
Zhanna Tsitkov [Wed, 6 Jan 2010 21:56:02 +0000 (21:56 +0000)]
Divide copy_auth.c into three files based on the functionality. Namely,
1. copy/merge authdata
2. KDC related encode authdata
3. decode authdata

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

14 years agoSince krb5int_validate_times is used only inside krb dir do not export it and move...
Zhanna Tsitkov [Wed, 6 Jan 2010 18:39:18 +0000 (18:39 +0000)]
Since krb5int_validate_times is used only inside krb dir do not export it and move its prototype into int-proto.h

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

14 years agoRename krb5_validate_times into krb5int_validate_times as it is internal function
Zhanna Tsitkov [Tue, 5 Jan 2010 21:20:15 +0000 (21:20 +0000)]
Rename krb5_validate_times into krb5int_validate_times as it is internal function

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

14 years agoRename krb5int_tgtname into krb5_tgtname as an internal function
Zhanna Tsitkov [Tue, 5 Jan 2010 21:11:03 +0000 (21:11 +0000)]
Rename krb5int_tgtname into krb5_tgtname as an internal function

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

14 years agoUpdate trunk for post-1.8-branch
Tom Yu [Tue, 5 Jan 2010 04:48:57 +0000 (04:48 +0000)]
Update trunk for post-1.8-branch

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

14 years agoREADME, copyright, patchlevel for krb5-1.8 branch
Tom Yu [Tue, 5 Jan 2010 04:37:07 +0000 (04:37 +0000)]
README, copyright, patchlevel for krb5-1.8 branch

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

14 years agodisable weak crypto by default
Tom Yu [Tue, 5 Jan 2010 02:47:58 +0000 (02:47 +0000)]
disable weak crypto by default

Set allow_weak_crypto=false by default.  Set default master key
enctype to sha256.  Adjust test suite to compensate.

ticket: 6621

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

14 years agoInstall encrypted_challenge plugin during fake-install
Tom Yu [Mon, 4 Jan 2010 21:45:23 +0000 (21:45 +0000)]
Install encrypted_challenge plugin during fake-install

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

14 years agoAdd preauth_module_dir support to the KDC preauth module loader
Greg Hudson [Mon, 4 Jan 2010 21:22:00 +0000 (21:22 +0000)]
Add preauth_module_dir support to the KDC preauth module loader
(should have been part of r23531).  Most or all of this logic should
be moved into the plugin code or a layer above it, after the branch.

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

14 years agoAnonymous documentation
Sam Hartman [Mon, 4 Jan 2010 19:59:25 +0000 (19:59 +0000)]
Anonymous documentation

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

14 years agoOther changes in this ticket guarantee that the padata argument to
Sam Hartman [Mon, 4 Jan 2010 19:59:20 +0000 (19:59 +0000)]
Other changes in this ticket guarantee that the padata argument to
return callbacks is non-null; don't check for null in pkinit_srv.c.

ticket: 6607

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

14 years agoBring back krb5_kt_free_entry which really does the same thing as
Sam Hartman [Mon, 4 Jan 2010 19:59:16 +0000 (19:59 +0000)]
Bring back krb5_kt_free_entry which really does the same thing as
krb5_free_keytab_entry_contents per discussion on krbdev in order to
avoid breaking samba builds.

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

14 years agoTest FAST authentication during each pass
Sam Hartman [Mon, 4 Jan 2010 19:59:12 +0000 (19:59 +0000)]
Test FAST authentication during each pass

Because a new principal is added to the database, the iprop test
expected output is updated.

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

14 years agoFix documentation of armor cache based on fast negotiation project
Sam Hartman [Mon, 4 Jan 2010 19:59:03 +0000 (19:59 +0000)]
Fix documentation of armor cache based on fast negotiation project

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

14 years agokdc_supported_enctypes does nothing; eradicate mentions thereof
Tom Yu [Mon, 4 Jan 2010 19:34:33 +0000 (19:34 +0000)]
kdc_supported_enctypes does nothing; eradicate mentions thereof

kdc_supported_enctypes does nothing.  Remove all mention of it from
documentation and test suites.

ticket: 6620

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

14 years agoDon't accept AS replies encrypted in enctypes other than the ones we
Greg Hudson [Mon, 4 Jan 2010 17:00:23 +0000 (17:00 +0000)]
Don't accept AS replies encrypted in enctypes other than the ones we
asked for.

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

14 years agoFor the better code modularity keep some "free" routines closer to the resource alloc...
Zhanna Tsitkov [Mon, 4 Jan 2010 06:22:41 +0000 (06:22 +0000)]
For the better code modularity keep some "free" routines closer to the resource allocators. Also, reindent cleanup in the touched files

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

14 years agoUpdate dependencies
Ken Raeburn [Sun, 3 Jan 2010 23:41:49 +0000 (23:41 +0000)]
Update dependencies

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

14 years agoEnable caching of key-derived context info such as key schedules from
Ken Raeburn [Sun, 3 Jan 2010 23:39:12 +0000 (23:39 +0000)]
Enable caching of key-derived context info such as key schedules from
one encryption operation to another.  Use a new function in the
enc_provider structure for cleanup.  Implement caching of aes_ctx
values.

Using Greg's performance tests from the derived-key caching work, on a
2.8GHz Xeon, I see 1 million AES-128 encryptions of 16 bytes improved
by 5-6%; encryptions of 1024 bytes and checksums are not significantly
affected.

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

14 years agoFix a case where krb5int_aes_decrypt was trying to encrypt a block
Greg Hudson [Sun, 3 Jan 2010 23:12:19 +0000 (23:12 +0000)]
Fix a case where krb5int_aes_decrypt was trying to encrypt a block
instead of decrypting it.

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

14 years agokrb5_gss_acquire_cred will deref garbage pointer if actual_mechs is NULL
Ezra Peisach [Sun, 3 Jan 2010 15:14:51 +0000 (15:14 +0000)]
krb5_gss_acquire_cred will deref garbage pointer if actual_mechs is NULL

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

14 years agoInitialize variables in case of error path winds up freeing stack garbage
Ezra Peisach [Sun, 3 Jan 2010 14:27:02 +0000 (14:27 +0000)]
Initialize variables in case of error path winds up freeing stack garbage

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

14 years agoIgnore some routing messages indicating changes that don't affect our
Ken Raeburn [Sun, 3 Jan 2010 03:00:24 +0000 (03:00 +0000)]
Ignore some routing messages indicating changes that don't affect our
set of local addresses.

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

14 years agoRemove old 'full' arg to KDC that should've gone away with '-4'
Ken Raeburn [Sun, 3 Jan 2010 03:00:19 +0000 (03:00 +0000)]
Remove old 'full' arg to KDC that should've gone away with '-4'

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

14 years agoSome unsigned/signed warning cleanup
Ezra Peisach [Sun, 3 Jan 2010 00:19:53 +0000 (00:19 +0000)]
Some unsigned/signed warning cleanup

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

14 years agoUse krb5int_count_etypes in rd_req_decoded_opt
Greg Hudson [Sat, 2 Jan 2010 02:35:40 +0000 (02:35 +0000)]
Use krb5int_count_etypes in rd_req_decoded_opt

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

14 years agoTest -P options to kdc and kadmind to write out a pid file. Verify contents of
Ezra Peisach [Sat, 2 Jan 2010 02:16:23 +0000 (02:16 +0000)]
Test -P options to kdc and kadmind to write out a pid file. Verify contents of
pid file match pid of executable.

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

14 years agoFactor out copying and counting of zero-terminated enctype lists into
Greg Hudson [Fri, 1 Jan 2010 23:20:56 +0000 (23:20 +0000)]
Factor out copying and counting of zero-terminated enctype lists into
a new file src/lib/krb5/krb/etype_list.c.

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

14 years agoUpdate copyright year in prototype sources
Greg Hudson [Fri, 1 Jan 2010 22:34:29 +0000 (22:34 +0000)]
Update copyright year in prototype sources

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

14 years agoChange db_args from being a global to only defined in the function
Ezra Peisach [Fri, 1 Jan 2010 16:41:04 +0000 (16:41 +0000)]
Change db_args from being a global to only defined in the function
that uses it. This removes a warning of shadowed variable names.  Change
several functions to static when limited to main.c

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

14 years agoAdd gcc printf attribute for kdc_err prototype
Ezra Peisach [Fri, 1 Jan 2010 13:00:08 +0000 (13:00 +0000)]
Add gcc printf attribute for kdc_err prototype

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

14 years agoUnsigned/signed cleanup
Ezra Peisach [Fri, 1 Jan 2010 12:58:42 +0000 (12:58 +0000)]
Unsigned/signed cleanup

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

14 years agoAdd a new -P option to krb5kdc and kadmind which, if given, specifies
Russ Allbery [Fri, 1 Jan 2010 05:09:57 +0000 (05:09 +0000)]
Add a new -P option to krb5kdc and kadmind which, if given, specifies
the path to which to write the PID file of the daemon after it finishes
initializing.

Ticket: 6618

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

14 years agoFree tinfo at end - so program runs with new memory leaks
Ezra Peisach [Thu, 31 Dec 2009 23:18:16 +0000 (23:18 +0000)]
Free tinfo at end - so program runs with new memory leaks

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

14 years agoRemove tests for functions that we do not conditionalize on. Most deprecated
Ezra Peisach [Thu, 31 Dec 2009 23:13:56 +0000 (23:13 +0000)]
Remove tests for functions that we do not conditionalize on.  Most deprecated
from breakoff of apps.

Specifically, do not test for:

gethostbyname2 getifaddrs pthread_mutex_lock sched_yield ftime strstr
timezone umask waitpid sem_init sem_trywait daemon

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

14 years agoDeclare function as static to avoid compiler warning on missing prototypes
Ezra Peisach [Thu, 31 Dec 2009 22:49:52 +0000 (22:49 +0000)]
Declare function as static to avoid compiler warning on missing prototypes

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

14 years agoRemove $(TOBJS) for make clean
Ezra Peisach [Thu, 31 Dec 2009 22:48:19 +0000 (22:48 +0000)]
Remove $(TOBJS) for make clean

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

14 years agoUse krb5_free_default_realm instead of free on the results of
Ezra Peisach [Thu, 31 Dec 2009 22:25:11 +0000 (22:25 +0000)]
Use krb5_free_default_realm instead of free on the results of
krb5_get_default_realm().

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

14 years agoFix spelling and hyphen errors in man pages
Russ Allbery [Thu, 31 Dec 2009 04:21:34 +0000 (04:21 +0000)]
Fix spelling and hyphen errors in man pages

Fix spelling errors in man pages detected by Debian's Lintian program.
Also escape some -'s that are intended to be literal ASCII dashes and
not Unicode hyphens so that groff won't change them into true hyphens.

ticket: 6616
component: krb5-doc

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

14 years agoNetBSD 5.0.1 uses an OpenSSL snapshot that describes itself as 0.9.9,
Ken Raeburn [Thu, 31 Dec 2009 04:07:03 +0000 (04:07 +0000)]
NetBSD 5.0.1 uses an OpenSSL snapshot that describes itself as 0.9.9,
and has the EVP_PKEY_decrypt API change that was already being worked
around for OpenSSL 1.0.0.  Work around it for 0.9.9 too.

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

14 years agoformat %p wants void*
Ken Raeburn [Thu, 31 Dec 2009 03:37:40 +0000 (03:37 +0000)]
format %p wants void*

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

14 years agoInitialize hash_iov, in case of premature error exit
Ken Raeburn [Thu, 31 Dec 2009 03:37:37 +0000 (03:37 +0000)]
Initialize hash_iov, in case of premature error exit

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

14 years agoConvert C++ style comments into traditional C comments
Ken Raeburn [Thu, 31 Dec 2009 03:37:34 +0000 (03:37 +0000)]
Convert C++ style comments into traditional C comments

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

14 years agoNo comma at end of enumerator list
Ken Raeburn [Thu, 31 Dec 2009 03:37:30 +0000 (03:37 +0000)]
No comma at end of enumerator list

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

14 years agoNo comma at end of enumerator list
Ken Raeburn [Thu, 31 Dec 2009 01:32:00 +0000 (01:32 +0000)]
No comma at end of enumerator list

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

14 years agoInclude os-proto.h for _krb5_conf_boolean prototype before declaration
Ezra Peisach [Wed, 30 Dec 2009 23:03:48 +0000 (23:03 +0000)]
Include os-proto.h for _krb5_conf_boolean prototype before declaration
of function. (gcc warning)

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

14 years agoMove krb5int_get_domain_realm_mapping into kdc_util.c as this function is a helper...
Zhanna Tsitkov [Wed, 30 Dec 2009 19:53:16 +0000 (19:53 +0000)]
Move krb5int_get_domain_realm_mapping into kdc_util.c as this function is a helper in kdc code

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