+Tue Feb 18 18:03:55 1997 Richard Basch <basch@lehman.com>
+
+ * krcp.c: Replace krb5_xfree with krb5_free_data_contents
+ * kcmd.c krlogind.c krshd.c: Use free instead of internal krb5_xfree
+
Sat Dec 28 21:06:43 1996 Sam Hartman <hartmans@luminous.MIT.EDU>
* login.c: Force environment variables like HOME to be set even if
status = krb5_sendauth(bsd_context, &auth_context, (krb5_pointer) &s,
"KCMDV0.1", ret_cred->client, ret_cred->server,
authopts, &cksumdat, ret_cred, 0, &error, &rep_ret, NULL);
- krb5_xfree(cksumdat.data);
+ free(cksumbuf);
if (status) {
printf("Couldn't authenticate to server: %s\n", error_message(status));
if (error) {
&creds.server)) )
exit(1);
- krb5_xfree(pname_data.data);
+ krb5_free_data_contents(bsd_context, &pname_data);
+
if ((status = krb5_get_credentials(bsd_context, KRB5_GC_USER_USER, cc,
&creds, &new_creds)))
exit(1);
if ((status = krb5_write_message(bsd_context, (krb5_pointer) &rem,
&msg))) {
- krb5_xfree(msg.data);
+ krb5_free_data_contents(bsd_context, &msg);
exit(1);
}
/* cleanup */
krb5_free_cred_contents(bsd_context, &creds);
krb5_free_creds(bsd_context, new_creds);
- krb5_xfree(msg.data);
+ krb5_free_data_contents(bsd_context, &msg);
/* OK process key */
krb5_use_enctype(bsd_context, &eblock, session_key->enctype);
ticket->enc_part2->session->length);
error_cleanup:
if (chksumbuf)
- krb5_xfree(chksumbuf);
+ free(chksumbuf);
if (status) {
krb5_free_authenticator(bsd_context, authenticator);
return status;
error_cleanup:
if (chksumbuf)
- krb5_xfree(chksumbuf);
+ free(chksumbuf);
if (status) {
krb5_free_authenticator(bsd_context, authenticator);
return status;
+Tue Feb 18 18:11:03 1997 Richard Basch <basch@lehman.com>
+
+ * sim_client.c: Replace krb5_xfree with krb5_free_data_contents
+
Tue Feb 4 20:38:44 1997 Tom Yu <tlyu@mit.edu>
* Makefile.in:
if ((i = send(sock, (char *)packet.data, packet.length, flags)) < 0)
com_err(progname, errno, "while sending KRB_AP_REQ message");
printf("Sent authentication data: %d bytes\n", i);
- krb5_xfree(packet.data);
+ krb5_free_data_contents(context, &packet);
/* PREPARE KRB_SAFE MESSAGE */
if ((i = send(sock, (char *)packet.data, packet.length, flags)) < 0)
com_err(progname, errno, "while sending SAFE message");
printf("Sent checksummed message: %d bytes\n", i);
- krb5_xfree(packet.data);
+ krb5_free_data_contents(context, &packet);
/* PREPARE KRB_PRIV MESSAGE */
if ((i = send(sock, (char *)packet.data, packet.length, flags)) < 0)
com_err(progname, errno, "while sending PRIV message");
printf("Sent encrypted message: %d bytes\n", i);
- krb5_xfree(packet.data);
+ krb5_free_data_contents(context, &packet);
krb5_auth_con_free(context, auth_context);
krb5_free_context(context);
+Tue Feb 18 18:12:16 1997 Richard Basch <basch@lehman.com>
+
+ * sim_server.c: Use krb5_free_data_contents instead of krb5_xfree
+
Tue Feb 4 20:41:49 1997 Tom Yu <tlyu@mit.edu>
* Makefile.in:
}
printf("Safe message is: '%.*s'\n", message.length, message.data);
- krb5_xfree(message.data);
+ krb5_free_data_contents(context, &message);
/* NOW GET ENCRYPTED MESSAGE */
+Tue Feb 18 17:43:55 1997 Richard Basch <basch@lehman.com>
+
+ * krb5.hin:
+ Added prototypes for krb5_free_data, krb5_free_data_contents
+ Moved krb5_xfree definition to k5-int.h
+ * k5-int.h:
+ krb5_xfree is an internal macro
+
Mon Feb 17 13:58:45 1997 Richard Basch <basch@lehman.com>
* win-mac.h: Added KRB4 Windows INI related definitions.
int krb5_setenv KRB5_PROTOTYPE((const char *, const char *, int));
void krb5_unsetenv KRB5_PROTOTYPE((const char *));
+
+/* to keep lint happy */
+#define krb5_xfree(val) free((char FAR *)(val))
+
#endif /* _KRB5_INT_H */
/* krb5_free.c */
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_principal
- KRB5_PROTOTYPE((krb5_context,
- krb5_principal ));
+ KRB5_PROTOTYPE((krb5_context, krb5_principal ));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_authenticator
- KRB5_PROTOTYPE((krb5_context,
- krb5_authenticator FAR * ));
+ KRB5_PROTOTYPE((krb5_context, krb5_authenticator FAR * ));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_authenticator_contents
- KRB5_PROTOTYPE((krb5_context,
- krb5_authenticator FAR * ));
+ KRB5_PROTOTYPE((krb5_context, krb5_authenticator FAR * ));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_addresses
- KRB5_PROTOTYPE((krb5_context,
- krb5_address FAR * FAR * ));
+ KRB5_PROTOTYPE((krb5_context, krb5_address FAR * FAR * ));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_address
- KRB5_PROTOTYPE((krb5_context,
- krb5_address FAR * ));
+ KRB5_PROTOTYPE((krb5_context, krb5_address FAR * ));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_authdata
- KRB5_PROTOTYPE((krb5_context,
- krb5_authdata FAR * FAR * ));
+ KRB5_PROTOTYPE((krb5_context, krb5_authdata FAR * FAR * ));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_enc_tkt_part
- KRB5_PROTOTYPE((krb5_context,
- krb5_enc_tkt_part FAR * ));
+ KRB5_PROTOTYPE((krb5_context, krb5_enc_tkt_part FAR * ));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_ticket
- KRB5_PROTOTYPE((krb5_context,
- krb5_ticket FAR * ));
+ KRB5_PROTOTYPE((krb5_context, krb5_ticket FAR * ));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_tickets
- KRB5_PROTOTYPE((krb5_context,
- krb5_ticket FAR * FAR * ));
+ KRB5_PROTOTYPE((krb5_context, krb5_ticket FAR * FAR * ));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_kdc_req
- KRB5_PROTOTYPE((krb5_context,
- krb5_kdc_req FAR * ));
+ KRB5_PROTOTYPE((krb5_context, krb5_kdc_req FAR * ));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_kdc_rep
- KRB5_PROTOTYPE((krb5_context,
- krb5_kdc_rep FAR * ));
+ KRB5_PROTOTYPE((krb5_context, krb5_kdc_rep FAR * ));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_last_req
- KRB5_PROTOTYPE((krb5_context,
- krb5_last_req_entry FAR * FAR * ));
+ KRB5_PROTOTYPE((krb5_context, krb5_last_req_entry FAR * FAR * ));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_enc_kdc_rep_part
- KRB5_PROTOTYPE((krb5_context,
- krb5_enc_kdc_rep_part FAR * ));
+ KRB5_PROTOTYPE((krb5_context, krb5_enc_kdc_rep_part FAR * ));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_error
- KRB5_PROTOTYPE((krb5_context,
- krb5_error FAR * ));
+ KRB5_PROTOTYPE((krb5_context, krb5_error FAR * ));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_ap_req
- KRB5_PROTOTYPE((krb5_context,
- krb5_ap_req FAR * ));
+ KRB5_PROTOTYPE((krb5_context, krb5_ap_req FAR * ));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_ap_rep
- KRB5_PROTOTYPE((krb5_context,
- krb5_ap_rep FAR * ));
+ KRB5_PROTOTYPE((krb5_context, krb5_ap_rep FAR * ));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_safe
- KRB5_PROTOTYPE((krb5_context,
- krb5_safe FAR * ));
+ KRB5_PROTOTYPE((krb5_context, krb5_safe FAR * ));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_priv
- KRB5_PROTOTYPE((krb5_context,
- krb5_priv FAR * ));
+ KRB5_PROTOTYPE((krb5_context, krb5_priv FAR * ));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_priv_enc_part
- KRB5_PROTOTYPE((krb5_context,
- krb5_priv_enc_part FAR * ));
+ KRB5_PROTOTYPE((krb5_context, krb5_priv_enc_part FAR * ));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_cred
- KRB5_PROTOTYPE((krb5_context,
- krb5_cred FAR *));
+ KRB5_PROTOTYPE((krb5_context, krb5_cred FAR *));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_creds
- KRB5_PROTOTYPE((krb5_context,
- krb5_creds FAR *));
+ KRB5_PROTOTYPE((krb5_context, krb5_creds FAR *));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_cred_contents
- KRB5_PROTOTYPE((krb5_context,
- krb5_creds FAR *));
+ KRB5_PROTOTYPE((krb5_context, krb5_creds FAR *));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_cred_enc_part
- KRB5_PROTOTYPE((krb5_context,
- krb5_cred_enc_part FAR *));
+ KRB5_PROTOTYPE((krb5_context, krb5_cred_enc_part FAR *));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_checksum
- KRB5_PROTOTYPE((krb5_context,
- krb5_checksum FAR *));
+ KRB5_PROTOTYPE((krb5_context, krb5_checksum FAR *));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_keyblock
- KRB5_PROTOTYPE((krb5_context,
- krb5_keyblock FAR *));
+ KRB5_PROTOTYPE((krb5_context, krb5_keyblock FAR *));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_keyblock_contents
- KRB5_PROTOTYPE((krb5_context,
- krb5_keyblock FAR *));
+ KRB5_PROTOTYPE((krb5_context, krb5_keyblock FAR *));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_pa_data
- KRB5_PROTOTYPE((krb5_context,
- krb5_pa_data FAR * FAR *));
+ KRB5_PROTOTYPE((krb5_context, krb5_pa_data FAR * FAR *));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_ap_rep_enc_part
- KRB5_PROTOTYPE((krb5_context,
- krb5_ap_rep_enc_part FAR *));
+ KRB5_PROTOTYPE((krb5_context, krb5_ap_rep_enc_part FAR *));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_tkt_authent
- KRB5_PROTOTYPE((krb5_context,
- krb5_tkt_authent FAR *));
+ KRB5_PROTOTYPE((krb5_context, krb5_tkt_authent FAR *));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_pwd_data
- KRB5_PROTOTYPE((krb5_context,
- krb5_pwd_data FAR *));
+ KRB5_PROTOTYPE((krb5_context, krb5_pwd_data FAR *));
KRB5_DLLIMP void KRB5_CALLCONV krb5_free_pwd_sequences
- KRB5_PROTOTYPE((krb5_context,
- passwd_phrase_element FAR * FAR *));
+ KRB5_PROTOTYPE((krb5_context, passwd_phrase_element FAR * FAR *));
+KRB5_DLLIMP void KRB5_CALLCONV krb5_free_data
+ KRB5_PROTOTYPE((krb5_context, krb5_data FAR *));
+KRB5_DLLIMP void KRB5_CALLCONV krb5_free_data_contents
+ KRB5_PROTOTYPE((krb5_context, krb5_data FAR *));
/* From krb5/os but needed but by the outside world */
KRB5_DLLIMP krb5_error_code KRB5_CALLCONV krb5_us_timeofday
KRB5_PROTOTYPE((krb5_deltat, char FAR *, size_t));
-/*
- * end stuff from libos.h
- */
-
-/*
- * begin "k5-free.h"
- */
-
-/* to keep lint happy */
-#define krb5_xfree(val) free((char FAR *)(val))
-
-#define krb5_free_data(context, val) { krb5_xfree((val)->data); krb5_xfree(val);}
-
-/*
- * end "k5-free.h"
- */
/* The name of the Kerberos ticket granting service... and its size */
#define KRB5_TGS_NAME "krbtgt"
+Tue Feb 18 17:42:52 1997 Richard Basch <basch@lehman.com>
+
+ * Makefile.in f_data.c:
+ f_data.c now implements the functions
+ krb5_free_data, krb5_free_data_contents
+
Thu Nov 21 11:55:16 EST 1996 Richard Basch <basch@lehman.com>
* Makefile.in: win32 build
f_authent.o \
f_auth_cnt.o \
f_chksum.o \
- f_creds.o \
+ f_cred.o \
f_cred_cnt.o \
+ f_cred_enc.o \
+ f_creds.o \
+ f_data.o \
f_enc_kdc.o \
f_enc_tkt.o \
f_einfo.o \
f_tgt_cred.o \
f_tkt_auth.o \
f_pwd_data.o \
- f_pwd_seq.o \
- f_cred.o \
- f_cred_enc.o
+ f_pwd_seq.o
OBJS= \
f_addr.$(OBJEXT) \
f_authent.$(OBJEXT) \
f_auth_cnt.$(OBJEXT) \
f_chksum.$(OBJEXT) \
- f_creds.$(OBJEXT) \
+ f_cred.$(OBJEXT) \
f_cred_cnt.$(OBJEXT) \
+ f_cred_enc.$(OBJEXT) \
+ f_creds.$(OBJEXT) \
+ f_data.$(OBJEXT) \
f_enc_kdc.$(OBJEXT) \
f_enc_tkt.$(OBJEXT) \
f_einfo.$(OBJEXT) \
f_tgt_cred.$(OBJEXT) \
f_tkt_auth.$(OBJEXT) \
f_pwd_data.$(OBJEXT) \
- f_pwd_seq.$(OBJEXT) \
- f_cred.$(OBJEXT) \
- f_cred_enc.$(OBJEXT)
+ f_pwd_seq.$(OBJEXT)
SRCS= \
$(srcdir)/f_addr.c \
$(srcdir)/f_authent.c \
$(srcdir)/f_auth_cnt.c \
$(srcdir)/f_chksum.c \
- $(srcdir)/f_creds.c \
+ $(srcdir)/f_cred.c \
$(srcdir)/f_cred_cnt.c \
+ $(srcdir)/f_cred_enc.c \
+ $(srcdir)/f_creds.c \
+ $(srcdir)/f_data.c \
$(srcdir)/f_enc_kdc.c \
$(srcdir)/f_enc_tkt.c \
$(srcdir)/f_einfo.c \
$(srcdir)/f_tgt_cred.c \
$(srcdir)/f_tkt_auth.c \
$(srcdir)/f_pwd_data.c \
- $(srcdir)/f_pwd_seq.c \
- $(srcdir)/f_cred.c \
- $(srcdir)/f_cred_enc.c
+ $(srcdir)/f_pwd_seq.c
all-windows:: $(OBJFILE)
--- /dev/null
+/*
+ * lib/krb5/free/f_data.c
+ *
+ * Copyright 1997 by the Massachusetts Institute of Technology.
+ *
+ * Export of this software from the United States of America may
+ * require a specific license from the United States Government.
+ * It is the responsibility of any person or organization contemplating
+ * export to obtain such a license before exporting.
+ *
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
+ * distribute this software and its documentation for any purpose and
+ * without fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation, and that
+ * the name of M.I.T. not be used in advertising or publicity pertaining
+ * to distribution of the software without specific, written prior
+ * permission. M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is" without express
+ * or implied warranty.
+ *
+ *
+ * krb5_free_address()
+ */
+
+#include "k5-int.h"
+
+KRB5_DLLIMP void KRB5_CALLCONV
+krb5_free_data(context, val)
+ krb5_context context;
+ krb5_data FAR * val;
+{
+ if (val->data)
+ krb5_xfree(val->data);
+ krb5_xfree(val);
+ return;
+}
+
+KRB5_DLLIMP void KRB5_CALLCONV
+krb5_free_data_contents(context, val)
+ krb5_context context;
+ krb5_data FAR * val;
+{
+ if (val->data)
+ krb5_xfree(val->data);
+ return;
+}
krb5_data *inbuf;
{
krb5_int32 len;
- int len2, ilen;
+ int len2, ilen;
char *buf = NULL;
int fd = *( (int *) fdp);
return((len2 < 0) ? errno : ECONNABORTED);
len = ntohl(len);
- if ((len & VALID_UINT_BITS) != len) /* Overflow size_t??? */
- return ENOMEM;
+ if ((len & VALID_UINT_BITS) != len) /* Overflow size_t??? */
+ return ENOMEM;
inbuf->length = ilen = (int) len;
if (ilen) {
+Tue Feb 18 18:18:44 1997 Richard Basch <basch@lehman.com>
+
+ * kprop.c kpropd.c: Use krb5_free_data_contents, where appropriate.
+
Fri Jan 31 19:22:37 1997 Tom Yu <tlyu@mit.edu>
* Makefile.in:
exit(1);
}
if (retval = krb5_write_message(context, (void *) &fd, &outbuf)) {
- krb5_xfree(outbuf.data);
+ krb5_free_data_contents(context, &outbuf);
com_err(progname, retval, "while sending database size");
exit(1);
}
- krb5_xfree(outbuf.data);
+ krb5_free_data_contents(context, &outbuf);
/*
* Initialize the initial vector.
*/
exit(1);
}
if (retval = krb5_write_message(context, (void *)&fd,&outbuf)) {
- krb5_xfree(outbuf.data);
+ krb5_free_data_contents(context, &outbuf);
com_err(progname, retval,
"while sending database block starting at %d",
sent_size);
exit(1);
}
- krb5_xfree(outbuf.data);
+ krb5_free_data_contents(context, &outbuf);
sent_size += n;
if (debug)
printf("%d bytes sent.\n", sent_size);
strcpy(error.text.data, text);
if (!krb5_mk_error(context, &error, &outbuf)) {
(void) krb5_write_message(context, (void *)&fd,&outbuf);
- krb5_xfree(outbuf.data);
+ krb5_free_data_contents(context, &outbuf);
}
free(error.text.data);
}
*/
if (retval = krb5_write_message(kpropd_context, (void *) &fd,
&confmsg)) {
- krb5_xfree(confmsg.data);
+ krb5_free_data_contents(context, &confmsg);
com_err(progname, retval,
"while sending # of received bytes");
exit(1);
}
- krb5_xfree(confmsg.data);
+ krb5_free_data_contents(context, &confmsg);
if (close(fd) < 0) {
com_err(progname, errno,
"while trying to close database file");
recv_error(context, &inbuf);
if (retval = krb5_rd_safe(context,auth_context,&inbuf,&outbuf,NULL)) {
send_error(context, fd, retval, "while decoding database size");
- krb5_xfree(inbuf.data);
+ krb5_free_data_contents(context, &inbuf);
com_err(progname, retval,
"while decoding database size from client");
exit(1);
}
memcpy((char *) &database_size, outbuf.data, sizeof(database_size));
- krb5_xfree(inbuf.data);
- krb5_xfree(outbuf.data);
+ krb5_free_data_contents(context, &inbuf);
+ krb5_free_data_contents(context, &outbuf);
database_size = ntohl(database_size);
/*
received_size);
com_err(progname, retval, buf);
send_error(context, fd, retval, buf);
- krb5_xfree(inbuf.data);
+ krb5_free_data_contents(context, &inbuf);
exit(1);
}
n = write(database_fd, outbuf.data, outbuf.length);
- krb5_xfree(inbuf.data);
- krb5_xfree(outbuf.data);
+ krb5_free_data_contents(context, &inbuf);
+ krb5_free_data_contents(context, &outbuf);
if (n < 0) {
sprintf(buf,
"while writing database block starting at offset %d",
strcpy(error.text.data, text);
if (!krb5_mk_error(context, &error, &outbuf)) {
(void) krb5_write_message(context, (void *)&fd,&outbuf);
- krb5_xfree(outbuf.data);
+ krb5_free_data_contents(context, &outbuf);
}
free(error.text.data);
}
+Tue Feb 18 18:20:14 1997 Richard Basch <basch@lehman.com>
+
+ * kdb5_mkdums.c (add_princ):
+ Replace krb5_xfree with krb5_free_data_contents
+
Sun Feb 9 01:35:19 1997 Tom Yu <tlyu@mit.edu>
* Makefile.in:
&key, &pwd, &salt)) {
com_err(progname,retval,"while converting password to key for '%s'",
princ_name);
- krb5_xfree(salt.data);
+ krb5_free_data_contents(context, &salt);
goto error;
}
- krb5_xfree(salt.data);
+ krb5_free_data_contents(context, &salt);
if (retval = krb5_dbe_create_key_data(context, &newentry)) {
com_err(progname, retval, "while creating key_data for '%s'",
+Tue Feb 18 18:21:16 1997 Richard Basch <basch@lehman.com>
+
+ * kdc5_hammer.c (verify_cs_pair):
+ Use krb5_free_data_contents instead of krb5_xfree
+
Sun Feb 9 01:45:03 1997 Tom Yu <tlyu@mit.edu>
* Makefile.in:
krb5_free_keyblock(context, keyblock);
cleanup_rdata:
- krb5_xfree(request_data.data);
-
+ krb5_free_data_contents(context, &request_data);
krb5_free_cred_contents(context, credsp);
return retval;