auth/spnego: remove one more useless indentation level in gensec_spnego_create_negTok...
authorStefan Metzmacher <metze@samba.org>
Thu, 13 Jul 2017 13:49:32 +0000 (15:49 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 25 Jul 2017 11:51:10 +0000 (13:51 +0200)
Check with git show -w -U20

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
auth/gensec/spnego.c

index 6645913..5d71ae1 100644 (file)
@@ -230,6 +230,10 @@ static NTSTATUS gensec_spnego_create_negTokenInit(struct gensec_security *gensec
                                              mechTypes,
                                              GENSEC_OID_SPNEGO);
        for (i=0; all_sec && all_sec[i].op; i++) {
+               const char *next = NULL;
+               const char *principal = NULL;
+               int dbg_level = DBGLVL_WARNING;
+
                nt_status = gensec_subcontext_start(spnego_state,
                                                    gensec_security,
                                                    &spnego_state->sub_sec_security);
@@ -261,44 +265,38 @@ static NTSTATUS gensec_spnego_create_negTokenInit(struct gensec_security *gensec
                        spnego_state->sub_sec_ready = true;
                }
 
-               if (GENSEC_UPDATE_IS_NTERROR(nt_status)) {
-                       const char *next = NULL;
-                       const char *principal = NULL;
-                       int dbg_level = DBGLVL_WARNING;
-
-                       if (all_sec[i+1].op != NULL) {
-                               next = all_sec[i+1].op->name;
-                               dbg_level = DBGLVL_NOTICE;
-                       }
-
-                       if (gensec_security->target.principal != NULL) {
-                               principal = gensec_security->target.principal;
-                       } else if (gensec_security->target.service != NULL &&
-                                  gensec_security->target.hostname != NULL)
-                       {
-                               principal = talloc_asprintf(spnego_state->sub_sec_security,
-                                                           "%s/%s",
-                                                           gensec_security->target.service,
-                                                           gensec_security->target.hostname);
-                       } else {
-                               principal = gensec_security->target.hostname;
-                       }
+               if (!GENSEC_UPDATE_IS_NTERROR(nt_status)) {
+                       goto reply;
+               }
 
-                       DEBUG(dbg_level, ("SPNEGO(%s) creating NEG_TOKEN_INIT for %s failed (next[%s]): %s\n",
-                                 spnego_state->sub_sec_security->ops->name,
-                                 principal,
-                                 next, nt_errstr(nt_status)));
+               if (all_sec[i+1].op != NULL) {
+                       next = all_sec[i+1].op->name;
+                       dbg_level = DBGLVL_NOTICE;
+               }
 
-                       /*
-                        * Pretend we never started it
-                        */
-                       gensec_spnego_update_sub_abort(spnego_state);
-                       continue;
+               if (gensec_security->target.principal != NULL) {
+                       principal = gensec_security->target.principal;
+               } else if (gensec_security->target.service != NULL &&
+                          gensec_security->target.hostname != NULL)
+               {
+                       principal = talloc_asprintf(spnego_state->sub_sec_security,
+                                                   "%s/%s",
+                                                   gensec_security->target.service,
+                                                   gensec_security->target.hostname);
+               } else {
+                       principal = gensec_security->target.hostname;
                }
 
-               goto reply;
+               DEBUG(dbg_level, ("SPNEGO(%s) creating NEG_TOKEN_INIT for %s failed (next[%s]): %s\n",
+                         spnego_state->sub_sec_security->ops->name,
+                         principal,
+                         next, nt_errstr(nt_status)));
+
+               /*
+                * Pretend we never started it
+                */
+               gensec_spnego_update_sub_abort(spnego_state);
        }
-       gensec_spnego_update_sub_abort(spnego_state);
 
        DEBUG(10, ("Failed to setup SPNEGO negTokenInit request: %s\n", nt_errstr(nt_status)));
        return nt_status;