]> git.ipfire.org Git - thirdparty/krb5.git/log
thirdparty/krb5.git
16 years agoImplement strengthen key fast
Sam Hartman [Fri, 3 Apr 2009 03:39:58 +0000 (03:39 +0000)] 
Implement strengthen key

Per ietf-krb-wg discussion, the reply key mechanism is being replaced
with a strengthen key mechanism.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22166 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoAdvertize FAST in supported preauth types
Sam Hartman [Fri, 3 Apr 2009 03:39:56 +0000 (03:39 +0000)] 
Advertize FAST in supported preauth types

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22165 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoImplement test forr ad-fx-armor
Sam Hartman [Fri, 3 Apr 2009 03:39:53 +0000 (03:39 +0000)] 
Implement test forr ad-fx-armor

Implement a test program to replace the TGT in the ccache with a
ticket with the ad-fx-armor authorization data.  This can be used to
confirm that a KDC honors this authorization data.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22164 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoImplement KDC side cookie handling
Sam Hartman [Fri, 3 Apr 2009 03:39:50 +0000 (03:39 +0000)] 
Implement KDC side cookie handling

Return a constant cookie in errors to indicate that clients should
continue their conversations.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22163 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoImplement PRF for RC4 enctypes
Sam Hartman [Fri, 3 Apr 2009 03:39:41 +0000 (03:39 +0000)] 
Implement PRF for RC4 enctypes

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22162 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoClient-side cookie support
Sam Hartman [Fri, 3 Apr 2009 03:39:38 +0000 (03:39 +0000)] 
Client-side cookie support

Echo the pa-fx-cookie back to the KDC.
No need to store cookie padata in the state structure; removed.
If cookie is not present and FAST is being used, do not retry after error.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22161 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoTGS error path can end up with null state if it fails too soon. In
Sam Hartman [Wed, 1 Apr 2009 21:13:40 +0000 (21:13 +0000)] 
TGS error path can end up with null state if it fails too soon.  In
this case do not call into FAST.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22158 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoInitialize request state in the TGS path
Sam Hartman [Wed, 1 Apr 2009 21:13:38 +0000 (21:13 +0000)] 
Initialize request state in the TGS path

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22157 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoFix memory management errors detected through static analysis; thanks Greg Hudson
Sam Hartman [Wed, 1 Apr 2009 21:13:34 +0000 (21:13 +0000)] 
Fix memory management errors detected through static analysis; thanks Greg Hudson

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22156 dc483132-0cff-0310-8789-dd5450dbe970

16 years agofast_options is a KerberosFlags not an int32
Sam Hartman [Wed, 1 Apr 2009 21:13:31 +0000 (21:13 +0000)] 
fast_options is a KerberosFlags not an int32

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22155 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoWhen FAST is enabled, do not use encrypted timestamp
Sam Hartman [Thu, 26 Mar 2009 05:37:45 +0000 (05:37 +0000)] 
When FAST is enabled, do not use encrypted timestamp
pre-authentication.  FAST mandates encrypted challenge.  Encrypted
timestamp ends up using the raw client key in the AS reply.  Also, if
encrypted timestamp is enabled, it is preferred to any plugin.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22146 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoImplement Encrypted Challenge fast factor
Sam Hartman [Thu, 26 Mar 2009 05:37:41 +0000 (05:37 +0000)] 
Implement Encrypted Challenge fast factor

Implement the encrypted challenge fast factor.  As part of this,
expose an interface for a preauth method to request the FAST armor
key.

* plugins/preauth/encrypted_challenge: new plugin
* include/krb5/krb5.hin: constants (keyusages) for encrypted challenge
* include/k5-int.h krb5/os/accessor.c: expose interfaces needed by encrypted challenge
* kdc/kdc_preauth.c lib/krb5/krb/preauth2.c include/krb5/preauth_plugin.h: interface for
          fast armor key
* kdc/do_as_req.c: make fast state available to preauth
* lib/krb5/krb/get_in_tkt.c: initialize etype based on etype of AS reply
*  lib/krb5/krb/preauth2.c: Etype given to plugins tracked the same way as etype used internally

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22145 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoReject non-armor ticket use of AD-FX-ARMOR
Sam Hartman [Thu, 26 Mar 2009 05:37:36 +0000 (05:37 +0000)] 
Reject non-armor ticket use of AD-FX-ARMOR

