*
* 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
* unsuccessful, the GSS-API error messages are displayed on stderr
* and -1 is returned.
*/
-static int client_establish_context(s, service_name, deleg_flag, auth_flag,
- v1_format, oid, gss_context, ret_flags)
+static int client_establish_context(s, service_name, gss_flags, auth_flag,
+ v1_format, oid, gss_context, ret_flags, replay_flag,
+ seq_flag, mutual_flag)
int s;
char *service_name;
gss_OID oid;
- OM_uint32 deleg_flag;
+ OM_uint32 gss_flags;
int auth_flag;
int v1_format;
gss_ctx_id_t *gss_context;
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
* reads back a GSS-API signature block for msg from the server, and
* verifies it with gss_verify. -1 is returned if any step fails,
* otherwise 0 is returned. */
-static int call_server(host, port, oid, service_name, deleg_flag, auth_flag,
+static int call_server(host, port, oid, service_name, gss_flags, auth_flag,
wrap_flag, encrypt_flag, mic_flag, v1_format, msg, use_file,
mcount)
char *host;
u_short port;
gss_OID oid;
char *service_name;
- OM_uint32 deleg_flag;
+ OM_uint32 gss_flags;
int auth_flag, wrap_flag, encrypt_flag, mic_flag;
int v1_format;
char *msg;
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) close(s);
char *mechanism = 0;
u_short port = 4444;
int use_file = 0;
- OM_uint32 deleg_flag = 0, min_stat;
+ OM_uint32 gss_flags = GSS_C_MUTUAL_FLAG | GSS_C_REPLAY_FLAG;
+ OM_uint32 min_stat;
gss_OID oid = GSS_C_NULL_OID;
int mcount = 1, ccount = 1;
int i;
if (!argc) usage();
mechanism = *argv;
} else if (strcmp(*argv, "-d") == 0) {
- deleg_flag = GSS_C_DELEG_FLAG;
+ gss_flags |= GSS_C_DELEG_FLAG;
+ } else if (strcmp(*argv, "-seq") == 0) {
+ gss_flags |= GSS_C_SEQUENCE_FLAG;
+ } else if (strcmp(*argv, "-noreplay") == 0) {
+ gss_flags &= ~GSS_C_REPLAY_FLAG;
+ } else if (strcmp(*argv, "-nomutual") == 0) {
+ gss_flags &= ~GSS_C_MUTUAL_FLAG;
} else if (strcmp(*argv, "-f") == 0) {
use_file = 1;
} else if (strcmp(*argv, "-q") == 0) {
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)
exit(1);
}