Ken Raeburn [Thu, 18 Mar 2004 03:07:22 +0000 (03:07 +0000)]
Thread-safe manipulation of registered error-table list
* error_message.c: Include k5-thread.h.
(_et_list): Now always static.
(et_list_lock): New mutex.
(error_message): Lock it while manipulating the table lists.
(add_error_table, remove_error_table): Likewise.
Ken Raeburn [Thu, 18 Mar 2004 02:55:48 +0000 (02:55 +0000)]
* ac-archive: New directory.
* ac-archive/README: New file.
* ac-archive/acx_pthread.m4: New file, data taken from autoconf macro archive
at sourceforge.
Ken Raeburn [Mon, 15 Mar 2004 17:45:01 +0000 (17:45 +0000)]
* k5seal.c (kg_seal): Extract the krb5 context from the security context
instead of requiring it be passed in as an argument.
* k5unseal.c (kg_unseal): Likewise.
* gssapiP_krb5.h (kg_seal, kg_unseal): Declarations updated.
* delete_sec_context.c, process_context_token.c, seal.c, sign.c, unseal.c,
verify.c: Callers changed.
* inq_context.c (krb5_gss_inquire_context): Use krb5 context contained in
security context instead of calling kg_get_context.
* wrap_size_limit.c (krb5_gss_wrap_size_limit): Likewise.
* import_sec_context.c (krb5_gss_ser_init): New function.
(krb5_gss_import_sec_context): Create a krb5 context locally to use for the
import.
* export_sec_context.c (krb5_gss_export_sec_context): Use the krb5 context in
the security context.
* gssapiP_krb5.h (krb5_gss_ser_init): Declare.
* gssapi_krb5.c (kg_get_context): Don't call krb5 serialization initialization
code here.
* accept_sec_context.c (krb5_gss_accept_sec_context): Free the new krb5 context
in an error case not caught before.
Ken Raeburn [Mon, 15 Mar 2004 02:05:11 +0000 (02:05 +0000)]
* gssapiP_krb5.h (struct _krb5_gss_ctx_id_rec): Add a krb5 context object.
* init_sec_context.c (krb5_gss_init_sec_context): Create a new krb5 context,
and store it in the security context if successful. If there's already a
security context, use the krb5 context in it.
* accept_sec_context.c (krb5_gss_accept_sec_context): Create a new krb5
context, and store it in the security context if successful.
* delete_sec_context.c (krb5_gss_delete_sec_context): If the security context
has a krb5 context, free it.
Ken Raeburn [Sun, 14 Mar 2004 08:14:51 +0000 (08:14 +0000)]
* gssapiP_krb5.h (struct _krb5_gss_ctx_id_rec): Delete fields init_token and
testing_unknown_tokid.
* init_sec_context.c (new_connection): Drop support (already inside "#if 0")
for them.
(krb5_gss_init_sec_context): Drop support for testing_unknown_tokid.
(mutual_auth): Don't let major_status be used uninitialized.
Ken Raeburn [Sun, 14 Mar 2004 07:08:40 +0000 (07:08 +0000)]
Add a mutex to protect the set manipulations
* gssapiP_generic.h: Include k5-thread.h.
(g_set): Add a mutex.
(G_SET_INIT): Initialize it.
* util_validate.c (g_save, g_validate, g_delete): Lock the mutex while working
on the set. (BDB version untested.)
Ken Raeburn [Sun, 14 Mar 2004 06:47:13 +0000 (06:47 +0000)]
Make the set type separate from the set-element (linked list node) type
* generic/gssapiP_generic.h (g_set): New struct type.
(G_SET_INIT): New macro.
* generic/util_validate.c (g_save, g_validate, g_delete): Change first argument
to take a g_set * rather than void **; use the address of the void pointer from
the structure.
(g_save_name, g_save_cred_id, g_save_ctx_id, g_validate_name,
g_validate_cred_id, g_validate_ctx_id, g_delete_name, g_delete_cred_id,
g_delete_ctx_id): Updated first argument type.
* genericgssapiP_generic.h: Declarations updated.
* krb5/gssapi_krb5.c (kg_vdb): Change type to g_set and initialize.
* krb5/gssapiP_krb5.h (kg_vdb): Declaration updated.
Ken Raeburn [Sun, 14 Mar 2004 04:27:08 +0000 (04:27 +0000)]
Change profile code over to new thread macros, and enable data sharing always
* prof_int.h: Include k5-thread.h. Don't include sys/types.h and pthread.h.
(SHARE_TREE_DATA): Always define.
(USE_PTHREADS): Don't define.
(prof_mutex_lock, prof_mutex_unlock): Deleted.
(struct global_shared_profile_data): Change mutex to use k5_mutex_t instead of
pthread_mutex_t.
(g_shared_trees_mutex): Don't conditionalize on USE_PTHREADS.
* prof_file.c (krb5int_profile_shared_data): Initialize mutex.
(profile_open_file, profile_dereference_data): Use new mutex macros. Check
return status when locking. Fix a potential memory leak in an error case.
Ken Raeburn [Mon, 8 Mar 2004 07:20:55 +0000 (07:20 +0000)]
Change subdir processing so that SUBDIRS will contain the configured
subdirs only for the makefile in the directory with the configure
script, and will have only $(LOCAL_SUBDIRS) elsewhere. Drop the use
of "MY_SUBDIRS=." to override SUBDIRS in favor of this way of keeping
SUBDIRS empty. Drop other uses of MY_SUBDIRS in favor of
LOCAL_SUBDIRS or (in one case, the top level) overriding the SUBDIRS
setting from pre.in.
One less thing to keep tweaking as configure scripts get reorganized
and merged.
Ken Raeburn [Mon, 8 Mar 2004 04:06:32 +0000 (04:06 +0000)]
* aclocal.m4 (AC_KRB5_TCL_FIND_CONFIG): Look for tclConfig.sh in
the specified directory if it's not in a "lib" subdirectory.
(AC_KRB5_TCL): If no pathname is supplied and tclConfig.sh isn't
found in /usr/lib, try running a script under tclsh to see if it
can supply the pathname for tclConfig.sh.
This allows the configure script to find /System/Library/Tcl/8.3/tclConfig.sh
on Jaguar.
Jeffrey Altman [Fri, 27 Feb 2004 05:24:39 +0000 (05:24 +0000)]
As discussed on the krbdev mailing list, krb5_get_init_creds_password()
suffered from a behavior in which it would unintentionally query a master
KDC twice if in fact the KDC queried when krb5int_sendto() was called
with use_master = 0 was in fact the master. This resulted in more than
an additional protocol operation. There were two negative side effects.
First, in the case of an incorrect password there would be two counts
against the max retry attempts. Second, in the case of hardware pre-auth
and an expired password, the user would be asked to enter their expired
password twice before being told it was expired.
This has been fixed by changing the use_master parameter into an in/out
parameter and modifying krb5int_sendto() to indicate which KDC it received
the response from. This allows the use_master parameter to be set to
indicate whether or not the response came from a master KDC regardless
of whether a master KDC was requested.
Ken Raeburn [Thu, 26 Feb 2004 04:35:09 +0000 (04:35 +0000)]
* rcp.exp (stop_rsh_daemon): Check for any output before eof, causing any such
info to be dumped into the debug log.
* rsh.exp (stop_rsh_daemon): Likewise.
Ken Raeburn [Thu, 26 Feb 2004 04:19:23 +0000 (04:19 +0000)]
* default.exp (passes): Add "mode=udp" to existing pass specifications. Add a
new pass which does AES and "mode=tcp".
(setup_kerberos_files, setup_krb5_conf): Check global var "mode" and use it to
force UDP or TCP communication between client and KDC. Also, have clients try
another random port where we don't expect anything to be listening.
Ken Raeburn [Thu, 26 Feb 2004 03:43:00 +0000 (03:43 +0000)]
* network.c (setup_a_tcp_listener): Call setreuseaddr before calling bind.
(setup_tcp_listener_ports): Don't call setreuseaddr. Log info about socket
option IPV6_V6ONLY in unsupported and success cases.
Sam Hartman [Tue, 24 Feb 2004 21:07:22 +0000 (21:07 +0000)]
Remove ENCTYPE_LOCAL_DES3_HMAC_SHA1
Previously, MIT had support for a version of the des3 enctype with a
32-bit length prepended to encrypted data. Remove that support. This
is non-standard and is no longer needed even at MIT.
Ken Raeburn [Tue, 17 Feb 2004 23:36:41 +0000 (23:36 +0000)]
* afsstring2key.c (krb5_afs_encrypt): Drop EDFLAG as an argument, make it local
instead, since we always pass 0.
(afs_crypt): Call changed.
(krb5_afs_crypt_setkey, krb5_afs_encrypt): Use memcpy.
Ken Raeburn [Sat, 14 Feb 2004 00:31:35 +0000 (00:31 +0000)]
* aclocal.m4 (TRY_PEER_INT): Deleted.
(KRB5_GETPEERNAME_ARGS): Map the getpeername arg types to the corresponding
getsockname arg types.
(KRB5_GETSOCKNAME_ARGS): If nothing matches, assume struct sockaddr and
socklen_t.
Ken Raeburn [Fri, 13 Feb 2004 23:40:08 +0000 (23:40 +0000)]
* t_encrypt.c (compare_results): New function.
(main): Use it to check decryption results against the original plaintext. When
testing with cipher state, encrypt and then decrypt (and verify) two messages.
* Makefile.in (t_encrypt$(EXEEXT)): Depend on CRYPTO_DEPLIB.
Ken Raeburn [Fri, 13 Feb 2004 23:38:57 +0000 (23:38 +0000)]
* dk_decrypt.c (krb5_dk_decrypt_maybe_trunc_hmac): New argument IVEC_MODE. If
clear, same old behavior. If set, copy out next to last block for CTS.
(krb5_dk_decrypt, krb5int_aes_dk_decrypt): Pass extra argument.
* dk_encrypt.c (krb5int_aes_dk_encrypt): For IV, copy out next to last block for
CTS.
Tom Yu [Fri, 13 Feb 2004 03:19:30 +0000 (03:19 +0000)]
priocntl workaround for Solaris 9 pty-close bug
Implement gross hack to use priocntl to work around the Solaris 9
pty-close bug. Run expect at a higher class "FX" priority than
spawned processes, which run at a lower class "FX" priority. "make
check" needs to start from a process which has FX priority >= 30 and
FX priority limit >= 30. Thanks to Bill Sommerfeld for the hints.
Tom Yu [Thu, 12 Feb 2004 18:28:01 +0000 (18:28 +0000)]
Tru64 and Irix have RPATH issues for test suite
Implement hack for faking up _RLD_ROOT with a shadow of the directory
tree up to the installed "lib" directory. This helps with running
tests on Tru64 and Irix.
Ken Raeburn [Tue, 10 Feb 2004 04:35:14 +0000 (04:35 +0000)]
* ser_sctx.c (kg_oid_externalize): Check for errors.
(kg_oid_internalize): Check for errors. Free allocated storage on error.
(kg_queue_externalize): Check for errorrs.
(kg_queue_internalize): Check for errors. Free allocated storage on error.
(kg_ctx_size): Update for new context data.
(kg_ctx_externalize): Update for new context data. Check for error storing
trailer.
(kg_ctx_internalize): Update for new context data. Check for errors in a few
more cases.