+2004-02-06 Jeffrey Altman <jaltman@mit.edu>
+
+ * resource.h: add new component id values for replay, mutual, sequence
+
+ * gss.rc: add new components for replay, mutual, sequence
+
+ * gss.h, gss.c, gss-client.c: add support for replay, mutual, and sequence
+
2004-02-04 Jeffrey Altman <jaltman@mit.edu>
* resource.h: add new component id values for ccache
*
* s (r) an established TCP connection to the service
* service_name (r) the ASCII service name of the service
- * deleg_flag (r) GSS-API delegation flag (if any)
+ * gss_flags (r) GSS-API delegation flag (if any)
* auth_flag (r) whether to actually do authentication
* oid (r) OID of the mechanism to use
* context (w) the established GSS-API context
*/
int client_establish_context( int s,
char *service_name,
- OM_uint32 deleg_flag,
+ OM_uint32 gss_flags,
int auth_flag,
int v1_format,
gss_OID oid,
gss_context,
target_name,
oid,
- GSS_C_MUTUAL_FLAG | GSS_C_REPLAY_FLAG |
- deleg_flag,
+ gss_flags,
0,
NULL, /* no channel bindings */
token_ptr,
* host (r) the host providing the service
* port (r) the port to connect to on host
* service_name (r) the GSS-API service name to authenticate to
- * deleg_flag (r) GSS-API delegation flag (if any)
+ * gss_flags (r) GSS-API delegation flag (if any)
* auth_flag (r) whether to do authentication
* wrap_flag (r) whether to do message wrapping at all
* encrypt_flag (r) whether to do encryption while wrapping
* verifies it with gss_verify. -1 is returned if any step fails,
* otherwise 0 is returned. */
int call_server(char *host, u_short port, gss_OID oid, char *service_name,
- OM_uint32 deleg_flag, int auth_flag,
+ OM_uint32 gss_flags, int auth_flag,
int wrap_flag, int encrypt_flag, int mic_flag, int v1_format,
char *msg, int use_file, int mcount)
{
return -1;
/* Establish context */
- if (client_establish_context(s, service_name, deleg_flag, auth_flag,
+ if (client_establish_context(s, service_name, gss_flags, auth_flag,
v1_format, oid, &context,
&ret_flags) < 0) {
(void) closesocket(s);
int
gss (char *server_host, char *service_name, char *mechanism, char *msg, int port,
- int verbose, int delegate, int v1_format, int auth_flag, int wrap_flag,
+ int verbose, int delegate, int mutual, int replay, int sequence,
+ int v1_format, int auth_flag, int wrap_flag,
int encrypt_flag, int mic_flag, int ccount, int mcount, char *ccache)
{
int use_file = 0;
- OM_uint32 deleg_flag = (delegate ? GSS_C_DELEG_FLAG : 0), min_stat;
+ OM_uint32 gss_flags = 0, min_stat;
gss_OID oid = GSS_C_NULL_OID;
OM_uint32 minor_status;
int i;
if (mechanism && mechanism[0])
parse_oid(mechanism, &oid);
+ if ( delegate )
+ gss_flags |= GSS_C_DELEG_FLAG;
+ if ( mutual )
+ gss_flags |= GSS_C_MUTUAL_FLAG;
+ if ( replay )
+ gss_flags |= GSS_C_REPLAY_FLAG;
+ if ( sequence )
+ gss_flags |= GSS_C_SEQUENCE_FLAG;
+
/* By using this function the independence between the application and
* the underlying authentication system is broken
*/
for (i = 0; i < ccount; i++) {
if (call_server(server_host, port, oid, service_name,
- deleg_flag, auth_flag, wrap_flag, encrypt_flag, mic_flag,
+ gss_flags, auth_flag, wrap_flag, encrypt_flag, mic_flag,
v1_format, msg, use_file, mcount) < 0)
rc = -1;
break;
#define INI_LAST_MECH "Mechanism"
#define INI_LAST_MSG "Message"
#define INI_LAST_DELEGATE "Delegation"
+#define INI_LAST_SEQUENCE "Sequence"
+#define INI_LAST_MUTUAL "Mutual"
+#define INI_LAST_REPLAY "Replay"
#define INI_LAST_VERBOSE "Verbose"
#define INI_LAST_CCOUNT "Call Count"
#define INI_LAST_MCOUNT "Message Count"
char szCCache[256]; // CCache to use
int port = 0; // Which port to use
int delegate = 0; // Delegate?
+int replay = 1; // Replay?
+int mutual = 1; // Mutual?
+int sequence = 0; // Sequence?
int verbose = 1; // Verbose?
int ccount = 1; // Call Count
int mcount = 1; // Message Count
hcursor = SetCursor(LoadCursor(NULL, IDC_WAIT));
n = gss (szHost, szService, szMech, szMessage[0] ? szMessage : "Test Gssapi Message", port,
- verbose, delegate, gssv1, !noauth, !nowrap, !nocrypt, !nomic, ccount, mcount,
+ verbose, delegate, mutual, replay, sequence,
+ gssv1, !noauth, !nowrap, !nocrypt, !nomic, ccount, mcount,
szCCache);
SetCursor(hcursor);
verbose = IsDlgButtonChecked(hDlg, GSS_VERBOSE);
delegate = IsDlgButtonChecked(hDlg, GSS_DELEGATION);
+ mutual = IsDlgButtonChecked(hDlg, GSS_MUTUAL);
+ replay = IsDlgButtonChecked(hDlg, GSS_REPLAY);
+ sequence = IsDlgButtonChecked(hDlg, GSS_SEQUENCE);
gssv1 = IsDlgButtonChecked(hDlg, GSS_VERSION_ONE);
noauth = IsDlgButtonChecked(hDlg, GSS_NO_AUTH);
GetPrivateProfileString(INI_LAST, INI_LAST_DELEGATE, "", buff, 32, GSSAPI_INI);
if ( buff[0] )
delegate = atoi(buff);
+ GetPrivateProfileString(INI_LAST, INI_LAST_MUTUAL, "", buff, 32, GSSAPI_INI);
+ if ( buff[0] )
+ mutual = atoi(buff);
+ GetPrivateProfileString(INI_LAST, INI_LAST_REPLAY, "", buff, 32, GSSAPI_INI);
+ if ( buff[0] )
+ replay = atoi(buff);
+ GetPrivateProfileString(INI_LAST, INI_LAST_SEQUENCE, "", buff, 32, GSSAPI_INI);
+ if ( buff[0] )
+ sequence = atoi(buff);
GetPrivateProfileString(INI_LAST, INI_LAST_VERBOSE, "", buff, 32, GSSAPI_INI);
if ( buff[0] )
verbose = atoi(buff);
WritePrivateProfileString(INI_LAST, INI_LAST_MSG, szMessage, GSSAPI_INI);
wsprintf(buff, "%d", delegate);
WritePrivateProfileString(INI_LAST, INI_LAST_DELEGATE, buff, GSSAPI_INI);
+ wsprintf(buff, "%d", mutual);
+ WritePrivateProfileString(INI_LAST, INI_LAST_MUTUAL, buff, GSSAPI_INI);
+ wsprintf(buff, "%d", replay);
+ WritePrivateProfileString(INI_LAST, INI_LAST_REPLAY, buff, GSSAPI_INI);
+ wsprintf(buff, "%d", sequence);
+ WritePrivateProfileString(INI_LAST, INI_LAST_SEQUENCE, buff, GSSAPI_INI);
wsprintf(buff, "%d", verbose);
WritePrivateProfileString(INI_LAST, INI_LAST_VERBOSE, buff, GSSAPI_INI);
wsprintf(buff, "%d", ccount);
CheckDlgButton(hDlg, GSS_VERBOSE, verbose);
CheckDlgButton(hDlg, GSS_DELEGATION, delegate);
+ CheckDlgButton(hDlg, GSS_MUTUAL, mutual);
+ CheckDlgButton(hDlg, GSS_REPLAY, replay);
+ CheckDlgButton(hDlg, GSS_SEQUENCE, sequence);
CheckDlgButton(hDlg, GSS_VERSION_ONE, gssv1);
CheckDlgButton(hDlg, GSS_NO_AUTH, noauth);
CheckDlgButton(hDlg, GSS_NO_WRAP, nowrap);
// gss-client.c
int
gss (char *server_host, char *service_name, char *mechanism, char *msg, int port,
- int verbose, int delegate, int v1_format, int auth_flag, int wrap_flag,
+ int verbose, int delegate, int mutual, int replay, int sequence,
+ int v1_format, int auth_flag, int wrap_flag,
int encrypt_flag, int mic_flag, int ccount, int mcount, char * ccache);
int call_server(char *host, u_short port, gss_OID oid, char *service_name,
OM_uint32 deleg_flag, int auth_flag,
LTEXT "The following items are optional and should only be altered by those who understand their implications.",
IDC_STATIC_OPTIONS,10,85,305,20
CONTROL "Verbose Output",GSS_VERBOSE,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,70,135,65,10
+ WS_TABSTOP,72,138,65,10
CONTROL "Delegation",GSS_DELEGATION,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,170,135,50,10
+ WS_TABSTOP,72,150,50,10
CONTROL "Version 1",GSS_VERSION_ONE,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,270,135,45,10
+ WS_TABSTOP,150,138,45,10
CONTROL "No Auth",GSS_NO_AUTH,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,70,155,42,10
+ WS_TABSTOP,72,162,42,10
CONTROL "No Wrap",GSS_NO_WRAP,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,135,155,45,10
+ WS_TABSTOP,132,162,45,10
CONTROL "No Encrypt",GSS_NO_ENCRYPT,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,205,155,51,10
+ WS_TABSTOP,198,162,51,10
CONTROL "No Mic",GSS_NO_MIC,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,275,155,39,10
+ WS_TABSTOP,270,162,39,10
CONTROL "Slider1",GSS_CALL_COUNT,"msctls_trackbar32",TBS_BOTH |
- WS_TABSTOP,70,170,100,15
+ WS_TABSTOP,66,174,100,15
CONTROL "Slider2",GSS_MESSAGE_COUNT,"msctls_trackbar32",TBS_BOTH |
- WS_TABSTOP,205,170,100,15
- CTEXT "Call Count",IDC_STATIC_CCOUNT,75,185,90,8
- CTEXT "Message Count",IDC_STATIC_MSG_COUNT,210,185,90,8
+ WS_TABSTOP,204,174,100,15
+ CTEXT "Call Count",IDC_STATIC_CCOUNT,72,192,90,8
+ CTEXT "Message Count",IDC_STATIC_MSG_COUNT,210,192,90,8
GROUPBOX "Output",IDC_GROUP_OUTPUT,0,210,325,75
GROUPBOX "Configuration Options",IDC_GROUP_OPTIONS,0,0,325,205
EDITTEXT GSS_OUTPUT,0,220,320,60,ES_MULTILINE | ES_AUTOVSCROLL |
ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL
+ CONTROL "Mutual",GSS_MUTUAL,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,132,150,37,10
+ CONTROL "Replay",GSS_REPLAY,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,198,150,38,10
+ CONTROL "Sequence",GSS_SEQUENCE,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,270,150,49,10
END
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
+
#include <winver.h>
#include "..\version.rc"
TestTrackerMOTD TEXT ver_serv.txt
-
#define IDC_STATIC_HOST 1027
#define GSS_CCACHE_NAME 1028
#define IDC_STATIC_CCACHE 1029
+#define GSS_MUTUAL 1030
+#define GSS_REPLAY 1031
+#define GSS_SEQUENCE 1032
#define IDD_GSSAPIDLG 101
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1030
+#define _APS_NEXT_CONTROL_VALUE 1033
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif