]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
auth3: Use auth3_context_set_challenge() in auth3_set_challenge()
authorVolker Lendecke <vl@samba.org>
Wed, 21 Apr 2021 10:29:16 +0000 (12:29 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 27 Apr 2021 13:24:35 +0000 (13:24 +0000)
Don't duplicate what's already there.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/auth/auth_ntlmssp.c

index 8d213f194cf7eb8b03bdf3e66d00a295ffea43e9..ba7b88ac93e7acbe109a2d556812827aee1d1e94 100644 (file)
@@ -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"));