Clean up some open-parenthesis problems, and reindent
authorTom Yu <tlyu@mit.edu>
Mon, 16 Nov 2009 22:32:40 +0000 (22:32 +0000)
committerTom Yu <tlyu@mit.edu>
Mon, 16 Nov 2009 22:32:40 +0000 (22:32 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23246 dc483132-0cff-0310-8789-dd5450dbe970

src/include/pkinit_apple_utils.h
src/kdc/do_tgs_req.c
src/kdc/fast_util.c
src/kdc/kdc_authdata.c
src/kdc/kdc_preauth.c
src/kdc/kdc_util.h
src/kdc/main.c
src/lib/crypto/krb/keyhash_provider/keyhash_provider.h

index 11751095c6c07736127174f802a4a66640e621c4..421da207b4779ec5ceeaf16ccb8f5c14d49ed103 100644 (file)
@@ -114,11 +114,11 @@ krb5_error_code pkiCfDataToKrb5Data(
  */
 #define PKI_CSSM_TO_KRB_DATA(cd, kd)            \
     (kd)->data = (char *)(cd)->Data;            \
-        (kd)->length = (cd)->Length;
+    (kd)->length = (cd)->Length;
 
 #define PKI_KRB_TO_CSSM_DATA(kd, cd)            \
     (cd)->Data = (uint8 *)(kd)->data;           \
-        (cd)->Length = (kd)->length;
+    (cd)->Length = (kd)->length;
 
 /*
  * Compare to CSSM_DATAs. Return TRUE if they're the same else FALSE.
index dab1513d66806f40751ae05b551671cbc225a404..778a3e87c109d42597d837d5da813aec84aaed3a 100644 (file)
@@ -380,12 +380,12 @@ tgt_again:
         if (isflagset(request->kdc_options, KDC_OPT_CNAME_IN_ADDL_TKT)) {
             /* Do constrained delegation protocol and authorization checks */
             errcode = kdc_process_s4u2proxy_req(kdc_context,
-                                  request,
-                                  request->second_ticket[st_idx]->enc_part2,
-                                  &st_client,
-                                  header_ticket->enc_part2->client,
-                                  request->server,
-                                  &status);
+                                                request,
+                                                request->second_ticket[st_idx]->enc_part2,
+                                                &st_client,
+                                                header_ticket->enc_part2->client,
+                                                request->server,
+                                                &status);
             if (errcode)
                 goto cleanup;
 
@@ -648,7 +648,7 @@ tgt_again:
             /* try refreshing master key list */
             /* XXX it would nice if we had the mkvno here for optimization */
             if (krb5_db_fetch_mkey_list(kdc_context, master_princ,
-                                   &master_keyblock, 0, &tmp_mkey_list) == 0) {
+                                        &master_keyblock, 0, &tmp_mkey_list) == 0) {
                 krb5_dbe_free_key_list(kdc_context, master_keylist);
                 master_keylist = tmp_mkey_list;
                 if ((errcode = krb5_dbe_find_mkey(kdc_context, master_keylist,
@@ -816,9 +816,9 @@ tgt_again:
         char *tdots;
 
         errcode = kdc_check_transited_list (kdc_context,
-                        &enc_tkt_reply.transited.tr_contents,
-                        krb5_princ_realm (kdc_context, header_enc_tkt->client),
-                        krb5_princ_realm (kdc_context, request->server));
+                                            &enc_tkt_reply.transited.tr_contents,
+                                            krb5_princ_realm (kdc_context, header_enc_tkt->client),
+                                            krb5_princ_realm (kdc_context, request->server));
         tlen = enc_tkt_reply.transited.tr_contents.length;
         tdots = tlen > 125 ? "..." : "";
         tlen = tlen > 125 ? 125 : tlen;
@@ -943,13 +943,13 @@ tgt_again:
     reply.enc_part.enctype = subkey ? subkey->enctype :
         header_ticket->enc_part2->session->enctype;
     errcode  = kdc_fast_response_handle_padata(state, request, &reply,
-                  subkey ? subkey->enctype : header_ticket->enc_part2->session->enctype);
+                                               subkey ? subkey->enctype : header_ticket->enc_part2->session->enctype);
     if (errcode !=0 ) {
         status = "Preparing FAST padata";
         goto cleanup;
     }
     errcode =kdc_fast_handle_reply_key(state,
-                  subkey?subkey:header_ticket->enc_part2->session, &reply_key);
+                                       subkey?subkey:header_ticket->enc_part2->session, &reply_key);
     if (errcode) {
         status  = "generating reply key";
         goto cleanup;
@@ -1116,9 +1116,9 @@ find_alternate_tgs(krb5_kdc_req *request, krb5_db_entry *server,
      * the principal.
      */
     if ((retval = krb5_walk_realm_tree(kdc_context,
-                         krb5_princ_realm(kdc_context, request->server),
-                         krb5_princ_component(kdc_context, request->server, 1),
-                         &plist, KRB5_REALM_BRANCH_CHAR)))
+                                       krb5_princ_realm(kdc_context, request->server),
+                                       krb5_princ_component(kdc_context, request->server, 1),
+                                       &plist, KRB5_REALM_BRANCH_CHAR)))
         return;
 
     /* move to the end */
