diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/Makefile.am | 15 | ||||
-rwxr-xr-x | tools/addgnupghome | 4 | ||||
-rwxr-xr-x | tools/applygnupgdefaults | 5 | ||||
-rw-r--r-- | tools/ccidmon.c | 36 | ||||
-rw-r--r-- | tools/clean-sat.c | 1 | ||||
-rw-r--r-- | tools/mk-tdata.c | 4 | ||||
-rw-r--r-- | tools/no-libgcrypt.c | 12 | ||||
-rw-r--r-- | tools/rfc822parse.c | 42 | ||||
-rw-r--r-- | tools/rfc822parse.h | 8 | ||||
-rw-r--r-- | tools/sockprox.c | 8 | ||||
-rw-r--r-- | tools/symcryptrun.c | 32 |
11 files changed, 82 insertions, 85 deletions
diff --git a/tools/Makefile.am b/tools/Makefile.am index 323e11433..584967040 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,18 +1,18 @@ # Makefile.am - Tools directory # Copyright (C) 2003, 2007 Free Software Foundation, Inc. -# +# # This file is part of GnuPG. -# +# # GnuPG is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. -# +# # GnuPG is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, see <http://www.gnu.org/licenses/>. @@ -76,7 +76,7 @@ maybe_commonpth_libs = $(common_libs) endif if HAVE_W32CE_SYSTEM -pwquery_libs = +pwquery_libs = else pwquery_libs = ../common/libsimple-pwquery.a endif @@ -99,14 +99,14 @@ gpgconf_LDADD = $(maybe_commonpth_libs) $(opt_libassuan_libs) \ gpgconf_LDFLAGS = $(extra_bin_ldflags) gpgparsemail_SOURCES = gpgparsemail.c rfc822parse.c rfc822parse.h -gpgparsemail_LDADD = +gpgparsemail_LDADD = symcryptrun_SOURCES = symcryptrun.c symcryptrun_LDADD = $(LIBUTIL_LIBS) $(common_libs) $(pwquery_libs) \ $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) $(LIBINTL) \ $(LIBICONV) $(NETLIBS) $(W32SOCKLIBS) -watchgnupg_SOURCES = watchgnupg.c +watchgnupg_SOURCES = watchgnupg.c watchgnupg_LDADD = $(NETLIBS) gpg_connect_agent_SOURCES = gpg-connect-agent.c no-libgcrypt.c @@ -146,4 +146,3 @@ gpgtar_LDADD = $(common_libs) $(GPG_ERROR_LIBS) $(NETLIBS) $(W32SOCKLIBS) # Make sure that all libs are build before we use them. This is # important for things like make -j2. $(PROGRAMS): $(common_libs) $(pwquery_libs) ../common/libgpgrl.a - diff --git a/tools/addgnupghome b/tools/addgnupghome index fb032b674..e13c3cd01 100755 --- a/tools/addgnupghome +++ b/tools/addgnupghome @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh # Add a new .gnupg home directory for a list of users -*- sh -*- # # Copyright 2004 Free Software Foundation, Inc. @@ -89,7 +89,7 @@ one_user () { } -if [ -z "$1" ]; then +if [ -z "$1" ]; then echo "usage: $PGM userids" exit 1 fi diff --git a/tools/applygnupgdefaults b/tools/applygnupgdefaults index b4cff6390..2f298541b 100755 --- a/tools/applygnupgdefaults +++ b/tools/applygnupgdefaults @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh # Apply defaults from /etc/gnupg/gpg.conf to all users -*- sh -*- # # Copyright 2007 Free Software Foundation, Inc. @@ -23,7 +23,7 @@ info () { echo "$PGM: $*" >&2 } -if [ -n "$1" ]; then +if [ -n "$1" ]; then echo "usage: $PGM" >&2 exit 1 fi @@ -79,4 +79,3 @@ done [ "$(wc -c <$errorfile)" -gt 0 ] && exit 1 exit 0 - diff --git a/tools/ccidmon.c b/tools/ccidmon.c index b8546407e..f632c0d85 100644 --- a/tools/ccidmon.c +++ b/tools/ccidmon.c @@ -52,7 +52,7 @@ static int debug; static int skip_escape; static int usb_bus, usb_dev; static int sniffusb; - + /* Error counter. */ static int any_error; @@ -142,19 +142,19 @@ err (const char *format, ...) /* Convert a little endian stored 4 byte value into an unsigned integer. */ -static unsigned int +static unsigned int convert_le_u32 (const unsigned char *buf) { - return buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24); + return buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24); } /* Convert a little endian stored 2 byte value into an unsigned integer. */ -static unsigned int +static unsigned int convert_le_u16 (const unsigned char *buf) { - return buf[0] | (buf[1] << 8); + return buf[0] | (buf[1] << 8); } @@ -182,7 +182,7 @@ print_pr_data (const unsigned char *data, size_t datalen, size_t off) putchar ('\n'); } - + static void print_p2r_header (const char *name, const unsigned char *msg, size_t msglen) { @@ -359,7 +359,7 @@ print_p2r_unknown (const unsigned char *msg, size_t msglen) { char buf[100]; - snprintf (buf, sizeof buf, "Unknown PC_to_RDR command 0x%02X", + snprintf (buf, sizeof buf, "Unknown PC_to_RDR command 0x%02X", msglen? msg[0]:0); print_p2r_header (buf, msg, msglen); if (msglen < 10) @@ -466,7 +466,7 @@ print_r2p_slotstatus (const unsigned char *msg, size_t msglen) msg[9] == 3? " (stopped)":""); print_pr_data (msg, msglen, 10); } - + static void print_r2p_parameters (const unsigned char *msg, size_t msglen) @@ -527,7 +527,7 @@ print_r2p_unknown (const unsigned char *msg, size_t msglen) { char buf[100]; - snprintf (buf, sizeof buf, "Unknown RDR_to_PC command 0x%02X", + snprintf (buf, sizeof buf, "Unknown RDR_to_PC command 0x%02X", msglen? msg[0]:0); print_r2p_header (buf, msg, msglen); if (msglen < 10) @@ -571,7 +571,7 @@ flush_data (void) { if (!databuffer.count) return; - + if (verbose) printf ("Address: %s\n", databuffer.address); if (databuffer.is_bi) @@ -684,7 +684,7 @@ parse_line (char *line, unsigned int lineno) p = strtok (NULL, " "); if (!p) return; /* No data length. */ - + datatag = strtok (NULL, " "); if (datatag && *datatag == '=') { @@ -707,10 +707,10 @@ parse_line_sniffusb (char *line, unsigned int lineno) return; p = strtok (NULL, " \t"); if (!p) - return; + return; p = strtok (NULL, " \t"); if (!p) - return; + return; if (hexdigitp (p[0]) && hexdigitp (p[1]) && hexdigitp (p[2]) && hexdigitp (p[3]) @@ -718,7 +718,7 @@ parse_line_sniffusb (char *line, unsigned int lineno) { size_t length; unsigned int value; - + length = databuffer.count; while ((p=strtok (NULL, " \t"))) { @@ -791,7 +791,7 @@ parse_input (FILE *fp) } -int +int main (int argc, char **argv) { int last_argc = -1; @@ -845,7 +845,7 @@ main (int argc, char **argv) sniffusb = 1; argc--; argv++; } - } + } if (argc && sniffusb) die ("no arguments expected when using --sniffusb\n"); @@ -855,14 +855,14 @@ main (int argc, char **argv) if (argc == 1) { const char *s = strchr (argv[0], ':'); - + usb_bus = atoi (argv[0]); if (s) usb_dev = atoi (s+1); if (usb_bus < 1 || usb_bus > 999 || usb_dev < 1 || usb_dev > 999) die ("invalid bus:dev specified"); } - + signal (SIGPIPE, SIG_IGN); diff --git a/tools/clean-sat.c b/tools/clean-sat.c index 4b44a7bcd..4848f97f6 100644 --- a/tools/clean-sat.c +++ b/tools/clean-sat.c @@ -33,4 +33,3 @@ main(int argc, char **argv) return 0; } - diff --git a/tools/mk-tdata.c b/tools/mk-tdata.c index 9328dc12a..b19796110 100644 --- a/tools/mk-tdata.c +++ b/tools/mk-tdata.c @@ -44,12 +44,12 @@ main(int argc, char **argv) argc -= 2; argv += 2; } - + limit = argc ? atoi(argv[0]) : 0; srand(getpid()); - for (i=0; !limit || i < limit; i++ ) + for (i=0; !limit || i < limit; i++ ) { if (char_mode) { diff --git a/tools/no-libgcrypt.c b/tools/no-libgcrypt.c index e4b304a51..496757647 100644 --- a/tools/no-libgcrypt.c +++ b/tools/no-libgcrypt.c @@ -4,7 +4,7 @@ * This file is free software; as a special exception the author gives * unlimited permission to copy and/or distribute it, with or without * modifications, as long as this notice is preserved. - * + * * This file is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY, to the extent permitted by law; without even * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR @@ -115,28 +115,28 @@ gcry_free (void *a) /* We need this dummy because exechelp.c uses gcry_control to terminate the secure memeory. */ -gcry_error_t +gcry_error_t gcry_control (enum gcry_ctl_cmds cmd, ...) { (void)cmd; return 0; } -void +void gcry_set_outofcore_handler (gcry_handler_no_mem_t h, void *opaque) { (void)h; (void)opaque; } -void +void gcry_set_fatalerror_handler (gcry_handler_error_t fnc, void *opaque) { (void)fnc; (void)opaque; } -void +void gcry_set_log_handler (gcry_handler_log_t f, void *opaque) { (void)f; @@ -149,7 +149,7 @@ gcry_create_nonce (void *buffer, size_t length) { (void)buffer; (void)length; - + log_fatal ("unexpected call to gcry_create_nonce\n"); } diff --git a/tools/rfc822parse.c b/tools/rfc822parse.c index 8fbe3c283..dd8b31601 100644 --- a/tools/rfc822parse.c +++ b/tools/rfc822parse.c @@ -6,12 +6,12 @@ * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 3 of * the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, see <http://www.gnu.org/licenses/>. */ @@ -105,7 +105,7 @@ length_sans_trailing_ws (const unsigned char *line, size_t len) { const unsigned char *p, *mark; size_t n; - + for (mark=NULL, p=line, n=0; n < len; n++, p++) { if (strchr (" \t\r\n", *p )) @@ -116,8 +116,8 @@ length_sans_trailing_ws (const unsigned char *line, size_t len) else mark = NULL; } - - if (mark) + + if (mark) return mark - line; return len; } @@ -160,7 +160,7 @@ stpcpy (char *a,const char *b) while (*b) *a++ = *b++; *a = 0; - + return (char*)a; } #endif @@ -356,10 +356,10 @@ transition_to_body (rfc822parse_t msg) { assert (!msg->current_part->boundary); msg->current_part->boundary = malloc (strlen (s) + 1); - if (msg->current_part->boundary) + if (msg->current_part->boundary) { part_t part; - + strcpy (msg->current_part->boundary, s); msg->boundary = msg->current_part->boundary; part = new_part (); @@ -428,7 +428,7 @@ insert_header (rfc822parse_t msg, const unsigned char *line, size_t length) hdr->cont = (*line == ' ' || *line == '\t'); memcpy (hdr->line, line, length); hdr->line[length] = 0; /* Make it a string. */ - + /* Transform a field name into canonical format. */ if (!hdr->cont && strchr (line, ':')) capitalize_header_name (hdr->line); @@ -490,7 +490,7 @@ insert_body (rfc822parse_t msg, const unsigned char *line, size_t length) int rfc822parse_insert (rfc822parse_t msg, const unsigned char *line, size_t length) { - return (msg->in_body + return (msg->in_body ? insert_body (msg, line, length) : insert_header (msg, line, length)); } @@ -516,11 +516,11 @@ rfc822parse_finish (rfc822parse_t msg) * WHICH gives the mode: * -1 := Take the last occurence * n := Take the n-th one. - * + * * Returns a newly allocated buffer or NULL on error. errno is set in * case of a memory failure or set to 0 if the requested field is not * available. - * + * * If VALUEOFF is not NULL it will receive the offset of the first non * space character in the value part of the line (i.e. after the first * colon). @@ -589,7 +589,7 @@ rfc822parse_enum_header_lines (rfc822parse_t msg, void **context) HDR_LINE l; if (!msg) /* Close. */ - return NULL; + return NULL; if (*context == msg || !msg->current_part) return NULL; @@ -760,7 +760,7 @@ parse_field (HDR_LINE hdr) static const char tspecials[] = "/?=<>@,;:\\[]\"()"; static const char tspecials2[] = "/?=<>@.,;:"; /* FIXME: really include '.'?*/ - static struct + static struct { const unsigned char *name; size_t namelen; @@ -871,13 +871,13 @@ parse_field (HDR_LINE hdr) else if (*s2 == '\\' && s2[1]) /* what about continuation? */ s2++; } - + t = (t ? append_to_token (t, s, s2 - s) : new_token (term == '\"'? tQUOTED : tDOMAINLIT, s, s2 - s)); if (!t) goto failure; - + if (*s2 || !hdr->next || !hdr->next->cont) break; hdr = hdr->next; @@ -1007,10 +1007,10 @@ is_parameter (TOKEN t) Returns a pointer to the value which is valid as long as the parse context is valid; NULL is returned in case that attr is not defined in the header, a missing value is reppresented by an empty string. - + With LOWER_VALUE set to true, a matching field valuebe be lowercased. - + Note, that ATTR should be lowercase. */ const char * @@ -1115,7 +1115,7 @@ dump_structure (rfc822parse_t msg, part_t part, int indent) part_t save_part; /* ugly hack - we should have a function to get part inforation. */ const char *s; - + save_part = msg->current_part; msg->current_part = part; ctx = rfc822parse_parse_field (msg, "Content-Type", -1); @@ -1141,7 +1141,7 @@ dump_structure (rfc822parse_t msg, part_t part, int indent) if (part->down) dump_structure (msg, part->down, indent + 1); } - + } @@ -1211,7 +1211,7 @@ msg_cb (void *dummy_arg, rfc822parse_event_t event, rfc822parse_t msg) } else printf ("*** media: text/plain [assumed]\n"); - + } diff --git a/tools/rfc822parse.h b/tools/rfc822parse.h index 12699d5e8..8bb5536a1 100644 --- a/tools/rfc822parse.h +++ b/tools/rfc822parse.h @@ -6,12 +6,12 @@ * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 3 of * the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, see <http://www.gnu.org/licenses/>. */ @@ -22,7 +22,7 @@ struct rfc822parse_context; typedef struct rfc822parse_context *rfc822parse_t; -typedef enum +typedef enum { RFC822PARSE_OPEN = 1, RFC822PARSE_CLOSE, @@ -37,7 +37,7 @@ typedef enum RFC822PARSE_BEGIN_HEADER, RFC822PARSE_PREAMBLE, RFC822PARSE_EPILOGUE - } + } rfc822parse_event_t; struct rfc822parse_field_context; diff --git a/tools/sockprox.c b/tools/sockprox.c index fe8d320a1..38648f066 100644 --- a/tools/sockprox.c +++ b/tools/sockprox.c @@ -15,7 +15,7 @@ * along with this program; if not, see <http://www.gnu.org/licenses/>. */ -/* Hacked by Moritz Schulte <[email protected]>. +/* Hacked by Moritz Schulte <[email protected]>. Usage example: @@ -24,10 +24,10 @@ sockprox opens a new local socket (here "mysock"); the whole traffic between server and client is written to "/tmp/prot" in this case. - + ./sockprox --server /tmp/gpg-PKdD8r/S.gpg-agent.ssh \ --listen mysock --protocol /tmp/prot - + Then, redirect your ssh-agent client to sockprox by setting SSH_AUTH_SOCK to "mysock". */ @@ -441,7 +441,7 @@ run_proxy (void) /* ? */ out: - + pthread_attr_destroy (&thread_attr); fclose (protocol_file); /* FIXME, err checking. */ diff --git a/tools/symcryptrun.c b/tools/symcryptrun.c index 438ed459c..1d882a1d5 100644 --- a/tools/symcryptrun.c +++ b/tools/symcryptrun.c @@ -152,9 +152,9 @@ static ARGPARSE_OPTS opts[] = { oDecrypt, "decrypt", 0, N_("decryption modus") }, { oEncrypt, "encrypt", 0, N_("encryption modus") }, - + { 302, NULL, 0, N_("@\nOptions:\n ") }, - + { oClass, "class", 2, N_("tool class (confucius)") }, { oProgram, "program", 2, N_("program filename") }, @@ -167,7 +167,7 @@ static ARGPARSE_OPTS opts[] = /* Hidden options. */ { oNoVerbose, "no-verbose", 0, "@" }, - { oHomedir, "homedir", 2, "@" }, + { oHomedir, "homedir", 2, "@" }, { oNoOptions, "no-options", 0, "@" },/* shortcut for --options /dev/null */ {0} @@ -253,10 +253,10 @@ remove_file (char *name, int shred) if (pid == 0) { /* Child. */ - + /* -f forces file to be writable, and -u unlinks it afterwards. */ char *args[] = { SHRED, "-uf", name, NULL }; - + execv (SHRED, args); _exit (127); } @@ -268,11 +268,11 @@ remove_file (char *name, int shred) else { /* Parent. */ - + if (TEMP_FAILURE_RETRY (waitpid (pid, &status, 0)) != pid) status = -1; } - + if (!WIFEXITED (status)) { log_error (_("%s on %s aborted with status %i\n"), @@ -433,7 +433,7 @@ confucius_get_pass (const char *cacheid, int again, int *canceled) if (canceled) *canceled = 0; - + orig_codeset = i18n_switchto_utf8 (); pw = simple_pwquery (cacheid, again ? _("does not match - try again"):NULL, @@ -451,7 +451,7 @@ confucius_get_pass (const char *cacheid, int again, int *canceled) log_info (_("cancelled\n")); if (canceled) *canceled = 1; - } + } } return pw; @@ -560,7 +560,7 @@ confucius_process (int mode, char *infile, char *outfile, free (args); return 1; } - else if (pid == 0) + else if (pid == 0) { /* Child. */ @@ -633,7 +633,7 @@ confucius_process (int mode, char *infile, char *outfile, close (cstderr[0]); return 1; } - else + else { char *newline; @@ -859,7 +859,7 @@ confucius_main (int mode, int argc, char *argv[]) rmdir (tmpdir); return res; } - + remove_file (outfile, mode == oDecrypt); if (infile_from_stdin) remove_file (infile, mode == oEncrypt); @@ -879,7 +879,7 @@ main (int argc, char **argv) char **orig_argv; FILE *configfp = NULL; char *configname = NULL; - unsigned configlineno; + unsigned configlineno; int mode = 0; int res; char *logfile = NULL; @@ -916,7 +916,7 @@ main (int argc, char **argv) if (default_config) configname = make_filename (opt.homedir, "symcryptrun.conf", NULL ); - + argc = orig_argc; argv = orig_argv; pargs.argc = &argc; @@ -935,7 +935,7 @@ main (int argc, char **argv) configname, strerror(errno) ); exit(1); } - xfree (configname); + xfree (configname); configname = NULL; } default_config = 0; @@ -952,7 +952,7 @@ main (int argc, char **argv) case oQuiet: opt.quiet = 1; break; case oVerbose: opt.verbose++; break; case oNoVerbose: opt.verbose = 0; break; - + case oClass: opt.class = pargs.r.ret_str; break; case oProgram: opt.program = pargs.r.ret_str; break; case oKeyfile: opt.keyfile = pargs.r.ret_str; break; |