]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:gse: Pass down the gensec_security pointer
authorAndreas Schneider <asn@samba.org>
Mon, 6 Mar 2017 07:16:11 +0000 (08:16 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 10 Mar 2017 10:37:22 +0000 (11:37 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12554

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/librpc/crypto/gse.c

index cc62849b7b27c7f84f012c4ef571eef3823bb82e..8fee44424c7bf36afa15fa36eeb1e04bd5bd3539 100644 (file)
@@ -353,10 +353,13 @@ err_out:
 }
 
 static NTSTATUS gse_get_client_auth_token(TALLOC_CTX *mem_ctx,
-                                         struct gse_context *gse_ctx,
+                                         struct gensec_security *gensec_security,
                                          const DATA_BLOB *token_in,
                                          DATA_BLOB *token_out)
 {
+       struct gse_context *gse_ctx =
+               talloc_get_type_abort(gensec_security->private_data,
+                                     struct gse_context);
        OM_uint32 gss_maj, gss_min;
        gss_buffer_desc in_data;
        gss_buffer_desc out_data;
@@ -497,10 +500,13 @@ done:
 }
 
 static NTSTATUS gse_get_server_auth_token(TALLOC_CTX *mem_ctx,
-                                         struct gse_context *gse_ctx,
+                                         struct gensec_security *gensec_security,
                                          const DATA_BLOB *token_in,
                                          DATA_BLOB *token_out)
 {
+       struct gse_context *gse_ctx =
+               talloc_get_type_abort(gensec_security->private_data,
+                                     struct gse_context);
        OM_uint32 gss_maj, gss_min;
        gss_buffer_desc in_data;
        gss_buffer_desc out_data;
@@ -717,17 +723,16 @@ static NTSTATUS gensec_gse_update(struct gensec_security *gensec_security,
                                  const DATA_BLOB in, DATA_BLOB *out)
 {
        NTSTATUS status;
-       struct gse_context *gse_ctx =
-               talloc_get_type_abort(gensec_security->private_data,
-               struct gse_context);
 
        switch (gensec_security->gensec_role) {
        case GENSEC_CLIENT:
-               status = gse_get_client_auth_token(mem_ctx, gse_ctx,
+               status = gse_get_client_auth_token(mem_ctx,
+                                                  gensec_security,
                                                   &in, out);
                break;
        case GENSEC_SERVER:
-               status = gse_get_server_auth_token(mem_ctx, gse_ctx,
+               status = gse_get_server_auth_token(mem_ctx,
+                                                  gensec_security,
                                                   &in, out);
                break;
        }