struct request_state {
krb5_kdcpreauth_verify_respond_fn respond;
void *arg;
+ krb5_enc_tkt_part *enc_tkt_reply;
};
static krb5_error_code
if (retval == 0 && response != otp_response_success)
retval = KRB5_PREAUTH_FAILED;
+ if (retval == 0)
+ rs.enc_tkt_reply->flags |= TKT_FLG_PRE_AUTH;
+
rs.respond(rs.arg, retval, NULL, NULL, NULL);
}
krb5_data d, plaintext;
char *config;
- enc_tkt_reply->flags |= TKT_FLG_PRE_AUTH;
-
/* Get the FAST armor key. */
armor_key = cb->fast_armor(context, rock);
if (armor_key == NULL) {
goto error;
}
- /* Create the request state. */
+ /* Create the request state. Save the response callback, and the
+ * enc_tkt_reply pointer so we can set the TKT_FLG_PRE_AUTH flag later. */
rs = k5alloc(sizeof(struct request_state), &retval);
if (rs == NULL)
goto error;
rs->arg = arg;
rs->respond = respond;
+ rs->enc_tkt_reply = enc_tkt_reply;
/* Get the principal's OTP configuration string. */
retval = cb->get_string(context, rock, "otp", &config);
pkiDebug("pkinit_verify_padata: entered!\n");
if (data == NULL || data->length <= 0 || data->contents == NULL) {
- (*respond)(arg, 0, NULL, NULL, NULL);
+ (*respond)(arg, EINVAL, NULL, NULL, NULL);
return;
}
plgctx = pkinit_find_realm_context(context, moddata, request->server);
if (plgctx == NULL) {
- (*respond)(arg, 0, NULL, NULL, NULL);
+ (*respond)(arg, EINVAL, NULL, NULL, NULL);
return;
}