diff options
author | Tom Yu <tlyu@mit.edu> | 2009-10-31 00:48:38 +0000 |
---|---|---|
committer | Tom Yu <tlyu@mit.edu> | 2009-10-31 00:48:38 +0000 |
commit | 02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b (patch) | |
tree | 61b9147863cd8be3eff63903dc36cae168254bd5 /src/windows/identity/plugins/krb4 | |
parent | 162ab371748cba0cc6f172419bd6e71fa04bb878 (diff) | |
download | krb5-02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b.tar.gz krb5-02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b.tar.xz krb5-02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b.zip |
make mark-cstyle
make reindent
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23100 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/windows/identity/plugins/krb4')
-rw-r--r-- | src/windows/identity/plugins/krb4/errorfuncs.c | 11 | ||||
-rw-r--r-- | src/windows/identity/plugins/krb4/errorfuncs.h | 2 | ||||
-rw-r--r-- | src/windows/identity/plugins/krb4/krb4configdlg.c | 14 | ||||
-rw-r--r-- | src/windows/identity/plugins/krb4/krb4funcs.c | 76 | ||||
-rw-r--r-- | src/windows/identity/plugins/krb4/krb4funcs.h | 6 | ||||
-rw-r--r-- | src/windows/identity/plugins/krb4/krb4newcreds.c | 4 | ||||
-rw-r--r-- | src/windows/identity/plugins/krb4/krb4plugin.c | 32 | ||||
-rw-r--r-- | src/windows/identity/plugins/krb4/krbcred.h | 4 | ||||
-rw-r--r-- | src/windows/identity/plugins/krb4/langres.h | 2 |
9 files changed, 75 insertions, 76 deletions
diff --git a/src/windows/identity/plugins/krb4/errorfuncs.c b/src/windows/identity/plugins/krb4/errorfuncs.c index f436a40a7e..3441316e54 100644 --- a/src/windows/identity/plugins/krb4/errorfuncs.c +++ b/src/windows/identity/plugins/krb4/errorfuncs.c @@ -156,7 +156,7 @@ LPSTR err_describe(LPSTR buf, size_t len, long code) case GT_PW_NULLTKT: /* 55 Null tkt returned by KDC */ /* no error msg yet */ break; - + /* Values returned by send_to_kdc */ case SKDC_RETRY : /* 56 Retry count exceeded */ case SKDC_CANT : /* 57 Can't send request */ @@ -187,9 +187,9 @@ LPSTR err_describe(LPSTR buf, size_t len, long code) * message box is too small for VGA screens. * It does work well if we only have to support 1024x768 */ - + com_err_msg = "You have entered an insecure or weak password."; - + default: /* no extra error msg */ break; @@ -216,11 +216,10 @@ LPSTR err_describe(LPSTR buf, size_t len, long code) #endif ")", etype, offset //")\nPress F1 for help on this error.", etype, offset -#ifdef DEBUG_COM_ERR +#ifdef DEBUG_COM_ERR , code #endif ); - + return (LPSTR)buf; } - diff --git a/src/windows/identity/plugins/krb4/errorfuncs.h b/src/windows/identity/plugins/krb4/errorfuncs.h index d760c62595..0d4d75f1e7 100644 --- a/src/windows/identity/plugins/krb4/errorfuncs.h +++ b/src/windows/identity/plugins/krb4/errorfuncs.h @@ -35,7 +35,7 @@ /* * This is a hack needed because the real com_err.h does * not define err_func. We need it in the case where - * we pull in the real com_err instead of the krb4 + * we pull in the real com_err instead of the krb4 * impostor. */ #ifndef _DCNS_MIT_COM_ERR_H diff --git a/src/windows/identity/plugins/krb4/krb4configdlg.c b/src/windows/identity/plugins/krb4/krb4configdlg.c index c2ab3f5622..f13f9ad9e4 100644 --- a/src/windows/identity/plugins/krb4/krb4configdlg.c +++ b/src/windows/identity/plugins/krb4/krb4configdlg.c @@ -259,7 +259,7 @@ k4_id_write_params(HWND hwnd, k4_id_data * d) { if (csp_ident) khc_close_space(csp_ident); - + if (csp_idk4) khc_close_space(csp_idk4); @@ -409,7 +409,7 @@ krb4_confg_proc(HWND hwnd, in_init = TRUE; - // Set KRB.CON + // Set KRB.CON memset(krb_path, '\0', sizeof(krb_path)); if (!pkrb_get_krbconf2(krb_path, &krb_path_sz)) { // Error has happened @@ -419,9 +419,9 @@ krb4_confg_proc(HWND hwnd, StringCbCopyA(d->krb_path, sizeof(d->krb_path), krb_path); } - // Set KRBREALM.CON + // Set KRBREALM.CON memset(krbrealm_path, '\0', sizeof(krbrealm_path)); - if (!pkrb_get_krbrealm2(krbrealm_path, &krbrealm_path_sz)) { + if (!pkrb_get_krbrealm2(krbrealm_path, &krbrealm_path_sz)) { // Error has happened } else { AnsiStrToUnicode(wbuf, sizeof(wbuf), krbrealm_path); @@ -442,13 +442,13 @@ krb4_confg_proc(HWND hwnd, // Set TICKET.KRB file Editbox *ticketName = 0; pkrb_set_tkt_string(0); - - pticketName = ptkt_string(); + + pticketName = ptkt_string(); if (pticketName) StringCbCopyA(ticketName, sizeof(ticketName), pticketName); } - + if (!*ticketName) { // error } else { diff --git a/src/windows/identity/plugins/krb4/krb4funcs.c b/src/windows/identity/plugins/krb4/krb4funcs.c index e5287ca9f9..33a94996e1 100644 --- a/src/windows/identity/plugins/krb4/krb4funcs.c +++ b/src/windows/identity/plugins/krb4/krb4funcs.c @@ -44,7 +44,7 @@ int com_addr(void) { long ipAddr; char loc_addr[ADDR_SZ]; - CREDENTIALS cred; + CREDENTIALS cred; char service[40]; char instance[40]; // char addr[40]; @@ -71,11 +71,11 @@ int com_addr(void) break; } // while() return 0; -} +} -long -khm_krb4_list_tickets(void) +long +khm_krb4_list_tickets(void) { char ptktname[MAX_PATH + 5]; char pname[ANAME_SZ]; @@ -103,15 +103,15 @@ khm_krb4_list_tickets(void) goto collect; com_addr(); - + // Open ticket file if ((k_errno = (*ptf_init)((*ptkt_string)(), R_TKT_FIL))) { goto cleanup; } - // Close ticket file + // Close ticket file (void) (*ptf_close)(); - + // We must find the realm of the ticket file here before calling // tf_init because since the realm of the ticket file is not // really stored in the principal section of the file, the @@ -121,9 +121,9 @@ khm_krb4_list_tickets(void) { goto cleanup; } - - // Open ticket file - if (k_errno = (*ptf_init)((*ptkt_string)(), R_TKT_FIL)) + + // Open ticket file + if (k_errno = (*ptf_init)((*ptkt_string)(), R_TKT_FIL)) { goto cleanup; } @@ -132,12 +132,12 @@ khm_krb4_list_tickets(void) open = 1; - // Get principal name and instance - if ((k_errno = (*ptf_get_pname)(pname)) || (k_errno = (*ptf_get_pinst)(pinst))) + // Get principal name and instance + if ((k_errno = (*ptf_get_pname)(pname)) || (k_errno = (*ptf_get_pinst)(pinst))) { goto cleanup; } - + // You may think that this is the obvious place to get the // realm of the ticket file, but it can't be done here as the // routine to do this must open the ticket file. This is why @@ -189,7 +189,7 @@ khm_krb4_list_tickets(void) return(KSUCCESS); if (open) - (*ptf_close)(); //close ticket file + (*ptf_close)(); //close ticket file if (k_errno == EOF) k_errno = 0; @@ -211,7 +211,7 @@ khm_krb4_list_tickets(void) { CHAR message[256]; CHAR errBuf[256]; - LPCSTR errText; + LPCSTR errText; if (!Lerror_message) return -1; @@ -219,7 +219,7 @@ khm_krb4_list_tickets(void) errText = err_describe(errBuf, KRBERR(k_errno)); sprintf(message, "%s\n\n%s failed", errText, functionName); - MessageBox(NULL, message, "Kerberos Four", + MessageBox(NULL, message, "Kerberos Four", MB_OK | MB_ICONERROR | MB_TASKMODAL | MB_SETFOREGROUND); } #endif @@ -234,11 +234,11 @@ khm_krb4_list_tickets(void) #define KRBREALM_FILE "KRBREALM.CON" #define KRB5_FILE "KRB5.INI" -BOOL +BOOL khm_krb5_get_profile_file(LPSTR confname, UINT szConfname) { char **configFile = NULL; - if (pkrb5_get_default_config_files(&configFile)) + if (pkrb5_get_default_config_files(&configFile)) { GetWindowsDirectoryA(confname,szConfname); confname[szConfname-1] = '\0'; @@ -248,15 +248,15 @@ khm_krb5_get_profile_file(LPSTR confname, UINT szConfname) return FALSE; } - + *confname = 0; - + if (configFile) { StringCchCopyA(confname, szConfname, *configFile); - pkrb5_free_config_files(configFile); + pkrb5_free_config_files(configFile); } - + if (!*confname) { GetWindowsDirectoryA(confname,szConfname); @@ -265,7 +265,7 @@ khm_krb5_get_profile_file(LPSTR confname, UINT szConfname) StringCchCatA(confname, szConfname, "\\"); StringCchCatA(confname, szConfname, KRB5_FILE); } - + return FALSE; } @@ -296,7 +296,7 @@ khm_get_krb4_con_file(LPSTR confname, UINT szConfname) } StringCchCopyA(confname, szConfname, krbConFile); - } else if (hKrb4) { + } else if (hKrb4) { size_t size = szConfname; memset(confname, '\0', szConfname); if (!pkrb_get_krbconf2(confname, &size)) { @@ -316,7 +316,7 @@ readstring(FILE * file, char * buf, int len) int c,i; memset(buf, '\0', sizeof(buf)); for (i=0, c=fgetc(file); c != EOF ; c=fgetc(file), i++) - { + { if (i < sizeof(buf)) { if (c == '\n') { buf[i] = '\0'; @@ -346,7 +346,7 @@ readstring(FILE * file, char * buf, int len) /*! \internal \brief Return a list of configured realms - The string that is returned is a set of null terminated unicode strings, + The string that is returned is a set of null terminated unicode strings, each of which denotes one realm. The set is terminated by a zero length null terminated string. @@ -354,7 +354,7 @@ readstring(FILE * file, char * buf, int len) \return The string with the list of realms or NULL if the operation fails. */ -wchar_t * khm_krb5_get_realm_list(void) +wchar_t * khm_krb5_get_realm_list(void) { wchar_t * rlist = NULL; @@ -383,7 +383,7 @@ wchar_t * khm_krb5_get_realm_list(void) { /* first figure out how much space to allocate */ cbsize = 0; - for (cpp = sections; *cpp; cpp++) + for (cpp = sections; *cpp; cpp++) { cbsize += sizeof(wchar_t) * (strlen(*cpp) + 1); } @@ -420,7 +420,7 @@ wchar_t * khm_krb5_get_realm_list(void) size_t cbsize, t; wchar_t * d; - if (!khm_get_krb4_con_file(krb_conf,sizeof(krb_conf)) && + if (!khm_get_krb4_con_file(krb_conf,sizeof(krb_conf)) && #if _MSC_VER >= 1400 !fopen_s(&file, krb_conf, "rt") #else @@ -492,7 +492,7 @@ wchar_t * khm_krb5_get_default_realm(void) pkrb5_init_context(&ctx); pkrb5_get_default_realm(ctx,&def); - + if (def) { cch = strlen(def) + 1; realm = PMALLOC(sizeof(wchar_t) * cch); @@ -570,7 +570,7 @@ khm_krb4_set_def_tkt_string(void) { UnicodeStrToAnsi(tkt_string, sizeof(tkt_string), wtkt_string); - pkrb_set_tkt_string(tkt_string); + pkrb_set_tkt_string(tkt_string); } } @@ -618,7 +618,7 @@ khm_krb4_changepwd(char * principal, k_errno = make_temp_cache_v4("_chgpwd"); if (k_errno) return k_errno; - k_errno = pkadm_change_your_password(principal, password, newpassword, + k_errno = pkadm_change_your_password(principal, password, newpassword, error_str); make_temp_cache_v4(0); return k_errno; @@ -674,7 +674,7 @@ khm_krb4_find_tgt(khm_handle credset, khm_handle identity) { idname, &cb))) return NULL; - + t = wcsrchr(idname, L'@'); if (t == NULL) return NULL; @@ -747,7 +747,7 @@ khm_convert524(khm_handle identity) NULL))) { goto cleanup; } - + increds.client = me; increds.server = server; increds.times.endtime = 0; @@ -814,7 +814,7 @@ khm_convert524(khm_handle identity) } return (code || icode); -#endif /* NO_KRB5 */ +#endif /* NO_KRB5 */ } long @@ -862,11 +862,11 @@ khm_krb4_kinit(char * aname, khm_krb4_set_def_tkt_string(); - err_context = L"fetching ticket"; - rc4 = (*pkrb_get_pw_in_tkt)(aname, inst, realm, "krbtgt", realm, + err_context = L"fetching ticket"; + rc4 = (*pkrb_get_pw_in_tkt)(aname, inst, realm, "krbtgt", realm, lifetime, password); - if (rc4) /* XXX: do we want: && (rc != NO_TKT_FIL) as well? */ { + if (rc4) /* XXX: do we want: && (rc != NO_TKT_FIL) as well? */ { functionName = L"krb_get_pw_in_tkt()"; msg = IDS_ERR_PWINTKT; goto cleanup; diff --git a/src/windows/identity/plugins/krb4/krb4funcs.h b/src/windows/identity/plugins/krb4/krb4funcs.h index 05ed3e75dc..1328b4136d 100644 --- a/src/windows/identity/plugins/krb4/krb4funcs.h +++ b/src/windows/identity/plugins/krb4/krb4funcs.h @@ -68,15 +68,15 @@ khm_krb4_kinit(char * aname, char * inst, char * realm, long lifetime, - char * password); + char * password); -long +long khm_krb4_list_tickets(void); int khm_krb4_kdestroy(void); khm_handle -khm_krb4_find_tgt(khm_handle credset, +khm_krb4_find_tgt(khm_handle credset, khm_handle identity); LONG diff --git a/src/windows/identity/plugins/krb4/krb4newcreds.c b/src/windows/identity/plugins/krb4/krb4newcreds.c index 9c200b618d..bcc3bc745a 100644 --- a/src/windows/identity/plugins/krb4/krb4newcreds.c +++ b/src/windows/identity/plugins/krb4/krb4newcreds.c @@ -188,7 +188,7 @@ void k4_read_identity_data(k4_dlg_data * d) { &csp_ident))) { khc_open_space(csp_ident, CSNAME_KRB4CRED, 0, &csp_k4); - + if (csp_k4) { if (KHM_SUCCEEDED(khc_read_int32(csp_k4, L"Krb4NewCreds", &t))) d->k4_enabled = !!t; @@ -741,7 +741,7 @@ krb4_msg_newcred(khm_int32 msg_type, khm_int32 msg_subtype, /* only supported for new credentials */ if (method == K4_METHOD_AUTO || method == K4_METHOD_PASSWORD) { - + khm_size n_prompts = 0; khm_size idx; khm_size cb; diff --git a/src/windows/identity/plugins/krb4/krb4plugin.c b/src/windows/identity/plugins/krb4/krb4plugin.c index 9a50249f7a..168a0f8a7b 100644 --- a/src/windows/identity/plugins/krb4/krb4plugin.c +++ b/src/windows/identity/plugins/krb4/krb4plugin.c @@ -40,8 +40,8 @@ khm_boolean krb4_initialized = FALSE; khm_handle krb4_credset = NULL; /* Kerberos IV stuff */ -khm_int32 KHMAPI -krb4_msg_system(khm_int32 msg_type, khm_int32 msg_subtype, +khm_int32 KHMAPI +krb4_msg_system(khm_int32 msg_type, khm_int32 msg_subtype, khm_ui_4 uparam, void * vparam) { khm_int32 rv = KHM_ERROR_SUCCESS; @@ -65,7 +65,7 @@ krb4_msg_system(khm_int32 msg_type, khm_int32 msg_subtype, ct.id = KCDB_CREDTYPE_AUTO; ct.name = KRB4_CREDTYPE_NAME; - if(LoadString(hResModule, IDS_KRB4_SHORT_DESC, + if(LoadString(hResModule, IDS_KRB4_SHORT_DESC, buf, ARRAYLENGTH(buf))) { StringCbLength(buf, KCDB_MAXCB_SHORT_DESC, &cbsize); @@ -77,7 +77,7 @@ krb4_msg_system(khm_int32 msg_type, khm_int32 msg_subtype, /* even though ideally we should be setting limits based KCDB_MAXCB_LONG_DESC, our long description actually fits nicely in KCDB_MAXCB_SHORT_DESC */ - if(LoadString(hResModule, IDS_KRB4_LONG_DESC, + if(LoadString(hResModule, IDS_KRB4_LONG_DESC, buf, ARRAYLENGTH(buf))) { StringCbLength(buf, KCDB_MAXCB_SHORT_DESC, &cbsize); @@ -95,7 +95,7 @@ krb4_msg_system(khm_int32 msg_type, khm_int32 msg_subtype, rv = kcdb_credset_create(&krb4_credset); if (KHM_SUCCEEDED(rv)) - rv = kcdb_credtype_get_id(KRB5_CREDTYPE_NAME, + rv = kcdb_credtype_get_id(KRB5_CREDTYPE_NAME, &credtype_id_krb5); if(ct.short_desc) @@ -165,38 +165,38 @@ krb4_msg_system(khm_int32 msg_type, khm_int32 msg_subtype, } /* Lookup common data types */ - if(KHM_FAILED(kcdb_type_get_id(TYPENAME_ENCTYPE, + if(KHM_FAILED(kcdb_type_get_id(TYPENAME_ENCTYPE, &type_id_enctype))) { rv = KHM_ERROR_UNKNOWN; } - if(KHM_FAILED(kcdb_type_get_id(TYPENAME_ADDR_LIST, + if(KHM_FAILED(kcdb_type_get_id(TYPENAME_ADDR_LIST, &type_id_addr_list))) { rv = KHM_ERROR_UNKNOWN; } - if(KHM_FAILED(kcdb_type_get_id(TYPENAME_KRB5_FLAGS, + if(KHM_FAILED(kcdb_type_get_id(TYPENAME_KRB5_FLAGS, &type_id_krb5_flags))) { rv = KHM_ERROR_UNKNOWN; } /* Lookup common attributes */ - if(KHM_FAILED(kcdb_attrib_get_id(ATTRNAME_KEY_ENCTYPE, + if(KHM_FAILED(kcdb_attrib_get_id(ATTRNAME_KEY_ENCTYPE, &attr_id_key_enctype))) { rv = KHM_ERROR_UNKNOWN; } - if(KHM_FAILED(kcdb_attrib_get_id(ATTRNAME_TKT_ENCTYPE, + if(KHM_FAILED(kcdb_attrib_get_id(ATTRNAME_TKT_ENCTYPE, &attr_id_tkt_enctype))) { rv = KHM_ERROR_UNKNOWN; } - if(KHM_FAILED(kcdb_attrib_get_id(ATTRNAME_ADDR_LIST, + if(KHM_FAILED(kcdb_attrib_get_id(ATTRNAME_ADDR_LIST, &attr_id_addr_list))) { rv = KHM_ERROR_UNKNOWN; } - if(KHM_FAILED(kcdb_attrib_get_id(ATTRNAME_KRB5_FLAGS, + if(KHM_FAILED(kcdb_attrib_get_id(ATTRNAME_KRB5_FLAGS, &attr_id_krb5_flags))) { rv = KHM_ERROR_UNKNOWN; } @@ -230,8 +230,8 @@ krb4_msg_system(khm_int32 msg_type, khm_int32 msg_subtype, return rv; } -khm_int32 KHMAPI -krb4_msg_cred(khm_int32 msg_type, khm_int32 msg_subtype, +khm_int32 KHMAPI +krb4_msg_cred(khm_int32 msg_type, khm_int32 msg_subtype, khm_ui_4 uparam, void * vparam) { khm_int32 rv = KHM_ERROR_SUCCESS; @@ -283,8 +283,8 @@ krb4_msg_cred(khm_int32 msg_type, khm_int32 msg_subtype, return rv; } -khm_int32 KHMAPI -krb4_cb(khm_int32 msg_type, khm_int32 msg_subtype, +khm_int32 KHMAPI +krb4_cb(khm_int32 msg_type, khm_int32 msg_subtype, khm_ui_4 uparam, void * vparam) { switch(msg_type) { diff --git a/src/windows/identity/plugins/krb4/krbcred.h b/src/windows/identity/plugins/krb4/krbcred.h index 0b6a148eeb..834d3f9a3d 100644 --- a/src/windows/identity/plugins/krb4/krbcred.h +++ b/src/windows/identity/plugins/krb4/krbcred.h @@ -106,8 +106,8 @@ extern khm_boolean krb4_initialized; extern khm_handle krb4_credset; /* plugin callbacks */ -khm_int32 KHMAPI -krb4_cb(khm_int32 msg_type, khm_int32 msg_subtype, +khm_int32 KHMAPI +krb4_cb(khm_int32 msg_type, khm_int32 msg_subtype, khm_ui_4 uparam, void * vparam); INT_PTR CALLBACK diff --git a/src/windows/identity/plugins/krb4/langres.h b/src/windows/identity/plugins/krb4/langres.h index 5c0e46f9aa..b4f911874d 100644 --- a/src/windows/identity/plugins/krb4/langres.h +++ b/src/windows/identity/plugins/krb4/langres.h @@ -38,7 +38,7 @@ #define IDC_CFG_GETTIX 1037 // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 108 |