[krbdev.mit.edu #3735] Add TCP change/set password support

Tom Yu via RT rt-comment at krbdev.mit.edu
Thu Nov 30 18:50:55 EST 2006


From: raeburn at MIT.EDU
Subject: svn rev #18518: trunk/src/ include/ lib/krb4/ lib/krb5/krb/
lib/krb5/os/
To: cvs-krb5 at mit.edu
Date: Wed, 23 Aug 2006 18:56:29 -0400 (EDT)
Reply-To: krbdev at MIT.EDU

Commit By: raeburn
Log Message: 
Merge Todd's TCP changepw support, with a few fixups.

* include/cm.h (state_strings, enum conn_states, struct
incoming_krb5_message,
struct conn_state): Moved here from lib/krb5/os/sendto_kdc.c.
(stuct sendto_callback_info): New type.
* lib/krb5/os/sendto_kdc.c (set_conn_state_msg_length): New function.
(setup_connection): Deleted argument message_len_buf.  Don't store message
length; call set_conn_state_msg_length instead.
(start_connection): New arguments callback_info and callback_buffer.  Invoke
callback function if any, and set message length on success.
(maybe_send): New arguments callback_info and callback_buffer; pass them to
start_connection.
(krb5int_sendto): New arguments callback_info, remoteaddr,
remoteaddrlen.  If
callback info is provided, allocate per-connection buffers, and pass them to
maybe_send.  On cleanup, invoke the cleanup callback function if any.
(krb5_sendto_kdc): Update krb5int_sendto call.
* include/k5-int.h (struct sendto_callback_info): Add forward declaration.
(krb5int_sendto, struct _krb5int_access.sendto_udp): Update for new
signature.
* lib/krb5/os/send524 (krb5int_524_sendto_kdc): Update krb5int_sendto call.
* lib/krb4/send_to_kdc.c (krb5int_send_to_kdc_addr): Update sendto_udp call.

* lib/krb5/os/changepw.c (struct sendto_callback_context): New type.
(krb5_locate_kpasswd): New argument useTcp, used to select socket type in
krb5int_locate_server call.
(kpasswd_sendto_msg_cleanup, kpasswd_sendto_msg_callback): New functions.
(krb5_change_set_password): Call krb5int_sendto with callbacks, instead of
managing the exchange here.  On RESPONSE_TOO_BIG error, try again with TCP
only.

* lib/krb5/krb/chpw.c (krb5int_rd_chpw_rep): If length is wrong, check if a
buggy server sent a KRB_ERROR.



Changed Files:
U   trunk/src/include/cm.h
U   trunk/src/include/k5-int.h
U   trunk/src/lib/krb4/send_to_kdc.c
U   trunk/src/lib/krb5/krb/chpw.c
U   trunk/src/lib/krb5/os/changepw.c
U   trunk/src/lib/krb5/os/send524.c
U   trunk/src/lib/krb5/os/sendto_kdc.c



More information about the krb5-bugs mailing list