Reject tickets or authenticators that have AD-FX-ARMOR and are used
with the TGS per draft-ietf-krb-wg-preauth-framework.

* kdc_util.c find authdata and reject
* krb5.hin include constant
* libkrb5.exports: export krb5int_find_authdata

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22144 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoFAST response only when FAST in use
Sam Hartman [Thu, 26 Mar 2009 05:37:34 +0000 (05:37 +0000)] 
FAST response only when FAST in use

Client should expect a FAST response only when fast is being ussed.
krb5int_fast_process_response now returns success if FAST is not in use.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22143 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoKDC TGS FAST support
Sam Hartman [Thu, 26 Mar 2009 05:37:31 +0000 (05:37 +0000)] 
KDC TGS FAST support

* Correct TGS armor key handling
* Use appropriate checksum type  for FAST responses from KDC
* FAST response handling for TGS replies and errors

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22142 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoKDC handling of FAST response
Sam Hartman [Thu, 26 Mar 2009 05:37:28 +0000 (05:37 +0000)] 
KDC handling of FAST response

Integrate FAST response handling into AS reply and error paths.  Ad
support for encrypting and generating PA_FX_FAST_REPLY.  Use that
support in the AS.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22141 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoFAST encrypted response for client
Sam Hartman [Thu, 26 Mar 2009 05:37:25 +0000 (05:37 +0000)] 
FAST encrypted response for  client

Implement routine to decrypt FAST response.  Use this in
process_error.  Implement new krb5int_fast_process_response to process
FAST in an AS-REP or TGS-rep.  Call that routine from
krb5_get_init_creds.
Add a new error code for FAST required but not supported.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22140 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoDo not include cookie in outer padata on client
Sam Hartman [Thu, 26 Mar 2009 05:37:23 +0000 (05:37 +0000)] 
Do not include cookie in outer padata on client

If the cookie is going to be present in the inner padata then
krb5int_fast_process_error is the wrong place to emit it.
Instead it should be added to the padata in the preauth loop.
This patch removes it from the outer padata.
In addition, it is easier if the cookie is stored as a pa_data on the client rather than a krb5_data.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22139 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoRemove FAST finish checksum
Sam Hartman [Thu, 26 Mar 2009 05:37:18 +0000 (05:37 +0000)] 
Remove FAST finish checksum

Per discussion on ietf-krb-wg, the checksum is unnecessary if a nonce
is included in the response .  For this to be secure, the cookie needs
to be inner padata when FAST is used.

* kdc/fast.c: when constructing fast responses  include the nonce
* lib/krb5/krb/fast.c: generate a random nonce for each time a fast request is constructed
* add nonce field to fast_response
* remove checksum field from fast_finished
* Look for cookie as inner padata when FAST is used

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22138 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoPull the kdc_req_body out of the ASN.1 packet and pass in to be
Sam Hartman [Thu, 26 Mar 2009 05:37:15 +0000 (05:37 +0000)] 
Pull the kdc_req_body out of the ASN.1 packet and pass in to be
checksummed; the code previously incorrectly passed in the entire
kdc_req.

do_as_req: decode kdc_req_body

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22137 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoSet status when kdc_find_fast fails in do_as_req.c
Sam Hartman [Thu, 26 Mar 2009 05:37:12 +0000 (05:37 +0000)] 
Set status when kdc_find_fast fails in do_as_req.c

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22136 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoap-request armor handling for KDC
Sam Hartman [Thu, 26 Mar 2009 05:37:09 +0000 (05:37 +0000)] 
ap-request armor handling for KDC

Implement support for ap-request armor handling in the KDC FAST routines.

* export needed decoders and free functions from libkrb5

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22135 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoImplement client AS armor
Sam Hartman [Thu, 26 Mar 2009 05:37:06 +0000 (05:37 +0000)] 
Implement client AS armor

* fast_armor_ap_request: generate ap_request armor
* krb5int_fast_as_armor: parse GIC options and request armor
* krb5_get_init_creds: call
* krb5_get_init_creds_opt_set_fast_ccache_name: API to indicate where armor credentials are found
* krb5_free_fast_armored_req: implement

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22134 dc483132-0cff-0310-8789-dd5450dbe970

16 years agodefault to not retrying after error in client preauth loop
Sam Hartman [Thu, 26 Mar 2009 05:37:04 +0000 (05:37 +0000)] 
default to not retrying after error in client preauth loop

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22133 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoIntegrate fast in KDC AS errors
Sam Hartman [Thu, 26 Mar 2009 05:37:01 +0000 (05:37 +0000)] 
Integrate fast in KDC AS errors

