remove trailing whitespace

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2008-09-13 09:21:03 +00:00
parent e172367898
commit 6937d41a02
940 changed files with 23827 additions and 23827 deletions

View File

@@ -1,18 +1,18 @@
/*
* Copyright (c) 2006 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of KTH nor the names of its contributors may be
* used to endorse or promote products derived from this software without
@@ -62,8 +62,8 @@ add_list(char ****list, size_t *listlen, char **str, size_t len)
}
static void
permute(char ****list, size_t *listlen,
char **str, const int start, const int len)
permute(char ****list, size_t *listlen,
char **str, const int start, const int len)
{
int i, j;

View File

@@ -1,18 +1,18 @@
/*
* Copyright (c) 2006 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of KTH nor the names of its contributors may be
* used to endorse or promote products derived from this software without
@@ -37,7 +37,7 @@
#include <config.h>
#endif
/*
/*
* pthread support is disable because the pthread
* test have no "application pthread libflags" variable,
* when this is fixed pthread support can be enabled again.

View File

@@ -1,18 +1,18 @@
/*
* Copyright (c) 2006 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of KTH nor the names of its contributors may be
* used to endorse or promote products derived from this software without
@@ -61,9 +61,9 @@ static struct client **clients;
static int num_clients;
static int
init_sec_context(struct client *client,
init_sec_context(struct client *client,
int32_t *hContext, int32_t *hCred,
int32_t flags,
int32_t flags,
const char *targetname,
const krb5_data *itoken, krb5_data *otoken)
{
@@ -82,7 +82,7 @@ init_sec_context(struct client *client,
}
static int
accept_sec_context(struct client *client,
accept_sec_context(struct client *client,
int32_t *hContext,
int32_t flags,
const krb5_data *itoken,
@@ -103,7 +103,7 @@ accept_sec_context(struct client *client,
}
static int
acquire_cred(struct client *client,
acquire_cred(struct client *client,
const char *username,
const char *password,
int32_t flags,
@@ -120,7 +120,7 @@ acquire_cred(struct client *client,
}
static int
toast_resource(struct client *client,
toast_resource(struct client *client,
int32_t hCred)
{
int32_t val;
@@ -138,7 +138,7 @@ goodbye(struct client *client)
}
static int
get_targetname(struct client *client,
get_targetname(struct client *client,
char **target)
{
put32(client, eGetTargetName);
@@ -162,7 +162,7 @@ encrypt_token(struct client *client, int32_t hContext, int32_t flags,
}
static int32_t
decrypt_token(struct client *client, int32_t hContext, int flags,
decrypt_token(struct client *client, int32_t hContext, int flags,
krb5_data *in, krb5_data *out)
{
int32_t val;
@@ -192,7 +192,7 @@ get_mic(struct client *client, int32_t hContext,
}
static int32_t
verify_mic(struct client *client, int32_t hContext,
verify_mic(struct client *client, int32_t hContext,
krb5_data *in, krb5_data *mic)
{
int32_t val;
@@ -208,7 +208,7 @@ verify_mic(struct client *client, int32_t hContext,
static int32_t
get_version_capa(struct client *client,
get_version_capa(struct client *client,
int32_t *version, int32_t *capa,
char **version_str)
{
@@ -220,7 +220,7 @@ get_version_capa(struct client *client,
}
static int32_t
get_moniker(struct client *client,
get_moniker(struct client *client,
char **moniker)
{
put32(client, eGetMoniker);
@@ -310,7 +310,7 @@ build_context(struct client *ipeer, struct client *apeer,
case GSMERR_CONTINUE_NEEDED:
break;
default:
warnx("iPeer %s failed with %d (step %d)",
warnx("iPeer %s failed with %d (step %d)",
ipeer->name, (int)val, step);
goto out;
}
@@ -369,13 +369,13 @@ build_context(struct client *ipeer, struct client *apeer,
out:
return val;
}
static void
test_mic(struct client *c1, int32_t hc1, struct client *c2, int32_t hc2)
{
krb5_data msg, mic;
int32_t val;
msg.data = "foo";
msg.length = 3;
@@ -392,12 +392,12 @@ test_mic(struct client *c1, int32_t hc1, struct client *c2, int32_t hc2)
}
static int32_t
test_wrap(struct client *c1, int32_t hc1, struct client *c2, int32_t hc2,
test_wrap(struct client *c1, int32_t hc1, struct client *c2, int32_t hc2,
int conf)
{
krb5_data msg, wrapped, out;
int32_t val;
msg.data = "foo";
msg.length = 3;
@@ -476,9 +476,9 @@ log_function(void *ptr)
goto out;
if (krb5_ret_string(c->logsock, &string))
goto out;
printf("%s:%lu: %s\n",
printf("%s:%lu: %s\n",
file, (unsigned long)line, string);
fprintf(logfile, "%s:%lu: %s\n",
fprintf(logfile, "%s:%lu: %s\n",
file, (unsigned long)line, string);
fflush(logfile);
free(file);
@@ -510,7 +510,7 @@ connect_client(const char *slave)
*port++ = 0;
c->name = estrdup(slave);
memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
@@ -584,7 +584,7 @@ connect_client(const char *slave)
clients = erealloc(clients, (num_clients + 1) * sizeof(*clients));
clients[num_clients] = c;
num_clients++;
@@ -703,7 +703,7 @@ main(int argc, char **argv)
val = acquire_cred(clients[i], user, password, 1, &hCred);
if (val != GSMERR_OK) {
warnx("Failed to acquire_cred on host %s: %d",
warnx("Failed to acquire_cred on host %s: %d",
clients[i]->moniker, (int)val);
failed = 1;
} else
@@ -713,7 +713,7 @@ main(int argc, char **argv)
if (failed)
goto out;
/*
/*
* First test if all slaves can build context to them-self.
*/
@@ -732,8 +732,8 @@ main(int argc, char **argv)
val = acquire_cred(c, user, password, 1, &hCred);
if (val != GSMERR_OK)
errx(1, "failed to acquire_cred: %d", (int)val);
val = build_context(c, c,
val = build_context(c, c,
GSS_C_REPLAY_FLAG|GSS_C_SEQUENCE_FLAG|
GSS_C_INTEG_FLAG|GSS_C_CONF_FLAG|
GSS_C_DELEG_FLAG|GSS_C_MUTUAL_FLAG,
@@ -792,7 +792,7 @@ main(int argc, char **argv)
for (j = 1; j < num_clients + 1; j++) {
server = get_client(p[j % num_clients]);
if (server->target_name == NULL)
break;
@@ -809,11 +809,11 @@ main(int argc, char **argv)
warnx("build_context failed: %d", (int)val);
break;
}
val = test_token(client, clientC, server, serverC);
if (val)
break;
toast_resource(client, clientC);
toast_resource(server, serverC);
if (!delegCred) {
@@ -827,11 +827,11 @@ main(int argc, char **argv)
if (hCred)
toast_resource(client, hCred);
}
/*
* Close all connections to clients
*/
out:
printf("sending goodbye and waiting for log sockets\n");
for (i = 0; i < num_clients; i++) {

View File

@@ -1,18 +1,18 @@
/*
* Copyright (c) 2006 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of KTH nor the names of its contributors may be
* used to endorse or promote products derived from this software without
@@ -151,7 +151,7 @@ find_handle(struct handle *h, int32_t idx, enum handle_type type)
{
if (idx == 0)
return NULL;
while (h) {
if (h->idx == idx) {
if (type == h->type)
@@ -160,7 +160,7 @@ find_handle(struct handle *h, int32_t idx, enum handle_type type)
}
h = h->next;
}
return NULL;
return NULL;
}
@@ -237,7 +237,7 @@ acquire_cred(struct client *c,
ret = krb5_cc_initialize (context, id, cred.client);
if (ret)
krb5_err (context, 1, ret, "krb5_cc_initialize");
ret = krb5_cc_store_cred (context, id, &cred);
if (ret)
krb5_err (context, 1, ret, "krb5_cc_store_cred");
@@ -370,7 +370,7 @@ HandleOP(InitContext)
gss_target_name,
oid,
flags & 0x7f,
0,
0,
NULL,
input_token_ptr,
NULL,
@@ -382,7 +382,7 @@ HandleOP(InitContext)
del_handle(&c->handles, hContext);
new_context_id = 0;
logmessage(c, __FILE__, __LINE__, 0,
"gss_init_sec_context returns code: %d/%d",
"gss_init_sec_context returns code: %d/%d",
maj_stat, min_stat);
} else {
if (input_token.length == 0)
@@ -461,7 +461,7 @@ HandleOP(AcceptContext)
if (hContext != 0)
del_handle(&c->handles, hContext);
logmessage(c, __FILE__, __LINE__, 0,
"gss_accept_sec_context returns code: %d/%d",
"gss_accept_sec_context returns code: %d/%d",
maj_stat, min_stat);
new_context_id = 0;
} else {
@@ -484,8 +484,8 @@ HandleOP(AcceptContext)
gss_release_cred(&min_stat, &deleg_cred);
deleg_hcred = 0;
}
gsm_error = convert_gss_to_gsm(maj_stat);
put32(c, new_context_id);
@@ -534,11 +534,11 @@ HandleOP(AcquireCreds)
gsm_error = convert_krb5_to_gsm(ret);
goto out;
}
ret = krb5_get_init_creds_opt_alloc (context, &opt);
if (ret)
krb5_err(context, 1, ret, "krb5_get_init_creds_opt_alloc");
krb5_get_init_creds_opt_set_pa_password(context, opt, password, NULL);
gsm_error = acquire_cred(c, principal, opt, &handle);
@@ -580,22 +580,22 @@ HandleOP(Sign)
input_token.length = token.length;
input_token.value = token.data;
maj_stat = gss_get_mic(&min_stat, ctx, 0, &input_token,
&output_token);
if (maj_stat != GSS_S_COMPLETE)
errx(1, "gss_get_mic failed");
krb5_data_free(&token);
token.data = output_token.value;
token.length = output_token.length;
put32(c, 0); /* XXX fix gsm_error */
putdata(c, token);
gss_release_buffer(&min_stat, &output_token);
return 0;
}
@@ -621,7 +621,7 @@ HandleOP(Verify)
msg_token.length = msg.length;
msg_token.value = msg.data;
retdata(c, mic);
mic_token.length = mic.length;
@@ -631,12 +631,12 @@ HandleOP(Verify)
&mic_token, &qop);
if (maj_stat != GSS_S_COMPLETE)
errx(1, "gss_verify_mic failed");
krb5_data_free(&mic);
krb5_data_free(&msg);
put32(c, 0); /* XXX fix gsm_error */
return 0;
}
@@ -653,7 +653,7 @@ HandleOP(GetVersionAndCapabilities)
{
struct utsname ut;
if (uname(&ut) == 0) {
snprintf(name, sizeof(name), "%s-%s-%s",
snprintf(name, sizeof(name), "%s-%s-%s",
ut.sysname, ut.version, ut.machine);
}
}
@@ -663,7 +663,7 @@ HandleOP(GetVersionAndCapabilities)
put32(c, GSSMAGGOTPROTOCOL);
put32(c, cap);
putstring(c, str);
putstring(c, str);
free(str);
return 0;
@@ -711,12 +711,12 @@ HandleOP(SetLoggingSocket)
krb5_store_int32(c->logging, eLogSetMoniker);
store_string(c->logging, c->moniker);
logmessage(c, __FILE__, __LINE__, 0, "logging turned on");
return 0;
}
static int
HandleOP(ChangePassword)
@@ -751,22 +751,22 @@ HandleOP(Wrap)
input_token.length = token.length;
input_token.value = token.data;
maj_stat = gss_wrap(&min_stat, ctx, flags, 0, &input_token,
&conf_state, &output_token);
if (maj_stat != GSS_S_COMPLETE)
errx(1, "gss_wrap failed");
krb5_data_free(&token);
token.data = output_token.value;
token.length = output_token.length;
put32(c, 0); /* XXX fix gsm_error */
putdata(c, token);
gss_release_buffer(&min_stat, &output_token);
return 0;
}
@@ -793,10 +793,10 @@ HandleOP(Unwrap)
input_token.length = token.length;
input_token.value = token.data;
maj_stat = gss_unwrap(&min_stat, ctx, &input_token,
&output_token, &conf_state, &qop_state);
if (maj_stat != GSS_S_COMPLETE)
errx(1, "gss_unwrap failed: %d/%d", maj_stat, min_stat);
@@ -938,15 +938,15 @@ create_client(int fd, int port, const char *moniker)
c->salen = sizeof(c->sa);
getpeername(fd, (struct sockaddr *)&c->sa, &c->salen);
getnameinfo((struct sockaddr *)&c->sa, c->salen,
c->servername, sizeof(c->servername),
getnameinfo((struct sockaddr *)&c->sa, c->salen,
c->servername, sizeof(c->servername),
NULL, 0, NI_NUMERICHOST);
}
c->sock = krb5_storage_from_fd(fd);
if (c->sock == NULL)
errx(1, "krb5_storage_from_fd");
close(fd);
return c;
@@ -987,7 +987,7 @@ handleServer(void *ptr)
}
logmessage(c, __FILE__, __LINE__, 0,
"---> Got op %s from server %s",
"---> Got op %s from server %s",
handler->name, c->servername);
if ((handler->func)(handler->op, c))
@@ -1076,7 +1076,7 @@ main(int argc, char **argv)
fprintf(logfile, "connected\n");
{
struct client *c;
struct client *c;
c = create_client(0, port, moniker_str);
/* close(0); */

View File

@@ -1,18 +1,18 @@
/*
* Copyright (c) 2006 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of KTH nor the names of its contributors may be
* used to endorse or promote products derived from this software without
@@ -63,9 +63,9 @@ enum gssMaggotErrorCodes {
* int32: message OP (enum gssMaggotProtocol)
* ...
*
* return: -- on error
* return: -- on error
* int32: not support (GSMERR_NOT_SUPPORTED)
*
*
* return: -- on existing message OP
* int32: support (GSMERR_OK) -- only sent for extensions
* ...
@@ -75,28 +75,28 @@ enum gssMaggotErrorCodes {
enum gssMaggotOp {
eGetVersionInfo = 0,
/*
/*
* input:
* none
* return:
* int32: last version handled
* int32: last version handled
*/
eGoodBye,
/*
/*
* input:
* none
* return:
* close socket
*/
eInitContext,
/*
/*
* input:
* int32: hContext
* int32: hCred
* int32: Flags
* the lowest 0x7f flags maps directly to GSS-API flags
* DELEGATE 0x001
* MUTUAL_AUTH 0x002
* DELEGATE 0x001
* MUTUAL_AUTH 0x002
* REPLAY_DETECT 0x004
* SEQUENCE_DETECT 0x008
* CONFIDENTIALITY 0x010
@@ -115,7 +115,7 @@ enum gssMaggotOp {
* length-encoded: output token
*/
eAcceptContext,
/*
/*
* input:
* int32: hContext
* int32: Flags -- unused ?
@@ -229,7 +229,7 @@ enum gssMaggotOp {
* return1:
* int16: log port number
* int32: master log prototocol version (0)
*
*
* wait for master to connect on the master log socket
*
* return2: