krb5.git
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

14 years agoEliminate the krb5_set_default_in_tkt_ktypes and
Greg Hudson [Wed, 30 Dec 2009 19:39:35 +0000 (19:39 +0000)]
Eliminate the krb5_set_default_in_tkt_ktypes and
krb5_set_default_tgs_ktypes during context initialization, as they
weren't doing anything.

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

14 years agoCreate a separate file for krb5_copy_context for better code modularity
Zhanna Tsitkov [Tue, 29 Dec 2009 20:30:29 +0000 (20:30 +0000)]
Create a separate file for krb5_copy_context for better code modularity

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

14 years agoCombine the related code into one file
Zhanna Tsitkov [Tue, 29 Dec 2009 20:08:42 +0000 (20:08 +0000)]
Combine the related code into one file

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

14 years agoRemove an inoperable error check in return_pkinit_kx
Greg Hudson [Tue, 29 Dec 2009 18:03:31 +0000 (18:03 +0000)]
Remove an inoperable error check in return_pkinit_kx

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

14 years agoFunctions in enc_helper.c serve different code blocks. Split them
Zhanna Tsitkov [Tue, 29 Dec 2009 16:41:08 +0000 (16:41 +0000)]
Functions in enc_helper.c serve different code blocks. Split them

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

14 years agoMITKRB5-SA-2009-003 CVE-2009-3295 KDC null deref in referrals
Tom Yu [Tue, 29 Dec 2009 02:42:51 +0000 (02:42 +0000)]
MITKRB5-SA-2009-003 CVE-2009-3295 KDC null deref in referrals

On certain error conditions, prep_reprocess_req() calls kdc_err() with
a null pointer as the format string, causing a null dereference and
denial of service.  Legitimate protocol requests can trigger this
problem.

ticket: 6608
tags: pullup
target_version: 1.7.1

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

14 years agoAdd dejagnu test suite support for finding the preauth modules in the
Greg Hudson [Mon, 28 Dec 2009 20:13:39 +0000 (20:13 +0000)]
Add dejagnu test suite support for finding the preauth modules in the
fake install.  Not yet tested, except to verify that it doesn't break
the existing test suite.

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

14 years agoAdd a new profile variable preauth_module_dir, which specifies
Greg Hudson [Mon, 28 Dec 2009 19:59:10 +0000 (19:59 +0000)]
Add a new profile variable preauth_module_dir, which specifies
directories to look for preauth plugins in prior to the hardcoded
locations.  Undocumented for now since, like db_module_dir, this is
mostly intended for the test suite.

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

14 years agoMove krb5_get_profile back to init_os_ctx.c for now and revert r23519.
Greg Hudson [Mon, 28 Dec 2009 19:25:09 +0000 (19:25 +0000)]
Move krb5_get_profile back to init_os_ctx.c for now and revert r23519.
At this time we link t_etypes against init_ctx.so during "make check",
which breaks if init_ctx contains reference to the profile library.
More general solutions to this problem are under discussion.

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

14 years agoWhitespace fixes for new anonymous support
Greg Hudson [Mon, 28 Dec 2009 18:03:31 +0000 (18:03 +0000)]
Whitespace fixes for new anonymous support

ticket: 6607

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

14 years agoAnonymous support for Kerberos
Sam Hartman [Mon, 28 Dec 2009 17:15:30 +0000 (17:15 +0000)]
Anonymous support for Kerberos

This ticket implements Project/Anonymous pkinit from k5wiki.  Provides
support for completely anonymous principals and untested client
support for realm-exposed anonymous authentication.

* Introduce kinit -n
* Introduce kadmin -n
* krb5_get_init_creds_opt_set_out_ccache aliases the supplied ccache
* No longer generate ad-initial-verified-cas in pkinit
* Fix pkinit interactions with non-TGT authentication

Merge remote branch 'anonymous' into trunk

Conflicts:
src/lib/krb5/krb/gic_opt.c

ticket: 6607
Tags: enhancement

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

14 years agoRemove libpty references
Ken Raeburn [Mon, 28 Dec 2009 00:47:40 +0000 (00:47 +0000)]
Remove libpty references

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