index 543db1d5569c4c062fdc588ed99e11bb5417720e..17b8447526279128e84897a01725ee06da812548 100644 (file)
@@ -68,7 +68,7 @@ static krb5_error_code armor_ap_request
                                               tgs_server,
                                               ticket->server)) {
             krb5_set_error_message(kdc_context, KRB5KDC_ERR_SERVER_NOMATCH,
-                   "ap-request armor for something other than  the local TGS");
+                                   "ap-request armor for something other than  the local TGS");
             retval = KRB5KDC_ERR_SERVER_NOMATCH;
         }
     }
@@ -165,7 +165,7 @@ kdc_find_fast(krb5_kdc_req **requestptr,
                                               &state->armor_key);
             else {
                 krb5_set_error_message(kdc_context, KRB5KDC_ERR_PREAUTH_FAILED,
-                              "No armor key but FAST armored request present");
+                                       "No armor key but FAST armored request present");
                 retval = KRB5KDC_ERR_PREAUTH_FAILED;
             }
         }
index aa55ef455d9b695160ecb873e0f816dac1669c87..175fbec1c6b46c984962576e0b2164b00a95d342 100644 (file)
@@ -47,58 +47,57 @@ static const char *objdirs[] = { LIBDIR "/krb5/plugins/authdata", NULL };
 #endif
 
 /* MIT Kerberos 1.6 (V0) authdata plugin callback */
-typedef krb5_error_code (*authdata_proc_0)
-    (krb5_context, krb5_db_entry *client,
-     krb5_data *req_pkt,
-     krb5_kdc_req *request,
-     krb5_enc_tkt_part * enc_tkt_reply);
+typedef krb5_error_code (*authdata_proc_0)(
+    krb5_context,
+    krb5_db_entry *client,
+    krb5_data *req_pkt,
+    krb5_kdc_req *request,
+    krb5_enc_tkt_part * enc_tkt_reply);
 /* MIT Kerberos 1.8 (V2) authdata plugin callback */
