* kerberos_v4.c: Remove include of krb4-proto.h
+Tue Feb 18 18:51:09 1997 Richard Basch <basch@lehman.com>
+
+ * do_as_req.c do_tgs_req.c kdc_preauth.c kdc_util.c main.c
+ replay.c kerberos_v4.c:
+ Replace krb5_xfree with appropriate free routine.
+
Thu Feb 6 00:09:46 1997 Richard Basch <basch@lehman.com>
* Makefile.in: Remove logger.c target before copying over it.
encrypting_key.enctype = ENCTYPE_DES_CBC_MD5;
errcode = krb5_encrypt_tkt_part(kdc_context, &encrypting_key, &ticket_reply);
- memset((char *)encrypting_key.contents, 0, encrypting_key.length);
- krb5_xfree(encrypting_key.contents);
+ krb5_free_keyblock_contents(kdc_context, &encrypting_key);
encrypting_key.contents = 0;
if (errcode) {
status = "ENCRYPTING_TICKET";
errcode = krb5_encode_kdc_rep(kdc_context, KRB5_AS_REP, &reply_encpart,
&encrypting_key, &reply, response);
- memset((char *)encrypting_key.contents, 0, encrypting_key.length);
- krb5_xfree(encrypting_key.contents);
+ krb5_free_keyblock_contents(kdc_context, &encrypting_key);
encrypting_key.contents = 0;
if (errcode) {
errcode = prepare_error_as(request, errcode, &e_data, response);
}
- if (encrypting_key.contents) {
- memset((char *)encrypting_key.contents, 0, encrypting_key.length);
- krb5_xfree(encrypting_key.contents);
- }
+
+ krb5_free_keyblock_contents(kdc_context, &encrypting_key);
+
if (cname)
free(cname);
if (sname)
ticket_reply.enc_part.kvno = server_key->key_data_kvno;
errcode = krb5_encrypt_tkt_part(kdc_context, &encrypting_key,
&ticket_reply);
- memset((char *)encrypting_key.contents, 0, encrypting_key.length);
- krb5_xfree(encrypting_key.contents);
+ krb5_free_keyblock_contents(kdc_context, &encrypting_key);
if (errcode) {
status = "TKT_ENCRYPT";
goto cleanup;
key.enctype = enc_data->enctype;
retval = krb5_decrypt_data(context, &key, 0, enc_data, &enc_ts_data);
- memset((char *)key.contents, 0, key.length);
- krb5_xfree(key.contents);
-
+ krb5_free_keyblock_contents(context, &key);
if (retval == 0)
break;
}
cleanup:
if (enc_data) {
- if (enc_data->ciphertext.data)
- krb5_xfree(enc_data->ciphertext.data);
+ krb5_free_data_contents(context, &enc_data->ciphertext);
free(enc_data);
}
- if (enc_ts_data.data)
- krb5_xfree(enc_ts_data.data);
+ krb5_free_data_contents(context, &enc_ts_data)
if (pa_enc)
- krb5_xfree(pa_enc);
+ free(pa_enc);
return retval;
}
if (entry)
krb5_free_etype_info(context, entry);
if (salt.data)
- krb5_xfree(salt.data);
+ free(salt.data);
return retval;
}
}
cleanup:
- memset((char *)encrypting_key.contents, 0, encrypting_key.length);
- krb5_xfree(encrypting_key.contents);
+ krb5_free_keyblock_contents(context, &encrypting_key);
return retval;
}
setflag(enc_tkt_reply->flags, TKT_FLG_HW_AUTH);
cleanup:
if (retval) com_err("krb5kdc", retval, "sam verify failure");
- if (sr) krb5_xfree(sr);
- if (psr) krb5_xfree(psr);
- if (esre) krb5_xfree(esre);
+ if (sr) free(sr);
+ if (psr) free(psr);
+ if (esre) free(esre);
return retval;
}
*retdata[i] = **ptr;
if (!(retdata[i]->contents =
(krb5_octet *)malloc(retdata[i]->length))) {
- krb5_xfree(retdata[i]);
+ free((char *)retdata[i]);
retdata[i] = 0;
krb5_free_authdata(kdc_context, retdata);
return ENOMEM;
memcpy(out4, out5.contents, out5.length);
retval = 0;
}
- memset(out5.contents, 0, out5.length);
- krb5_xfree(out5.contents);
+ krb5_free_keyblock_contents(kdc_context, &out5);
return(retval);
}
}
}
}
- krb5_xfree(hostlist);
+ free(hostlist);
}
}
/*
hold = eptr;
last->next = eptr->next;
eptr = last;
- krb5_xfree(hold);
+ free(hold);
} else {
/* this isn't it, just move along */
last = eptr;
eptr->timein = timenow;
eptr->db_age = db_age;
if (krb5_copy_data(kdc_context, inpkt, &eptr->req_packet)) {
- krb5_xfree(eptr);
+ free(eptr);
return;
}
if (krb5_copy_data(kdc_context, outpkt, &eptr->reply_packet)) {
krb5_free_data(kdc_context, eptr->req_packet);
- krb5_xfree(eptr);
+ free(eptr);
return;
}
eptr->next = root_ptr.next;