14 years agoThe "comment" field of prf_data_t was never actually set nor used, so
Ken Raeburn [Mon, 28 Dec 2009 00:21:20 +0000 (00:21 +0000)]
The "comment" field of prf_data_t was never actually set nor used, so
delete it and all references.

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

14 years agoPerformance testing programs for krb5_init_context and profile data fetch
Ken Raeburn [Mon, 28 Dec 2009 00:21:16 +0000 (00:21 +0000)]
Performance testing programs for krb5_init_context and profile data fetch

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

14 years agoFixing minorly grammatical bad
Ken Raeburn [Mon, 28 Dec 2009 00:21:13 +0000 (00:21 +0000)]
Fixing minorly grammatical bad

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

14 years agoNote last real update was a while back; delete listings of libraries no longer in...
Ken Raeburn [Mon, 28 Dec 2009 00:21:10 +0000 (00:21 +0000)]
Note last real update was a while back; delete listings of libraries no longer in tree

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

14 years agoallow testing when offline
Ken Raeburn [Mon, 28 Dec 2009 00:21:06 +0000 (00:21 +0000)]
allow testing when offline

Define new make variable OFFLINE to "no"; if it's set to "yes", skip
the testing of t_locate_kdc, which requires access to mit.edu SRV
records.

ticket: 6606

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

14 years agoInclude prof_int.h in init_ctx.c instead of init_os_ctx.c,
Ken Raeburn [Mon, 28 Dec 2009 00:21:00 +0000 (00:21 +0000)]
Include prof_int.h in init_ctx.c instead of init_os_ctx.c,
corresponding to the moved use of profile_copy in r23484.

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

15 years agoCode modularity related updates
Zhanna Tsitkov [Wed, 23 Dec 2009 16:00:05 +0000 (16:00 +0000)]
Code modularity related updates

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

15 years agoRemove krb5_ prefix from some static func names
Zhanna Tsitkov [Tue, 22 Dec 2009 22:26:55 +0000 (22:26 +0000)]
Remove krb5_ prefix from some static func names

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

15 years agoAdd a set_cred_option handler for SPNEGO which forwards to the
Greg Hudson [Mon, 21 Dec 2009 17:58:12 +0000 (17:58 +0000)]
Add a set_cred_option handler for SPNEGO which forwards to the
underlying mechanism.  Fixes SPNEGO credential delegation in 1.7 and
copying of SPNEGO initiator creds in both 1.7 and trunk.  Patch
provided by nalin@redhat.com.

ticket: 6594
target_version: 1.7.1
tags: pullup

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

15 years agoFix a cleanup handler in the store_creds code; krb5_cc_close doesn't
Greg Hudson [Thu, 17 Dec 2009 20:03:16 +0000 (20:03 +0000)]
Fix a cleanup handler in the store_creds code; krb5_cc_close doesn't
handle NULL arguments, so we have to check.

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

15 years agoAdd GSS extensions to store credentials, generate random bits
Greg Hudson [Thu, 17 Dec 2009 04:49:27 +0000 (04:49 +0000)]
Add GSS extensions to store credentials, generate random bits

Merge /users/lhoward/gssextras-no-cqa to trunk.  Adds
gss_pseudo_random and gss_store_cred.

ticket: 6597

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

15 years agoWhitespace fixes
Greg Hudson [Wed, 16 Dec 2009 20:04:32 +0000 (20:04 +0000)]
Whitespace fixes

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

15 years agoOn Luke's advice, remove krb5_init_creds_store_creds. It is not a
Greg Hudson [Tue, 15 Dec 2009 17:40:27 +0000 (17:40 +0000)]
On Luke's advice, remove krb5_init_creds_store_creds.  It is not a
Heimdal API and its functionality is covered by
krb5_get_init_creds_opt_set_out_ccache.

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

15 years agoGet rid of the requirement of defining MAX_ENCTYPE in
Greg Hudson [Tue, 15 Dec 2009 17:33:09 +0000 (17:33 +0000)]
Get rid of the requirement of defining MAX_ENCTYPE in
krb5int_parse_enctype_list, at the cost of making repeated realloc()
calls during parsing.

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

15 years agoFormatining enhancement
Zhanna Tsitkov [Tue, 15 Dec 2009 16:37:00 +0000 (16:37 +0000)]
Formatining  enhancement

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

