From 89a86294b43b532042ec76178d96b318d34c6755 Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Mon, 5 Aug 1996 18:14:03 +0000 Subject: [PATCH] * Better support for Athena Kerberos if installed * Linux shared lib fix git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@8903 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kdc/ChangeLog | 8 ++++++++ src/kdc/configure.in | 1 + src/kdc/kerberos_v4.c | 12 ++++++------ src/krb524/ChangeLog | 11 +++++++++++ src/krb524/conv_creds.c | 2 +- src/krb524/encode.c | 18 +++++++++--------- src/krb524/krb524.h | 18 +++++++++--------- src/krb524/sendmsg.c | 2 +- src/krb524/test.c | 4 ++-- 9 files changed, 48 insertions(+), 28 deletions(-) diff --git a/src/kdc/ChangeLog b/src/kdc/ChangeLog index d80977973..06d8106d8 100644 --- a/src/kdc/ChangeLog +++ b/src/kdc/ChangeLog @@ -3,6 +3,13 @@ Thu Aug 1 11:13:46 1996 Ezra Peisach * configure.in (withval): Link -ldyn as it is needed by the kadm5 shared library. +Wed Jul 24 02:29:19 1996 Sam Hartman + + * kerberos_v4.c (set_tgtkey): s/KRB4_#@/krb5_ui_4 so we work with + athena Kerberos. + + + Tue Jul 23 22:26:29 1996 Theodore Y. Ts'o * Makefile.in: Build logger.o from the libkadm5 directory. This @@ -14,6 +21,7 @@ Tue Jul 23 22:26:29 1996 Theodore Y. Ts'o krb5kdc since they are needed for shared libraries. This is a horrible hack.... + Thu Jun 13 22:09:34 1996 Tom Yu * configure.in: remove ref to ET_RULES diff --git a/src/kdc/configure.in b/src/kdc/configure.in index 760872b15..9acd405eb 100644 --- a/src/kdc/configure.in +++ b/src/kdc/configure.in @@ -41,6 +41,7 @@ dnl that you link in all other libraries that depend on it. dnl dnl XXX we need to rethink where things go. dnl +USE_DYN_LIBRARY USE_KADMSRV_LIBRARY USE_GSSRPC_LIBRARY USE_GSSAPI_LIBRARY diff --git a/src/kdc/kerberos_v4.c b/src/kdc/kerberos_v4.c index 2f37821e4..e77ea31d9 100644 --- a/src/kdc/kerberos_v4.c +++ b/src/kdc/kerberos_v4.c @@ -413,7 +413,7 @@ kerb_get_principal(name, inst, principal, maxn, more) if (! compat_decrypt_key( pkey, k)) { memcpy( &principal->key_low, k, LONGLEN); - memcpy( &principal->key_high, (KRB4_32 *) k + 1, LONGLEN); + memcpy( &principal->key_high, (krb5_ui_4 *) k + 1, LONGLEN); } /* convert v5's entries struct to v4's Principal struct: * v5's time-unit for lifetimes is 1 sec, while v4 uses 5 minutes. @@ -579,7 +579,7 @@ kerberos_v4(client, pkt) /* unseal server's key from master key */ memcpy( key, &s_name_data.key_low, 4); - memcpy( ((KRB4_32 *) key) + 1, &s_name_data.key_high, 4); + memcpy( ((krb5_ui_4 *) key) + 1, &s_name_data.key_high, 4); s_name_data.key_low = s_name_data.key_high = 0; kdb_encrypt_key(key, key, master_key, @@ -599,7 +599,7 @@ kerberos_v4(client, pkt) /* a_name_data.key_low a_name_data.key_high */ memcpy( key, &a_name_data.key_low, 4); - memcpy( ((KRB4_32 *) key) + 1, &a_name_data.key_high, 4); + memcpy( ((krb5_ui_4 *) key) + 1, &a_name_data.key_high, 4); a_name_data.key_low= a_name_data.key_high = 0; /* unseal the a_name key from the master key */ @@ -629,7 +629,7 @@ kerberos_v4(client, pkt) } case AUTH_MSG_APPL_REQUEST: { - KRB4_32 time_ws; /* Workstation time */ + krb5_ui_4 time_ws; /* Workstation time */ u_long req_life; /* Requested liftime */ char *service; /* Service name */ char *instance; /* Service instance */ @@ -704,7 +704,7 @@ kerberos_v4(client, pkt) /* unseal server's key from master key */ memcpy(key, &s_name_data.key_low, 4); - memcpy(((KRB4_32 *) key) + 1, &s_name_data.key_high, 4); + memcpy(((krb5_ui_4 *) key) + 1, &s_name_data.key_high, 4); s_name_data.key_low = s_name_data.key_high = 0; kdb_encrypt_key(key, key, master_key, master_key_schedule, DECRYPT); @@ -958,7 +958,7 @@ int set_tgtkey(r) /* unseal tgt key from master key */ memcpy(key, &p->key_low, 4); - memcpy(((KRB4_32 *) key) + 1, &p->key_high, 4); + memcpy(((krb5_ui_4 *) key) + 1, &p->key_high, 4); kdb_encrypt_key(key, key, master_key, master_key_schedule, DECRYPT); krb_set_key((char *) key, 0); diff --git a/src/krb524/ChangeLog b/src/krb524/ChangeLog index 9bb88a3b7..1b1121283 100644 --- a/src/krb524/ChangeLog +++ b/src/krb524/ChangeLog @@ -1,3 +1,14 @@ +Wed Jul 24 02:18:02 1996 Sam Hartman + + * test.c (krb4_print_ticket): s/KRB4_INT4/krb5_ui_4 so we work + with Athena Kerberos4. + +Wed Jul 24 01:14:27 1996 Sam Hartman + + * encode.c: s/PROTOTYPE/KRB5_PROTOTYPE + + * krb524.h (KRB5_PROTOTYPE): Use KRB5_PROTOTYPE not PROTOTYPE because the include file is installed and PROTOTYPE wasn't defined anyway. + Wed Jul 31 17:05:25 1996 Tom Yu * krb524d.c: Revert prior change due to shuffling of netdb.h diff --git a/src/krb524/conv_creds.c b/src/krb524/conv_creds.c index fe3d7d4cf..1e30fa5cd 100644 --- a/src/krb524/conv_creds.c +++ b/src/krb524/conv_creds.c @@ -31,7 +31,7 @@ #include "krb524.h" int krb524_convert_creds_plain - PROTOTYPE((krb5_context context, krb5_creds *v5creds, +KRB5_PROTOTYPE((krb5_context context, krb5_creds *v5creds, CREDENTIALS *v4creds)); diff --git a/src/krb524/encode.c b/src/krb524/encode.c index b1b6434d6..b45f361c0 100644 --- a/src/krb524/encode.c +++ b/src/krb524/encode.c @@ -38,15 +38,15 @@ * the wheel is hidden. */ -int encode_v4tkt PROTOTYPE((KTEXT_ST *, char *, int *)), - encode_ktext PROTOTYPE((char **, int *, KTEXT_ST *)), - encode_bytes PROTOTYPE((char **, int *, char *, int)), - encode_int32 PROTOTYPE((char **, int *, krb5_int32 *)); - -int decode_v4tkt PROTOTYPE((KTEXT_ST *, char *, int *)), - decode_ktext PROTOTYPE((char **, int *, KTEXT_ST *)), - decode_bytes PROTOTYPE((char **, int *, char *, int)), - decode_int32 PROTOTYPE((char **, int *, krb5_int32 *)); +int encode_v4tkt KRB5_PROTOTYPE((KTEXT_ST *, char *, int *)), + encode_ktext KRB5_PROTOTYPE((char **, int *, KTEXT_ST *)), + encode_bytes KRB5_PROTOTYPE((char **, int *, char *, int)), + encode_int32 KRB5_PROTOTYPE((char **, int *, krb5_int32 *)); + +int decode_v4tkt KRB5_PROTOTYPE((KTEXT_ST *, char *, int *)), + decode_ktext KRB5_PROTOTYPE((char **, int *, KTEXT_ST *)), + decode_bytes KRB5_PROTOTYPE((char **, int *, char *, int)), + decode_int32 KRB5_PROTOTYPE((char **, int *, krb5_int32 *)); int encode_bytes(out, outlen, in, len) char **out; diff --git a/src/krb524/krb524.h b/src/krb524/krb524.h index 7ed942c1a..87ff21d74 100644 --- a/src/krb524/krb524.h +++ b/src/krb524/krb524.h @@ -31,50 +31,50 @@ extern int krb524_debug; int krb524_convert_tkt_skey - PROTOTYPE((krb5_context context, krb5_ticket *v5tkt, KTEXT_ST *v4tkt, + KRB5_PROTOTYPE((krb5_context context, krb5_ticket *v5tkt, KTEXT_ST *v4tkt, krb5_keyblock *v5_skey, krb5_keyblock *v4_skey)); /* conv_princ.c */ int krb524_convert_princs - PROTOTYPE((krb5_context context, krb5_principal client, + KRB5_PROTOTYPE((krb5_context context, krb5_principal client, krb5_principal server, char *pname, char *pinst, char *prealm, char *sname, char *sinst)); /* conv_creds.c */ int krb524_convert_creds_addr - PROTOTYPE((krb5_context context, krb5_creds *v5creds, + KRB5_PROTOTYPE((krb5_context context, krb5_creds *v5creds, CREDENTIALS *v4creds, struct sockaddr *saddr)); int krb524_convert_creds_kdc - PROTOTYPE((krb5_context context, krb5_creds *v5creds, + KRB5_PROTOTYPE((krb5_context context, krb5_creds *v5creds, CREDENTIALS *v4creds)); /* conv_tkt.c */ int krb524_convert_tkt - PROTOTYPE((krb5_principal server, krb5_data *v5tkt, KTEXT_ST *v4tkt, + KRB5_PROTOTYPE((krb5_principal server, krb5_data *v5tkt, KTEXT_ST *v4tkt, int *kvno, struct sockaddr_in *saddr)); /* encode.c */ int encode_v4tkt - PROTOTYPE((KTEXT_ST *v4tkt, char *buf, int *encoded_len)); + KRB5_PROTOTYPE((KTEXT_ST *v4tkt, char *buf, int *encoded_len)); int decode_v4tkt - PROTOTYPE((KTEXT_ST *v4tkt, char *buf, int *encoded_len)); + KRB5_PROTOTYPE((KTEXT_ST *v4tkt, char *buf, int *encoded_len)); /* misc.c */ void krb524_init_ets - PROTOTYPE((krb5_context context)); + KRB5_PROTOTYPE((krb5_context context)); /* sendmsg.c */ int krb524_send_message - PROTOTYPE((const struct sockaddr * addr, const krb5_data * message, + KRB5_PROTOTYPE((const struct sockaddr * addr, const krb5_data * message, krb5_data * reply)); #endif /* __KRB524_H__ */ diff --git a/src/krb524/sendmsg.c b/src/krb524/sendmsg.c index 76ce53440..4c7c8b748 100644 --- a/src/krb524/sendmsg.c +++ b/src/krb524/sendmsg.c @@ -56,7 +56,7 @@ extern int krb5_skdc_timeout_shift; extern int krb5_skdc_timeout_1; int krb524_send_message - PROTOTYPE((const struct sockaddr * addr, const krb5_data * message, + KRB5_PROTOTYPE((const struct sockaddr * addr, const krb5_data * message, krb5_data * reply)); diff --git a/src/krb524/test.c b/src/krb524/test.c index 50bd957dd..98e330ac7 100644 --- a/src/krb524/test.c +++ b/src/krb524/test.c @@ -148,8 +148,8 @@ void krb4_print_ticket(ticket, secret_key) char pname[ANAME_SZ], pinst[INST_SZ], prealm[REALM_SZ]; char sname[ANAME_SZ], sinst[INST_SZ]; unsigned char flags; - unsigned KRB4_32 addr; - unsigned KRB4_32 issue_time; + krb5_ui_4 addr; + krb5_ui_4 issue_time; C_Block session_key; int life; Key_schedule keysched; -- 2.26.2