Call kdc_fast_handle_error from prepare_as_error Also, decode either
td or pa sequence in e_data and feed into fast's idea of a pa
sequence.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22132 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoClient AS-req error handling for FAST
Sam Hartman [Thu, 26 Mar 2009 05:36:58 +0000 (05:36 +0000)] 
Client AS-req error handling for FAST

Find and decode the fast_response and fx_error.
Pull out padata and re-encode as typed-data

* Implement krb5_free_typed_data
* implement error handling logic in krb5int_fast_handle_error
* Implement krb5int_find_pa_data

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22131 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoImplement free_fast_response and free_fast_finished
Sam Hartman [Thu, 26 Mar 2009 05:36:56 +0000 (05:36 +0000)] 
Implement free_fast_response and free_fast_finished

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22130 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoImplement KDC side FAST response
Sam Hartman [Thu, 26 Mar 2009 05:36:53 +0000 (05:36 +0000)] 
Implement KDC side FAST response

Implement generation of fast_response, partial finish and fx_error.
Add reply key to state.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22129 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoFree the request in process_as_req for parallelism with TGS case. This permits the...
Sam Hartman [Thu, 26 Mar 2009 05:36:50 +0000 (05:36 +0000)] 
Free the request in process_as_req for parallelism with TGS case. This permits the FAST code to free the outer request if FAST is in use

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22128 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoSome fast free functions
Sam Hartman [Thu, 26 Mar 2009 05:36:48 +0000 (05:36 +0000)] 
Some fast free functions

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22127 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoIntegrate FAST in to client AS sending
Sam Hartman [Thu, 26 Mar 2009 05:36:45 +0000 (05:36 +0000)] 
Integrate FAST in to client AS sending

Functions to generate  FAST request and to manage client fast state.  Integrate into client  AS req loop.

Most of this is stub code although the integration points and arguments should be correct.

* Call into fast to prepare the request body.  If FAST is being used,
this may end up hiding the names in the future in the outer request.

* Call into FAST to prepare the request before sending.  This will
generate the FAST padata  and return an encoded outer request.

* Call into fast to handle error replies, potentially extracting
padata and information on whether to continue processing.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22126 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoIntegrate FAST into AS and TGS
Sam Hartman [Thu, 26 Mar 2009 05:36:40 +0000 (05:36 +0000)] 
Integrate FAST into AS and TGS

Integrate calls to lookup FAST padata into the AS and TGS paths.
kdc_util needs to return a pointer to the pa-tgs-req padata for the
fast checksum.

This code does not generate fast responses or errors yet.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22125 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoFunction to parse FAST for KDC requests
Sam Hartman [Thu, 26 Mar 2009 05:36:38 +0000 (05:36 +0000)] 
Function to parse FAST for KDC requests

* Add fast_util to KDC
* export fast_req decoder from libkrb5
* Function to find a fast request, extract and use inner body
* functions to free and create kdc_request_state

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22124 dc483132-0cff-0310-8789-dd5450dbe970

16 years agodefines for fast padata assignments
Sam Hartman [Thu, 26 Mar 2009 05:36:34 +0000 (05:36 +0000)] 
defines for fast padata assignments

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22123 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoAdd kdc_state field to krb5_kdc_req
Sam Hartman [Thu, 26 Mar 2009 05:36:31 +0000 (05:36 +0000)] 
Add kdc_state field to krb5_kdc_req

Add a kdc_state field to track internal state in handling a request.
The current usage is to pass FAST information to pre-authentication
plugins.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22122 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoAdd #defines for fast options and to keep track of unsupported
Sam Hartman [Thu, 26 Mar 2009 05:36:28 +0000 (05:36 +0000)] 
Add #defines for fast options and to keep track of unsupported
critical fast options.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22121 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoAdd KRB5KDC_UNKNOWN_FAST_CRITICAL_OPTION
Sam Hartman [Thu, 26 Mar 2009 05:36:26 +0000 (05:36 +0000)] 
Add KRB5KDC_UNKNOWN_FAST_CRITICAL_OPTION

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22120 dc483132-0cff-0310-8789-dd5450dbe970