15 years agofast negotiation projec
Sam Hartman [Mon, 14 Dec 2009 18:28:16 +0000 (18:28 +0000)]
fast negotiation projec

Merge branches/fast-negotiate into trunk.
This implements http://k5wiki.kerberos.org/wiki/Projects/Fast_negotiation

Additional changes:
* krb5_c_make_checksum with checksum type 0 uses mandatory checksum for given key enctype

Conflicts:
src/lib/crypto/krb/make_checksum.c

ticket: 6595
Tags: enhancement

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

15 years agoDon't use sizeof(pointertype) to get the length of an allocated array
Tom Yu [Thu, 10 Dec 2009 19:34:47 +0000 (19:34 +0000)]
Don't use sizeof(pointertype) to get the length of an allocated array

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

15 years agoAdd comments to make it slightly clearer how
Greg Hudson [Thu, 10 Dec 2009 19:04:47 +0000 (19:04 +0000)]
Add comments to make it slightly clearer how
krb5int_confounder_checksum works.

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

15 years agoRestructure the crypto checksum implementation to minimize
Greg Hudson [Thu, 10 Dec 2009 17:10:10 +0000 (17:10 +0000)]
Restructure the crypto checksum implementation to minimize
dependencies on the internals of modules.

* Keyhash providers are gone.
* The cksumtypes table contains checksum and verify functions,
  similar to the etypes encrypt and decrypt functions.  New checksum
  functions parallel the old keyhash providers, and there are also
  functions for unkeyed and derived-key HMAC checksums.
* The flags field is now used to indicate whether a checksum is
  unkeyed, but not whether it is a derived-key HMAC checksum.
* The descbc checksum is handled through a new enc_provider function
  which calculates a CBC MAC.

The OpenSSL module does not implement the CBC MAC function (it didn't
implement descbc before).  builtin/des could probably get rid of
f_cksum.c (the old DES CBC routine) with some alterations to
string2key.c.

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

15 years agoChange file holder for krb5int_check_clockskew. Minor Style changes per code practices
Zhanna Tsitkov [Wed, 9 Dec 2009 16:52:41 +0000 (16:52 +0000)]
Change file holder for krb5int_check_clockskew. Minor Style changes per code practices

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

15 years agoRemove dependency on /bin/csh in test suite
Ezra Peisach [Tue, 8 Dec 2009 03:24:23 +0000 (03:24 +0000)]
Remove dependency on /bin/csh in test suite

The libdb2 test suite would fail if /bin/csh was not present.  The
tests did not execute /bin/csh - but used the contents as data to put
into the test database.  Iterate over a few "known" files until one is found
that could be used for it... Tests for /bin/csh, /bin/cat, /usr/bin/cat,
/bin/ls, /usr/bin/ls.  If none of these exist - then fail.

ticket: 6593

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

15 years agoMark and reindent lib/gssapi, with some exceptions
Tom Yu [Tue, 8 Dec 2009 00:04:48 +0000 (00:04 +0000)]
Mark and reindent lib/gssapi, with some exceptions

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

15 years agoMark lib/apputils
Tom Yu [Mon, 7 Dec 2009 23:26:27 +0000 (23:26 +0000)]
Mark lib/apputils

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

15 years agoMark and reindent util, with some exceptions
Tom Yu [Mon, 7 Dec 2009 22:36:41 +0000 (22:36 +0000)]
Mark and reindent util, with some exceptions

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

15 years agohandle negative enctypes better
Tom Yu [Mon, 7 Dec 2009 15:30:37 +0000 (15:30 +0000)]
handle negative enctypes better

krb5_dbe_def_search_enctype and krb5int_parse_enctype_list were making
assumptions that enctype numbers are positive.  Potentially more code
makes this assumption, but these appear to be the major ones.

ticket: 6592
status: open

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

15 years agoInitialize ihash_iov in case fall through to cleanup handler and try
Ezra Peisach [Sun, 6 Dec 2009 22:07:02 +0000 (22:07 +0000)]
Initialize ihash_iov in case fall through to cleanup handler and try
to free garbarge.

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

15 years agoRemove the ivec parameters from the keyhash provider functions, as
Greg Hudson [Sun, 6 Dec 2009 20:55:16 +0000 (20:55 +0000)]
Remove the ivec parameters from the keyhash provider functions, as
they are never used by callers.

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

