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.
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.
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.
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
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.
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.
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
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
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
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?
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.
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.)
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.
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.
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.
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.
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).
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().
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.
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.
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.
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.
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.
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
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.
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.
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.
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.)
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.
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.
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.
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