16 years agokdc_req_body in fast_req should be a pointer
Sam Hartman [Thu, 26 Mar 2009 05:36:23 +0000 (05:36 +0000)] 
kdc_req_body in fast_req should be a pointer

The req_body needs to be a pointer so  after FAST processing it can replace the request.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22119 dc483132-0cff-0310-8789-dd5450dbe970

16 years agopa_fx_fast_reply is a choice of sequence of encrypted data
Sam Hartman [Thu, 26 Mar 2009 05:36:20 +0000 (05:36 +0000)] 
pa_fx_fast_reply is a choice of sequence of encrypted data

There is a decryption step that needs to go between unwrapping the
fx_fast_reply and decoding the fast_response.  Expose the necessary
encoders and decoders?

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22118 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoDefine FAST encoders and decoders
Sam Hartman [Thu, 26 Mar 2009 05:36:17 +0000 (05:36 +0000)] 
Define FAST encoders and decoders

Initial implementation of FAST encoders and decoders

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22117 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoFAST data structures for protocol messages
Sam Hartman [Thu, 26 Mar 2009 05:36:05 +0000 (05:36 +0000)] 
FAST data structures for protocol messages

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22116 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoBranch trunk for FAST project
Sam Hartman [Thu, 26 Mar 2009 05:31:49 +0000 (05:31 +0000)] 
Branch trunk for FAST project

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/fast@22115 dc483132-0cff-0310-8789-dd5450dbe970

16 years agoUpdate kdb5_util man page for mkey migration project
Will Fiveash [Wed, 25 Mar 2009 21:12:58 +0000 (21:12 +0000)] 
Update kdb5_util man page for mkey migration project

Updated the kdb5_util command man page to include documentation on new
subcommands added as a result of the Master Key Migration project.

Ticket: 6432
Version_Reported: 1.7
Target_Version: 1.7
Tags: pullup

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

16 years agoRevert r21880 which included k5-int.h in several pkinit source files.
Greg Hudson [Tue, 24 Mar 2009 17:24:31 +0000 (17:24 +0000)] 
Revert r21880 which included k5-int.h in several pkinit source files.
Instead, move the pkinit-specific KRB5_CONF macros to pkinit.h, and
add duplicate definitions of the non-pkinit-specific macros used by
the pkinit code.

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

16 years agoInstall kadmin and kdb headers
Greg Hudson [Fri, 20 Mar 2009 18:09:19 +0000 (18:09 +0000)] 
Install kadmin and kdb headers

Add disclaimers to the kadmin and kdb headers about the weaker
stability commitments we make for their APIs, and install them for the
benefit of users who can tolerate such instability.  (The kadmin
interface is the real goal here, but the kadmin header includes kdb.h
so we need to install both.)

ticket: 6431
tags: pullup
target_version: 1.7

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

16 years agoFix error handling issue in ASN.1 decoder
Greg Hudson [Tue, 17 Mar 2009 21:54:51 +0000 (21:54 +0000)] 
Fix error handling issue in ASN.1 decoder

In asn1_k_decode.c, check the return value of
end_sequence_of_no_tagvars_helper.

ticket: 6427
tags: pullup
target_version: 1.7

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

16 years agoVerify return code from krb5_db_set_mkey_list
Zhanna Tsitkov [Mon, 16 Mar 2009 18:00:06 +0000 (18:00 +0000)] 
Verify return code from krb5_db_set_mkey_list

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

16 years agomake depend
Sam Hartman [Mon, 16 Mar 2009 16:54:40 +0000 (16:54 +0000)] 
make depend

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

16 years agoImplement tests for authdata functions
Sam Hartman [Mon, 16 Mar 2009 16:50:30 +0000 (16:50 +0000)] 
Implement tests for authdata functions

Implement some test cases for krb5_merge_authdata and
krb5int_find_authdata

ticket: 6422

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

16 years agoImplement krb5int_find_authdata
Sam Hartman [Mon, 16 Mar 2009 16:50:26 +0000 (16:50 +0000)] 
Implement krb5int_find_authdata

Implement a function to find all instances of a particular ad_type in
ticket or authenticator authdata.

ticket: 6422

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

16 years agoImplement test cases for CF2
Sam Hartman [Mon, 16 Mar 2009 16:50:23 +0000 (16:50 +0000)] 
Implement test cases for CF2

Implement a simple program to call KRB-FX-CF2 and print the resulting
keys.  Add to regression tests.  Also, use the PRF testing application
to confirm that CF2 generates consistent keys if called by hand.

