Fix the non-KFW case of the KDC Probe. Prevent infinite loop.
void KFW_import_ccache_data(void);
void KFW_import_windows_lsa(void);
BOOL MSLSA_IsKerberosLogon();
+
+/* From afs/krb_prot.h */
+/* values for kerb error codes */
+#define KERB_ERR_OK 0
+#define KERB_ERR_NAME_EXP 1
+#define KERB_ERR_SERVICE_EXP 2
+#define KERB_ERR_AUTH_EXP 3
+#define KERB_ERR_PKT_VER 4
+#define KERB_ERR_NAME_MAST_KEY_VER 5
+#define KERB_ERR_SERV_MAST_KEY_VER 6
+#define KERB_ERR_BYTE_ORDER 7
+#define KERB_ERR_PRINCIPAL_UNKNOWN 8
+#define KERB_ERR_PRINCIPAL_NOT_UNIQUE 9
+#define KERB_ERR_NULL_KEY 10
#endif /* AFSKFW_INT_H */
code = pkrb5_c_random_make_octets(ctx, &pwdata);
if (code) {
int i;
- for ( i=0 ; i<PROBE_PASSWORD_LEN ; i )
+ for ( i=0 ; i<PROBE_PASSWORD_LEN ; i++ )
password[i] = 'x';
}
password[PROBE_PASSWORD_LEN] = '\0';
}
} else {
int i;
- for ( i=0 ; i<PROBE_PASSWORD_LEN ; i )
+
+ for ( i=0 ; i<PROBE_PASSWORD_LEN ; i++ )
password[i] = 'x';
- code = ObtainNewCredentials(rootcell, PROBE_USERNAME, password);
- serverReachable = 1;
+ code = ObtainNewCredentials(rootcell, PROBE_USERNAME, password, TRUE);
+ switch ( code ) {
+ case INTK_BADPW:
+ case KERB_ERR_PRINCIPAL_UNKNOWN:
+ case KERB_ERR_SERVICE_EXP:
+ case RD_AP_TIME:
+ serverReachable = TRUE;
+ break;
+ default:
+ serverReachable = FALSE;
+ }
}
#endif
if ( !serverReachable ) {
WizCreds_OnEnable (hDlg, FALSE);
- if (ObtainNewCredentials (szCell, szUser, szPassword) == 0)
+ if (ObtainNewCredentials (szCell, szUser, szPassword, FALSE) == 0)
{
g.pWizard->SetState (STEP_MOUNT);
}
}
-int ObtainNewCredentials (LPCTSTR pszCell, LPCTSTR pszUser, LPCTSTR pszPassword)
+int ObtainNewCredentials (LPCTSTR pszCell, LPCTSTR pszUser, LPCTSTR pszPassword, BOOL Silent)
{
int rc = KTC_NOCM;
char *Result = NULL;
rc = ka_UserAuthenticateGeneral(KA_USERAUTH_VERSION, szNameA, "", szCellA, szPasswordA, 0, &Expiration, 0, &Result);
}
- if (rc != 0)
+ if (!Silent && rc != 0)
{
int idsTitle = (g.fIsWinNT) ? IDS_ERROR_TITLE : IDS_ERROR_TITLE_95;
int idsDesc = (g.fIsWinNT) ? IDS_ERROR_OBTAIN : IDS_ERROR_OBTAIN_95;
int DestroyCurrentCredentials (LPCTSTR pszCell);
-int ObtainNewCredentials (LPCTSTR pszCell, LPCTSTR pszUser, LPCTSTR pszPassword);
+int ObtainNewCredentials (LPCTSTR pszCell, LPCTSTR pszUser, LPCTSTR pszPassword, BOOL Silent);
int GetDefaultCell (LPTSTR pszCell);
GetDlgItemText (hDlg, IDC_NEWCREDS_PASSWORD, szPassword, cchRESOURCE);
int rc;
- if ((rc = ObtainNewCredentials (szCell, szUser, szPassword)) != 0)
+ if ((rc = ObtainNewCredentials (szCell, szUser, szPassword, FALSE)) != 0)
{
EnableWindow (GetDlgItem (hDlg, IDOK), TRUE);
EnableWindow (GetDlgItem (hDlg, IDCANCEL), TRUE);