15 years agoMake depend
Greg Hudson [Sun, 6 Dec 2009 16:25:22 +0000 (16:25 +0000)]
Make depend

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

15 years agoMake the libk5crypto hash_provider interface take crypto_iov lists
Greg Hudson [Sun, 6 Dec 2009 16:23:11 +0000 (16:23 +0000)]
Make the libk5crypto hash_provider interface take crypto_iov lists
instead of lists of krb5_data.  Make the base HMAC APIs take
crypto_iov lists and drop the _iov variants.

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

15 years agoIn the built-in des3 provider, remove the unused version of
Greg Hudson [Sun, 6 Dec 2009 15:57:36 +0000 (15:57 +0000)]
In the built-in des3 provider, remove the unused version of
validate_and_schedule, and drop the _iov suffix from the one we do
use.  (Cleanup from r23444.)

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

15 years agoMake the alloc_data and k5alloc convenience functions work if the
Greg Hudson [Sat, 5 Dec 2009 22:53:04 +0000 (22:53 +0000)]
Make the alloc_data and k5alloc convenience functions work if the
caller requests zero bytes, by allocating one byte instead.

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

15 years agoRemove tests for sched.h, kdb_db.h, kdc.c. None of these are used in the tree
Ezra Peisach [Sat, 5 Dec 2009 13:47:37 +0000 (13:47 +0000)]
Remove tests for sched.h, kdb_db.h, kdc.c.  None of these are used in the tree

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

15 years agoRemove some code paths in crypto-length which are dead now that the
Greg Hudson [Fri, 4 Dec 2009 14:58:10 +0000 (14:58 +0000)]
Remove some code paths in crypto-length which are dead now that the
internal interface can't return an error.

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

15 years agoRemove CRC32_SHIFT4 code as we are unlikely to ever need it
Greg Hudson [Fri, 4 Dec 2009 14:54:57 +0000 (14:54 +0000)]
Remove CRC32_SHIFT4 code as we are unlikely to ever need it

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

15 years agoConsolidate the IOV and non-IOV encryption/decryption code paths, and
Greg Hudson [Fri, 4 Dec 2009 05:12:35 +0000 (05:12 +0000)]
Consolidate the IOV and non-IOV encryption/decryption code paths, and
drop the _iov suffix from most encryption- and decryption-related
functions.  The enc_provider encrypt and decrypt functions take IOVs,
as do the enctype entries in etypes.c, and there are no separate
encrypt_iov or decrypt_iov functions.

aead_provider is gone.  Enctype functions now take pointers to the
enctype entry instead of pointers to the enc/hash/aead providers; this
allows dk_encrypt and dk_decrypt to be polymorphic in the length
function they use now that AES and DES3 can't differentiate by aead
provider.

aes_string_to_key needed to be moved into the krb/ fold for this since
it's an enctype function; it was duplicated between builtin/ and
openssl/ before.  This leaves openssl/aes empty; the build system
currently demands that all modules have the same directory structure,
so the directory and Makefile will stick around for now.

Three separate copies of the derive_random logic are also now
consolidated into one.

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

15 years agoRevert r23442. Revert r23436 changes unrelated to comment reformatting
Tom Yu [Thu, 3 Dec 2009 04:49:37 +0000 (04:49 +0000)]
Revert r23442.  Revert r23436 changes unrelated to comment reformatting

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

15 years agoUpdate export list to reflect changes in r23436
Tom Yu [Thu, 3 Dec 2009 04:10:18 +0000 (04:10 +0000)]
Update export list to reflect changes in r23436

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

15 years agoReformat new comments
Ken Raeburn [Thu, 3 Dec 2009 02:35:21 +0000 (02:35 +0000)]
Reformat new comments

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

15 years agofix slow behavior on Mac OS X with link-local addresses
Ken Raeburn [Thu, 3 Dec 2009 02:17:28 +0000 (02:17 +0000)]
fix slow behavior on Mac OS X with link-local addresses

When using my previous patch, if a local hostname like "foobar.local"
is looked up, you may get back a link-local IPv6 address.  However,
the KDC seems to be unable to respond from that address, resulting in
a ~1s delay for each KDC exchange while waiting for the client to fail
over to another address (in my case, another IPv6 address).