-typedef krb5_error_code (*authdata_proc_2)
-    (krb5_context, unsigned int flags,
-     krb5_db_entry *client, krb5_db_entry *server,
-     krb5_db_entry *krbtgt,
-     krb5_keyblock *client_key,
-     krb5_keyblock *server_key,
-     krb5_keyblock *krbtgt_key,
-     krb5_data *req_pkt,
-     krb5_kdc_req *request,
-     krb5_const_principal for_user_princ,
-     krb5_enc_tkt_part *enc_tkt_request,
-     krb5_enc_tkt_part *enc_tkt_reply);
-typedef krb5_error_code (*init_proc)
-    (krb5_context, void **);
-typedef void (*fini_proc)
-    (krb5_context, void *);
-
-static krb5_error_code handle_request_authdata
-    (krb5_context context,
-     unsigned int flags,
-     krb5_db_entry *client,
-     krb5_db_entry *server,
-     krb5_db_entry *krbtgt,
-     krb5_keyblock *client_key,
-     krb5_keyblock *server_key,
-     krb5_keyblock *krbtgt_key,
-     krb5_data *req_pkt,
-     krb5_kdc_req *request,
-     krb5_const_principal for_user_princ,
-     krb5_enc_tkt_part *enc_tkt_request,
-     krb5_enc_tkt_part *enc_tkt_reply);
-
-static krb5_error_code handle_tgt_authdata
-    (krb5_context context,
-     unsigned int flags,
-     krb5_db_entry *client,
-     krb5_db_entry *server,
-     krb5_db_entry *krbtgt,
-     krb5_keyblock *client_key,
-     krb5_keyblock *server_key,
-     krb5_keyblock *krbtgt_key,
-     krb5_data *req_pkt,
-     krb5_kdc_req *request,
-     krb5_const_principal for_user_princ,
-     krb5_enc_tkt_part *enc_tkt_request,
-     krb5_enc_tkt_part *enc_tkt_reply);
+typedef krb5_error_code (*authdata_proc_2)(
+    krb5_context, unsigned int flags,
+    krb5_db_entry *client, krb5_db_entry *server,
+    krb5_db_entry *krbtgt,
+    krb5_keyblock *client_key,
+    krb5_keyblock *server_key,
+    krb5_keyblock *krbtgt_key,
+    krb5_data *req_pkt,
+    krb5_kdc_req *request,
+    krb5_const_principal for_user_princ,
+    krb5_enc_tkt_part *enc_tkt_request,
+    krb5_enc_tkt_part *enc_tkt_reply);
+typedef krb5_error_code (*init_proc)(krb5_context, void **);
+typedef void (*fini_proc)(krb5_context, void *);
+
+static krb5_error_code handle_request_authdata(
+    krb5_context context,
+    unsigned int flags,
+    krb5_db_entry *client,
+    krb5_db_entry *server,
+    krb5_db_entry *krbtgt,
+    krb5_keyblock *client_key,
+    krb5_keyblock *server_key,
+    krb5_keyblock *krbtgt_key,
+    krb5_data *req_pkt,
+    krb5_kdc_req *request,
+    krb5_const_principal for_user_princ,
+    krb5_enc_tkt_part *enc_tkt_request,
+    krb5_enc_tkt_part *enc_tkt_reply);
+
+static krb5_error_code handle_tgt_authdata(
+    krb5_context context,
+    unsigned int flags,
+    krb5_db_entry *client,
+    krb5_db_entry *server,
+    krb5_db_entry *krbtgt,
+    krb5_keyblock *client_key,
+    krb5_keyblock *server_key,
+    krb5_keyblock *krbtgt_key,
+    krb5_data *req_pkt,
+    krb5_kdc_req *request,
+    krb5_const_principal for_user_princ,
+    krb5_enc_tkt_part *enc_tkt_request,
+    krb5_enc_tkt_part *enc_tkt_reply);
 
 static krb5_error_code
 handle_kdb_authdata(krb5_context context, unsigned int flags,
index f547f5351b86cc74cf980484b2aba08351cfa268..05b109b4eb07fccffbac64a362a3333441abf2a7 100644 (file)
@@ -500,14 +500,14 @@ load_preauth_plugins(krb5_context context)
                     if (server_init_proc != NULL) {
                         krb5_error_code initerr;
                         initerr = (*server_init_proc)(context, &plugin_context,
-                                               (const char **)kdc_realm_names);
+                                                      (const char **)kdc_realm_names);
                         if (initerr) {
                             const char *emsg;
                             emsg = krb5_get_error_message(context, initerr);
                             if (emsg) {
                                 krb5_klog_syslog(LOG_ERR,
-                                          "preauth %s failed to initialize: %s",
-                                          ftable->name, emsg);
+                                                 "preauth %s failed to initialize: %s",
+                                                 ftable->name, emsg);
                                 krb5_free_error_message(context, emsg);
                             }
                             memset(&preauth_systems[k], 0,
@@ -521,7 +521,7 @@ load_preauth_plugins(krb5_context context)
                 preauth_systems[k].type = ftable->pa_type_list[j];
                 if (ftable->flags_proc != NULL)
                     preauth_systems[k].flags = ftable->flags_proc(context,
-                                                     preauth_systems[k].type);
+                                                                  preauth_systems[k].type);
                 else
                     preauth_systems[k].flags = 0;
                 preauth_systems[k].plugin_context = plugin_context;
@@ -557,7 +557,7 @@ unload_preauth_plugins(krb5_context context)
         for (i = 0; i < n_preauth_systems; i++) {
             if (preauth_systems[i].fini != NULL) {
                 (*preauth_systems[i].fini)(context,
-                                      preauth_systems[i].plugin_context);
+                                           preauth_systems[i].plugin_context);
             }
             memset(&preauth_systems[i], 0, sizeof(preauth_systems[i]));
         }
