From 7daf5226b74e14a6e0f1a888b0be26f3d246f9f8 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Fri, 4 Sep 2009 13:46:09 +0200 Subject: removed trailing spaces ([[:space:]]+$) --- scripts/bin2array.c | 2 +- scripts/bin2sql.c | 2 +- scripts/dh_speed.c | 24 ++++++++++++------------ scripts/id2sql.c | 4 ++-- scripts/key2keyid.c | 10 +++++----- scripts/keyid2sql.c | 10 +++++----- scripts/pubkey_speed.c | 26 +++++++++++++------------- scripts/thread_analysis.c | 22 +++++++++++----------- 8 files changed, 50 insertions(+), 50 deletions(-) (limited to 'scripts') diff --git a/scripts/bin2array.c b/scripts/bin2array.c index 4778b446a..5e0ad7c74 100644 --- a/scripts/bin2array.c +++ b/scripts/bin2array.c @@ -27,7 +27,7 @@ int main(int argc, char *argv[]) { break; } - } + } printf("};\n"); return 0; } diff --git a/scripts/bin2sql.c b/scripts/bin2sql.c index 4f83dd3f2..8bc72f842 100644 --- a/scripts/bin2sql.c +++ b/scripts/bin2sql.c @@ -18,7 +18,7 @@ int main(int argc, char *argv[]) break; } printf("%02x", (unsigned int)byte); - } + } printf("'\n"); return 0; } diff --git a/scripts/dh_speed.c b/scripts/dh_speed.c index 76dafe752..5a57badb6 100644 --- a/scripts/dh_speed.c +++ b/scripts/dh_speed.c @@ -38,7 +38,7 @@ static void start_timing(struct timespec *start) static double end_timing(struct timespec *start) { struct timespec end; - + clock_gettime(CLOCK_THREAD_CPUTIME_ID, &end); return (end.tv_nsec - start->tv_nsec) / 1000000000.0 + (end.tv_sec - start->tv_sec) * 1.0; @@ -50,7 +50,7 @@ static void run_test(diffie_hellman_group_t group, int rounds) chunk_t chunk; struct timespec timing; int round; - + r = lib->crypto->create_dh(lib->crypto, group); if (!r) { @@ -58,24 +58,24 @@ static void run_test(diffie_hellman_group_t group, int rounds) diffie_hellman_group_names, group); return; } - + printf("%N:\t", diffie_hellman_group_names, group); - + start_timing(&timing); for (round = 0; round < rounds; round++) { l[round] = lib->crypto->create_dh(lib->crypto, group); } printf("A = g^a/s: %8.1f", rounds / end_timing(&timing)); - + for (round = 0; round < rounds; round++) { l[round]->get_my_public_value(l[round], &chunk); r->set_other_public_value(r, chunk); chunk_free(&chunk); } - + r->get_my_public_value(r, &chunk); start_timing(&timing); for (round = 0; round < rounds; round++) @@ -84,7 +84,7 @@ static void run_test(diffie_hellman_group_t group, int rounds) } printf(" | S = B^a/s: %8.1f\n", rounds / end_timing(&timing)); chunk_free(&chunk); - + for (round = 0; round < rounds; round++) { l[round]->destroy(l[round]); @@ -95,22 +95,22 @@ static void run_test(diffie_hellman_group_t group, int rounds) int main(int argc, char *argv[]) { int rounds, i, j; - + if (argc < 4) { usage(); } - + library_init(STRONGSWAN_CONF); lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR, argv[1]); atexit(library_deinit); - + rounds = atoi(argv[2]); - + for (i = 3; i < argc; i++) { bool found = FALSE; - + for (j = 0; j < countof(groups); j++) { if (streq(groups[j].name, argv[i])) diff --git a/scripts/id2sql.c b/scripts/id2sql.c index 5b0bd1d7d..5bc94f5b6 100644 --- a/scripts/id2sql.c +++ b/scripts/id2sql.c @@ -10,7 +10,7 @@ int main(int argc, char *argv[]) identification_t *id; chunk_t enc; int i; - + if (argc < 2) { return -1; @@ -29,7 +29,7 @@ int main(int argc, char *argv[]) for (i = 0; i < enc.len; i++) { printf("%02x", (unsigned int)enc.ptr[i]); - } + } printf("'\n"); return 0; } diff --git a/scripts/key2keyid.c b/scripts/key2keyid.c index e32c2baf3..cc3e0b18b 100644 --- a/scripts/key2keyid.c +++ b/scripts/key2keyid.c @@ -15,7 +15,7 @@ int main(int argc, char *argv[]) chunk_t chunk; char buf[8096]; int read; - + library_init(NULL); lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR, PLUGINS); atexit(library_deinit); @@ -26,9 +26,9 @@ int main(int argc, char *argv[]) fprintf(stderr, "reading key failed.\n"); return -1; } - + chunk = chunk_create(buf, read); - + private = lib->creds->create(lib->creds, CRED_PRIVATE_KEY, KEY_RSA, BUILD_BLOB_PEM, chunk_clone(chunk), BUILD_END); @@ -52,7 +52,7 @@ int main(int argc, char *argv[]) private->destroy(private); return 0; } - + public = lib->creds->create(lib->creds, CRED_PUBLIC_KEY, KEY_ANY, BUILD_BLOB_PEM, chunk_clone(chunk), BUILD_END); @@ -82,7 +82,7 @@ int main(int argc, char *argv[]) public->destroy(public); return 0; } - + fprintf(stderr, "unable to parse input key.\n"); return -1; } diff --git a/scripts/keyid2sql.c b/scripts/keyid2sql.c index 2ec011950..bf952170d 100644 --- a/scripts/keyid2sql.c +++ b/scripts/keyid2sql.c @@ -15,7 +15,7 @@ int main(int argc, char *argv[]) chunk_t chunk; char buf[8096]; int read, n; - + library_init(NULL); lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR, PLUGINS); atexit(library_deinit); @@ -26,9 +26,9 @@ int main(int argc, char *argv[]) fprintf(stderr, "reading key failed.\n"); return -1; } - + chunk = chunk_create(buf, read); - + private = lib->creds->create(lib->creds, CRED_PRIVATE_KEY, KEY_RSA, BUILD_BLOB_PEM, chunk_clone(chunk), BUILD_END); @@ -46,7 +46,7 @@ int main(int argc, char *argv[]) private->destroy(private); return 0; } - + public = lib->creds->create(lib->creds, CRED_PUBLIC_KEY, KEY_ANY, BUILD_BLOB_PEM, chunk_clone(chunk), BUILD_END); @@ -70,7 +70,7 @@ int main(int argc, char *argv[]) public->destroy(public); return 0; } - + fprintf(stderr, "unable to parse input key.\n"); return -1; } diff --git a/scripts/pubkey_speed.c b/scripts/pubkey_speed.c index 120ca858c..99075d251 100644 --- a/scripts/pubkey_speed.c +++ b/scripts/pubkey_speed.c @@ -13,7 +13,7 @@ void start_timing(struct timespec *start) double end_timing(struct timespec *start) { struct timespec end; - + clock_gettime(CLOCK_THREAD_CPUTIME_ID, &end); return (end.tv_nsec - start->tv_nsec) / 1000000000.0 + (end.tv_sec - start->tv_sec) * 1.0; @@ -37,14 +37,14 @@ int main(int argc, char *argv[]) key_type_t type = KEY_ANY; signature_scheme_t scheme = SIGN_UNKNOWN; chunk_t keydata, *sigs, data = chunk_from_buf(data_buf); - + if (argc < 4) { usage(); } - + rounds = atoi(argv[3]); - + if (streq(argv[2], "rsa")) { type = KEY_RSA; @@ -58,18 +58,18 @@ int main(int argc, char *argv[]) { usage(); } - + library_init(STRONGSWAN_CONF); lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR, argv[1]); atexit(library_deinit); - + keydata = chunk_create(buf, 0); while ((read = fread(pos, 1, sizeof(buf) - (pos - buf), stdin))) { pos += read; keydata.len += read; } - + private = lib->creds->create(lib->creds, CRED_PRIVATE_KEY, type, BUILD_BLOB_PEM, keydata, BUILD_END); if (!private) @@ -82,7 +82,7 @@ int main(int argc, char *argv[]) switch (private->get_keysize(private)) { case 32: - scheme = SIGN_ECDSA_256; + scheme = SIGN_ECDSA_256; break; case 48: scheme = SIGN_ECDSA_384; @@ -96,12 +96,12 @@ int main(int argc, char *argv[]) exit(1); } } - + printf("%4d bit %N: ", private->get_keysize(private)*8, key_type_names, type); - + sigs = malloc(sizeof(chunk_t) * rounds); - + start_timing(&timing); for (round = 0; round < rounds; round++) { @@ -112,7 +112,7 @@ int main(int argc, char *argv[]) } }; printf("sign()/s: %8.1f ", rounds / end_timing(&timing)); - + public = private->get_public_key(private); if (!public) { @@ -131,7 +131,7 @@ int main(int argc, char *argv[]) printf("verify()/s: %8.1f\n", rounds / end_timing(&timing)); public->destroy(public); private->destroy(private); - + for (round = 0; round < rounds; round++) { free(sigs[round].ptr); diff --git a/scripts/thread_analysis.c b/scripts/thread_analysis.c index 53cd04359..7670ce1f8 100644 --- a/scripts/thread_analysis.c +++ b/scripts/thread_analysis.c @@ -1,5 +1,5 @@ /* Analyzes the concurrent use of charon's threads - * + * * Copyright (C) 2008 Andreas Steffen * Hochschule fuer Technik Rapperswil * @@ -52,7 +52,7 @@ static int readline(FILE *fd, char *line) *line = '\0'; return 1; } - line++; + line++; } *line = '\0'; return 0; @@ -69,14 +69,14 @@ static void printline(state_t *state, char *timestamp) for (th = 1; th <= THREADS; th++) { states[state[th]]++; - printf("", state_names[state[th]]); + printf("", state_names[state[th]]); } total = states[STATE_INIT] + states[STATE_AUTH] + states[STATE_BUSY] + states[STATE_RETRY]; printf("%d%d%d", states[STATE_INIT], states[STATE_AUTH], total); for (th = 10; th <= (THREADS + 2); th += 5) { - printf("", (th <= total + 2)? "busy":"idle"); + printf("", (th <= total + 2)? "busy":"idle"); } printf("\n"); printf(" \n"); @@ -91,13 +91,13 @@ int main(int argc, char *argv[]) FILE *fd; state_t state[THREADS + 1]; - + /* threads 1..5 and 9 are always busy */ for (th = 1; th <= THREADS; th++) { state[th] = (th <= 7 && th != 3)? STATE_BUSY : STATE_IDLE; } - + /* open the log file */ fd = fopen(LOGFILE, "r"); if (!fd) @@ -135,16 +135,16 @@ int main(int argc, char *argv[]) printf(" Timestamp"); for (th = 1 ; th <= THREADS; th++) { - printf("%02d", th); + printf("%02d", th); } printf("IAB"); for (th = 10; th <= (THREADS + 2); th += 5) { - printf("%d", (th == 100)? 99:th); + printf("%d", (th == 100)? 99:th); } printf("\n"); printf(" \n"); - + while (readline(fd, line)) { char *p_section, *p_charon, *p_thread, *p_log; @@ -170,7 +170,7 @@ int main(int argc, char *argv[]) { continue; } - + /* determine thread */ p_thread = p_charon + 8; th = atol(p_thread); @@ -268,6 +268,6 @@ int main(int argc, char *argv[]) printf("\n"); printf("\n"); - fclose(fd); + fclose(fd); return 0; } -- cgit v1.2.3