auth3: Introduce auth3_context_set_challenge
authorVolker Lendecke <vl@samba.org>
Mon, 13 Mar 2017 07:08:44 +0000 (08:08 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 24 Mar 2017 10:57:08 +0000 (11:57 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=2976

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/auth/auth.c
source3/auth/proto.h

index fddb6b906f3687878a652af877054cd62d28162a..e40c4a63d405174d4e36af87e1e3616ca8448455 100644 (file)
@@ -547,4 +547,16 @@ NTSTATUS make_auth_context_fixed(TALLOC_CTX *mem_ctx,
        return nt_status;
 }
 
-
+bool auth3_context_set_challenge(struct auth_context *ctx, uint8_t chal[8],
+                                const char *challenge_set_by)
+{
+       ctx->challenge = data_blob_talloc(ctx, chal, 8);
+       if (ctx->challenge.data == NULL) {
+               return false;
+       }
+       ctx->challenge_set_by = talloc_strdup(ctx, challenge_set_by);
+       if (ctx->challenge_set_by == NULL) {
+               return false;
+       }
+       return true;
+}
index 5fd315846d87e83748b6154756e7be49c55a70ce..83ea2a57f4d8a52ab3227bbb1ed3904b011b6061 100644 (file)
@@ -43,6 +43,8 @@ NTSTATUS make_auth_context_subsystem(TALLOC_CTX *mem_ctx,
 NTSTATUS make_auth_context_fixed(TALLOC_CTX *mem_ctx,
                                 struct auth_context **auth_context,
                                 uchar chal[8]) ;
+bool auth3_context_set_challenge(struct auth_context *ctx, uint8_t chal[8],
+                                const char *challenge_set_by);
 
 /****************************************************************************
  Try to get a challenge out of the various authentication modules.