ticket: 6421

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

16 years agoImplement KRB-FX_CF2
Sam Hartman [Mon, 16 Mar 2009 16:50:09 +0000 (16:50 +0000)] 
Implement KRB-FX_CF2

Draft-ietf-krb-wg-preauth-framework defines a function KRB-FX-CF2 that
combines two keys of arbitrary enctype.  Implement this function as an
exported API.

ticket: 6421

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

16 years agoCall kdb_set_mkey_list from the KDC
Sam Hartman [Mon, 16 Mar 2009 16:50:04 +0000 (16:50 +0000)] 
Call kdb_set_mkey_list from the KDC

In order for the kdb keytab to be used from within the KDC, the KDC
needs to set the master key list in the context.

ticket: 6424
Target_version: 1.7
tags: pullup

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

16 years agokrb5_auth_con_free should support freeing a null auth_context without segfault
Sam Hartman [Mon, 16 Mar 2009 16:49:59 +0000 (16:49 +0000)] 
krb5_auth_con_free should support freeing a null auth_context without segfault

If the input auth_con is NULL, return success.

ticket: 6423

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

16 years agoAdd LDAP back end support for canonical name attribute
Greg Hudson [Sun, 15 Mar 2009 04:21:12 +0000 (04:21 +0000)] 
Add LDAP back end support for canonical name attribute

Add a krbCanonicalName attribute to the schema.  When looking up a
principal, if the canonical name is set and does not match the
requested name, then return the entry only if canonicalization was
requested, and use the entry's canonical name.

ticket: 6420
tags: pullup
target_version: 1.7

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

16 years agoDocument alias support in LDAP back end
Greg Hudson [Sun, 15 Mar 2009 04:15:16 +0000 (04:15 +0000)] 
Document alias support in LDAP back end

Add a few paragraphs to the LDAP instructions on creating aliases
through direct manipulation of the LDAP data, and briefly explain when
aliases will be used.

ticket: 6419
tags: pullup
target_version: 1.7

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

16 years agoImprove LDAP admin documentation
Greg Hudson [Sat, 14 Mar 2009 05:46:18 +0000 (05:46 +0000)] 
Improve LDAP admin documentation

Use dc=example,dc=com as the example base DN instead of more archaic
forms.  Provide a little more cross-referencing of concepts and
mechanisms.  Add additional steps in the OpenLDAP setup instructions
for choosing DNs for the Kerberos container, KDC service, and kadmin
service.  Explain a little bit about what the Kerberos container and
realm container are.  Be clearer that using separate subtrees from the
realm container for principals is an option, not a necessity, and
don't use the base DN as an example of a separate subtree (it's
confusing).

ticket: 6418
target_version: 1.7
tags: pullup

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

16 years agoCVE-2009-0845 SPNEGO can dereference a null pointer
Tom Yu [Fri, 13 Mar 2009 21:16:14 +0000 (21:16 +0000)] 
CVE-2009-0845 SPNEGO can dereference a null pointer

acc_ctx_new() can return an error condition without establishing a
SPNEGO context structure.  This can cause a null pointer dereference
in cleanup code in spnego_gss_accept_sec_context().

ticket: 6417
tags: pullup
target_version: 1.7

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

16 years agoUse correct salt for canonicalized principals
Greg Hudson [Fri, 13 Mar 2009 03:10:12 +0000 (03:10 +0000)] 
Use correct salt for canonicalized principals

In cases where the salt is derived from the client principal, use the
canonicalized principal received from the KDC to determine the salt.
Further changes are probably required for some preauth cases.

ticket: 6415
target_version: 1.7
tags: pullup

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

16 years agoBetter fix: Delay setting 'outbuf' until after the header buffer might
Ken Raeburn [Thu, 12 Mar 2009 22:06:35 +0000 (22:06 +0000)] 
Better fix: Delay setting 'outbuf' until after the header buffer might
have been allocated locally, and set it in both code paths instead of
just the confidentiality-requested code path.

ticket: 6412
tags: pullup

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

16 years agocrash using library-allocated storage for header in wrap_iov
Ken Raeburn [Thu, 12 Mar 2009 16:48:15 +0000 (16:48 +0000)] 
crash using library-allocated storage for header in wrap_iov

When allocating storage for the header buffer, update the internal
output buffer pointer as well.

ticket: 6412
target_version: 1.7
tags: pullup

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

