diff options
author | Ken Raeburn <raeburn@mit.edu> | 2002-07-22 20:45:59 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@mit.edu> | 2002-07-22 20:45:59 +0000 |
commit | bc6249cf813a59127d0a691cbb81962eea9d69e5 (patch) | |
tree | d9d0b6e42b07af454079e4554df2900ef5893757 /src/krb524 | |
parent | 33814e962a0af9fcdfc0c120d593684302324f30 (diff) | |
download | krb5-bc6249cf813a59127d0a691cbb81962eea9d69e5.zip krb5-bc6249cf813a59127d0a691cbb81962eea9d69e5.tar.gz krb5-bc6249cf813a59127d0a691cbb81962eea9d69e5.tar.bz2 |
reimplement macosx v4-local-addr changes; untested
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14665 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/krb524')
-rw-r--r-- | src/krb524/ChangeLog | 18 | ||||
-rw-r--r-- | src/krb524/conv_creds.c | 14 | ||||
-rw-r--r-- | src/krb524/krb524.h | 4 | ||||
-rw-r--r-- | src/krb524/sendmsg.c | 7 |
4 files changed, 39 insertions, 4 deletions
diff --git a/src/krb524/ChangeLog b/src/krb524/ChangeLog index 92141f0..3bb5c35 100644 --- a/src/krb524/ChangeLog +++ b/src/krb524/ChangeLog @@ -1,3 +1,21 @@ +2002-07-22 Ken Raeburn <raeburn@mit.edu> + + * sendmsg.c (krb524_sendto_kdc): Accept new arguments for local + address; pass them through to sendto_udp. + * krb524.h: Include port-sockets.h. + (krb524_sendto_kdc): Update declaration. + * conv_creds.c: Include socket-utils.h. + (krb524_convert_creds_kdc): Get local-address info from + krb524_sendto_kdc. On Mac, store the IPv4 address in the v4 + credentials. + +2002-07-19 Ken Raeburn <raeburn@mit.edu> + + * sendmsg.c (krb524_sendto_kdc): Accept new args for local address + return, pass them through to sendto_udp. + * conv_creds.c: Include socket-utils.h. + (krb524_convert_creds_kdc): + 2002-07-12 Ken Raeburn <raeburn@mit.edu> * conv_creds.c: Include port-sockets.h instead of winsock.h or diff --git a/src/krb524/conv_creds.c b/src/krb524/conv_creds.c index b4ebc1c..5e52040 100644 --- a/src/krb524/conv_creds.c +++ b/src/krb524/conv_creds.c @@ -25,6 +25,7 @@ #include <string.h> #include <sys/types.h> #include "port-sockets.h" +#include "socket-utils.h" #if TARGET_OS_MAC #include <Kerberos/krb.h> #include <Kerberos/krb524.h> @@ -46,6 +47,8 @@ krb524_convert_creds_kdc(context, v5creds, v4creds) krb5_error_code ret; krb5_data reply; char *p; + struct sockaddr_storage ss; + socklen_t slen = sizeof(ss); ret = krb524_convert_creds_plain(context, v5creds, v4creds); if (ret) @@ -53,10 +56,19 @@ krb524_convert_creds_kdc(context, v5creds, v4creds) reply.data = NULL; ret = krb524_sendto_kdc(context, &v5creds->ticket, - &v5creds->server->realm, &reply); + &v5creds->server->realm, &reply, + ss2sa(&ss), &slen); if (ret) return ret; +#ifdef TARGET_OS_MAC + if (slen == sizeof(struct sockaddr_in) + && ss2sa(&ss)->sa_family == AF_INET) { + v4creds->address = ss2sin(&ss)->sin_addr.s_addr; + } + /* Otherwise, leave it set to all-zero. */ +#endif + p = reply.data; ret = ntohl(*((krb5_error_code *) p)); p += sizeof(krb5_int32); diff --git a/src/krb524/krb524.h b/src/krb524/krb524.h index cd46ae8..0a7e23f 100644 --- a/src/krb524/krb524.h +++ b/src/krb524/krb524.h @@ -110,9 +110,11 @@ void krb524_init_ets /* sendmsg.c */ +#include "port-sockets.h" /* for socklen_t */ int krb524_sendto_kdc (krb5_context context, const krb5_data * message, - const krb5_data * realm, krb5_data * reply); + const krb5_data * realm, krb5_data * reply, + struct sockaddr *, socklen_t *); #endif /* KRB524_PRIVATE */ #if TARGET_OS_MAC diff --git a/src/krb524/sendmsg.c b/src/krb524/sendmsg.c index 879676b..733da0b 100644 --- a/src/krb524/sendmsg.c +++ b/src/krb524/sendmsg.c @@ -63,11 +63,13 @@ */ krb5_error_code -krb524_sendto_kdc (context, message, realm, reply) +krb524_sendto_kdc (context, message, realm, reply, addr, addrlen) krb5_context context; const krb5_data * message; const krb5_data * realm; krb5_data * reply; + struct sockaddr *addr; + socklen_t *addrlen; { int i; struct addrlist al = ADDRLIST_INIT; @@ -108,7 +110,8 @@ krb524_sendto_kdc (context, message, realm, reply) if (al.naddrs == 0) return KRB5_REALM_UNKNOWN; - retval = internals.sendto_udp (context, message, &al, reply, 0, 0); + retval = internals.sendto_udp (context, message, &al, reply, addr, + addrlen); internals.free_addrlist (&al); return retval; } |