summaryrefslogtreecommitdiffstats
path: root/src/tests/gss-threads
diff options
context:
space:
mode:
authorTom Yu <tlyu@mit.edu>2009-10-31 00:48:38 +0000
committerTom Yu <tlyu@mit.edu>2009-10-31 00:48:38 +0000
commit02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b (patch)
tree61b9147863cd8be3eff63903dc36cae168254bd5 /src/tests/gss-threads
parent162ab371748cba0cc6f172419bd6e71fa04bb878 (diff)
downloadkrb5-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/tests/gss-threads')
-rw-r--r--src/tests/gss-threads/gss-client.c34
-rw-r--r--src/tests/gss-threads/gss-misc.c36
-rw-r--r--src/tests/gss-threads/gss-misc.h4
-rw-r--r--src/tests/gss-threads/gss-server.c34
4 files changed, 54 insertions, 54 deletions
diff --git a/src/tests/gss-threads/gss-client.c b/src/tests/gss-threads/gss-client.c
index 1057c05c4..098718400 100644
--- a/src/tests/gss-threads/gss-client.c
+++ b/src/tests/gss-threads/gss-client.c
@@ -1,6 +1,6 @@
/*
* Copyright 1994 by OpenVision Technologies, Inc.
- *
+ *
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appears in all copies and
@@ -10,7 +10,7 @@
* without specific, written prior permission. OpenVision makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
- *
+ *
* OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
@@ -27,7 +27,7 @@
* require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
- *
+ *
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
@@ -110,7 +110,7 @@ static int get_server_info(host, port)
fprintf(stderr, "Unknown host: %s\n", host);
return -1;
}
-
+
saddr.sin_family = hp->h_addrtype;
memcpy(&saddr.sin_addr, hp->h_addr, sizeof(saddr.sin_addr));
saddr.sin_port = htons(port);
@@ -171,13 +171,13 @@ static int connect_to_server()
* Returns: 0 on success, -1 on failure
*
* Effects:
- *
+ *
* service_name is imported as a GSS-API name and a GSS-API context is
* established with the corresponding service; the service should be
* listening on the TCP connection s. The default GSS-API mechanism
* is used, and mutual authentication and replay detection are
* requested.
- *
+ *
* If successful, the context handle is returned in context. If
* unsuccessful, the GSS-API error messages are displayed on stderr
* and -1 is returned.
@@ -211,7 +211,7 @@ static int client_establish_context(s, service_name, gss_flags, auth_flag,
display_status("parsing name", maj_stat, min_stat);
return -1;
}
-
+
if (!v1_format) {
if (send_token(s, TOKEN_NOOP|TOKEN_CONTEXT_NEXT, empty_token) < 0) {
(void) gss_release_name(&min_stat, &target_name);
@@ -228,13 +228,13 @@ static int client_establish_context(s, service_name, gss_flags, auth_flag,
* transmitted to the server; every received token is stored in
* recv_tok, which token_ptr is then set to, to be processed by
* the next call to gss_init_sec_context.
- *
+ *
* GSS-API guarantees that send_tok's length will be non-zero
* if and only if the server is expecting another token from us,
* and that gss_init_sec_context returns GSS_S_CONTINUE_NEEDED if
* and only if the server has another token to send us.
*/
-
+
token_ptr = GSS_C_NO_BUFFER;
*gss_context = GSS_C_NO_CONTEXT;
@@ -273,7 +273,7 @@ static int client_establish_context(s, service_name, gss_flags, auth_flag,
}
}
(void) gss_release_buffer(&min_stat, &send_tok);
-
+
if (maj_stat!=GSS_S_COMPLETE && maj_stat!=GSS_S_CONTINUE_NEEDED) {
display_status("initializing context", maj_stat,
init_sec_min_stat);
@@ -283,7 +283,7 @@ static int client_establish_context(s, service_name, gss_flags, auth_flag,
GSS_C_NO_BUFFER);
return -1;
}
-
+
if (maj_stat == GSS_S_CONTINUE_NEEDED) {
if (verbose)
printf("continue needed...");
@@ -313,7 +313,7 @@ static void read_file(file_name, in_buf)
{
int fd, count;
struct stat stat_buf;
-
+
if ((fd = open(file_name, O_RDONLY, 0)) < 0) {
perror("open");
fprintf(stderr, "Couldn't open file %s\n", file_name);
@@ -371,7 +371,7 @@ static void read_file(file_name, in_buf)
* Returns: 0 on success, -1 on failure
*
* Effects:
- *
+ *
* call_server opens a TCP connection to <host:port> and establishes a
* GSS-API context with service_name over the connection. It then
* seals msg in a GSS-API token with gss_wrap, sends it to the server,
@@ -605,7 +605,7 @@ static void parse_oid(char *mechanism, gss_OID *oid)
char *mechstr = 0, *cp;
gss_buffer_desc tok;
OM_uint32 maj_stat, min_stat;
-
+
if (isdigit((int) mechanism[0])) {
if (asprintf(&mechstr, "{ %s }", mechanism) < 0) {
fprintf(stderr, "Couldn't allocate mechanism scratch!\n");
@@ -773,13 +773,13 @@ int main(argc, argv)
argc--; argv++;
if (!argc) usage();
mechanism = *argv;
- }
+ }
#if defined(_WIN32) || 1
else if (strcmp(*argv, "-threads") == 0) {
argc--; argv++;
if (!argc) usage();
max_threads = atoi(*argv);
- }
+ }
#endif
else if (strcmp(*argv, "-d") == 0) {
gss_flags |= GSS_C_DELEG_FLAG;
@@ -871,7 +871,7 @@ int main(argc, argv)
if (oid != GSS_C_NULL_OID)
(void) gss_release_oid(&min_stat, &oid);
-
+
#ifdef _WIN32
CleanupHandles();
#else
diff --git a/src/tests/gss-threads/gss-misc.c b/src/tests/gss-threads/gss-misc.c
index 27a8af6a5..c456f4944 100644
--- a/src/tests/gss-threads/gss-misc.c
+++ b/src/tests/gss-threads/gss-misc.c
@@ -1,6 +1,6 @@
/*
* Copyright 1994 by OpenVision Technologies, Inc.
- *
+ *
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appears in all copies and
@@ -10,7 +10,7 @@
* without specific, written prior permission. OpenVision makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
- *
+ *
* OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
@@ -27,7 +27,7 @@
* require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
- *
+ *
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
@@ -184,8 +184,8 @@ int send_token(s, flags, tok)
return -1;
} else if (ret != 4) {
if (display_file)
- fprintf(display_file,
- "sending token length: %d of %d bytes written\n",
+ fprintf(display_file,
+ "sending token length: %d of %d bytes written\n",
ret, 4);
return -1;
}
@@ -196,12 +196,12 @@ int send_token(s, flags, tok)
return -1;
} else if (ret != tok->length) {
if (display_file)
- fprintf(display_file,
- "sending token data: %d of %d bytes written\n",
+ fprintf(display_file,
+ "sending token data: %d of %d bytes written\n",
ret, (int) tok->length);
return -1;
}
-
+
return 0;
}
@@ -219,7 +219,7 @@ int send_token(s, flags, tok)
* Returns: 0 on success, -1 on failure
*
* Effects:
- *
+ *
* recv_token reads the token flags (a single byte, even though
* they're stored into an integer, then reads the token length (as a
* network long), allocates memory to hold the data, and then reads
@@ -257,8 +257,8 @@ int recv_token(s, flags, tok)
return -1;
} else if (ret != 3) {
if (display_file)
- fprintf(display_file,
- "reading token length: %d of %d bytes read\n",
+ fprintf(display_file,
+ "reading token length: %d of %d bytes read\n",
ret, 3);
return -1;
}
@@ -270,8 +270,8 @@ int recv_token(s, flags, tok)
return -1;
} else if (ret != 4) {
if (display_file)
- fprintf(display_file,
- "reading token length: %d of %d bytes read\n",
+ fprintf(display_file,
+ "reading token length: %d of %d bytes read\n",
ret, 4);
return -1;
}
@@ -284,7 +284,7 @@ int recv_token(s, flags, tok)
tok->value = (char *) malloc(tok->length ? tok->length : 1);
if (tok->length && tok->value == NULL) {
if (display_file)
- fprintf(display_file,
+ fprintf(display_file,
"Out of memory allocating token data\n");
return -1;
}
@@ -295,7 +295,7 @@ int recv_token(s, flags, tok)
free(tok->value);
return -1;
} else if (ret != tok->length) {
- fprintf(stderr, "sending token data: %d of %d bytes written\n",
+ fprintf(stderr, "sending token data: %d of %d bytes written\n",
ret, (int) tok->length);
free(tok->value);
return -1;
@@ -312,7 +312,7 @@ static void display_status_1(m, code, type)
OM_uint32 maj_stat, min_stat;
gss_buffer_desc msg;
OM_uint32 msg_ctx;
-
+
msg_ctx = 0;
while (1) {
maj_stat = gss_display_status(&min_stat, code,
@@ -320,9 +320,9 @@ static void display_status_1(m, code, type)
&msg_ctx, &msg);
if (display_file)
fprintf(display_file, "GSS-API error %s: %s\n", m,
- (char *)msg.value);
+ (char *)msg.value);
(void) gss_release_buffer(&min_stat, &msg);
-
+
if (!msg_ctx)
break;
}
diff --git a/src/tests/gss-threads/gss-misc.h b/src/tests/gss-threads/gss-misc.h
index 35b3b7390..77d8190f9 100644
--- a/src/tests/gss-threads/gss-misc.h
+++ b/src/tests/gss-threads/gss-misc.h
@@ -1,6 +1,6 @@
/*
* Copyright 1994 by OpenVision Technologies, Inc.
- *
+ *
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appears in all copies and
@@ -10,7 +10,7 @@
* without specific, written prior permission. OpenVision makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
- *
+ *
* OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
diff --git a/src/tests/gss-threads/gss-server.c b/src/tests/gss-threads/gss-server.c
index bc22f83e5..a751bf209 100644
--- a/src/tests/gss-threads/gss-server.c
+++ b/src/tests/gss-threads/gss-server.c
@@ -1,6 +1,6 @@
/*
* Copyright 1994 by OpenVision Technologies, Inc.
- *
+ *
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appears in all copies and
@@ -10,7 +10,7 @@
* without specific, written prior permission. OpenVision makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
- *
+ *
* OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
@@ -27,7 +27,7 @@
* require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
- *
+ *
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
@@ -116,7 +116,7 @@ static int server_acquire_creds(service_name, server_creds)
name_buf.value = service_name;
name_buf.length = strlen(name_buf.value) + 1;
- maj_stat = gss_import_name(&min_stat, &name_buf,
+ maj_stat = gss_import_name(&min_stat, &name_buf,
(gss_OID) gss_nt_service_name, &server_name);
if (maj_stat != GSS_S_COMPLETE) {
display_status("importing name", maj_stat, min_stat);
@@ -159,7 +159,7 @@ static int server_acquire_creds(service_name, server_creds)
* in client_name and 0 is returned. If unsuccessful, an error
* message is displayed and -1 is returned.
*/
-static int server_establish_context(s, server_creds, context, client_name,
+static int server_establish_context(s, server_creds, context, client_name,
ret_flags)
int s;
gss_cred_id_t server_creds;
@@ -242,7 +242,7 @@ static int server_establish_context(s, server_creds, context, client_name,
GSS_C_NO_BUFFER);
return -1;
}
-
+
if (verbose && logfile) {
if (maj_stat == GSS_S_CONTINUE_NEEDED)
fprintf(logfile, "continue needed...\n");
@@ -309,7 +309,7 @@ static int create_socket(port)
struct sockaddr_in saddr;
int s;
int on = 1;
-
+
saddr.sin_family = AF_INET;
saddr.sin_port = htons(port);
saddr.sin_addr.s_addr = INADDR_ANY;
@@ -351,7 +351,7 @@ static int test_import_export_context(context)
OM_uint32 min_stat, maj_stat;
gss_buffer_desc context_token, copied_token;
struct timeval tm1, tm2;
-
+
/*
* Attempt to save and then restore the context.
*/
@@ -364,7 +364,7 @@ static int test_import_export_context(context)
gettimeofday(&tm2, (struct timezone *)0);
if (verbose && logfile)
fprintf(logfile, "Exported context: %d bytes, %7.4f seconds\n",
- (int) context_token.length,
+ (int) context_token.length,
timeval_subtract(&tm2, &tm1));
copied_token.length = context_token.length;
copied_token.value = malloc(context_token.length);
@@ -400,7 +400,7 @@ static int test_import_export_context(context)
* service_name (r) the ASCII name of the GSS-API service to
* establish a context as
* export (r) whether to test context exporting
- *
+ *
* Returns: -1 on error
*
* Effects:
@@ -506,7 +506,7 @@ static int sign_server(s, server_creds, export)
cp = msg_buf.value;
if ((isprint((int) cp[0]) || isspace((int) cp[0])) &&
(isprint((int) cp[1]) || isspace((int) cp[1]))) {
- fprintf(logfile, "\"%.*s\"\n", (int) msg_buf.length,
+ fprintf(logfile, "\"%.*s\"\n", (int) msg_buf.length,
(char *) msg_buf.value);
} else {
fprintf(logfile, "\n");
@@ -674,7 +674,7 @@ worker_bee(void * param)
struct _work_plan *work = (struct _work_plan *) param;
/* this return value is not checked, because there's
- * not really anything to do if it fails
+ * not really anything to do if it fails
*/
sign_server(work->s, work->server_creds, work->export);
closesocket(work->s);
@@ -709,13 +709,13 @@ main(argc, argv)
argc--; argv++;
if (!argc) usage();
port = atoi(*argv);
- }
+ }
#if defined _WIN32 || 1
else if (strcmp(*argv, "-threads") == 0) {
argc--; argv++;
if (!argc) usage();
max_threads = atoi(*argv);
- }
+ }
#endif
else if (strcmp(*argv, "-verbose") == 0) {
verbose = 1;
@@ -769,7 +769,7 @@ main(argc, argv)
if (server_acquire_creds(service_name, &server_creds) < 0)
return -1;
-
+
if (do_inetd) {
close(1);
close(2);
@@ -796,13 +796,13 @@ main(argc, argv)
perror("accepting connection");
continue;
}
-
+
work->server_creds = server_creds;
work->export = export;
if (max_threads == 1) {
worker_bee((void *)work);
- }
+ }
#if defined _WIN32 || 1
else {
if ( WaitAndIncrementThreadCounter() ) {