Create a new object for holding whatever auxiliary information might
be needed to properly transmit the response to the client.  Currently,
that only means the interface index number under IPv6.  Fill it in on
receipt, always; copy it back to the pktinfo structure when
transmitting, ONLY if the local source address is link-local.

If an error occurs while transmitting the reply, print both the remote
destination address and the local source address.  Use getnameinfo
instead of inet_ntop.

Apply the same changes to kadmind, to keep the versions of network.c
more or less in sync.

ticket: 6591

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

15 years agoallow testing even if name->addr->name mapping doesn't work
Ken Raeburn [Thu, 3 Dec 2009 02:17:24 +0000 (02:17 +0000)]
allow testing even if name->addr->name mapping doesn't work

Many of the tests are set up to fail if the local hostname can't be
mapped to an address and back to a name again.  If the name results in
an address, and we can get a fully-qualified name or something that
looks like it, though, we should be able to just go ahead and run some
tests.

This is also closer to the current behavior of sname_to_principal when
reverse DNS is enabled.

ticket: 6590

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

15 years agoSense of POINTERS_ARE_ALL_THE_SAME test was backwards
Ken Raeburn [Thu, 3 Dec 2009 02:17:20 +0000 (02:17 +0000)]
Sense of POINTERS_ARE_ALL_THE_SAME test was backwards

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

15 years agoTemporarily define UINT16_TYPE and UINT32_TYPE so the load/store
Ken Raeburn [Thu, 3 Dec 2009 02:17:16 +0000 (02:17 +0000)]
Temporarily define UINT16_TYPE and UINT32_TYPE so the load/store
functions don't need excessive conditionals internally.

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

15 years agoReformat new block comment per coding style
Greg Hudson [Wed, 2 Dec 2009 23:34:05 +0000 (23:34 +0000)]
Reformat new block comment per coding style

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

15 years agoActually record dependencies of crypto tests
Ken Raeburn [Wed, 2 Dec 2009 23:09:42 +0000 (23:09 +0000)]
Actually record dependencies of crypto tests

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

15 years agoCheck ALL_DEP_SRCS, not SRCS, to decide what to put into the deps file
Ken Raeburn [Wed, 2 Dec 2009 23:09:40 +0000 (23:09 +0000)]
Check ALL_DEP_SRCS, not SRCS, to decide what to put into the deps file

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

15 years agoupdate dependencies
Ken Raeburn [Wed, 2 Dec 2009 23:09:36 +0000 (23:09 +0000)]
update dependencies

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

15 years agoPerform the AES-CBC XOR operations 4 bytes at a time, using the helper
Ken Raeburn [Wed, 2 Dec 2009 23:09:33 +0000 (23:09 +0000)]
Perform the AES-CBC XOR operations 4 bytes at a time, using the helper
functions for loading and storing potentially-unaligned values.
Improves bulk AES encryption performance by 2% or so on 32-bit x86
with gcc 4.

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

15 years agoAdd store_{16,32,64}_n functions, for potentially-unaligned, native-order values
Ken Raeburn [Wed, 2 Dec 2009 23:09:29 +0000 (23:09 +0000)]
Add store_{16,32,64}_n functions, for potentially-unaligned, native-order values

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

15 years agoSpeed up the per-block loops of AES, DES3, and DES IOV encryption by
Greg Hudson [Wed, 2 Dec 2009 22:37:16 +0000 (22:37 +0000)]
Speed up the per-block loops of AES, DES3, and DES IOV encryption by
avoiding function calls and copies in the case where the next block
is wholly contained within the current buffer.  To do this, introduce
two new inline functions in aead.h called iov_next_block and
iov_store_block.

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

15 years agoRemove t_kperf on make clean
Greg Hudson [Wed, 2 Dec 2009 20:13:26 +0000 (20:13 +0000)]
Remove t_kperf on make clean

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

15 years agoClean up the AES enc_provider code a bit. Chiefly, work with unsigned
Greg Hudson [Wed, 2 Dec 2009 19:52:54 +0000 (19:52 +0000)]
Clean up the AES enc_provider code a bit.  Chiefly, work with unsigned
char blocks, casting input->data and output->data once each upon entry
to the non-IOV encrypt and decrypt functions, rather than casting our
working buffers each time we need to work with an outside function.

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

