summaryrefslogtreecommitdiffstats
path: root/src/windows
diff options
context:
space:
mode:
authorKeith Vetter <keithv@fusion.com>1995-04-06 03:49:47 +0000
committerKeith Vetter <keithv@fusion.com>1995-04-06 03:49:47 +0000
commit8ae426aca4d7f95de05ec34a9e0dfe5cc70395a3 (patch)
treea32c3f23c5ac1aef1e9fc8230b92c344d563edda /src/windows
parent1d06f0e29f9041438a30c0a09911d911fdf1e1f5 (diff)
downloadkrb5-8ae426aca4d7f95de05ec34a9e0dfe5cc70395a3.tar.gz
krb5-8ae426aca4d7f95de05ec34a9e0dfe5cc70395a3.tar.xz
krb5-8ae426aca4d7f95de05ec34a9e0dfe5cc70395a3.zip
Bug fixes or better error handling for the following 4 Windows bugs
(note, these changes haven't yet been tested on the PC which were failing so no guarantee that they fully work): a) GUI to cns improved so that you don't need a resize for the widgets to align properly, and so the interaction of typing: "username cr password cr" is all you need to do to get you a ticket. b) cns uses krb5_us_gettimeofday instead of krb5_timeofday because the former is more accurate and handles timezones. Probably should make the latter just call the former. c) Added SOCKET_INIT and SOCKET_DESTROY around krb5_sendto_kdc to prevent some tcp/ip stacks from locking up after 8 uses. d) Added a new error message and better error handling to give more precision as to why one PC was getting the error 'Cannot find KDC for requested realm.' git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5342 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/windows')
-rw-r--r--src/windows/changelo4
-rw-r--r--src/windows/cns/changelo9
-rw-r--r--src/windows/cns/cns.c65
-rw-r--r--src/windows/cns/cns.def10
-rw-r--r--src/windows/cns/cns.h11
-rw-r--r--src/windows/cns/cns.rc11
-rw-r--r--src/windows/readme7
-rw-r--r--src/windows/wintel/changelo5
-rw-r--r--src/windows/wintel/dialog.h1
-rw-r--r--src/windows/wintel/screen.c15
-rw-r--r--src/windows/wintel/screen.h1
-rw-r--r--src/windows/wintel/telnet.rc1
12 files changed, 112 insertions, 28 deletions
diff --git a/src/windows/changelo b/src/windows/changelo
index cbd9f7b202..73fb984faa 100644
--- a/src/windows/changelo
+++ b/src/windows/changelo
@@ -1,3 +1,7 @@
+Wed Apr 5 16:14:49 1995 Keith Vetter (keithv@fusion.com)
+
+ * readme: updated about realms, conf files and telnet port.
+
Tue Mar 28 12:00:00 1995 Keith Vetter (keithv@fusion.com)
* ChangeLog renamed to changelo to avoid having to always rename it.
diff --git a/src/windows/cns/changelo b/src/windows/cns/changelo
index a2d9b87e6f..eb98d9a906 100644
--- a/src/windows/cns/changelo
+++ b/src/windows/cns/changelo
@@ -1,3 +1,12 @@
+Wed Apr 5 16:01:16 1995 Keith Vetter (keithv@fusion.com)
+
+ * cns.h, cns.rc, cns.c: GUI changes: re-order and resize
+ edit boxes, add hidden button for better CR handling.
+ * cns.c: used krb5_us_timeofday instead of krb5_timeofday
+ for timezone/clock skew fix (not tested by tytso yet).
+ * cns.c: added password changing stub with correct interface.
+ * cns.def: changed kwin to cns as the name of the program.
+
Fri Mar 31 16:47:18 1995 Keith Vetter (keithv@fusion.com)
* cns.c: realms file was not getting saved properly.
diff --git a/src/windows/cns/cns.c b/src/windows/cns/cns.c
index fbf5cd10e1..97b4b6bdb9 100644
--- a/src/windows/cns/cns.c
+++ b/src/windows/cns/cns.c
@@ -235,7 +235,7 @@ position_dialog (
x + cx < 0 ||
y + cy < 0)
center_dialog(hwnd);
- else
+ else
MoveWindow(hwnd, x, y, cx, cy, TRUE);
} /* position_dialog */
@@ -492,12 +492,45 @@ change_password (
#endif
#ifdef KRB5 /* FIXME */
- MessageBox (NULL, "Changing passwords is not yet implemented", "", MB_ICONEXCLAMATION);
- return TRUE;
+ char *msg; // Message string
+ krb5_error_code code; // Return value
+
+ krb5_error_code //FIXME INTERFACE
+ krb5_change_password(
+ krb5_context context,
+ char *user,
+ char *realm,
+ char *old_password,
+ char *new_password,
+ char **text);
+
+ code = krb5_change_password (k5_context, name, realm, oldpw, newpw, &msg);
+
+ if (msg != NULL) {
+ MessageBox (NULL, msg, NULL, MB_ICONEXCLAMATION);
+ //WHO FREES THIS SPACE??? free (msg);
+ } else if (code)
+ com_err (NULL, code, "while changing password.");
+
+ return (code == 0);
#endif
} /* change_password */
-
+/*+*/
+#ifdef KRB5
+krb5_error_code //FIXME INTERFACE
+krb5_change_password(
+ krb5_context context,
+ char *user,
+ char *realm,
+ char *old_password,
+ char *new_password,
+ char **text)
+{
+ *text = "Changing passwords is not yet implemented";
+ return -1;
+}
+#endif /* KRB5 */
/*+
* Function: Process WM_COMMAND messages for the password dialog.
*
@@ -1847,6 +1880,7 @@ kwin_command (
HMENU hmenu;
char menuitem[MAX_K_NAME_SZ + 3];
char copyright[128];
+ int id;
#ifdef KRB4
char instance[INST_SZ];
int lifetime;
@@ -1859,6 +1893,7 @@ kwin_command (
krb5_creds creds;
krb5_principal server;
krb5_timestamp now;
+ krb5_int32 sec, usec;
#endif
#ifdef KRB4
@@ -1885,6 +1920,8 @@ kwin_command (
}
EnableWindow(GetDlgItem(hwnd, IDD_LOGIN), blogin);
+ id = (blogin) ? IDD_LOGIN : IDD_PASSWORD_CR2;
+ SendMessage(hwnd, DM_SETDEFID, id, 0);
if (HIWORD(lparam) != BN_CLICKED && HIWORD(lparam) != 0 && HIWORD(lparam) != 1)
return FALSE;
@@ -1914,6 +1951,18 @@ kwin_command (
return TRUE;
+ case IDD_PASSWORD_CR2: // Make CR == TAB
+ id = GetDlgCtrlID(GetFocus());
+ assert(id != 0);
+
+ if (id == IDD_MAX_EDIT)
+ PostMessage(hwnd, WM_NEXTDLGCTL,
+ GetDlgItem(hwnd, IDD_MIN_EDIT), MAKELONG(1, 0));
+ else
+ PostMessage(hwnd, WM_NEXTDLGCTL, 0, 0);
+
+ return TRUE;
+
case IDD_LOGIN:
if (isblocking)
return TRUE;
@@ -1964,8 +2013,14 @@ kwin_command (
creds.client = principal;
creds.server = server;
- code = krb5_timeofday(k5_context, &now);
+ //code = krb5_timeofday(k5_context, &now);
+ //if (code) break;
+ code = krb5_us_timeofday(k5_context, &sec, &usec);
if (code) break;
+//if (labs(now-sec) > 60*60) { // Off by more than an hour
+// MessageBox (NULL, "DEBUG: timeofday != us_timeofday", NULL, 0);
+// now = sec;
+//}
creds.times.starttime = 0;
creds.times.endtime = now + 60L * lifetime;
creds.times.renew_till = 0;
diff --git a/src/windows/cns/cns.def b/src/windows/cns/cns.def
index d0f2032c73..01fd7f5eac 100644
--- a/src/windows/cns/cns.def
+++ b/src/windows/cns/cns.def
@@ -1,9 +1,9 @@
-NAME KWIN
-DESCRIPTION 'KWIN'
-EXETYPE WINDOWS
-STUB 'WINSTUB.EXE'
+NAME CNS
+DESCRIPTION 'CNS - Cygnus Network Security'
+EXETYPE WINDOWS
+STUB 'WINSTUB.EXE'
SEGMENTS _TEXT CLASS 'CODE' PRELOAD
-CODE DISCARDABLE
+CODE DISCARDABLE
DATA PRELOAD MULTIPLE MOVEABLE
HEAPSIZE 20480
STACKSIZE 20480
diff --git a/src/windows/cns/cns.h b/src/windows/cns/cns.h
index 7579400b8a..1508c09e18 100644
--- a/src/windows/cns/cns.h
+++ b/src/windows/cns/cns.h
@@ -59,14 +59,14 @@
#define IDD_MIN_TITLE 103
#define IDD_LOGIN_NAME_TITLE 103
- #define IDD_LOGIN_REALM_TITLE 104
- #define IDD_LOGIN_PASSWORD_TITLE 105
+ #define IDD_LOGIN_PASSWORD_TITLE 104
+ #define IDD_LOGIN_REALM_TITLE 105
#define IDD_MAX_TITLE 105
#define IDD_MIN_EDIT 107
#define IDD_LOGIN_NAME 107
- #define IDD_LOGIN_REALM 108
- #define IDD_LOGIN_PASSWORD 109
+ #define IDD_LOGIN_PASSWORD 108
+ #define IDD_LOGIN_REALM 109
#define IDD_MAX_EDIT 109
#endif
@@ -76,8 +76,9 @@
#define IDD_TICKET_DELETE 112
#define IDD_LOGIN 113
#define IDD_MAX_BUTTON 113
+ #define IDD_PASSWORD_CR2 114 // For better cr handling
- #define IDD_KWIN_LAST 113
+ #define IDD_KWIN_LAST 114
#define ID_PASSWORD 200
diff --git a/src/windows/cns/cns.rc b/src/windows/cns/cns.rc
index 55137252d5..1a49e2a48f 100644
--- a/src/windows/cns/cns.rc
+++ b/src/windows/cns/cns.rc
@@ -61,15 +61,16 @@ BEGIN
#endif
#ifdef KRB5
CONTROL "&Name", IDD_LOGIN_NAME_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 6, 69, 27, 8
- CONTROL "&Realm", IDD_LOGIN_REALM_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 140, 69, 26, 8
- CONTROL "&Password", IDD_LOGIN_PASSWORD_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 207, 69, 36, 8
- CONTROL "", IDD_LOGIN_NAME, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 6, 79, 62, 12
- CONTROL "", IDD_LOGIN_REALM, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_UPPERCASE | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 73, 79, 62, 12
- CONTROL "", IDD_LOGIN_PASSWORD, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 207, 79, 62, 12
+ CONTROL "&Password", IDD_LOGIN_PASSWORD_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 95, 69, 36, 8
+ CONTROL "&Realm", IDD_LOGIN_REALM_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 184, 69, 26, 8
+ CONTROL "", IDD_LOGIN_NAME, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 6, 79, 84, 12
+ CONTROL "", IDD_LOGIN_PASSWORD, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 95, 79, 84, 12
+ CONTROL "", IDD_LOGIN_REALM, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_UPPERCASE | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 184, 79, 84, 12
#endif
CONTROL "&Change Password...", IDD_CHANGE_PASSWORD, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 6, 96, 74, 14
CONTROL "&Delete", IDD_TICKET_DELETE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 122, 96, 52, 14
CONTROL "&Login", IDD_LOGIN, "BUTTON", BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 216, 96, 52, 14
+ CONTROL "", IDD_PASSWORD_CR2, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE, 5000, 5000, 0, 0
END
#ifdef KRB4
diff --git a/src/windows/readme b/src/windows/readme
index 6a34620948..7c1e5846a6 100644
--- a/src/windows/readme
+++ b/src/windows/readme
@@ -19,15 +19,10 @@ On the PC side
4) nmake -c -f makefile.in # Configures the makefiles and runs
# ...make in all the subdirectories.
5) <make sure the config and realms files, krb.con and krb.rea,
- are in the top level directory.>
+ are in the windows directory.>
The resulting interesting files will be:
lib/libkrb5.dll # The actual DLL
lib/libkrb5.lib # The library for linking in the DLL
windows/cns/cns.exe # Cygnus Network Security program
windows/wintel/telnet # K5 authenticated telnet program
-
-Note on telnet: since the only k5 telnet daemon at this time is
-tsx-11.mit.edu port 13131, the port the program connects to is
-hardwired for now to 13131.
-
diff --git a/src/windows/wintel/changelo b/src/windows/wintel/changelo
index 34b6ed30d7..f903d1045f 100644
--- a/src/windows/wintel/changelo
+++ b/src/windows/wintel/changelo
@@ -1,3 +1,8 @@
+Wed Apr 5 16:18:30 1995 Keith Vetter (keithv@fusion.com)
+
+ * screen.c, screen.h, dialog.h, telnet.rc: added an about
+ box with version number.
+
Fri Mar 31 16:24:52 1995 Keith Vetter (keithv@fusion.com)
* telnet.c, wt-proto.h: added command line option to set port number
diff --git a/src/windows/wintel/dialog.h b/src/windows/wintel/dialog.h
index da4790f74f..cfec5928a1 100644
--- a/src/windows/wintel/dialog.h
+++ b/src/windows/wintel/dialog.h
@@ -1,4 +1,3 @@
-#define IDM_ABOUT 100
#define IDM_SHOWCONSOLE 700
#define IDM_OPENTELNETDLG 200
diff --git a/src/windows/wintel/screen.c b/src/windows/wintel/screen.c
index 2f12ad00c3..6842b75c9e 100644
--- a/src/windows/wintel/screen.c
+++ b/src/windows/wintel/screen.c
@@ -2,7 +2,7 @@
#include <commdlg.h>
#include <stdlib.h>
#include <string.h>
-#include "screen.h"
+#include "telnet.h"
#include "ini.h"
extern char *cInvertedArray;
@@ -759,6 +759,19 @@ LPARAM lParam; /* additional information */
case IDM_PASTE:
Edit_Paste(hWnd);
break;
+ case IDM_ABOUT:
+ #ifdef KRB4
+ strcpy(strTmp, " Kerberos 4 for Windows\n");
+ #endif
+ #ifdef KRB5
+ strcpy(strTmp, " Kerberos 5 for Windows\n");
+ #endif
+ strcat(strTmp, "\n Version 1.00\n\n");
+ strcat(strTmp, " For support, contact:\n");
+ strcat(strTmp, "Cygnus Support");
+ strcat(strTmp, " - (415) 903-1400");
+ MessageBox(NULL, strTmp, "Kerberos", MB_OK);
+ break;
#ifdef _DEBUG
case IDM_DEBUG:
CheckScreen(fpScr);
diff --git a/src/windows/wintel/screen.h b/src/windows/wintel/screen.h
index edc4d13687..7a472436f2 100644
--- a/src/windows/wintel/screen.h
+++ b/src/windows/wintel/screen.h
@@ -127,6 +127,7 @@ typedef struct CONFIG {
#define IDM_FONT 100
#define IDM_BACKSPACE 101
#define IDM_DELETE 102
+#define IDM_ABOUT 103
#define IDM_COPY 200
#define IDM_PASTE 201
diff --git a/src/windows/wintel/telnet.rc b/src/windows/wintel/telnet.rc
index bcdcdb5693..cbe082578b 100644
--- a/src/windows/wintel/telnet.rc
+++ b/src/windows/wintel/telnet.rc
@@ -14,6 +14,7 @@ BEGIN
MENUITEM "&Delete", IDM_DELETE
MENUITEM SEPARATOR
MENUITEM "&Font...", IDM_FONT
+ MENUITEM "&About...", IDM_ABOUT
END
POPUP "&Edit"
BEGIN