@@ -952,12 +952,12 @@ const char *missing_required_preauth(krb5_db_entry *client,
 
 #ifdef DEBUG
     krb5_klog_syslog (
-      LOG_DEBUG,
-      "client needs %spreauth, %shw preauth; request has %spreauth, %shw preauth",
-      isflagset (client->attributes, KRB5_KDB_REQUIRES_PRE_AUTH) ? "" : "no ",
-      isflagset (client->attributes, KRB5_KDB_REQUIRES_HW_AUTH) ? "" : "no ",
-      isflagset (enc_tkt_reply->flags, TKT_FLG_PRE_AUTH) ? "" : "no ",
-      isflagset (enc_tkt_reply->flags, TKT_FLG_HW_AUTH) ? "" : "no ");
+        LOG_DEBUG,
+        "client needs %spreauth, %shw preauth; request has %spreauth, %shw preauth",
+        isflagset (client->attributes, KRB5_KDB_REQUIRES_PRE_AUTH) ? "" : "no ",
+        isflagset (client->attributes, KRB5_KDB_REQUIRES_HW_AUTH) ? "" : "no ",
+        isflagset (enc_tkt_reply->flags, TKT_FLG_PRE_AUTH) ? "" : "no ",
+        isflagset (enc_tkt_reply->flags, TKT_FLG_HW_AUTH) ? "" : "no ");
 #endif
 
     if (isflagset(client->attributes, KRB5_KDB_REQUIRES_PRE_AUTH) &&
@@ -1370,7 +1370,7 @@ cleanup:
 
 static krb5_boolean
 request_contains_enctype(krb5_context context,  const krb5_kdc_req *request,
-                          krb5_enctype enctype)
+                         krb5_enctype enctype)
 {
     int i;
     for (i =0; i < request->nktypes; i++)
@@ -2891,15 +2891,15 @@ static krb5_error_code return_pkinit_response(
      * We've already verified; just obtain the fields we need to create a response
      */
     krtn = krb5int_pkinit_as_req_parse(context,
-                         &pa_data,
-                         NULL, NULL, &nonce,     /* ctime, cusec, nonce */
-                         NULL, NULL,             /* pa_cksum, cert_status */
-                         &num_cms_types, &cms_types,
-                         &client_cert,   /* signer_cert: we encrypt for this */
-                         /* remaining fields unused (for now) */
-                         NULL, NULL,     /* num_all_certs, all_certs */
-                         &num_trusted_CAs, &trusted_CAs,
-                         &kdc_cert);
+                                       &pa_data,
+                                       NULL, NULL, &nonce,     /* ctime, cusec, nonce */
+                                       NULL, NULL,             /* pa_cksum, cert_status */
+                                       &num_cms_types, &cms_types,
+                                       &client_cert,   /* signer_cert: we encrypt for this */
+                                       /* remaining fields unused (for now) */
+                                       NULL, NULL,     /* num_all_certs, all_certs */
+                                       &num_trusted_CAs, &trusted_CAs,
+                                       &kdc_cert);
     if(krtn) {
         kdcPkinitDebug("pa_pk_as_req_parse returned %d; PKINIT aborting.\n",
                        (int)krtn);
@@ -2964,7 +2964,7 @@ static krb5_error_code return_pkinit_response(
                                         &pa_data);
     if(krtn) {
         kdcPkinitDebug("pa_pk_as_rep_create returned %d; PKINIT aborting.\n",
-                      (int)krtn);
+                       (int)krtn);
         goto cleanup;
     }
 
index cddbaf679202ca9231c75121df576ac2c52efc64..a2347208c8040012656afba21d89dd02ed90f184 100644 (file)
@@ -45,14 +45,14 @@ krb5_boolean is_local_principal(krb5_const_principal princ1);
 krb5_boolean krb5_is_tgs_principal (krb5_const_principal);
 krb5_error_code
 add_to_transited (krb5_data *,
-                                  krb5_data *,
-                                  krb5_principal,
-                                  krb5_principal,
-                                  krb5_principal);
+                  krb5_data *,
+                  krb5_principal,
+                  krb5_principal,
+                  krb5_principal);
 krb5_error_code
 compress_transited (krb5_data *,
-                                    krb5_principal,
-                                    krb5_data *);
+                    krb5_principal,
+                    krb5_data *);
 krb5_error_code
 concat_authorization_data (krb5_authdata **,
                            krb5_authdata **,
@@ -127,19 +127,19 @@ rep_etypes2str(char *s, size_t len, krb5_kdc_rep *rep);
 /* do_as_req.c */
 krb5_error_code
 process_as_req (krb5_kdc_req *, krb5_data *,
-                                const krb5_fulladdr *,
-                                krb5_data ** );
+                const krb5_fulladdr *,
+                krb5_data ** );
 
 /* do_tgs_req.c */
 krb5_error_code
 process_tgs_req (krb5_data *,
-                                 const krb5_fulladdr *,
-                                 krb5_data ** );
+                 const krb5_fulladdr *,
+                 krb5_data ** );
 /* dispatch.c */
 krb5_error_code
 dispatch (krb5_data *,
-                          const krb5_fulladdr *,
-                          krb5_data **);
+          const krb5_fulladdr *,
+          krb5_data **);
 
 /* main.c */
 krb5_error_code kdc_initialize_rcache (krb5_context, char *);
