From: Volker Lendecke Date: Wed, 21 Apr 2021 10:29:16 +0000 (+0200) Subject: auth3: Use auth3_context_set_challenge() in auth3_set_challenge() X-Git-Tag: tevent-0.11.0~1024 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b150982d90bf2c1d4dcf08384b1d35614d162e65;p=thirdparty%2Fsamba.git auth3: Use auth3_context_set_challenge() in auth3_set_challenge() Don't duplicate what's already there. Signed-off-by: Volker Lendecke Reviewed-by: Andreas Schneider --- diff --git a/source3/auth/auth_ntlmssp.c b/source3/auth/auth_ntlmssp.c index 8d213f194cf..ba7b88ac93e 100644 --- a/source3/auth/auth_ntlmssp.c +++ b/source3/auth/auth_ntlmssp.c @@ -111,13 +111,15 @@ NTSTATUS auth3_set_challenge(struct auth4_context *auth4_context, const uint8_t { 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"));