krb5_error_code retval;
krb5_key key;
krb5_replay_data replaydata;
+ krb5_data buf = empty_data();
+
+ *outbuf = empty_data();
/* Clear replaydata block */
memset(&replaydata, 0, sizeof(krb5_replay_data));
if ((retval = mk_priv_basic(context, userdata, key, &replaydata,
plocal_fulladdr, premote_fulladdr,
- auth_context->i_vector, outbuf))) {
+ auth_context->i_vector, &buf))) {
CLEANUP_DONE();
goto error;
}
krb5_donot_replay replay;
if ((retval = krb5_gen_replay_name(context, auth_context->local_addr,
- "_priv", &replay.client))) {
- free(outbuf);
+ "_priv", &replay.client)))
goto error;
- }
replay.server = ""; /* XXX */
replay.msghash = NULL;
free(replay.client);
}
+ *outbuf = buf;
return 0;
error:
+ krb5_free_data_contents(context, &buf);
if ((auth_context->auth_context_flags & KRB5_AUTH_CONTEXT_DO_SEQUENCE) ||
(auth_context->auth_context_flags & KRB5_AUTH_CONTEXT_RET_SEQUENCE))
auth_context->local_seq_number--;
krb5_error_code retval;
krb5_key key;
krb5_replay_data replaydata;
+ krb5_data buf = empty_data();
+
+ *outbuf = empty_data();
/* Clear replaydata block */
memset(&replaydata, 0, sizeof(krb5_replay_data));
sumtype = safe_cksumtype(context, auth_context, key->keyblock.enctype);
if ((retval = krb5_mk_safe_basic(context, userdata, key, &replaydata,
plocal_fulladdr, premote_fulladdr,
- sumtype, outbuf))) {
+ sumtype, &buf))) {
CLEANUP_DONE();
goto error;
}
krb5_donot_replay replay;
if ((retval = krb5_gen_replay_name(context, auth_context->local_addr,
- "_safe", &replay.client))) {
- free(outbuf);
+ "_safe", &replay.client)))
goto error;
- }
replay.server = ""; /* XXX */
replay.msghash = NULL;
replay.cusec = replaydata.usec;
replay.ctime = replaydata.timestamp;
- if ((retval = krb5_rc_store(context, auth_context->rcache, &replay))) {
- /* should we really error out here? XXX */
- free(outbuf);
+ /* should we really error out here? XXX */
+ if ((retval = krb5_rc_store(context, auth_context->rcache, &replay)))
goto error;
- }
free(replay.client);
}
+ *outbuf = buf;
return 0;
error:
+ krb5_free_data_contents(context, &buf);
if ((auth_context->auth_context_flags & KRB5_AUTH_CONTEXT_DO_SEQUENCE) ||
(auth_context->auth_context_flags & KRB5_AUTH_CONTEXT_RET_SEQUENCE))
auth_context->local_seq_number--;