@@ -157,13 +157,13 @@ krb5_error_code closedown_network (void);
 /* policy.c */
 int
 against_local_policy_as (krb5_kdc_req *, krb5_db_entry,
-                             krb5_db_entry, krb5_timestamp,
-                             const char **, krb5_data *);
+                         krb5_db_entry, krb5_timestamp,
+                         const char **, krb5_data *);
 
 int
 against_local_policy_tgs (krb5_kdc_req *, krb5_db_entry,
-                              krb5_ticket *, const char **,
-                              krb5_data *);
+                          krb5_ticket *, const char **,
+                          krb5_data *);
 
 /* kdc_preauth.c */
 krb5_boolean
@@ -171,13 +171,13 @@ enctype_requires_etype_info_2(krb5_enctype enctype);
 
 const char *
 missing_required_preauth (krb5_db_entry *client,
-                                       krb5_db_entry *server,
-                                       krb5_enc_tkt_part *enc_tkt_reply);
+                          krb5_db_entry *server,
+                          krb5_enc_tkt_part *enc_tkt_reply);
 void
 get_preauth_hint_list (krb5_kdc_req * request,
-                            krb5_db_entry *client,
-                            krb5_db_entry *server,
-                            krb5_data *e_data);
+                       krb5_db_entry *client,
+                       krb5_db_entry *server,
+                       krb5_data *e_data);
 krb5_error_code
 load_preauth_plugins(krb5_context context);
 krb5_error_code
index a12a7738b524efcfad41b2f4b5c3b653971cb70d..925019c4beb0551a645ed9698463678fce7e35b4 100644 (file)
@@ -213,15 +213,15 @@ handle_referral_params(krb5_realm_params *rparams,
                 if (!rdp->realm_no_host_referral)
                     retval = ENOMEM;
             } else if  (no_refrls && (asprintf(&(rdp->realm_no_host_referral),
-                                    "%s%s%s%s%s", " ", no_refrls," ",
-                                    rparams->realm_no_host_referral, " ") < 0))
+                                               "%s%s%s%s%s", " ", no_refrls," ",
+                                               rparams->realm_no_host_referral, " ") < 0))
                 retval = ENOMEM;
             else if (asprintf(&(rdp->realm_no_host_referral),"%s%s%s", " ",
                               rparams->realm_no_host_referral, " ") < 0)
                 retval = ENOMEM;
         } else if( no_refrls != NULL) {
             if ( asprintf(&(rdp->realm_no_host_referral),
-                         "%s%s%s", " ", no_refrls, " ") < 0)
+                          "%s%s%s", " ", no_refrls, " ") < 0)
                 retval = ENOMEM;
         } else
             rdp->realm_no_host_referral = NULL;
@@ -235,7 +235,7 @@ handle_referral_params(krb5_realm_params *rparams,
     }
 
     if (host_based_srvcs &&
-       (krb5_match_config_pattern(host_based_srvcs, KRB5_CONF_ASTERISK) == TRUE)) {
+        (krb5_match_config_pattern(host_based_srvcs, KRB5_CONF_ASTERISK) == TRUE)) {
         rdp->realm_host_based_services = strdup(KRB5_CONF_ASTERISK);
         if (!rdp->realm_host_based_services)
             retval = ENOMEM;
@@ -661,7 +661,7 @@ initialize_realms(krb5_context kcontext, int argc, char **argv)
                                              default_tcp_ports, manual, db_args,
                                              no_refrls, host_based_srvcs))) {
                         fprintf(stderr,
-                               "%s: cannot initialize realm %s - see log file for details\n",
+                                "%s: cannot initialize realm %s - see log file for details\n",
                                 argv[0], optarg);
                         exit(1);
                     }
index 2506dc355764da961dbea15045a88def6df3f285..c16f0fc113ecb38657f2924c86e913a6f967678e 100644 (file)
@@ -31,4 +31,3 @@ extern const struct krb5_keyhash_provider krb5int_keyhash_md4des;
 extern const struct krb5_keyhash_provider krb5int_keyhash_md5des;
 extern const struct krb5_keyhash_provider krb5int_keyhash_hmac_md5;
 extern const struct krb5_keyhash_provider krb5int_keyhash_md5_hmac;
-