16 years agoReport verbose error messages from KDC
Greg Hudson [Wed, 11 Mar 2009 22:14:24 +0000 (22:14 +0000)] 
Report verbose error messages from KDC

We were losing verbose error messages when logging from the KDC because
the context passed to krb5_klog_init did not match the realm-specific
context used for most library function calls.  Introduce a wrapper
function kdc_err which copies the error state from the call context
to the log context.  The wrapper function also knows the program name,
which removes the need to pass argv[0] around everywhere or make up
program names.

ticket: 6408
target_version: 1.7
tags: pullup

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

16 years agoMake a working krb5_copy_error_message
Greg Hudson [Wed, 11 Mar 2009 22:11:06 +0000 (22:11 +0000)] 
Make a working krb5_copy_error_message

The krb5_copy_error_state macro wasn't used, didn't work, and didn't
need to be a macro.  Replace it with an exported API function named
krb5_copy_error_message.

ticket: 6407
target_version: 1.7
tags: pullup

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

16 years agoMake Lite Client lib link again
Zhanna Tsitkov [Wed, 11 Mar 2009 15:36:41 +0000 (15:36 +0000)] 
Make Lite Client lib link again

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

16 years agoMake it link again
Zhanna Tsitkov [Wed, 11 Mar 2009 15:32:14 +0000 (15:32 +0000)] 
Make it link again

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

16 years agoSeveral small fixes to enable the migrate mkey commands to work properly with a LDAP...
Will Fiveash [Tue, 10 Mar 2009 20:26:24 +0000 (20:26 +0000)] 
Several small fixes to enable the migrate mkey commands to work properly with a LDAP KDB.  See the ticket for more details

ticket: 6405
Tags: pullup

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

16 years agoAdded test for KRB5_NT_UNKNOWN princ type
Zhanna Tsitkov [Tue, 10 Mar 2009 14:49:43 +0000 (14:49 +0000)] 
Added test for KRB5_NT_UNKNOWN princ type

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

16 years agoRename kdb_setup_lib_handle to krb5_db_setup_lib_handle and export it.
Greg Hudson [Tue, 10 Mar 2009 01:28:12 +0000 (01:28 +0000)] 
Rename kdb_setup_lib_handle to krb5_db_setup_lib_handle and export it.
Make kdb5_ldap_util work again by calling this function to set up
dal_handle instead of using one with an uninitialized lib_handle.

It is likely that kdb5_ldap_util will only function given a krb5.conf
which specifies a realm with an LDAP database module as the default
realm.  Not sure if that was the case before.

ticket: 6403

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

16 years agoRemoved unneeded printf's
Zhanna Tsitkov [Mon, 9 Mar 2009 14:23:31 +0000 (14:23 +0000)] 
Removed unneeded  printf's

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

16 years agoIntroduced '-u' option to kvno to enforce KRB5_NT_UNKNOWN princ type
Zhanna Tsitkov [Mon, 9 Mar 2009 14:21:20 +0000 (14:21 +0000)] 
Introduced '-u' option to kvno to enforce KRB5_NT_UNKNOWN princ type

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

16 years agoAdd "-V" option to klist to print the package name and version, and exit
Ken Raeburn [Fri, 6 Mar 2009 23:57:10 +0000 (23:57 +0000)] 
Add "-V" option to klist to print the package name and version, and exit

ticket: 4241
target_version: 1.7
tags: pullup

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

16 years agosend_as_req re-encodes the request
Sam Hartman [Fri, 6 Mar 2009 17:26:29 +0000 (17:26 +0000)] 
send_as_req re-encodes the request

krb5_get_init_creds calls encode_krb5_as_req to produce an encoding
for the preauth plugins, then passes the unencoded request structure
into the static function send_as_req.  That function re-encodes the
request.  This is an unnecessary call to the encoder.  In addition,
for the FAST project, it is desirable to encapsulate the unencoded
outer request so that krb5_get_init_creds does not need it.

* send_as_req is modified to take an encoded request and realm
* Remove unused logic to fill in request nonce from send_as_req

ticket: 6401

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

16 years agoTake out of the loop unchangeble assignments. Tabulation
Zhanna Tsitkov [Thu, 5 Mar 2009 16:49:12 +0000 (16:49 +0000)] 
Take out of the loop unchangeble assignments. Tabulation

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