15 years agoIn t_kperf, generate a valid ciphertext when testing decryption
Greg Hudson [Wed, 2 Dec 2009 18:32:03 +0000 (18:32 +0000)]
In t_kperf, generate a valid ciphertext when testing decryption

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

15 years agoFix an incorrect length in the new krb5int_c_decrypt_aead_compat
Greg Hudson [Wed, 2 Dec 2009 18:10:12 +0000 (18:10 +0000)]
Fix an incorrect length in the new krb5int_c_decrypt_aead_compat

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

15 years agoFixed the conflicting type "static krb5_error_code KRB5_CALLCONV" of krb5_change_set...
Zhanna Tsitkov [Wed, 2 Dec 2009 18:06:19 +0000 (18:06 +0000)]
Fixed the conflicting type "static krb5_error_code KRB5_CALLCONV" of  krb5_change_set_password and some reindentation/reformating

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

15 years agoReindent and removed krb5_ prefix from static func name
Zhanna Tsitkov [Tue, 1 Dec 2009 16:22:47 +0000 (16:22 +0000)]
Reindent and removed krb5_ prefix from static func name

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

15 years agoFix AES IOV decryption of small messages
Greg Hudson [Tue, 1 Dec 2009 01:36:42 +0000 (01:36 +0000)]
Fix AES IOV decryption of small messages

AES messages never need to be padded because the confounder ensures
that the plaintext is at least one block long.  Remove a check in
krb5int_dk_decrypt_iov which was rejecting short AES messages because
it didn't count the header length.

ticket: 6589
tags: pullup
target_version: 1.7.1

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

15 years agoMake krb5int_c_decrypt_aead_compat more efficient by building the
Greg Hudson [Tue, 1 Dec 2009 01:32:02 +0000 (01:32 +0000)]
Make krb5int_c_decrypt_aead_compat more efficient by building the
buffers explicitly rather than using stream decryption.  Sidesteps
some machinery and avoids copying the output.

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

15 years agoFix the usage fallback in krb5int_arcfour_decrypt_iov. Factor out IOV
Greg Hudson [Tue, 1 Dec 2009 00:40:54 +0000 (00:40 +0000)]
Fix the usage fallback in krb5int_arcfour_decrypt_iov.  Factor out IOV
encryption with a keyblock since this makes four uses of it in one
file.

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

15 years agoMark and reindent tests, with some exclusions
Tom Yu [Mon, 30 Nov 2009 23:09:36 +0000 (23:09 +0000)]
Mark and reindent tests, with some exclusions

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

15 years agoReindent
Zhanna Tsitkov [Mon, 30 Nov 2009 22:29:48 +0000 (22:29 +0000)]
Reindent

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

15 years agoMark and reindent util/support
Tom Yu [Mon, 30 Nov 2009 21:35:38 +0000 (21:35 +0000)]
Mark and reindent util/support

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

15 years agoRemove some stray tabs
Greg Hudson [Mon, 30 Nov 2009 19:37:31 +0000 (19:37 +0000)]
Remove some stray tabs

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

15 years agoUse aead_dk instead of aead_old for des-hmac-sha1, since it uses
Greg Hudson [Mon, 30 Nov 2009 19:05:01 +0000 (19:05 +0000)]
Use aead_dk instead of aead_old for des-hmac-sha1, since it uses
dk_encrypt.

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

15 years agoFix ivec chaining for DES iov encryption
Greg Hudson [Mon, 30 Nov 2009 19:03:58 +0000 (19:03 +0000)]
Fix ivec chaining for DES iov encryption

krb5int_des_cbc_decrypt_iov was using a plaintext block to update the
ivec.  Fix it to use the last cipher block, borrowing from the
corresponding des3 function.  The impact of this bug is not serious
since ivec chaining is not typically used with IOV encryption in 1.7.

ticket: 6588
tags: pullup
target_version: 1.7.1

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

15 years agoAdd an AEAD provider for enctypes which use krb5_old_encrypt and
Greg Hudson [Mon, 30 Nov 2009 16:19:24 +0000 (16:19 +0000)]
Add an AEAD provider for enctypes which use krb5_old_encrypt and
krb5_old_decrypt; this makes every enctype have an AEAD provider.  To
make this work, expose make_unkeyed_checksum_iov to other files (under
the name krb5int_hash_iov) and make krb5int_c_padding_length take into
account the header length.

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

