{
struct auth_context *auth_context = talloc_get_type_abort(auth4_context->private_data,
struct auth_context);
+ bool ok;
- auth_context->challenge = data_blob_talloc(auth_context,
- chal, 8);
- NT_STATUS_HAVE_NO_MEMORY(auth_context->challenge.data);
-
- auth_context->challenge_set_by = talloc_strdup(auth_context, challenge_set_by);
- NT_STATUS_HAVE_NO_MEMORY(auth_context->challenge_set_by);
+ ok = auth3_context_set_challenge(auth_context, chal, challenge_set_by);
+ if (!ok) {
+ /*
+ * This can only fail for ENOMEM
+ */
+ return NT_STATUS_NO_MEMORY;
+ }
DEBUG(5, ("auth_context challenge set by %s\n", auth_context->challenge_set_by));
DEBUG(5, ("challenge is: \n"));