16 years agokrb5_merge_authdata should initialize output on failure
Sam Hartman [Thu, 26 Feb 2009 20:32:35 +0000 (20:32 +0000)] 
krb5_merge_authdata  should initialize output on failure

ticket: 6400

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

16 years agoInclude authenticator and ticket authdata in gss-api
Sam Hartman [Thu, 26 Feb 2009 20:07:05 +0000 (20:07 +0000)] 
Include authenticator and ticket authdata in gss-api

Currently, the GSS-API routines for handling authdata only extract the
authorization data from the ticket, not that from the authenticator.
This is incorrect.  Introduce a new function krb5_merge_authadata to
merge two authdata arrays into a newly allocated result array.  Use
this function in accept_sec_context.c to include both sets of
authdata.

ticket: 6400
Target_version: 1.7
Tags: pullup

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

16 years agoCheck return code of encode_krb5_ap_req. Also, tabs vs whitespace
Zhanna Tsitkov [Mon, 23 Feb 2009 21:26:29 +0000 (21:26 +0000)] 
Check return code of encode_krb5_ap_req. Also, tabs vs whitespace

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

16 years agoIn krb5int_generate_and_save_subkey, check the return value of
Greg Hudson [Mon, 23 Feb 2009 20:15:05 +0000 (20:15 +0000)] 
In krb5int_generate_and_save_subkey, check the return value of
krb5_crypto_us_timeofday.  It can't really fail in practice, but if it
did we'd be passing stack garbage to krb5_c_random_add_entropy.
That's harmless, but poor form.

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

16 years agoCheck the return value of fseek in two places in kt_file.c
Greg Hudson [Mon, 23 Feb 2009 19:30:36 +0000 (19:30 +0000)] 
Check the return value of fseek in two places in kt_file.c

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

16 years agoCorrect the return code
Zhanna Tsitkov [Mon, 23 Feb 2009 18:47:28 +0000 (18:47 +0000)] 
Correct the return code

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

16 years agoKill an odd (but harmless) use of strncpy in
Greg Hudson [Mon, 23 Feb 2009 18:28:48 +0000 (18:28 +0000)] 
Kill an odd (but harmless) use of strncpy in
krb5_get_in_tkt_with_password, by using the construction from
krb5_get_init_creds_password.

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

16 years agosend_tgs.c:
Sam Hartman [Mon, 23 Feb 2009 16:22:47 +0000 (16:22 +0000)] 
send_tgs.c:
* Move generation of subkey into krb5int_send_tgs from construct_authenticator so that it is available for encrypting authorization data.

* Initialize rep->message_type and note that rep is touched on
unsuccessful calls (this has always been true).

* Do not set *subkey until successful return.
Thanks to Greg Hudson for pointing out these problems.

Ticket: 6393

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

16 years agoIn krcp, check the return value when closing the output file after
Greg Hudson [Fri, 20 Feb 2009 19:13:00 +0000 (19:13 +0000)] 
In krcp, check the return value when closing the output file after
successfully writing it.  close cannot return an error status on most
local filesystems, but can on some network filesystems such as AFS or
NFS.

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

16 years agoAlso install k5srvutil into PREFIX/bin instead of PREFIX/sbin
Russ Allbery [Fri, 20 Feb 2009 18:48:26 +0000 (18:48 +0000)] 
Also install k5srvutil into PREFIX/bin instead of PREFIX/sbin

Ticket: 6348
Tags: pullup

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

16 years agoAdjust to the return value of isflagset routine
Zhanna Tsitkov [Fri, 20 Feb 2009 18:24:18 +0000 (18:24 +0000)] 
Adjust to the return value of isflagset routine

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

16 years agoKDC realm referral test
Zhanna Tsitkov [Fri, 20 Feb 2009 14:34:34 +0000 (14:34 +0000)] 
KDC realm referral test

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

16 years agoremove obsolete GNU.ORG realm info
Ken Raeburn [Thu, 19 Feb 2009 20:51:27 +0000 (20:51 +0000)] 
remove obsolete GNU.ORG realm info

Our sample krb5.conf has obsolete info on the GNU.ORG realm; the DNS
entries named don't exist, and AFAIK this hasn't been accurate in
years.  (I don't even know if they're currently running a Kerberos
realm.)

ticket: 6398
target_version: 1.7
tags: pullup

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

16 years agoFix in handle_referral_params
Zhanna Tsitkov [Thu, 19 Feb 2009 20:15:04 +0000 (20:15 +0000)] 
Fix in handle_referral_params

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