15 years agoIn the des enc_provider decrypt_iov function, count header blocks as
Greg Hudson [Mon, 30 Nov 2009 16:13:50 +0000 (16:13 +0000)]
In the des enc_provider decrypt_iov function, count header blocks as
well as data and padding blocks when checking for correctly padded
input.

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

15 years agoMake the crc32 hash provider correctly chain multiple input buffers,
Greg Hudson [Mon, 30 Nov 2009 16:12:36 +0000 (16:12 +0000)]
Make the crc32 hash provider correctly chain multiple input buffers,
so that it returns the same result if you pass it one big buffer or
many small buffers containing the same data.  To do this, change the
contract of mit_crc32 so that the cksum parameter is in-out.

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

15 years agoStream decryption is handled in krb5_k_decrypt_iov; remove some
Greg Hudson [Mon, 30 Nov 2009 14:17:06 +0000 (14:17 +0000)]
Stream decryption is handled in krb5_k_decrypt_iov; remove some
lingering checks in the dk and raw aead providers from before that
was introduced.

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

15 years agoFix memory leak
Sam Hartman [Mon, 30 Nov 2009 14:14:47 +0000 (14:14 +0000)]
Fix memory leak

ticket: 6585

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

15 years agoTerminate the loop in find_authdata_1 if we get an error in one of the
Greg Hudson [Mon, 30 Nov 2009 01:19:14 +0000 (01:19 +0000)]
Terminate the loop in find_authdata_1 if we get an error in one of the
iterations.

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

15 years agoRemove the non-iov entry point introduced in r23378, since it's easy
Greg Hudson [Sun, 29 Nov 2009 23:13:57 +0000 (23:13 +0000)]
Remove the non-iov entry point introduced in r23378, since it's easy
to use the iov entry point at both call sites.  Rename the iov entry
point to remove the "_iov" suffix since it's no longer needed to
disambiguate.

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

15 years agoAvoid using strncpy in the production of the arcfour salt because it
Greg Hudson [Sun, 29 Nov 2009 15:43:29 +0000 (15:43 +0000)]
Avoid using strncpy in the production of the arcfour salt because it
produces a (spurious) Coverity defect.  Fix a memory leak in
krb5int_arcfour_encrypt.

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

15 years agoAdd do-while(0) around multi-statement macros in f_tables.h for more
Greg Hudson [Sun, 29 Nov 2009 15:32:28 +0000 (15:32 +0000)]
Add do-while(0) around multi-statement macros in f_tables.h for more
consistent and elegant emacs auto-formatting.

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

15 years agoCreate functional internal interfaces to allow GSSAPI to perform
Greg Hudson [Sat, 28 Nov 2009 23:10:31 +0000 (23:10 +0000)]
Create functional internal interfaces to allow GSSAPI to perform
arcfour encryption of GSS tokens.  This factors out derivation of
the usage and encryption keys, and removes the need for the provider
structures to be visible to all of krb5 via k5-int.h.

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

15 years agoClean up the arcfour token encryption and decryption functions by
Greg Hudson [Sat, 28 Nov 2009 15:53:39 +0000 (15:53 +0000)]
Clean up the arcfour token encryption and decryption functions by
making use of newer convenience functions and by factoring out the
derivation of the usage and encryption keys.

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

15 years agoAdd a convenience inline function in k5-int.h to initialize a
Greg Hudson [Sat, 28 Nov 2009 15:51:45 +0000 (15:51 +0000)]
Add a convenience inline function in k5-int.h to initialize a
krb5_data structure with allocated memory.

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

15 years agoMark and reindent lib/crypto
Greg Hudson [Sat, 28 Nov 2009 00:43:34 +0000 (00:43 +0000)]
Mark and reindent lib/crypto

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

15 years agoAdd krb5_key versions of the auth context key accessors, and use them
Greg Hudson [Fri, 27 Nov 2009 21:30:51 +0000 (21:30 +0000)]
Add krb5_key versions of the auth context key accessors, and use them
to simplify the gss-krb5 code a little bit.

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