+Fri Jun 9 06:49:36 1995 Ezra Peisach <epeisach@kangaroo.mit.edu>
+
+ * 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 <epeisach@kangaroo.mit.edu>
* kadm_stream.c: Based on presence of stdlib.h, include or declare
/* 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);
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 */
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;
}
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;
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 */
#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();
/* 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) {
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;
#include <mit-copyright.h>
#include <string.h>
+#include "k5-int.h"
#ifdef HAS_STDLIB_H
#include <stdlib.h>
}
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);
}
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)