16 years agoSome fixups and stubs for building ccapi on UNIX, and dependencies.
Ken Raeburn [Wed, 18 Feb 2009 18:20:41 +0000 (18:20 +0000)] 
Some fixups and stubs for building ccapi on UNIX, and dependencies.
(Doesn't make a complete working implementation, but it mostly compiles.)

Does *not* include the changes to actually cause the ccapi code to get
built in normal UNIX builds.

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

16 years agoRevert the fopen part of the previous krb5_kuserok change, but keep
Greg Hudson [Tue, 17 Feb 2009 17:32:19 +0000 (17:32 +0000)] 
Revert the fopen part of the previous krb5_kuserok change, but keep
the string-handling change.  It introduced an unwanted behavior change
when .k5login was detectable but unreadable.

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

16 years agoIn krb5_kuserok, just try opening .k5login; don't check ahead of time
Greg Hudson [Tue, 17 Feb 2009 17:09:35 +0000 (17:09 +0000)] 
In krb5_kuserok, just try opening .k5login; don't check ahead of time
whether it looks accessible.  Also rewrite the construction of the
.k5login filename to use snprintf instead of strnpy/strncat.

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

16 years agoBe less verbose about routing-socket messages
Ken Raeburn [Fri, 13 Feb 2009 22:23:24 +0000 (22:23 +0000)] 
Be less verbose about routing-socket messages

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

16 years agoCorrect numerous memory leaks on error conditions in the ASN.1
Greg Hudson [Fri, 13 Feb 2009 22:05:48 +0000 (22:05 +0000)] 
Correct numerous memory leaks on error conditions in the ASN.1
decoder functions.

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

16 years agoIn krb5_decode_leak.c, work around the oddity that
Greg Hudson [Fri, 13 Feb 2009 22:03:37 +0000 (22:03 +0000)] 
In krb5_decode_leak.c, work around the oddity that
krb5_free_cred_enc_part is a contents-only free function.

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

16 years agoIn tgs_construct_tgsreq, free scratch even if scratch->data is NULL.
Greg Hudson [Fri, 13 Feb 2009 22:00:47 +0000 (22:00 +0000)] 
In tgs_construct_tgsreq, free scratch even if scratch->data is NULL.
(Which probably can't happen, but static analyzers don't know that.)
Also protect scratch from being freed before initialization.

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

16 years agoImplement TGS authenticator subkey usage
Sam Hartman [Fri, 13 Feb 2009 15:55:32 +0000 (15:55 +0000)] 
Implement TGS authenticator subkey usage

Implement support for use of a subkey in the TGS req.  This is needed
by FAST TGS support.  The interface to krb5_send_tgs changed in order
to gain a subkey output parameter.  Since this is a private interface
it was renamed to krb5int_send_tgs and removed from the export list.

* send_tgs.c: generate a subkey and return to caller
* decode_kdc_rep.c: Use subkey keyusage
* gc_via_tkt.c: pass in subkey to decode_kdc_rep
* send_tgs.c: use subkey for encrypting authorization data

ticket: 6393
tags: enhancement

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

16 years agoDon't pass negative numbers to strerror
Ken Raeburn [Thu, 12 Feb 2009 20:35:15 +0000 (20:35 +0000)] 
Don't pass negative numbers to strerror

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

16 years agoDon't apply 'const' twice. Make kg_arcfour_l40 static
Ken Raeburn [Thu, 12 Feb 2009 20:19:21 +0000 (20:19 +0000)] 
Don't apply 'const' twice.  Make kg_arcfour_l40 static

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

16 years agoDon't apply 'const' twice
Ken Raeburn [Thu, 12 Feb 2009 20:18:20 +0000 (20:18 +0000)] 
Don't apply 'const' twice

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

16 years agoIn krb5_get_in_tkt_with_password, free opte before returning the error
Greg Hudson [Thu, 12 Feb 2009 20:07:15 +0000 (20:07 +0000)] 
In krb5_get_in_tkt_with_password, free opte before returning the error
from krb5_unparse_name, not after.

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

16 years agoMake output parameter of krb5_generate_subkey_extended well-defined on
Greg Hudson [Thu, 12 Feb 2009 19:43:23 +0000 (19:43 +0000)] 
Make output parameter of krb5_generate_subkey_extended well-defined on
error, and reformat function to fit coding standards.

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