From 81dc0e00c060ca874501e151fff7cda34677adb2 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Fri, 9 Jun 1995 10:56:54 +0000 Subject: [PATCH] Ported to DEC Alpha OSF/1: kadm_stream.c (vts_long, stv_long): Change u_long to krb5_ui_4 kadm_server.c (kadm_ser_ckpw): Change u_long to krb5_ui_4 kadm_ser_wrap.c (errpkt, kadm_ser_in): Change u_long to krb5_ui_4 kadm_funcs.c (kadm_add_entry): Change u_long to krb5_ui_4 admin_server.c (process_client): Change u_long to krb5_ui_4 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5999 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kadmin.v4/server/ChangeLog | 12 +++++++++++ src/kadmin.v4/server/admin_server.c | 8 ++++---- src/kadmin.v4/server/kadm_funcs.c | 2 +- src/kadmin.v4/server/kadm_ser_wrap.c | 30 ++++++++++++++-------------- src/kadmin.v4/server/kadm_server.c | 2 +- src/kadmin.v4/server/kadm_stream.c | 23 +++++++++++---------- 6 files changed, 45 insertions(+), 32 deletions(-) diff --git a/src/kadmin.v4/server/ChangeLog b/src/kadmin.v4/server/ChangeLog index bed14b2f9..01bdc8886 100644 --- a/src/kadmin.v4/server/ChangeLog +++ b/src/kadmin.v4/server/ChangeLog @@ -1,3 +1,15 @@ +Fri Jun 9 06:49:36 1995 Ezra Peisach + + * kadm_stream.c (vts_long, stv_long): Change u_long to krb5_ui_4 + + * kadm_server.c (kadm_ser_ckpw): Change u_long to krb5_ui_4 + + * kadm_ser_wrap.c (errpkt, kadm_ser_in): Change u_long to krb5_ui_4 + + * kadm_funcs.c (kadm_add_entry): Change u_long to krb5_ui_4 + + * admin_server.c (process_client): Change u_long to krb5_ui_4 + Sat May 20 22:33:58 1995 Ezra Peisach * kadm_stream.c: Based on presence of stdlib.h, include or declare diff --git a/src/kadmin.v4/server/admin_server.c b/src/kadmin.v4/server/admin_server.c index fc365efb5..9fdcb1a57 100644 --- a/src/kadmin.v4/server/admin_server.c +++ b/src/kadmin.v4/server/admin_server.c @@ -360,15 +360,15 @@ struct sockaddr_in *who; /* ugh... clean this up later */ if (status == KRB5_KDB_DB_INUSE) { /* db locked */ - u_long retcode = KADM_DB_INUSE; + krb5_ui_4 retcode = KADM_DB_INUSE; char *pdat; - dat_len = KADM_VERSIZE + sizeof(u_long); + dat_len = KADM_VERSIZE + sizeof(krb5_ui_4); dat = (u_char *) malloc((unsigned)dat_len); pdat = (char *) dat; - retcode = htonl((u_long) KADM_DB_INUSE); + retcode = htonl((krb5_ui_4) KADM_DB_INUSE); (void) strncpy(pdat, KADM_ULOSE, KADM_VERSIZE); - memcpy(&pdat[KADM_VERSIZE], (char *)&retcode, sizeof(u_long)); + memcpy(&pdat[KADM_VERSIZE], (char *)&retcode, sizeof(krb5_ui_4)); goto out; } else if (!nentries) { syslog(LOG_ERR, "no service %s.%s", server_parm.sname, server_parm.sinst); diff --git a/src/kadmin.v4/server/kadm_funcs.c b/src/kadmin.v4/server/kadm_funcs.c index ac97b8a7a..e5efe2922 100644 --- a/src/kadmin.v4/server/kadm_funcs.c +++ b/src/kadmin.v4/server/kadm_funcs.c @@ -197,7 +197,7 @@ Kadm_vals *valsout; data_i.key_low = ntohl(data_i.key_low); data_i.key_high = ntohl(data_i.key_high); memcpy(newpw.contents, &data_i.key_low, 4); - memcpy((char *)(((long *) newpw.contents) + 1), &data_i.key_high, 4); + memcpy((char *)(((krb5_int32 *) newpw.contents) + 1), &data_i.key_high, 4); newpw.length = 8; newpw.keytype = KEYTYPE_DES; /* encrypt new key in master key */ diff --git a/src/kadmin.v4/server/kadm_ser_wrap.c b/src/kadmin.v4/server/kadm_ser_wrap.c index abe9ee1a6..46ebc386c 100644 --- a/src/kadmin.v4/server/kadm_ser_wrap.c +++ b/src/kadmin.v4/server/kadm_ser_wrap.c @@ -122,20 +122,20 @@ u_char **dat; int *dat_len; int code; { - u_long retcode; + krb5_ui_4 retcode; char *pdat; free((char *)*dat); /* free up req */ - *dat_len = KADM_VERSIZE + sizeof(u_long); + *dat_len = KADM_VERSIZE + sizeof(krb5_ui_4); *dat = (u_char *) malloc((unsigned)*dat_len); if (!(*dat)) { syslog(LOG_ERR, "malloc(%d) returned null while in errpkt!", *dat_len); abort(); } pdat = (char *) *dat; - retcode = htonl((u_long) code); + retcode = htonl((krb5_ui_4) code); (void) strncpy(pdat, KADM_ULOSE, KADM_VERSIZE); - memcpy(&pdat[KADM_VERSIZE], (char *)&retcode, sizeof(u_long)); + memcpy(&pdat[KADM_VERSIZE], (char *)&retcode, sizeof(krb5_ui_4)); return; } @@ -150,10 +150,10 @@ int *dat_len; u_char *in_st; /* pointer into the sent packet */ int in_len,retc; /* where in packet we are, for returns */ - u_long r_len; /* length of the actual packet */ + krb5_ui_4 r_len; /* length of the actual packet */ KTEXT_ST authent; /* the authenticator */ AUTH_DAT ad; /* who is this, klink */ - u_long ncksum; /* checksum of encrypted data */ + krb5_ui_4 ncksum; /* checksum of encrypted data */ des_key_schedule sess_sched; /* our schedule */ MSG_DAT msg_st; u_char *retdat, *tmpdat; @@ -168,7 +168,7 @@ int *dat_len; if ((retc = stv_long(*dat, &r_len, in_len, *dat_len)) < 0) return KADM_LENGTH_ERROR; in_len += retc; - authent.length = *dat_len - r_len - KADM_VERSIZE - sizeof(u_long); + authent.length = *dat_len - r_len - KADM_VERSIZE - sizeof(krb5_ui_4); memcpy((char *)authent.dat, (char *)(*dat) + in_len, authent.length); authent.mbz = 0; /* service key should be set before here */ @@ -185,7 +185,7 @@ int *dat_len; #ifdef NOENCRYPTION ncksum = 0; #else - ncksum = quad_cksum(in_st, (u_long *)0, (long) r_len, 0, ad.session); + ncksum = quad_cksum(in_st, (krb5_ui_4 *)0, (long) r_len, 0, ad.session); #endif if (ncksum!=ad.checksum) { /* yow, are we correct yet */ clr_cli_secrets(); @@ -241,28 +241,28 @@ int *dat_len; /* Now seal the response back into a priv msg */ free((char *)*dat); tmpdat = (u_char *) malloc((unsigned)(retlen + KADM_VERSIZE + - sizeof(u_long))); + sizeof(krb5_ui_4))); if (!tmpdat) { clr_cli_secrets(); syslog(LOG_ERR, "malloc(%d) returned null while in kadm_ser_in!", - retlen + KADM_VERSIZE + sizeof(u_long)); + retlen + KADM_VERSIZE + sizeof(krb5_ui_4)); errpkt(dat, dat_len, KADM_NOMEM); return KADM_NOMEM; } (void) strncpy((char *)tmpdat, KADM_VERSTR, KADM_VERSIZE); - retval = htonl((u_long)retval); - memcpy((char *)tmpdat + KADM_VERSIZE, (char *)&retval, sizeof(u_long)); + retval = htonl((krb5_ui_4)retval); + memcpy((char *)tmpdat + KADM_VERSIZE, (char *)&retval, sizeof(krb5_ui_4)); if (retlen) { - memcpy((char *)tmpdat + KADM_VERSIZE + sizeof(u_long), (char *)retdat, + memcpy((char *)tmpdat + KADM_VERSIZE + sizeof(krb5_ui_4), (char *)retdat, retlen); free((char *)retdat); } /* slop for mk_priv stuff */ *dat = (u_char *) malloc((unsigned) (retlen + KADM_VERSIZE + - sizeof(u_long) + 200)); + sizeof(krb5_ui_4) + 200)); if ((*dat_len = krb_mk_priv(tmpdat, *dat, (u_long) (retlen + KADM_VERSIZE + - sizeof(u_long)), + sizeof(krb5_ui_4)), sess_sched, ad.session, &server_parm.admin_addr, &server_parm.recv_addr)) < 0) { diff --git a/src/kadmin.v4/server/kadm_server.c b/src/kadmin.v4/server/kadm_server.c index 42b0ebfc1..fe326cf31 100644 --- a/src/kadmin.v4/server/kadm_server.c +++ b/src/kadmin.v4/server/kadm_server.c @@ -352,7 +352,7 @@ AUTH_DAT *ad; u_char **datout; int *outlen; { - unsigned long keylow, keyhigh; + krb5_ui_4 keylow, keyhigh; char pword[MAX_KPW_LEN]; int no_pword = 0; des_cblock newkey; diff --git a/src/kadmin.v4/server/kadm_stream.c b/src/kadmin.v4/server/kadm_stream.c index 8c5c9ff50..c73498d83 100644 --- a/src/kadmin.v4/server/kadm_stream.c +++ b/src/kadmin.v4/server/kadm_stream.c @@ -12,6 +12,7 @@ #include #include +#include "k5-int.h" #ifdef HAS_STDLIB_H #include @@ -111,16 +112,16 @@ int loc; /* offset into the stream for current data */ } vts_long(dat, st, loc) -u_long dat; /* the attributes field */ +krb5_ui_4 dat; /* the attributes field */ u_char **st; /* a base pointer to the stream */ int loc; /* offset into the stream for current data */ { - u_long temp; /* to hold the net order short */ + krb5_ui_4 temp; /* to hold the net order short */ temp = htonl(dat); /* convert to network order */ - *st = (u_char *) realloc ((char *)*st, (unsigned)(loc + sizeof(u_long))); - memcpy((char *)(*st + loc), (char *) &temp, sizeof(u_long)); - return sizeof(u_long); + *st = (u_char *) realloc ((char *)*st, (unsigned)(loc + sizeof(krb5_ui_4))); + memcpy((char *)(*st + loc), (char *) &temp, sizeof(krb5_ui_4)); + return sizeof(krb5_ui_4); } @@ -242,24 +243,24 @@ int maxlen; if (loc + sizeof(u_short) > maxlen) return(-1); - memcpy((char *) &temp, (char *)((u_long)st+(u_long)loc), sizeof(u_short)); + memcpy((char *) &temp, (char *) st+ loc, sizeof(u_short)); *dat = ntohs(temp); /* convert to network order */ return sizeof(u_short); } stv_long(st, dat, loc, maxlen) u_char *st; /* a base pointer to the stream */ -u_long *dat; /* the attributes field */ +krb5_ui_4 *dat; /* the attributes field */ int loc; /* offset into the stream for current data */ int maxlen; /* maximum length of st */ { - u_long temp; /* to hold the net order short */ + krb5_ui_4 temp; /* to hold the net order short */ - if (loc + sizeof(u_long) > maxlen) + if (loc + sizeof(krb5_ui_4) > maxlen) return(-1); - memcpy((char *) &temp, (char *)((u_long)st+(u_long)loc), sizeof(u_long)); + memcpy((char *) &temp, (char *) st + loc, sizeof(krb5_ui_4)); *dat = ntohl(temp); /* convert to network order */ - return sizeof(u_long); + return sizeof(krb5_ui_4); } stv_char(st, dat, loc, maxlen) -- 2.26.2