diff options
author | Volker Lendecke <vl@samba.org> | 2021-04-21 12:29:16 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2021-04-27 13:24:35 +0000 |
commit | b150982d90bf2c1d4dcf08384b1d35614d162e65 (patch) | |
tree | 577aa6309a6f8e0017a50b418bc8e05514fdce95 /source3 | |
parent | cdd9d423716f4f917a9f4589ac90ee1b21d11c02 (diff) | |
download | samba-b150982d90bf2c1d4dcf08384b1d35614d162e65.tar.gz |
auth3: Use auth3_context_set_challenge() in auth3_set_challenge()
Don't duplicate what's already there.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/auth/auth_ntlmssp.c | 14 |
1 files changed, 8 insertions, 6 deletions
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")); |