aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
Diffstat (limited to 'g10')
-rw-r--r--g10/Makefile.am12
-rw-r--r--g10/armor.c28
-rw-r--r--g10/call-agent.c118
-rw-r--r--g10/call-agent.h6
-rw-r--r--g10/call-dirmngr.c32
-rw-r--r--g10/call-dirmngr.h2
-rw-r--r--g10/card-util.c107
-rw-r--r--g10/cipher.c4
-rw-r--r--g10/comment.c2
-rw-r--r--g10/compress-bz2.c2
-rw-r--r--g10/compress.c6
-rw-r--r--g10/cpr.c66
-rw-r--r--g10/dearmor.c2
-rw-r--r--g10/decrypt.c14
-rw-r--r--g10/delkey.c4
-rw-r--r--g10/exec.c16
-rw-r--r--g10/filter.h2
-rw-r--r--g10/free-packet.c16
-rw-r--r--g10/getkey.c22
-rw-r--r--g10/gpg.c194
-rw-r--r--g10/gpg.h84
-rw-r--r--g10/gpgv.c63
-rw-r--r--g10/helptext.c4
-rw-r--r--g10/kbnode.c10
-rw-r--r--g10/keydb.c88
-rw-r--r--g10/keydb.h8
-rw-r--r--g10/keyedit.c52
-rw-r--r--g10/keylist.c18
-rw-r--r--g10/keyring.c202
-rw-r--r--g10/main.h8
-rw-r--r--g10/mainproc.c68
-rw-r--r--g10/mdfilter.c1
-rw-r--r--g10/openfile.c30
-rw-r--r--g10/options.h10
-rw-r--r--g10/options.skel5
-rw-r--r--g10/packet.h16
-rw-r--r--g10/parse-packet.c27
-rw-r--r--g10/photoid.c4
-rw-r--r--g10/pkclist.c132
-rw-r--r--g10/plaintext.c12
-rw-r--r--g10/progress.c4
-rw-r--r--g10/revoke.c18
-rw-r--r--g10/rmd160.c16
-rw-r--r--g10/seckey-cert.c9
-rw-r--r--g10/server.c43
-rw-r--r--g10/sig-check.c20
-rw-r--r--g10/signal.c2
-rw-r--r--g10/skclist.c6
-rw-r--r--g10/t-rmd160.c7
-rw-r--r--g10/tdbdump.c14
-rw-r--r--g10/tdbio.c7
-rw-r--r--g10/tdbio.h4
-rw-r--r--g10/trustdb.c176
-rw-r--r--g10/verify.c9
54 files changed, 906 insertions, 926 deletions
diff --git a/g10/Makefile.am b/g10/Makefile.am
index a28b2ab50..56d5d10a4 100644
--- a/g10/Makefile.am
+++ b/g10/Makefile.am
@@ -7,12 +7,12 @@
# 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/>.
@@ -21,13 +21,13 @@
EXTRA_DIST = options.skel
AM_CPPFLAGS = -I$(top_srcdir)/gl -I$(top_srcdir)/common \
- -I$(top_srcdir)/include -I$(top_srcdir)/intl
+ -I$(top_srcdir)/include -I$(top_srcdir)/intl
include $(top_srcdir)/am/cmacros.am
AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(LIBASSUAN_CFLAGS) $(GPG_ERROR_CFLAGS)
-needed_libs = $(libcommon) ../gl/libgnu.a
+needed_libs = $(libcommon) ../gl/libgnu.a
bin_PROGRAMS = gpg2
if !HAVE_W32CE_SYSTEM
@@ -130,7 +130,7 @@ gpgv2_LDADD = $(LDADD) $(LIBGCRYPT_LIBS) $(LIBASSUAN_LIBS) $(GPG_ERROR_LIBS) \
$(LIBICONV) $(extra_sys_libs)
gpgv2_LDFLAGS = $(extra_bin_ldflags)
-t_common_ldadd =
+t_common_ldadd =
module_tests = t-rmd160
t_rmd160_SOURCES = t-rmd160.c rmd160.c
t_rmd160_LDADD = $(t_common_ldadd)
@@ -144,7 +144,7 @@ install-data-local:
$(DESTDIR)$(pkgdatadir)/gpg-conf.skel
uninstall-local:
- -@rm $(DESTDIR)$(pkgdatadir)/gpg-conf.skel
+ -@rm $(DESTDIR)$(pkgdatadir)/gpg-conf.skel
# There has never been a gpg for WindowsCE, thus we don't need a gpg2 here
diff --git a/g10/armor.c b/g10/armor.c
index a6195fc3d..3948916fb 100644
--- a/g10/armor.c
+++ b/g10/armor.c
@@ -147,7 +147,7 @@ release_armor_context (armor_filter_context_t *afx)
int
push_armor_filter (armor_filter_context_t *afx, iobuf_t iobuf)
{
- int rc;
+ int rc;
afx->refcount++;
rc = iobuf_push_filter (iobuf, armor_filter, afx);
@@ -982,7 +982,7 @@ armor_filter( void *opaque, int control,
/* We need some space for the faked packet. The minmum
* required size is the PARTIAL_CHUNK size plus a byte for the
* length itself */
- if( size < PARTIAL_CHUNK+1 )
+ if( size < PARTIAL_CHUNK+1 )
BUG(); /* supplied buffer too short */
if( afx->faked )
@@ -1001,7 +1001,7 @@ armor_filter( void *opaque, int control,
unsigned int hashes = afx->hashes;
const byte *sesmark;
size_t sesmarklen;
-
+
sesmark = get_session_marker( &sesmarklen );
if ( sesmarklen > 20 )
BUG();
@@ -1023,7 +1023,7 @@ armor_filter( void *opaque, int control,
buf[n++] = 0xff; /* new format, type 63, 1 length byte */
n++; /* see below */
memcpy(buf+n, sesmark, sesmarklen ); n+= sesmarklen;
- buf[n++] = CTRLPKT_CLEARSIGN_START;
+ buf[n++] = CTRLPKT_CLEARSIGN_START;
buf[n++] = afx->not_dash_escaped? 0:1; /* sigclass */
if( hashes & 1 )
buf[n++] = DIGEST_ALGO_RMD160;
@@ -1284,7 +1284,7 @@ make_radix64_string( const byte *data, size_t len )
/***********************************************
* For the pipemode command we can't use the armor filter for various
- * reasons, so we use this new unarmor_pump stuff to remove the armor
+ * reasons, so we use this new unarmor_pump stuff to remove the armor
*/
enum unarmor_state_e {
@@ -1292,7 +1292,7 @@ enum unarmor_state_e {
STA_bypass,
STA_wait_newline,
STA_wait_dash,
- STA_first_dash,
+ STA_first_dash,
STA_compare_header,
STA_found_header_wait_newline,
STA_skip_header_lines,
@@ -1331,12 +1331,12 @@ unarmor_pump_release (UnarmorPump x)
xfree (x);
}
-/*
+/*
* Get the next character from the ascii armor taken from the IOBUF
* created earlier by unarmor_pump_new().
* Return: c = Character
* 256 = ignore this value
- * -1 = End of current armor
+ * -1 = End of current armor
* -2 = Premature EOF (not used)
* -3 = Invalid armor
*/
@@ -1347,9 +1347,9 @@ unarmor_pump (UnarmorPump x, int c)
switch (x->state) {
case STA_init:
- {
+ {
byte tmp[1];
- tmp[0] = c;
+ tmp[0] = c;
if ( is_armored (tmp) )
x->state = c == '-'? STA_first_dash : STA_wait_newline;
else {
@@ -1372,10 +1372,10 @@ unarmor_pump (UnarmorPump x, int c)
x->state = STA_compare_header;
case STA_compare_header:
if ( "-----BEGIN PGP SIGNATURE-----"[++x->pos] == c ) {
- if ( x->pos == 28 )
+ if ( x->pos == 28 )
x->state = STA_found_header_wait_newline;
}
- else
+ else
x->state = c == '\n'? STA_wait_dash : STA_wait_newline;
break;
case STA_found_header_wait_newline:
@@ -1422,7 +1422,7 @@ unarmor_pump (UnarmorPump x, int c)
break;
}
}
-
+
switch(x->pos) {
case 0:
x->val = c << 2;
@@ -1463,7 +1463,7 @@ unarmor_pump (UnarmorPump x, int c)
x->state = STA_ready; /* not sure whether this is correct */
break;
}
-
+
switch(x->pos) {
case 0:
x->val = c << 2;
diff --git a/g10/call-agent.c b/g10/call-agent.c
index dc2ace0e5..6333586fb 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -23,7 +23,7 @@
#include <stdlib.h>
#include <string.h>
#include <errno.h>
-#include <unistd.h>
+#include <unistd.h>
#include <time.h>
#include <assert.h>
#ifdef HAVE_LOCALE_H
@@ -48,7 +48,7 @@
static assuan_context_t agent_ctx = NULL;
static int did_early_card_test;
-struct cipher_parm_s
+struct cipher_parm_s
{
ctrl_t ctrl;
assuan_context_t ctx;
@@ -116,7 +116,7 @@ status_sc_op_failure (int rc)
write_status (STATUS_SC_OP_FAILURE);
break;
}
-}
+}
@@ -154,7 +154,7 @@ start_agent (ctrl_t ctrl, int for_card)
here used to indirectly enable GPG_ERR_FULLY_CANCELED. */
assuan_transact (agent_ctx, "OPTION agent-awareness=2.1.0",
NULL, NULL, NULL, NULL, NULL, NULL);
-
+
}
}
@@ -185,7 +185,7 @@ start_agent (ctrl_t ctrl, int for_card)
if (!rc && is_status_enabled () && info.serialno)
{
char *buf;
-
+
buf = xasprintf ("3 %s", info.serialno);
write_status_text (STATUS_CARDCTRL, buf);
xfree (buf);
@@ -197,7 +197,7 @@ start_agent (ctrl_t ctrl, int for_card)
did_early_card_test = 1;
}
-
+
return rc;
}
@@ -290,7 +290,7 @@ get_serialno_cb (void *opaque, const char *line)
memcpy (*serialno, line, n);
(*serialno)[n] = 0;
}
-
+
return 0;
}
@@ -352,7 +352,7 @@ learn_status_cb (void *opaque, const char *line)
{
xfree (parm->serialno);
parm->serialno = store_serialno (line);
- parm->is_v2 = (strlen (parm->serialno) >= 16
+ parm->is_v2 = (strlen (parm->serialno) >= 16
&& xtoi_2 (parm->serialno+12) >= 2 );
}
else if (keywordlen == 7 && !memcmp (keyword, "APPTYPE", keywordlen))
@@ -533,7 +533,7 @@ agent_learn (struct agent_card_info_s *info)
/* Also try to get the key attributes. */
if (!rc)
agent_scd_getattr ("KEY-ATTR", info);
-
+
return rc;
}
@@ -552,7 +552,7 @@ agent_scd_getattr (const char *name, struct agent_card_info_s *info)
/* We assume that NAME does not need escaping. */
if (12 + strlen (name) > DIM(line)-1)
return gpg_error (GPG_ERR_TOO_LARGE);
- stpcpy (stpcpy (line, "SCD GETATTR "), name);
+ stpcpy (stpcpy (line, "SCD GETATTR "), name);
rc = start_agent (NULL, 1);
if (rc)
@@ -560,7 +560,7 @@ agent_scd_getattr (const char *name, struct agent_card_info_s *info)
rc = assuan_transact (agent_ctx, line, NULL, NULL, default_inq_cb, NULL,
learn_status_cb, info);
-
+
return rc;
}
@@ -585,8 +585,8 @@ agent_scd_setattr (const char *name,
/* We assume that NAME does not need escaping. */
if (12 + strlen (name) > DIM(line)-1)
return gpg_error (GPG_ERR_TOO_LARGE);
-
- p = stpcpy (stpcpy (line, "SCD SETATTR "), name);
+
+ p = stpcpy (stpcpy (line, "SCD SETATTR "), name);
*p++ = ' ';
for (; valuelen; value++, valuelen--)
{
@@ -607,7 +607,7 @@ agent_scd_setattr (const char *name,
rc = start_agent (NULL, 1);
if (!rc)
{
- rc = assuan_transact (agent_ctx, line, NULL, NULL,
+ rc = assuan_transact (agent_ctx, line, NULL, NULL,
default_inq_cb, NULL, NULL, NULL);
}
@@ -624,7 +624,7 @@ static gpg_error_t
inq_writecert_parms (void *opaque, const char *line)
{
int rc;
- struct writecert_parm_s *parm = opaque;
+ struct writecert_parm_s *parm = opaque;
if (!strncmp (line, "CERTDATA", 8) && (line[8]==' '||!line[8]))
{
@@ -638,7 +638,7 @@ inq_writecert_parms (void *opaque, const char *line)
/* Send a WRITECERT command to the SCdaemon. */
-int
+int
agent_scd_writecert (const char *certidstr,
const unsigned char *certdata, size_t certdatalen)
{
@@ -657,7 +657,7 @@ agent_scd_writecert (const char *certidstr,
parms.ctx = agent_ctx;
parms.certdata = certdata;
parms.certdatalen = certdatalen;
-
+
rc = assuan_transact (agent_ctx, line, NULL, NULL,
inq_writecert_parms, &parms, NULL, NULL);
@@ -672,7 +672,7 @@ static gpg_error_t
inq_writekey_parms (void *opaque, const char *line)
{
int rc;
- struct writekey_parm_s *parm = opaque;
+ struct writekey_parm_s *parm = opaque;
if (!strncmp (line, "KEYDATA", 7) && (line[7]==' '||!line[7]))
{
@@ -686,7 +686,7 @@ inq_writekey_parms (void *opaque, const char *line)
/* Send a WRITEKEY command to the SCdaemon. */
-int
+int
agent_scd_writekey (int keyno, const char *serialno,
const unsigned char *keydata, size_t keydatalen)
{
@@ -707,7 +707,7 @@ agent_scd_writekey (int keyno, const char *serialno,
parms.ctx = agent_ctx;
parms.keydata = keydata;
parms.keydatalen = keydatalen;
-
+
rc = assuan_transact (agent_ctx, line, NULL, NULL,
inq_writekey_parms, &parms, NULL, NULL);
@@ -795,7 +795,7 @@ agent_scd_genkey (struct agent_card_genkey_s *info, int keyno, int force,
snprintf (line, DIM(line)-1, "SCD GENKEY %s%s %s %d",
*tbuf? "--timestamp=":"", tbuf,
- force? "--force":"",
+ force? "--force":"",
keyno);
line[DIM(line)-1] = 0;
@@ -803,7 +803,7 @@ agent_scd_genkey (struct agent_card_genkey_s *info, int keyno, int force,
rc = assuan_transact (agent_ctx, line,
NULL, NULL, default_inq_cb, NULL,
scd_genkey_cb, info);
-
+
status_sc_op_failure (rc);
return rc;
}
@@ -821,7 +821,7 @@ select_openpgp (const char *serialno)
/* Send the serialno command to initialize the connection. Without
a given S/N we don't care about the data returned. If the card
has already been initialized, this is a very fast command. We
- request the openpgp card because that is what we expect.
+ request the openpgp card because that is what we expect.
Note that an opt.limit_card_insert_tries of 1 means: No tries at
all whereas 0 means do not limit the number of tries. Due to the
@@ -837,7 +837,7 @@ select_openpgp (const char *serialno)
int ask;
char *want_sn;
char *p;
-
+
want_sn = xtrystrdup (serialno);
if (!want_sn)
return gpg_error_from_syserror ();
@@ -845,14 +845,14 @@ select_openpgp (const char *serialno)
if (p)
*p = 0;
- do
+ do
{
ask = 0;
err = assuan_transact (agent_ctx, "SCD SERIALNO openpgp",
- NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
get_serialno_cb, &this_sn);
if (gpg_err_code (err) == GPG_ERR_CARD_NOT_PRESENT)
- ask = 1;
+ ask = 1;
else if (gpg_err_code (err) == GPG_ERR_NOT_SUPPORTED)
ask = 2;
else if (err)
@@ -865,19 +865,19 @@ select_openpgp (const char *serialno)
xfree (this_sn);
this_sn = NULL;
-
+
if (ask)
{
char *formatted = NULL;
char *ocodeset = i18n_switchto_utf8 ();
- if (!strncmp (want_sn, "D27600012401", 12)
+ if (!strncmp (want_sn, "D27600012401", 12)
&& strlen (want_sn) == 32 )
formatted = xtryasprintf ("(%.4s) %.8s",
want_sn + 16, want_sn + 20);
-
+
err = 0;
- desc = xtryasprintf
+ desc = xtryasprintf
("%s:\n\n"
" \"%s\"",
ask == 1
@@ -912,7 +912,7 @@ membuf_data_cb (void *opaque, const void *buffer, size_t length)
put_membuf (data, buffer, length);
return 0;
}
-
+
/* Helper returning a command option to describe the used hash
algorithm. See scd/command.c:cmd_pksign. */
@@ -1023,7 +1023,7 @@ agent_scd_pkdecrypt (const char *serialno,
rc = select_openpgp (serialno);
if (rc)
return rc;
-
+
strcpy (line, "SCD SETDATA ");
bin2hex (indata, indatalen, line + strlen (line));
@@ -1055,7 +1055,7 @@ agent_scd_pkdecrypt (const char *serialno,
/* Send a READCERT command to the SCdaemon. */
-int
+int
agent_scd_readcert (const char *certidstr,
void **r_buf, size_t *r_buflen)
{
@@ -1175,8 +1175,8 @@ agent_get_passphrase (const char *cache_id,
int rc;
char line[ASSUAN_LINELENGTH];
char *arg1 = NULL;
- char *arg2 = NULL;
- char *arg3 = NULL;
+ char *arg2 = NULL;
+ char *arg3 = NULL;
char *arg4 = NULL;
membuf_t data;
@@ -1187,7 +1187,7 @@ agent_get_passphrase (const char *cache_id,
return rc;
/* Check that the gpg-agent understands the repeat option. */
- if (assuan_transact (agent_ctx,
+ if (assuan_transact (agent_ctx,
"GETINFO cmd_has_option GET_PASSPHRASE repeat",
NULL, NULL, NULL, NULL, NULL, NULL))
return gpg_error (GPG_ERR_NOT_SUPPORTED);
@@ -1205,9 +1205,9 @@ agent_get_passphrase (const char *cache_id,
if (!(arg4 = percent_plus_escape (desc_msg)))
goto no_mem;
- snprintf (line, DIM(line)-1,
- "GET_PASSPHRASE --data --repeat=%d%s -- %s %s %s %s",
- repeat,
+ snprintf (line, DIM(line)-1,
+ "GET_PASSPHRASE --data --repeat=%d%s -- %s %s %s %s",
+ repeat,
check? " --check --qualitybar":"",
arg1? arg1:"X",
arg2? arg2:"X",
@@ -1220,13 +1220,13 @@ agent_get_passphrase (const char *cache_id,
xfree (arg4);
init_membuf_secure (&data, 64);
- rc = assuan_transact (agent_ctx, line,
+ rc = assuan_transact (agent_ctx, line,
membuf_data_cb, &data,
default_inq_cb, NULL, NULL, NULL);
if (rc)
xfree (get_membuf (&data, NULL));
- else
+ else
{
put_membuf (&data, "", 1);
*r_passphrase = get_membuf (&data, NULL);
@@ -1305,12 +1305,12 @@ agent_get_s2k_count (unsigned long *r_count)
return err;
init_membuf (&data, 32);
- err = assuan_transact (agent_ctx, "GETINFO s2k_count",
+ err = assuan_transact (agent_ctx, "GETINFO s2k_count",
membuf_data_cb, &data,
NULL, NULL, NULL, NULL);
if (err)
xfree (get_membuf (&data, NULL));
- else
+ else
{
put_membuf (&data, "", 1);
buf = get_membuf (&data, NULL);
@@ -1511,7 +1511,7 @@ cache_nonce_status_cb (void *opaque, const char *line)
static gpg_error_t
inq_genkey_parms (void *opaque, const char *line)
{
- struct genkey_parm_s *parm = opaque;
+ struct genkey_parm_s *parm = opaque;
gpg_error_t err;
if (!strncmp (line, "KEYPARAM", 8) && (line[8]==' '||!line[8]))
@@ -1522,7 +1522,7 @@ inq_genkey_parms (void *opaque, const char *line)
else
err = default_inq_cb (parm->ctrl, line);
- return err;
+ return err;
}
@@ -1547,7 +1547,7 @@ agent_genkey (ctrl_t ctrl, char **cache_nonce_addr,
if (err)
return err;
- err = assuan_transact (agent_ctx, "RESET",
+ err = assuan_transact (agent_ctx, "RESET",
NULL, NULL, NULL, NULL, NULL, NULL);
if (err)
return err;
@@ -1563,15 +1563,15 @@ agent_genkey (ctrl_t ctrl, char **cache_nonce_addr,
cn_parm.cache_nonce_addr = cache_nonce_addr;
cn_parm.passwd_nonce_addr = NULL;
err = assuan_transact (agent_ctx, line,
- membuf_data_cb, &data,
- inq_genkey_parms, &gk_parm,
+ membuf_data_cb, &data,
+ inq_genkey_parms, &gk_parm,
cache_nonce_status_cb, &cn_parm);
if (err)
{
xfree (get_membuf (&data, &len));
return err;
}
-
+
buf = get_membuf (&data, &len);
if (!buf)
err = gpg_error_from_syserror ();
@@ -1721,7 +1721,7 @@ agent_pksign (ctrl_t ctrl, const char *cache_nonce,
static gpg_error_t
inq_ciphertext_cb (void *opaque, const char *line)
{
- struct cipher_parm_s *parm = opaque;
+ struct cipher_parm_s *parm = opaque;
int rc;
if (!strncmp (line, "CIPHERTEXT", 10) && (line[10]==' '||!line[10]))
@@ -1733,7 +1733,7 @@ inq_ciphertext_cb (void *opaque, const char *line)
else
rc = default_inq_cb (parm->ctrl, line);
- return rc;
+ return rc;
}
@@ -1783,7 +1783,7 @@ agent_pkdecrypt (ctrl_t ctrl, const char *keygrip, const char *desc,
init_membuf_secure (&data, 1024);
{
struct cipher_parm_s parm;
-
+
parm.ctrl = ctrl;
parm.ctx = agent_ctx;
err = make_canon_sexp (s_ciphertext, &parm.ciphertext, &parm.ciphertextlen);
@@ -1832,7 +1832,7 @@ agent_pkdecrypt (ctrl_t ctrl, const char *keygrip, const char *desc,
xfree (buf);
return gpg_error (GPG_ERR_INV_SEXP); /* Oops: Inconsistent S-Exp. */
}
-
+
memmove (buf, endp, n);
*r_buflen = n;
@@ -1864,7 +1864,7 @@ agent_keywrap_key (ctrl_t ctrl, int forexport, void **r_kek, size_t *r_keklen)
init_membuf_secure (&data, 64);
err = assuan_transact (agent_ctx, line,
- membuf_data_cb, &data,
+ membuf_data_cb, &data,
default_inq_cb, ctrl, NULL, NULL);
if (err)
{
@@ -1885,7 +1885,7 @@ agent_keywrap_key (ctrl_t ctrl, int forexport, void **r_kek, size_t *r_keklen)
static gpg_error_t
inq_import_key_parms (void *opaque, const char *line)
{
- struct import_key_parm_s *parm = opaque;
+ struct import_key_parm_s *parm = opaque;
gpg_error_t err;
if (!strncmp (line, "KEYDATA", 7) && (line[7]==' '||!line[7]))
@@ -1895,7 +1895,7 @@ inq_import_key_parms (void *opaque, const char *line)
else
err = default_inq_cb (parm->ctrl, line);
- return err;
+ return err;
}
@@ -1972,7 +1972,7 @@ agent_export_key (ctrl_t ctrl, const char *hexkeygrip, const char *desc,
return err;
}
- snprintf (line, DIM(line)-1, "EXPORT_KEY --openpgp %s%s %s",
+ snprintf (line, DIM(line)-1, "EXPORT_KEY --openpgp %s%s %s",
cache_nonce_addr && *cache_nonce_addr? "--cache-nonce=":"",
cache_nonce_addr && *cache_nonce_addr? *cache_nonce_addr:"",
hexkeygrip);
@@ -1981,7 +1981,7 @@ agent_export_key (ctrl_t ctrl, const char *hexkeygrip, const char *desc,
cn_parm.cache_nonce_addr = cache_nonce_addr;
cn_parm.passwd_nonce_addr = NULL;
err = assuan_transact (agent_ctx, line,
- membuf_data_cb, &data,
+ membuf_data_cb, &data,
default_inq_cb, ctrl,
cache_nonce_status_cb, &cn_parm);
if (err)
diff --git a/g10/call-agent.h b/g10/call-agent.h
index e09c30990..337847dab 100644
--- a/g10/call-agent.h
+++ b/g10/call-agent.h
@@ -17,10 +17,10 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GNUPG_G10_CALL_AGENT_H
-#define GNUPG_G10_CALL_AGENT_H
+#define GNUPG_G10_CALL_AGENT_H
-struct agent_card_info_s
+struct agent_card_info_s
{
int error; /* private. */
char *apptype; /* Malloced application type string. */
@@ -56,7 +56,7 @@ struct agent_card_info_s
struct { /* Array with key attributes. */
int algo; /* Algorithm identifier. */
unsigned int nbits; /* Supported keysize. */
- } key_attr[3];
+ } key_attr[3];
struct {
unsigned int ki:1; /* Key import available. */
unsigned int aac:1; /* Algorithm attributes are changeable. */
diff --git a/g10/call-dirmngr.c b/g10/call-dirmngr.c
index f34b94b60..10c0e568c 100644
--- a/g10/call-dirmngr.c
+++ b/g10/call-dirmngr.c
@@ -22,7 +22,7 @@
#include <stdlib.h>
#include <string.h>
#include <errno.h>
-#include <unistd.h>
+#include <unistd.h>
#include <time.h>
#include <assert.h>
#ifdef HAVE_LOCALE_H
@@ -77,7 +77,7 @@ struct ks_put_parm_s
function dirmngr_deinit_session_data is called bu gpg.c to cleanup
these resources. Note that gpg.h defines a typedef dirmngr_local_t
for this structure. */
-struct dirmngr_local_s
+struct dirmngr_local_s
{
/* Link to other contexts which are used simultaneously. */
struct dirmngr_local_s *next;
@@ -132,14 +132,14 @@ create_context (ctrl_t ctrl, assuan_context_t *r_ctx)
/* Tell the dirmngr that we want to collect audit event. */
/* err = assuan_transact (agent_ctx, "OPTION audit-events=1", */
/* NULL, NULL, NULL, NULL, NULL, NULL); */
-
+
/* Set all configured keyservers. We clear existing keyservers
so that any keyserver configured in GPG overrides keyservers
possibly configured in Dirmngr. */
for (ksi = opt.keyserver; !err && ksi; ksi = ksi->next)
{
char *line;
-
+
line = xtryasprintf ("KEYSERVER%s %s",
ksi == opt.keyserver? " --clear":"", ksi->uri);
if (!line)
@@ -160,7 +160,7 @@ create_context (ctrl_t ctrl, assuan_context_t *r_ctx)
/* audit_log_ok (ctrl->audit, AUDIT_DIRMNGR_READY, err); */
*r_ctx = ctx;
}
-
+
return err;
}
@@ -189,7 +189,7 @@ open_context (ctrl_t ctrl, assuan_context_t *r_ctx)
*r_ctx = dml->ctx;
return 0;
}
-
+
dml = xtrycalloc (1, sizeof *dml);
if (!dml)
return gpg_error_from_syserror ();
@@ -271,7 +271,7 @@ ks_search_data_cb (void *opaque, const void *data, size_t datalen)
fixedbuf[linelen-1] = 0;
err = parm->data_cb (parm->data_cb_value, fixedbuf);
}
- else
+ else
{
if (linelen + 1 >= parm->helpbufsize)
{
@@ -313,7 +313,7 @@ ks_search_data_cb (void *opaque, const void *data, size_t datalen)
gpg_error_t
gpg_dirmngr_ks_search (ctrl_t ctrl, const char *searchstr,
gpg_error_t (*cb)(void*, char *), void *cb_value)
-{
+{
gpg_error_t err;
assuan_context_t ctx;
struct ks_search_parm_s parm;
@@ -387,7 +387,7 @@ ks_get_data_cb (void *opaque, const void *data, size_t datalen)
are able to ask for (1000-10-1)/(2+8+1) = 90 keys at once. */
gpg_error_t
gpg_dirmngr_ks_get (ctrl_t ctrl, char **pattern, estream_t *r_fp)
-{
+{
gpg_error_t err;
assuan_context_t ctx;
struct ks_get_parm_s parm;
@@ -479,9 +479,9 @@ ks_put_inq_cb (void *opaque, const char *line)
case PKT_PUBLIC_SUBKEY:
{
PKT_public_key *pk = node->pkt->pkt.public_key;
-
+
keyid_from_pk (pk, NULL);
-
+
es_fprintf (fp, "%s:%08lX%08lX:%u:%u:%u:%u:%s%s:\n",
node->pkt->pkttype==PKT_PUBLIC_KEY? "pub" : "sub",
(ulong)pk->keyid[0], (ulong)pk->keyid[1],
@@ -502,18 +502,18 @@ ks_put_inq_cb (void *opaque, const char *line)
if (!uid->attrib_data)
{
es_fprintf (fp, "uid:");
-
+
/* Quote ':', '%', and any 8-bit characters. */
for (r=0; r < uid->len; r++)
{
- if (uid->name[r] == ':'
+ if (uid->name[r] == ':'
|| uid->name[r]== '%'
|| (uid->name[r]&0x80))
es_fprintf (fp, "%%%02X", (byte)uid->name[r]);
else
es_putc (uid->name[r], fp);
}
-
+
es_fprintf (fp, ":%u:%u:%s%s:\n",
uid->created,uid->expiredate,
uid->is_revoked? "r":"",
@@ -572,7 +572,7 @@ ks_put_inq_cb (void *opaque, const char *line)
else
return gpg_error (GPG_ERR_ASS_UNKNOWN_INQUIRE);
- return err;
+ return err;
}
@@ -582,7 +582,7 @@ ks_put_inq_cb (void *opaque, const char *line)
used to convey meta data to LDAP keyservers. */
gpg_error_t
gpg_dirmngr_ks_put (ctrl_t ctrl, void *data, size_t datalen, kbnode_t keyblock)
-{
+{
gpg_error_t err;
assuan_context_t ctx;
struct ks_put_parm_s parm;
diff --git a/g10/call-dirmngr.h b/g10/call-dirmngr.h
index 9523bf568..43636eab4 100644
--- a/g10/call-dirmngr.h
+++ b/g10/call-dirmngr.h
@@ -17,7 +17,7 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GNUPG_G10_CALL_DIRMNGR_H
-#define GNUPG_G10_CALL_DIRMNGR_H
+#define GNUPG_G10_CALL_DIRMNGR_H
void gpg_dirmngr_deinit_session_data (ctrl_t ctrl);
diff --git a/g10/card-util.c b/g10/card-util.c
index 966a3202b..2b7ac7469 100644
--- a/g10/card-util.c
+++ b/g10/card-util.c
@@ -87,7 +87,7 @@ change_pin (int unblock_v2, int allow_admin)
gpg_strerror (rc));
return;
}
-
+
log_info (_("OpenPGP card no. %s detected\n"),
info.serialno? info.serialno : "[none]");
@@ -181,7 +181,7 @@ change_pin (int unblock_v2, int allow_admin)
rc = agent_scd_change_pin (102, info.serialno);
write_sc_op_status (rc);
if (rc)
- tty_printf ("Error setting the Reset Code: %s\n",
+ tty_printf ("Error setting the Reset Code: %s\n",
gpg_strerror (rc));
else
tty_printf ("Reset Code set.\n");
@@ -383,7 +383,7 @@ card_status (estream_t fp, char *serialno, size_t serialnobuflen)
else
tty_fprintf (fp, "Application ID ...: %s\n",
info.serialno? info.serialno : "[none]");
- if (!info.serialno || strncmp (info.serialno, "D27600012401", 12)
+ if (!info.serialno || strncmp (info.serialno, "D27600012401", 12)
|| strlen (info.serialno) != 32 )
{
if (info.apptype && !strcmp (info.apptype, "NKS"))
@@ -425,7 +425,7 @@ card_status (estream_t fp, char *serialno, size_t serialnobuflen)
;
else if (strlen (serialno)+1 > serialnobuflen)
log_error ("serial number longer than expected\n");
- else
+ else
strcpy (serialno, info.serialno);
if (opt.with_colons)
@@ -438,7 +438,7 @@ card_status (estream_t fp, char *serialno, size_t serialnobuflen)
uval = xtoi_2(info.serialno+16)*256 + xtoi_2 (info.serialno+18);
es_fprintf (fp, "vendor:%04x:%s:\n", uval, get_manufacturer (uval));
es_fprintf (fp, "serial:%.8s:\n", info.serialno+20);
-
+
print_isoname (fp, "Name of cardholder: ", "name", info.disp_name);
es_fputs ("lang:", fp);
@@ -498,18 +498,18 @@ card_status (estream_t fp, char *serialno, size_t serialnobuflen)
(unsigned long)info.fpr1time, (unsigned long)info.fpr2time,
(unsigned long)info.fpr3time);
}
- else
+ else
{
tty_fprintf (fp, "Version ..........: %.1s%c.%.1s%c\n",
info.serialno[12] == '0'?"":info.serialno+12,
info.serialno[13],
info.serialno[14] == '0'?"":info.serialno+14,
info.serialno[15]);
- tty_fprintf (fp, "Manufacturer .....: %s\n",
+ tty_fprintf (fp, "Manufacturer .....: %s\n",
get_manufacturer (xtoi_2(info.serialno+16)*256
+ xtoi_2 (info.serialno+18)));
tty_fprintf (fp, "Serial number ....: %.8s\n", info.serialno+20);
-
+
print_isoname (fp, "Name of cardholder: ", "name", info.disp_name);
print_name (fp, "Language prefs ...: ", info.disp_lang);
tty_fprintf (fp, "Sex ..............: %s\n",
@@ -572,13 +572,13 @@ card_status (estream_t fp, char *serialno, size_t serialnobuflen)
if (info.fpr3valid && info.fpr3time)
tty_fprintf (fp, " created ....: %s\n",
isotimestamp (info.fpr3time));
- tty_fprintf (fp, "General key info..: ");
+ tty_fprintf (fp, "General key info..: ");
- thefpr = (info.fpr1valid? info.fpr1 : info.fpr2valid? info.fpr2 :
+ thefpr = (info.fpr1valid? info.fpr1 : info.fpr2valid? info.fpr2 :
info.fpr3valid? info.fpr3 : NULL);
/* If the fingerprint is all 0xff, the key has no asssociated
OpenPGP certificate. */
- if ( thefpr && !fpr_is_ff (thefpr)
+ if ( thefpr && !fpr_is_ff (thefpr)
&& !get_pubkey_byfprint (pk, thefpr, 20))
{
print_pubkey_info (fp, pk);
@@ -586,14 +586,14 @@ card_status (estream_t fp, char *serialno, size_t serialnobuflen)
#if GNUPG_MAJOR_VERSION == 1
{
kbnode_t keyblock = NULL;
-
+
if ( !get_seckeyblock_byfprint (&keyblock, thefpr, 20) )
print_card_key_info (fp, keyblock);
else if ( !get_keyblock_byfprint (&keyblock, thefpr, 20) )
{
release_kbnode (keyblock);
keyblock = NULL;
-
+
if (!auto_create_card_key_stub (info.serialno,
info.fpr1valid? info.fpr1:NULL,
info.fpr2valid? info.fpr2:NULL,
@@ -603,7 +603,7 @@ card_status (estream_t fp, char *serialno, size_t serialnobuflen)
print_card_key_info (fp, keyblock);
}
}
-
+
release_kbnode (keyblock);
}
#endif /* GNUPG_MAJOR_VERSION == 1 */
@@ -611,7 +611,7 @@ card_status (estream_t fp, char *serialno, size_t serialnobuflen)
else
tty_fprintf (fp, "[none]\n");
}
-
+
free_public_key (pk);
agent_release_card_info (&info);
}
@@ -640,7 +640,7 @@ get_one_name (const char *prompt1, const char *prompt2)
else if (strchr (name, '<'))
tty_printf (_("Error: The \"<\" character may not be used.\n"));
else if (strstr (name, " "))
- tty_printf (_("Error: Double spaces are not allowed.\n"));
+ tty_printf (_("Error: Double spaces are not allowed.\n"));
else
return name;
xfree (name);
@@ -678,7 +678,7 @@ change_name (void)
if (strlen (isoname) > 39 )
{
tty_printf (_("Error: Combined name too long "
- "(limit is %d characters).\n"), 39);
+ "(limit is %d characters).\n"), 39);
xfree (isoname);
return -1;
}
@@ -707,7 +707,7 @@ change_url (void)
if (strlen (url) > 254 )
{
tty_printf (_("Error: URL too long "
- "(limit is %d characters).\n"), 254);
+ "(limit is %d characters).\n"), 254);
xfree (url);
return -1;
}
@@ -778,7 +778,7 @@ get_data_from_file (const char *fname, size_t maxlen, char **r_buffer)
estream_t fp;
char *data;
int n;
-
+
*r_buffer = NULL;
fp = es_fopen (fname, "rb");
@@ -795,7 +795,7 @@ get_data_from_file (const char *fname, size_t maxlen, char **r_buffer)
tty_printf (_("can't open `%s': %s\n"), fname, strerror (errno));
return -1;
}
-
+
data = xtrymalloc (maxlen? maxlen:1);
if (!data)
{
@@ -826,7 +826,7 @@ static int
put_data_to_file (const char *fname, const void *buffer, size_t length)
{
estream_t fp;
-
+
fp = es_fopen (fname, "wb");
#if GNUPG_MAJOR_VERSION == 1
if (fp && is_secured_file (fileno (fp)))
@@ -841,7 +841,7 @@ put_data_to_file (const char *fname, const void *buffer, size_t length)
tty_printf (_("can't create `%s': %s\n"), fname, strerror (errno));
return -1;
}
-
+
if (length && es_fwrite (buffer, length, 1, fp) != 1)
{
tty_printf (_("error writing `%s': %s\n"), fname, strerror (errno));
@@ -882,7 +882,7 @@ change_login (const char *args)
if (n > 254 )
{
tty_printf (_("Error: Login data too long "
- "(limit is %d characters).\n"), 254);
+ "(limit is %d characters).\n"), 254);
xfree (data);
return -1;
}
@@ -901,7 +901,7 @@ change_private_do (const char *args, int nr)
char do_name[] = "PRIVATE-DO-X";
char *data;
int n;
- int rc;
+ int rc;
assert (nr >= 1 && nr <= 4);
do_name[11] = '0' + nr;
@@ -928,7 +928,7 @@ change_private_do (const char *args, int nr)
if (n > 254 )
{
tty_printf (_("Error: Private DO too long "
- "(limit is %d characters).\n"), 254);
+ "(limit is %d characters).\n"), 254);
xfree (data);
return -1;
}
@@ -1061,13 +1061,13 @@ change_sex (void)
str = "1";
else if ((*data == 'F' || *data == 'f') && !data[1])
str = "2";
- else
+ else
{
tty_printf (_("Error: invalid response.\n"));
xfree (data);
return -1;
}
-
+
rc = agent_scd_setattr ("DISP-SEX", str, 1, NULL );
if (rc)
log_error ("error setting sex: %s\n", gpg_strerror (rc));
@@ -1155,7 +1155,7 @@ get_info_for_key_operation (struct agent_card_info_s *info)
memset (info, 0, sizeof *info);
rc = agent_scd_getattr ("SERIALNO", info);
- if (rc || !info->serialno || strncmp (info->serialno, "D27600012401", 12)
+ if (rc || !info->serialno || strncmp (info->serialno, "D27600012401", 12)
|| strlen (info->serialno) != 32 )
{
log_error (_("key operation not possible: %s\n"),
@@ -1180,7 +1180,7 @@ get_info_for_key_operation (struct agent_card_info_s *info)
/* Helper for the key generation/edit functions. */
static int
check_pin_for_key_operation (struct agent_card_info_s *info, int *forced_chv1)
-{
+{
int rc = 0;
agent_clear_pin_cache (info->serialno);
@@ -1214,7 +1214,7 @@ check_pin_for_key_operation (struct agent_card_info_s *info, int *forced_chv1)
}
/* Helper for the key generation/edit functions. */
-static void
+static void
restore_forced_chv1 (int *forced_chv1)
{
int rc;
@@ -1298,7 +1298,7 @@ ask_card_keysize (int keyno, unsigned int nbits)
for (;;)
{
- prompt = xasprintf
+ prompt = xasprintf
(keyno == 0?
_("What keysize do you want for the Signature key? (%u) "):
keyno == 1?
@@ -1310,16 +1310,16 @@ ask_card_keysize (int keyno, unsigned int nbits)
req_nbits = *answer? atoi (answer): nbits;
xfree (prompt);
xfree (answer);
-
+
if (req_nbits != nbits && (req_nbits % 32) )
{
req_nbits = ((req_nbits + 31) / 32) * 32;
tty_printf (_("rounded up to %u bits\n"), req_nbits);
}
-
+
if (req_nbits == nbits)
return 0; /* Use default. */
-
+
if (req_nbits < min_nbits || req_nbits > max_nbits)
{
tty_printf (_("%s keysizes must be in the range %u-%u\n"),
@@ -1339,19 +1339,19 @@ ask_card_keysize (int keyno, unsigned int nbits)
/* Change the size of key KEYNO (0..2) to NBITS and show an error
message if that fails. */
static gpg_error_t
-do_change_keysize (int keyno, unsigned int nbits)
+do_change_keysize (int keyno, unsigned int nbits)
{
gpg_error_t err;
char args[100];
-
+
snprintf (args, sizeof args, "--force %d 1 %u", keyno+1, nbits);
err = agent_scd_setattr ("KEY-ATTR", args, strlen (args), NULL);
if (err)
- log_error (_("error changing size of key %d to %u bits: %s\n"),
+ log_error (_("error changing size of key %d to %u bits: %s\n"),
keyno+1, nbits, gpg_strerror (err));
return err;
}
-
+
static void
generate_card_keys (void)
@@ -1432,7 +1432,7 @@ generate_card_keys (void)
/* Note that INFO has not be synced. However we will only use
the serialnumber and thus it won't harm. */
}
-
+
generate_keypair (NULL, info.serialno, want_backup);
leave:
@@ -1450,11 +1450,11 @@ card_generate_subkey (KBNODE pub_keyblock)
struct agent_card_info_s info;
int forced_chv1 = 0;
int keyno;
-
+
err = get_info_for_key_operation (&info);
if (err)
return err;
-
+
show_card_key_info (&info);
tty_printf (_("Please select the type of key to generate:\n"));
@@ -1463,7 +1463,7 @@ card_generate_subkey (KBNODE pub_keyblock)
tty_printf (_(" (2) Encryption key\n"));
tty_printf (_(" (3) Authentication key\n"));
- for (;;)
+ for (;;)
{
char *answer = cpr_get ("cardedit.genkeys.subkeytype",
_("Your selection? "));
@@ -1480,23 +1480,23 @@ card_generate_subkey (KBNODE pub_keyblock)
break; /* Okay. */
tty_printf(_("Invalid selection.\n"));
}
-
+
if (replace_existing_key_p (&info, keyno))
{
err = gpg_error (GPG_ERR_CANCELED);
goto leave;
}
-
+
err = check_pin_for_key_operation (&info, &forced_chv1);
if (err)
goto leave;
-
+
/* If the cards features changeable key attributes, we ask for the
key size. */
if (info.is_v2 && info.extcap.aac)
{
unsigned int nbits;
-
+
ask_again:
nbits = ask_card_keysize (keyno-1, info.key_attr[keyno-1].nbits);
if (nbits && do_change_keysize (keyno-1, nbits))
@@ -1511,9 +1511,9 @@ card_generate_subkey (KBNODE pub_keyblock)
/* Note that INFO has not be synced. However we will only use
the serialnumber and thus it won't harm. */
}
-
+
err = generate_card_subkeypair (pub_keyblock, keyno, info.serialno);
-
+
leave:
agent_release_card_info (&info);
restore_forced_chv1 (&forced_chv1);
@@ -1525,7 +1525,7 @@ card_generate_subkey (KBNODE pub_keyblock)
carry the serialno stuff instead of the actual secret key
parameters. USE is the usage for that key; 0 means any
usage. */
-int
+int
card_store_subkey (KBNODE node, int use)
{
log_info ("FIXME: card_store_subkey has not yet been implemented\n");
@@ -1722,7 +1722,7 @@ static struct
{ "privatedo", cmdPRIVATEDO, 0, NULL },
{ "readcert", cmdREADCERT, 0, NULL },
{ "writecert", cmdWRITECERT, 1, NULL },
- { NULL, cmdINVCMD, 0, NULL }
+ { NULL, cmdINVCMD, 0, NULL }
};
@@ -1801,7 +1801,7 @@ card_edit (ctrl_t ctrl, strlist_t commands)
char *p;
int i;
int cmd_admin_only;
-
+
tty_printf("\n");
if (redisplay )
{
@@ -1853,7 +1853,7 @@ card_edit (ctrl_t ctrl, strlist_t commands)
cmd = cmdLIST; /* Default to the list command */
else if (*answer == CONTROL_D)
cmd = cmdQUIT;
- else
+ else
{
if ((p=strchr (answer,' ')))
{
@@ -1868,7 +1868,7 @@ card_edit (ctrl_t ctrl, strlist_t commands)
while (spacep (arg_rest))
arg_rest++;
}
-
+
for (i=0; cmds[i].name; i++ )
if (!ascii_strcasecmp (answer, cmds[i].name ))
break;
@@ -2012,4 +2012,3 @@ card_edit (ctrl_t ctrl, strlist_t commands)
leave:
xfree (answer);
}
-
diff --git a/g10/cipher.c b/g10/cipher.c
index f0dc57719..07df792c9 100644
--- a/g10/cipher.c
+++ b/g10/cipher.c
@@ -66,7 +66,7 @@ write_header( cipher_filter_context_t *cfx, IOBUF a )
{
char buf[20];
-
+
sprintf (buf, "%d %d", ed.mdc_method, cfx->dek->algo);
write_status_text (STATUS_BEGIN_ENCRYPTION, buf);
}
@@ -81,7 +81,7 @@ write_header( cipher_filter_context_t *cfx, IOBUF a )
temp[nprefix] = temp[nprefix-2];
temp[nprefix+1] = temp[nprefix-1];
print_cipher_algo_note( cfx->dek->algo );
- err = openpgp_cipher_open (&cfx->cipher_hd,
+ err = openpgp_cipher_open (&cfx->cipher_hd,
cfx->dek->algo,
GCRY_CIPHER_MODE_CFB,
(GCRY_CIPHER_SECURE
diff --git a/g10/comment.c b/g10/comment.c
index 7f9295ea5..085dbad3b 100644
--- a/g10/comment.c
+++ b/g10/comment.c
@@ -106,5 +106,3 @@ make_mpi_comment_node( const char *s, gcry_mpi_t a )
xfree (buf);
return new_kbnode( pkt );
}
-
-
diff --git a/g10/compress-bz2.c b/g10/compress-bz2.c
index 1dabca14e..ea80956c3 100644
--- a/g10/compress-bz2.c
+++ b/g10/compress-bz2.c
@@ -156,7 +156,7 @@ do_uncompress( compress_filter_context_t *zfx, bz_stream *bzs,
rc = -1; /* eof */
else if( zrc != BZ_OK && zrc != BZ_PARAM_ERROR )
log_fatal("bz2lib inflate problem: rc=%d\n", zrc );
- else if (zrc == BZ_OK && eofseen
+ else if (zrc == BZ_OK && eofseen
&& !bzs->avail_in && bzs->avail_out > 0)
{
log_error ("unexpected EOF in bz2lib\n");
diff --git a/g10/compress.c b/g10/compress.c
index 5dd3591df..6e412e9ac 100644
--- a/g10/compress.c
+++ b/g10/compress.c
@@ -35,7 +35,7 @@
# include <zlib.h>
# if defined(__riscos__) && defined(USE_ZLIBRISCOS)
# include "zlib-riscos.h"
-# endif
+# endif
#endif
#include "gpg.h"
@@ -48,7 +48,7 @@
#ifdef __riscos__
#define BYTEF_CAST(a) ((Bytef *)(a))
-#else
+#else
#define BYTEF_CAST(a) (a)
#endif
@@ -140,7 +140,7 @@ init_uncompress( compress_filter_context_t *zfx, z_stream *zs )
* PGP uses a windowsize of 13 bits. Using a negative value for
* it forces zlib not to expect a zlib header. This is a
* undocumented feature Peter Gutmann told me about.
- *
+ *
* We must use 15 bits for the inflator because CryptoEx uses 15
* bits thus the output would get scrambled w/o error indication
* if we would use 13 bits. For the uncompressing this does not
diff --git a/g10/cpr.c b/g10/cpr.c
index 72d23b987..b84710d03 100644
--- a/g10/cpr.c
+++ b/g10/cpr.c
@@ -1,4 +1,4 @@
-/* status.c - Status message and command-fd interface
+/* status.c - Status message and command-fd interface
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003,
* 2004, 2005, 2006, 2010 Free Software Foundation, Inc.
*
@@ -78,13 +78,13 @@ status_currently_allowed (int no)
prompt the user. */
switch (no)
{
- case STATUS_GET_BOOL:
- case STATUS_GET_LINE:
- case STATUS_GET_HIDDEN:
- case STATUS_GOT_IT:
+ case STATUS_GET_BOOL:
+ case STATUS_GET_LINE:
+ case STATUS_GET_HIDDEN:
+ case STATUS_GOT_IT:
case STATUS_IMPORTED:
- case STATUS_IMPORT_OK:
- case STATUS_IMPORT_CHECK:
+ case STATUS_IMPORT_OK:
+ case STATUS_IMPORT_CHECK:
case STATUS_IMPORT_RES:
return 1; /* Yes. */
default:
@@ -98,16 +98,16 @@ void
set_status_fd (int fd)
{
static int last_fd = -1;
-
+
if (fd != -1 && last_fd == fd)
return;
if (statusfp && statusfp != es_stdout && statusfp != es_stderr )
es_fclose (statusfp);
statusfp = NULL;
- if (fd == -1)
+ if (fd == -1)
return;
-
+
if (fd == 1)
statusfp = es_stdout;
else if (fd == 2)
@@ -147,7 +147,7 @@ write_status_text (int no, const char *text)
es_fputs ("[GNUPG:] ", statusfp);
es_fputs (get_status_string (no), statusfp);
- if ( text )
+ if ( text )
{
es_putc ( ' ', statusfp);
for (; *text; text++)
@@ -156,7 +156,7 @@ write_status_text (int no, const char *text)
es_fputs ("\\n", statusfp);
else if (*text == '\r')
es_fputs ("\\r", statusfp);
- else
+ else
es_fputc ( *(const byte *)text, statusfp);
}
}
@@ -173,7 +173,7 @@ write_status_error (const char *where, gpg_error_t err)
if (!statusfp || !status_currently_allowed (STATUS_ERROR))
return; /* Not enabled or allowed. */
- es_fprintf (statusfp, "[GNUPG:] %s %s %u\n",
+ es_fprintf (statusfp, "[GNUPG:] %s %s %u\n",
get_status_string (STATUS_ERROR), where, err);
if (es_fflush (statusfp) && opt.exit_on_status_write_error)
g10_exit (0);
@@ -187,7 +187,7 @@ write_status_errcode (const char *where, int errcode)
if (!statusfp || !status_currently_allowed (STATUS_ERROR))
return; /* Not enabled or allowed. */
- es_fprintf (statusfp, "[GNUPG:] %s %s %u\n",
+ es_fprintf (statusfp, "[GNUPG:] %s %s %u\n",
get_status_string (STATUS_ERROR), where, gpg_err_code (errcode));
if (es_fflush (statusfp) && opt.exit_on_status_write_error)
g10_exit (0);
@@ -211,7 +211,7 @@ write_status_text_and_buffer (int no, const char *string,
if (!statusfp || !status_currently_allowed (no))
return; /* Not enabled or allowed. */
-
+
if (wrap == -1)
{
lower_limit--;
@@ -220,7 +220,7 @@ write_status_text_and_buffer (int no, const char *string,
text = get_status_string (no);
count = dowrap = first = 1;
- do
+ do
{
if (dowrap)
{
@@ -241,8 +241,8 @@ write_status_text_and_buffer (int no, const char *string,
}
for (esc=0, s=buffer, n=len; n && !esc; s++, n--)
{
- if (*s == '%' || *(const byte*)s <= lower_limit
- || *(const byte*)s == 127 )
+ if (*s == '%' || *(const byte*)s <= lower_limit
+ || *(const byte*)s == 127 )
esc = 1;
if (wrap && ++count > wrap)
{
@@ -250,13 +250,13 @@ write_status_text_and_buffer (int no, const char *string,
break;
}
}
- if (esc)
+ if (esc)
{
s--; n++;
}
- if (s != buffer)
+ if (s != buffer)
es_fwrite (buffer, s-buffer, 1, statusfp);
- if ( esc )
+ if ( esc )
{
es_fprintf (statusfp, "%%%02X", *(const byte*)s );
s++; n--;
@@ -265,7 +265,7 @@ write_status_text_and_buffer (int no, const char *string,
len = n;
if (dowrap && len)
es_putc ('\n', statusfp);
- }
+ }
while (len);
es_putc ('\n',statusfp);
@@ -291,7 +291,7 @@ write_status_begin_signing (gcry_md_hd_t md)
char buf[100];
size_t buflen;
int i;
-
+
/* We use a hard coded list of possible algorithms. Using other
algorithms than specified by OpenPGP does not make sense
anyway. We do this out of performance reasons: Walking all
@@ -304,7 +304,7 @@ write_status_begin_signing (gcry_md_hd_t md)
if (i < 4 || i > 7)
if (gcry_md_is_enabled (md, i) && buflen < DIM(buf))
{
- snprintf (buf+buflen, DIM(buf) - buflen - 1,
+ snprintf (buf+buflen, DIM(buf) - buflen - 1,
"%sH%d", buflen? " ":"",i);
buflen += strlen (buf+buflen);
}
@@ -319,10 +319,10 @@ static int
myread(int fd, void *buf, size_t count)
{
int rc;
- do
+ do
{
rc = read( fd, buf, count );
- }
+ }
while (rc == -1 && errno == EINTR);
if (!rc && count)
@@ -335,7 +335,7 @@ myread(int fd, void *buf, size_t count)
eof_emmited++;
}
else /* Ctrl-D not caught - do something reasonable */
- {
+ {
#ifdef HAVE_DOSISH_SYSTEM
#ifndef HAVE_W32CE_SYSTEM
raise (SIGINT); /* Nothing to hangup under DOS. */
@@ -344,7 +344,7 @@ myread(int fd, void *buf, size_t count)
raise (SIGHUP); /* No more input data. */
#endif
}
- }
+ }
return rc;
}
@@ -358,16 +358,16 @@ do_get_from_fd ( const char *keyword, int hidden, int getbool )
{
int i, len;
char *string;
-
+
if (statusfp != es_stdout)
es_fflush (es_stdout);
-
+
write_status_text (getbool? STATUS_GET_BOOL :
hidden? STATUS_GET_HIDDEN : STATUS_GET_LINE, keyword);
- for (string = NULL, i = len = 200; ; i++ )
+ for (string = NULL, i = len = 200; ; i++ )
{
- if (i >= len-1 )
+ if (i >= len-1 )
{
char *save = string;
len += 100;
@@ -380,7 +380,7 @@ do_get_from_fd ( const char *keyword, int hidden, int getbool )
/* Fixme: why not use our read_line function here? */
if ( myread( opt.command_fd, string+i, 1) != 1 || string[i] == '\n' )
break;
- else if ( string[i] == CONTROL_D )
+ else if ( string[i] == CONTROL_D )
{
/* Found ETX - Cancel the line and return a sole ETX. */
string[0] = CONTROL_D;
diff --git a/g10/dearmor.c b/g10/dearmor.c
index 04b9e61bf..e83447103 100644
--- a/g10/dearmor.c
+++ b/g10/dearmor.c
@@ -130,5 +130,3 @@ enarmor_file( const char *fname )
release_armor_context (afx);
return rc;
}
-
-
diff --git a/g10/decrypt.c b/g10/decrypt.c
index 48d5e84f7..e8c4563a6 100644
--- a/g10/decrypt.c
+++ b/g10/decrypt.c
@@ -52,7 +52,7 @@ decrypt_message (ctrl_t ctrl, const char *filename)
int no_out = 0;
pfx = new_progress_context ();
-
+
/* Open the message file. */
fp = iobuf_open (filename);
if (fp && is_secured_file (iobuf_get_fd (fp)))
@@ -111,7 +111,7 @@ decrypt_message_fd (ctrl_t ctrl, int input_fd, int output_fd)
return gpg_error (GPG_ERR_BUG);
pfx = new_progress_context ();
-
+
/* Open the message file. */
fp = iobuf_open_fd_or_name (input_fd, NULL, "rb");
if (fp && is_secured_file (iobuf_get_fd (fp)))
@@ -123,7 +123,7 @@ decrypt_message_fd (ctrl_t ctrl, int input_fd, int output_fd)
if (!fp)
{
char xname[64];
-
+
err = gpg_error_from_syserror ();
snprintf (xname, sizeof xname, "[fd %d]", input_fd);
log_error (_("can't open `%s': %s\n"), xname, gpg_strerror (err));
@@ -173,12 +173,12 @@ void
decrypt_messages (ctrl_t ctrl, int nfiles, char *files[])
{
IOBUF fp;
- armor_filter_context_t *afx = NULL;
+ armor_filter_context_t *afx = NULL;
progress_filter_context_t *pfx;
char *p, *output = NULL;
int rc=0,use_stdin=0;
unsigned int lno=0;
-
+
if (opt.outfile)
{
log_error(_("--output doesn't work for this command\n"));
@@ -222,7 +222,7 @@ decrypt_messages (ctrl_t ctrl, int nfiles, char *files[])
if(filename==NULL)
break;
- print_file_status(STATUS_FILE_START, filename, 3);
+ print_file_status(STATUS_FILE_START, filename, 3);
output = make_outfile_name(filename);
if (!output)
goto next_file;
@@ -267,7 +267,7 @@ decrypt_messages (ctrl_t ctrl, int nfiles, char *files[])
reset_literals_seen();
}
- set_next_passphrase(NULL);
+ set_next_passphrase(NULL);
release_armor_context (afx);
release_progress_context (pfx);
}
diff --git a/g10/delkey.c b/g10/delkey.c
index 62c75632b..978549826 100644
--- a/g10/delkey.c
+++ b/g10/delkey.c
@@ -92,7 +92,7 @@ do_delete_key( const char *username, int secret, int force, int *r_sec_avail )
pk = node->pkt->pkt.public_key;
keyid_from_pk( pk, keyid );
-
+
if (!force)
{
if (have_secret_key_with_kid (keyid))
@@ -181,7 +181,7 @@ delete_keys( strlist_t names, int secret, int allow_both )
for(;names;names=names->next) {
rc = do_delete_key (names->d, secret, force, &avail );
- if ( rc && avail ) {
+ if ( rc && avail ) {
if ( allow_both ) {
rc = do_delete_key (names->d, 1, 0, &avail );
if ( !rc )
diff --git a/g10/exec.c b/g10/exec.c
index 2803812dc..56e49ec34 100644
--- a/g10/exec.c
+++ b/g10/exec.c
@@ -17,7 +17,7 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-/*
+/*
FIXME: We should replace most code in this module by our
spawn implementation from common/exechelp.c.
*/
@@ -50,7 +50,7 @@
#include "exec.h"
#ifdef NO_EXEC
-int
+int
exec_write(struct exec_info **info,const char *program,
const char *args_in,const char *name,int writeonly,int binary)
{
@@ -71,7 +71,7 @@ set_exec_path(const char *path) { return G10ERR_GENERAL; }
/* This is a nicer system() for windows that waits for programs to
return before returning control to the caller. I hate helpful
computers. */
-static int
+static int
w32_system(const char *command)
{
#ifdef HAVE_W32CE_SYSTEM
@@ -107,7 +107,7 @@ w32_system(const char *command)
#endif
/* Replaces current $PATH */
-int
+int
set_exec_path(const char *path)
{
#ifdef HAVE_W32CE_SYSTEM
@@ -134,7 +134,7 @@ set_exec_path(const char *path)
}
/* Makes a temp directory and filenames */
-static int
+static int
make_tempdir(struct exec_info *info)
{
char *tmp=opt.temp_dir,*namein=info->name,*nameout;
@@ -216,7 +216,7 @@ make_tempdir(struct exec_info *info)
/* Expands %i and %o in the args to the full temp files within the
temp directory. */
-static int
+static int
expand_args(struct exec_info *info,const char *args_in)
{
const char *ch = args_in;
@@ -305,7 +305,7 @@ expand_args(struct exec_info *info,const char *args_in)
If there are args, but no tempfiles, then it's a fork/exec/pipe via
shell -c. If there are tempfiles, then it's a system. */
-int
+int
exec_write(struct exec_info **info,const char *program,
const char *args_in,const char *name,int writeonly,int binary)
{
@@ -607,7 +607,7 @@ exec_finish(struct exec_info *info)
log_info(_("WARNING: unable to remove tempfile (%s) `%s': %s\n"),
"in",info->tempfile_in,strerror(errno));
}
-
+
if(info->tempfile_out)
{
if(unlink(info->tempfile_out)==-1)
diff --git a/g10/filter.h b/g10/filter.h
index 923cfdadf..18a9170f8 100644
--- a/g10/filter.h
+++ b/g10/filter.h
@@ -121,7 +121,7 @@ typedef struct {
unsigned long last; /* last amount reported */
unsigned long offset; /* current amount */
unsigned long total; /* total amount */
- int refcount;
+ int refcount;
} progress_filter_context_t;
/* encrypt_filter_context_t defined in main.h */
diff --git a/g10/free-packet.c b/g10/free-packet.c
index 3b186561e..267568478 100644
--- a/g10/free-packet.c
+++ b/g10/free-packet.c
@@ -29,7 +29,7 @@
#include "packet.h"
#include "../common/iobuf.h"
#include "cipher.h"
-#include "options.h"
+#include "options.h"
void
@@ -79,7 +79,7 @@ void
release_public_key_parts (PKT_public_key *pk)
{
int n, i;
-
+
if (pk->seckey_info)
n = pubkey_get_nskey (pk->pubkey_algo);
else
@@ -143,7 +143,7 @@ cp_subpktarea (subpktarea_t *s )
}
/*
- * Return a copy of the preferences
+ * Return a copy of the preferences
*/
prefitem_t *
copy_prefs (const prefitem_t *prefs)
@@ -153,7 +153,7 @@ copy_prefs (const prefitem_t *prefs)
if (!prefs)
return NULL;
-
+
for (n=0; prefs[n].type; n++)
;
new = xmalloc ( sizeof (*new) * (n+1));
@@ -175,11 +175,11 @@ PKT_public_key *
copy_public_key (PKT_public_key *d, PKT_public_key *s)
{
int n, i;
-
+
if (!d)
d = xmalloc (sizeof *d);
memcpy (d, s, sizeof *d);
- d->seckey_info = NULL;
+ d->seckey_info = NULL;
d->user_id = scopy_user_id (s->user_id);
d->prefs = copy_prefs (s->prefs);
@@ -187,7 +187,7 @@ copy_public_key (PKT_public_key *d, PKT_public_key *s)
i = 0;
if (!n)
d->pkey[i++] = mpi_copy (s->pkey[0]);
- else
+ else
{
for (; i < n; i++ )
d->pkey[i] = mpi_copy( s->pkey[i] );
@@ -213,7 +213,7 @@ static pka_info_t *
cp_pka_info (const pka_info_t *s)
{
pka_info_t *d = xmalloc (sizeof *s + strlen (s->email));
-
+
d->valid = s->valid;
d->checked = s->checked;
d->uri = s->uri? xstrdup (s->uri):NULL;
diff --git a/g10/getkey.c b/g10/getkey.c
index 65f5829dc..6464f9e0f 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -1139,7 +1139,7 @@ get_seckeyblock_byfprint (kbnode_t *ret_keyblock,
-/* The new function to return a key.
+/* The new function to return a key.
FIXME: Document it. */
gpg_error_t
getkey_bynames (getkey_ctx_t *retctx, PKT_public_key *pk,
@@ -1157,11 +1157,11 @@ getkey_bynames (getkey_ctx_t *retctx, PKT_public_key *pk,
* NULL the found keyblock is stored at this address. WANT_SECRET
* passed as true requires that a secret key is available for the
* selected key.
- *
+ *
* If WANT_SECRET is true and NAME is NULL and a default key has been
* defined that defined key is used. In all other cases the first
- * available key is used.
- *
+ * available key is used.
+ *
* FIXME: Explain what is up with unusable keys.
*
* FIXME: We also have the get_pubkey_byname function which has a
@@ -1184,7 +1184,7 @@ getkey_byname (getkey_ctx_t *retctx, PKT_public_key *pk,
err = key_byname (retctx, namelist, pk, want_secret, with_unusable,
ret_keyblock, NULL);
-
+
/* FIXME: Check that we really return GPG_ERR_NO_SECKEY if
WANT_SECRET has been used. */
@@ -2486,7 +2486,7 @@ lookup (getkey_ctx_t ctx, kbnode_t *ret_keyblock, int want_secret)
release_kbnode (ctx->keyblock);
ctx->keyblock = NULL;
}
-
+
found:
if (rc && rc != -1)
log_error ("keydb_search failed: %s\n", g10_errstr (rc));
@@ -2562,7 +2562,7 @@ enum_secret_keys (void **context, PKT_public_key *sk)
while (!c->keyblock)
{
/* Loop over the list of secret keys. */
- do
+ do
{
name = NULL;
switch (c->state)
@@ -2572,12 +2572,12 @@ enum_secret_keys (void **context, PKT_public_key *sk)
name = opt.def_secret_key;
c->state = 1;
break;
-
+
case 1: /* Init list of keys to try. */
c->sl = opt.secret_keys_to_try;
c->state++;
break;
-
+
case 2: /* Get next item from list. */
if (c->sl)
{
@@ -2588,7 +2588,7 @@ enum_secret_keys (void **context, PKT_public_key *sk)
c->state++;
break;
- default: /* No more names to check - stop. */
+ default: /* No more names to check - stop. */
c->eof = 1;
return gpg_error (GPG_ERR_EOF);
}
@@ -2607,7 +2607,7 @@ enum_secret_keys (void **context, PKT_public_key *sk)
else
c->node = c->keyblock;
}
-
+
/* Get the next key from the current keyblock. */
for (; c->node; c->node = c->node->next)
{
diff --git a/g10/gpg.c b/g10/gpg.c
index 6daa144be..8326ee7e3 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -304,7 +304,7 @@ enum cmd_and_opt_values
oNoAllowNonSelfsignedUID,
oAllowFreeformUID,
oNoAllowFreeformUID,
- oAllowSecretKeyImport,
+ oAllowSecretKeyImport,
oEnableSpecialFilenames,
oNoLiteral,
oSetFilesize,
@@ -395,7 +395,7 @@ static ARGPARSE_OPTS opts[] = {
ARGPARSE_c (aListSecretKeys, "list-secret-keys", N_("list secret keys")),
ARGPARSE_c (aKeygen, "gen-key", N_("generate a new key pair")),
ARGPARSE_c (aGenRevoke, "gen-revoke",N_("generate a revocation certificate")),
- ARGPARSE_c (aDeleteKeys,"delete-keys",
+ ARGPARSE_c (aDeleteKeys,"delete-keys",
N_("remove keys from the public keyring")),
ARGPARSE_c (aDeleteSecretKeys, "delete-secret-keys",
N_("remove keys from the secret keyring")),
@@ -408,9 +408,9 @@ static ARGPARSE_OPTS opts[] = {
ARGPARSE_c (aExport, "export" , N_("export keys") ),
ARGPARSE_c (aSendKeys, "send-keys" , N_("export keys to a key server") ),
ARGPARSE_c (aRecvKeys, "recv-keys" , N_("import keys from a key server") ),
- ARGPARSE_c (aSearchKeys, "search-keys" ,
+ ARGPARSE_c (aSearchKeys, "search-keys" ,
N_("search for keys on a key server") ),
- ARGPARSE_c (aRefreshKeys, "refresh-keys",
+ ARGPARSE_c (aRefreshKeys, "refresh-keys",
N_("update all keys from a keyserver")),
ARGPARSE_c (aLocateKeys, "locate-keys", "@"),
ARGPARSE_c (aFetchKeys, "fetch-keys" , "@" ),
@@ -600,7 +600,7 @@ static ARGPARSE_OPTS opts[] = {
/* More hidden commands and options. */
ARGPARSE_c (aPrintMDs, "print-mds", "@"), /* old */
ARGPARSE_c (aListTrustDB, "list-trustdb", "@"),
- /* Not yet used:
+ /* Not yet used:
ARGPARSE_c (aListTrustPath, "list-trust-path", "@"), */
ARGPARSE_c (aDeleteSecretAndPublicKeys,
"delete-secret-and-public-keys", "@"),
@@ -624,8 +624,8 @@ static ARGPARSE_OPTS opts[] = {
ARGPARSE_s_n (oNoArmor, "no-armour", "@"),
ARGPARSE_s_n (oNoDefKeyring, "no-default-keyring", "@"),
ARGPARSE_s_n (oNoGreeting, "no-greeting", "@"),
- ARGPARSE_s_n (oNoOptions, "no-options", "@"),
- ARGPARSE_s_s (oHomedir, "homedir", "@"),
+ ARGPARSE_s_n (oNoOptions, "no-options", "@"),
+ ARGPARSE_s_s (oHomedir, "homedir", "@"),
ARGPARSE_s_n (oNoBatch, "no-batch", "@"),
ARGPARSE_s_n (oWithColons, "with-colons", "@"),
ARGPARSE_s_n (oWithKeyData,"with-key-data", "@"),
@@ -738,8 +738,8 @@ static ARGPARSE_OPTS opts[] = {
ARGPARSE_s_s (oKeyidFormat, "keyid-format", "@"),
ARGPARSE_s_n (oExitOnStatusWriteError, "exit-on-status-write-error", "@"),
ARGPARSE_s_i (oLimitCardInsertTries, "limit-card-insert-tries", "@"),
-
- ARGPARSE_s_n (oAllowMultisigVerification,
+
+ ARGPARSE_s_n (oAllowMultisigVerification,
"allow-multisig-verification", "@"),
ARGPARSE_s_n (oEnableDSA2, "enable-dsa2", "@"),
ARGPARSE_s_n (oDisableDSA2, "disable-dsa2", "@"),
@@ -794,7 +794,7 @@ make_libversion (const char *libname, const char *(*getfnc)(const char*))
{
const char *s;
char *result;
-
+
if (maybe_setuid)
{
gcry_control (GCRYCTL_INIT_SECMEM, 0, 0); /* Drop setuid. */
@@ -864,14 +864,14 @@ my_strusage( int level )
break;
case 35:
if( !ciphers )
- ciphers = build_list(_("Cipher: "), 'S',
+ ciphers = build_list(_("Cipher: "), 'S',
openpgp_cipher_algo_name,
openpgp_cipher_test_algo );
p = ciphers;
break;
case 36:
if( !digests )
- digests = build_list(_("Hash: "), 'H',
+ digests = build_list(_("Hash: "), 'H',
gcry_md_algo_name,
openpgp_md_test_algo );
p = digests;
@@ -971,7 +971,7 @@ static void
set_opt_session_env (const char *name, const char *value)
{
gpg_error_t err;
-
+
err = session_env_setenv (opt.session_env, name, value);
if (err)
log_fatal ("error setting session environment: %s\n",
@@ -1005,7 +1005,7 @@ set_debug (const char *level)
/* Unless the "guru" string has been used we don't want to allow
hashing debugging. The rationale is that people tend to
select the highest debug value and would then clutter their
- disk with debug files which may reveal confidential data. */
+ disk with debug files which may reveal confidential data. */
if (numok)
opt.debug &= ~(DBG_HASHING_VALUE);
}
@@ -1029,17 +1029,17 @@ set_debug (const char *level)
if (opt.debug)
log_info ("enabled debug flags:%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
- (opt.debug & DBG_PACKET_VALUE )? " packet":"",
- (opt.debug & DBG_MPI_VALUE )? " mpi":"",
- (opt.debug & DBG_CIPHER_VALUE )? " cipher":"",
- (opt.debug & DBG_FILTER_VALUE )? " filter":"",
- (opt.debug & DBG_IOBUF_VALUE )? " iobuf":"",
- (opt.debug & DBG_MEMORY_VALUE )? " memory":"",
- (opt.debug & DBG_CACHE_VALUE )? " cache":"",
- (opt.debug & DBG_MEMSTAT_VALUE)? " memstat":"",
- (opt.debug & DBG_TRUST_VALUE )? " trust":"",
- (opt.debug & DBG_HASHING_VALUE)? " hashing":"",
- (opt.debug & DBG_EXTPROG_VALUE)? " extprog":"",
+ (opt.debug & DBG_PACKET_VALUE )? " packet":"",
+ (opt.debug & DBG_MPI_VALUE )? " mpi":"",
+ (opt.debug & DBG_CIPHER_VALUE )? " cipher":"",
+ (opt.debug & DBG_FILTER_VALUE )? " filter":"",
+ (opt.debug & DBG_IOBUF_VALUE )? " iobuf":"",
+ (opt.debug & DBG_MEMORY_VALUE )? " memory":"",
+ (opt.debug & DBG_CACHE_VALUE )? " cache":"",
+ (opt.debug & DBG_MEMSTAT_VALUE)? " memstat":"",
+ (opt.debug & DBG_TRUST_VALUE )? " trust":"",
+ (opt.debug & DBG_HASHING_VALUE)? " hashing":"",
+ (opt.debug & DBG_EXTPROG_VALUE)? " extprog":"",
(opt.debug & DBG_CARD_IO_VALUE)? " cardio":"",
(opt.debug & DBG_ASSUAN_VALUE )? " assuan":"");
}
@@ -1102,7 +1102,7 @@ open_info_file (const char *fname, int for_write, int binary)
(void)for_write;
(void)binary;
return -1;
-#else
+#else
int fd;
if (binary)
@@ -1128,7 +1128,7 @@ open_info_file (const char *fname, int for_write, int binary)
if ( fd == -1)
log_error ( for_write? _("can't create `%s': %s\n")
: _("can't open `%s': %s\n"), fname, strerror(errno));
-
+
return fd;
#endif
}
@@ -1572,7 +1572,7 @@ list_config(char *items)
es_printf ("\n");
any=1;
}
-
+
if(show_all || ascii_strcasecmp(name,"compress")==0)
{
es_printf ("cfg:compress:");
@@ -1839,7 +1839,7 @@ get_default_configname (void)
if (configname)
{
char *tok;
-
+
xfree (configname);
configname = NULL;
@@ -1850,13 +1850,13 @@ get_default_configname (void)
else
break;
}
-
+
configname = make_filename (opt.homedir, name, NULL);
}
while (access (configname, R_OK));
xfree(name);
-
+
if (! configname)
configname = make_filename (opt.homedir, "gpg" EXTSEP_S "conf", NULL);
if (! access (configname, R_OK))
@@ -2065,7 +2065,7 @@ main (int argc, char **argv)
/* Initialize the secure memory. */
if (!gcry_control (GCRYCTL_INIT_SECMEM, 32768, 0))
- got_secmem = 1;
+ got_secmem = 1;
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
/* There should be no way to get to this spot while still carrying
setuid privs. Just in case, bomb out if we are. */
@@ -2083,7 +2083,7 @@ main (int argc, char **argv)
assuan_set_malloc_hooks (&malloc_hooks);
assuan_set_gpg_err_source (GPG_ERR_SOURCE_DEFAULT);
setup_libassuan_logging (&opt.debug);
-
+
/* Try for a version specific config file first */
default_configname = get_default_configname ();
if (default_config)
@@ -2142,55 +2142,55 @@ main (int argc, char **argv)
{
switch( pargs.r_opt )
{
- case aCheckKeys:
+ case aCheckKeys:
case aListConfig:
case aGPGConfList:
case aGPGConfTest:
case aListPackets:
- case aImport:
- case aFastImport:
- case aSendKeys:
- case aRecvKeys:
+ case aImport:
+ case aFastImport:
+ case aSendKeys:
+ case aRecvKeys:
case aSearchKeys:
case aRefreshKeys:
case aFetchKeys:
- case aExport:
+ case aExport:
#ifdef ENABLE_CARD_SUPPORT
case aCardStatus:
- case aCardEdit:
+ case aCardEdit:
case aChangePIN:
#endif /* ENABLE_CARD_SUPPORT*/
- case aListKeys:
+ case aListKeys:
case aLocateKeys:
- case aListSigs:
- case aExportSecret:
- case aExportSecretSub:
+ case aListSigs:
+ case aExportSecret:
+ case aExportSecretSub:
case aSym:
- case aClearsign:
- case aGenRevoke:
- case aDesigRevoke:
- case aPrimegen:
+ case aClearsign:
+ case aGenRevoke:
+ case aDesigRevoke:
+ case aPrimegen:
case aGenRandom:
case aPrintMD:
- case aPrintMDs:
- case aListTrustDB:
+ case aPrintMDs:
+ case aListTrustDB:
case aCheckTrustDB:
- case aUpdateTrustDB:
- case aFixTrustDB:
- case aListTrustPath:
- case aDeArmor:
- case aEnArmor:
- case aSign:
- case aSignKey:
+ case aUpdateTrustDB:
+ case aFixTrustDB:
+ case aListTrustPath:
+ case aDeArmor:
+ case aEnArmor:
+ case aSign:
+ case aSignKey:
case aLSignKey:
- case aStore:
- case aExportOwnerTrust:
- case aImportOwnerTrust:
+ case aStore:
+ case aExportOwnerTrust:
+ case aImportOwnerTrust:
case aRebuildKeydbCaches:
set_cmd (&cmd, pargs.r_opt);
break;
- case aKeygen:
+ case aKeygen:
case aEditKey:
case aDeleteSecretKeys:
case aDeleteSecretAndPublicKeys:
@@ -2240,7 +2240,7 @@ main (int argc, char **argv)
case oNoUseAgent:
obsolete_option (configname, configlineno, "--no-use-agent");
break;
- case oGpgAgentInfo:
+ case oGpgAgentInfo:
obsolete_option (configname, configlineno, "--gpg-agent-info");
break;
@@ -2308,12 +2308,12 @@ main (int argc, char **argv)
case oNoArmor: opt.no_armor=1; opt.armor=0; break;
case oNoDefKeyring: default_keyring = 0; break;
case oNoGreeting: nogreeting = 1; break;
- case oNoVerbose:
+ case oNoVerbose:
opt.verbose = 0;
gcry_control (GCRYCTL_SET_VERBOSITY, (int)opt.verbose);
opt.list_sigs=0;
break;
- case oQuickRandom:
+ case oQuickRandom:
gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
break;
case oEmitVersion: opt.no_version=0; break;
@@ -2343,7 +2343,7 @@ main (int argc, char **argv)
case oWithColons: opt.with_colons=':'; break;
case oWithSigCheck: opt.check_sigs = 1; /*FALLTHRU*/
- case oWithSigList: opt.list_sigs = 1; break;
+ case oWithSigList: opt.list_sigs = 1; break;
case oSkipVerify: opt.skip_verify=1; break;
@@ -2535,7 +2535,7 @@ main (int argc, char **argv)
any_explicit_recipient = 1;
break;
- case oTrySecretKey:
+ case oTrySecretKey:
add_to_strlist2 (&opt.secret_keys_to_try,
pargs.r.ret_str, utf8_strings);
break;
@@ -2599,7 +2599,7 @@ main (int argc, char **argv)
case oCommandFile:
opt.command_fd = open_info_file (pargs.r.ret_str, 0, 1);
break;
- case oCipherAlgo:
+ case oCipherAlgo:
def_cipher_string = xstrdup(pargs.r.ret_str);
break;
case oDigestAlgo:
@@ -2629,12 +2629,12 @@ main (int argc, char **argv)
compress_algo_string = xstrdup(pargs.r.ret_str);
}
break;
- case oCertDigestAlgo:
+ case oCertDigestAlgo:
cert_digest_string = xstrdup(pargs.r.ret_str);
break;
- case oNoSecmemWarn:
- gcry_control (GCRYCTL_DISABLE_SECMEM_WARN);
+ case oNoSecmemWarn:
+ gcry_control (GCRYCTL_DISABLE_SECMEM_WARN);
break;
case oRequireSecmem: require_secmem=1; break;
@@ -2864,7 +2864,7 @@ main (int argc, char **argv)
log_error (_("could not parse keyserver URL\n"));
else
free_keyserver_spec (keyserver);
-
+
opt.def_keyserver_url = pargs.r.ret_str;
}
break;
@@ -2907,8 +2907,8 @@ main (int argc, char **argv)
}
break;
- case oStrict:
- case oNoStrict:
+ case oStrict:
+ case oNoStrict:
/* Not used */
break;
@@ -2933,8 +2933,8 @@ main (int argc, char **argv)
opt.exit_on_status_write_error = 1;
break;
- case oLimitCardInsertTries:
- opt.limit_card_insert_tries = pargs.r.ret_int;
+ case oLimitCardInsertTries:
+ opt.limit_card_insert_tries = pargs.r.ret_int;
break;
case oRequireCrossCert: opt.flags.require_cross_cert=1; break;
@@ -2968,7 +2968,7 @@ main (int argc, char **argv)
case oFakedSystemTime:
{
- time_t faked_time = isotime2epoch (pargs.r.ret_str);
+ time_t faked_time = isotime2epoch (pargs.r.ret_str);
if (faked_time == (time_t)(-1))
faked_time = (time_t)strtoul (pargs.r.ret_str, NULL, 10);
gnupg_set_time (faked_time, 0);
@@ -2977,7 +2977,7 @@ main (int argc, char **argv)
case oNoop: break;
- default:
+ default:
pargs.err = configfp? ARGPARSE_PRINT_WARNING:ARGPARSE_PRINT_ERROR;
break;
}
@@ -3085,13 +3085,13 @@ main (int argc, char **argv)
if (gnupg_faked_time_p ())
{
gnupg_isotime_t tbuf;
-
+
log_info (_("WARNING: running with faked system time: "));
gnupg_get_isotime (tbuf);
dump_isotime (tbuf);
log_printf ("\n");
}
-
+
gcry_control (GCRYCTL_RESUME_SECMEM_WARN);
@@ -3396,12 +3396,12 @@ main (int argc, char **argv)
avoid adding the secret keyring for a couple of commands to
avoid unneeded access in case the secrings are stored on a
floppy.
-
+
We always need to add the keyrings if we are running under
SELinux, this is so that the rings are added to the list of
secured files. */
- if( ALWAYS_ADD_KEYRINGS
- || (cmd != aDeArmor && cmd != aEnArmor && cmd != aGPGConfTest) )
+ if( ALWAYS_ADD_KEYRINGS
+ || (cmd != aDeArmor && cmd != aEnArmor && cmd != aGPGConfTest) )
{
if (!nrings || default_keyring) /* Add default ring. */
keydb_add_resource ("pubring" EXTSEP_S "gpg", 4);
@@ -3444,11 +3444,11 @@ main (int argc, char **argv)
switch (cmd)
{
- case aStore:
- case aSym:
- case aSign:
- case aSignSym:
- case aClearsign:
+ case aStore:
+ case aSym:
+ case aSign:
+ case aSignSym:
+ case aClearsign:
if (!opt.quiet && any_explicit_recipient)
log_info (_("WARNING: recipients (-r) given "
"without using public key encryption\n"));
@@ -3613,7 +3613,7 @@ main (int argc, char **argv)
log_error("decrypt_message failed: %s\n", g10_errstr(rc) );
}
break;
-
+
case aSignKey:
if( argc != 1 )
wrong_args(_("--sign-key user-id"));
@@ -3986,7 +3986,7 @@ main (int argc, char **argv)
wrong_args("--import-ownertrust [file]");
import_ownertrust( argc? *argv:NULL );
break;
-
+
case aRebuildKeydbCaches:
if (argc)
wrong_args ("--rebuild-keydb-caches");
@@ -4103,7 +4103,7 @@ g10_exit( int rc )
gcry_control (GCRYCTL_DUMP_SECMEM_STATS );
emergency_cleanup ();
-
+
rc = rc? rc : log_get_errorcount(0)? 2 : g10_errors_seen? 1 : 0;
exit (rc);
}
@@ -4197,14 +4197,14 @@ print_hashline( gcry_md_hd_t md, int algo, const char *fname )
{
int i, n;
const byte *p;
-
+
if ( fname )
{
- for (p = fname; *p; p++ )
+ for (p = fname; *p; p++ )
{
if ( *p <= 32 || *p > 127 || *p == ':' || *p == '%' )
es_printf ("%%%02X", *p );
- else
+ else
es_putc (*p, es_stdout);
}
}
@@ -4212,7 +4212,7 @@ print_hashline( gcry_md_hd_t md, int algo, const char *fname )
es_printf ("%d:", algo);
p = gcry_md_read (md, algo);
n = gcry_md_get_algo_dlen (algo);
- for(i=0; i < n ; i++, p++ )
+ for(i=0; i < n ; i++, p++ )
es_printf ("%02X", *p);
es_fputs (":\n", es_stdout);
}
@@ -4269,7 +4269,7 @@ print_mds( const char *fname, int algo )
else {
gcry_md_final (md);
if ( opt.with_colons ) {
- if ( algo )
+ if ( algo )
print_hashline( md, algo, fname );
else {
print_hashline( md, GCRY_MD_MD5, fname );
@@ -4368,7 +4368,7 @@ add_policy_url( const char *string, int which )
sl=add_to_strlist( &opt.sig_policy_url, string );
if(critical)
- sl->flags |= 1;
+ sl->flags |= 1;
}
static void
@@ -4401,5 +4401,5 @@ add_keyserver_url( const char *string, int which )
sl=add_to_strlist( &opt.sig_keyserver_url, string );
if(critical)
- sl->flags |= 1;
+ sl->flags |= 1;
}
diff --git a/g10/gpg.h b/g10/gpg.h
index 29db15a45..693f2ccda 100644
--- a/g10/gpg.h
+++ b/g10/gpg.h
@@ -17,7 +17,7 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GNUPG_G10_GPG_H
-#define GNUPG_G10_GPG_H
+#define GNUPG_G10_GPG_H
/* Note, that this file should be the first one after the system
header files. This is required to set the error source to the
@@ -41,8 +41,8 @@
#define MAX_FINGERPRINT_LEN 20
-/*
- Forward declarations.
+/*
+ Forward declarations.
*/
/* Object used to keep state locally to server.c . */
@@ -73,7 +73,7 @@ struct server_control_s
-/*
+/*
Compatibility stuff to be faded out over time.
*/
@@ -84,46 +84,46 @@ struct server_control_s
/* Mapping of the old error codes to the gpg-error ones. Fixme: This
is just a temporary solution: We need to do all these gpg_error()
calls in the code. */
-#define G10ERR_BAD_KEY GPG_ERR_BAD_KEY
-#define G10ERR_BAD_PASS GPG_ERR_BAD_PASS
-#define G10ERR_BAD_PUBKEY GPG_ERR_BAD_PUBKEY
+#define G10ERR_BAD_KEY GPG_ERR_BAD_KEY
+#define G10ERR_BAD_PASS GPG_ERR_BAD_PASS
+#define G10ERR_BAD_PUBKEY GPG_ERR_BAD_PUBKEY
#define G10ERR_BAD_SIGN GPG_ERR_BAD_SIGNATURE
-#define G10ERR_BAD_URI GPG_ERR_BAD_URI
-#define G10ERR_CHECKSUM GPG_ERR_CHECKSUM
-#define G10ERR_CIPHER_ALGO GPG_ERR_CIPHER_ALGO
-#define G10ERR_CLOSE_FILE GPG_ERR_CLOSE_FILE
-#define G10ERR_COMPR_ALGO GPG_ERR_COMPR_ALGO
-#define G10ERR_CREATE_FILE GPG_ERR_CREATE_FILE
-#define G10ERR_DIGEST_ALGO GPG_ERR_DIGEST_ALGO
+#define G10ERR_BAD_URI GPG_ERR_BAD_URI
+#define G10ERR_CHECKSUM GPG_ERR_CHECKSUM
+#define G10ERR_CIPHER_ALGO GPG_ERR_CIPHER_ALGO
+#define G10ERR_CLOSE_FILE GPG_ERR_CLOSE_FILE
+#define G10ERR_COMPR_ALGO GPG_ERR_COMPR_ALGO
+#define G10ERR_CREATE_FILE GPG_ERR_CREATE_FILE
+#define G10ERR_DIGEST_ALGO GPG_ERR_DIGEST_ALGO
#define G10ERR_FILE_EXISTS GPG_ERR_EEXIST
-#define G10ERR_GENERAL GPG_ERR_GENERAL
-#define G10ERR_INV_ARG GPG_ERR_INV_ARG
-#define G10ERR_INV_KEYRING GPG_ERR_INV_KEYRING
-#define G10ERR_INV_USER_ID GPG_ERR_INV_USER_ID
-#define G10ERR_INVALID_ARMOR GPG_ERR_INV_ARMOR
-#define G10ERR_INVALID_PACKET GPG_ERR_INV_PACKET
-#define G10ERR_KEYRING_OPEN GPG_ERR_KEYRING_OPEN
-#define G10ERR_KEYSERVER GPG_ERR_KEYSERVER
-#define G10ERR_NO_DATA GPG_ERR_NO_DATA
-#define G10ERR_NO_PUBKEY GPG_ERR_NO_PUBKEY
-#define G10ERR_NO_SECKEY GPG_ERR_NO_SECKEY
-#define G10ERR_NO_USER_ID GPG_ERR_NO_USER_ID
-#define G10ERR_NOT_PROCESSED GPG_ERR_NOT_PROCESSED
-#define G10ERR_OPEN_FILE GPG_ERR_OPEN_FILE
-#define G10ERR_PASSPHRASE GPG_ERR_PASSPHRASE
-#define G10ERR_PUBKEY_ALGO GPG_ERR_PUBKEY_ALGO
-#define G10ERR_READ_FILE GPG_ERR_READ_FILE
-#define G10ERR_RENAME_FILE GPG_ERR_RENAME_FILE
-#define G10ERR_RESOURCE_LIMIT GPG_ERR_RESOURCE_LIMIT
-#define G10ERR_SIG_CLASS GPG_ERR_SIG_CLASS
-#define G10ERR_TIME_CONFLICT GPG_ERR_TIME_CONFLICT
-#define G10ERR_TRUSTDB GPG_ERR_TRUSTDB
-#define G10ERR_UNEXPECTED GPG_ERR_UNEXPECTED
-#define G10ERR_UNKNOWN_PACKET GPG_ERR_UNKNOWN_PACKET
-#define G10ERR_UNSUPPORTED GPG_ERR_UNSUPPORTED
-#define G10ERR_UNU_PUBKEY GPG_ERR_UNUSABLE_PUBKEY
-#define G10ERR_UNU_SECKEY GPG_ERR_UNUSABLE_SECKEY
-#define G10ERR_WRONG_SECKEY GPG_ERR_WRONG_SECKEY
+#define G10ERR_GENERAL GPG_ERR_GENERAL
+#define G10ERR_INV_ARG GPG_ERR_INV_ARG
+#define G10ERR_INV_KEYRING GPG_ERR_INV_KEYRING
+#define G10ERR_INV_USER_ID GPG_ERR_INV_USER_ID
+#define G10ERR_INVALID_ARMOR GPG_ERR_INV_ARMOR
+#define G10ERR_INVALID_PACKET GPG_ERR_INV_PACKET
+#define G10ERR_KEYRING_OPEN GPG_ERR_KEYRING_OPEN
+#define G10ERR_KEYSERVER GPG_ERR_KEYSERVER
+#define G10ERR_NO_DATA GPG_ERR_NO_DATA
+#define G10ERR_NO_PUBKEY GPG_ERR_NO_PUBKEY
+#define G10ERR_NO_SECKEY GPG_ERR_NO_SECKEY
+#define G10ERR_NO_USER_ID GPG_ERR_NO_USER_ID
+#define G10ERR_NOT_PROCESSED GPG_ERR_NOT_PROCESSED
+#define G10ERR_OPEN_FILE GPG_ERR_OPEN_FILE
+#define G10ERR_PASSPHRASE GPG_ERR_PASSPHRASE
+#define G10ERR_PUBKEY_ALGO GPG_ERR_PUBKEY_ALGO
+#define G10ERR_READ_FILE GPG_ERR_READ_FILE
+#define G10ERR_RENAME_FILE GPG_ERR_RENAME_FILE
+#define G10ERR_RESOURCE_LIMIT GPG_ERR_RESOURCE_LIMIT
+#define G10ERR_SIG_CLASS GPG_ERR_SIG_CLASS
+#define G10ERR_TIME_CONFLICT GPG_ERR_TIME_CONFLICT
+#define G10ERR_TRUSTDB GPG_ERR_TRUSTDB
+#define G10ERR_UNEXPECTED GPG_ERR_UNEXPECTED
+#define G10ERR_UNKNOWN_PACKET GPG_ERR_UNKNOWN_PACKET
+#define G10ERR_UNSUPPORTED GPG_ERR_UNSUPPORTED
+#define G10ERR_UNU_PUBKEY GPG_ERR_UNUSABLE_PUBKEY
+#define G10ERR_UNU_SECKEY GPG_ERR_UNUSABLE_SECKEY
+#define G10ERR_WRONG_SECKEY GPG_ERR_WRONG_SECKEY
#endif /*GNUPG_G10_GPG_H*/
diff --git a/g10/gpgv.c b/g10/gpgv.c
index 569601e89..9f46ab39c 100644
--- a/g10/gpgv.c
+++ b/g10/gpgv.c
@@ -57,7 +57,7 @@ enum cmd_and_opt_values {
oVerbose = 'v',
oBatch = 500,
oKeyring,
- oIgnoreTimeConflict,
+ oIgnoreTimeConflict,
oStatusFD,
oLoggerFD,
oHomedir,
@@ -67,10 +67,10 @@ enum cmd_and_opt_values {
static ARGPARSE_OPTS opts[] = {
ARGPARSE_group (300, N_("@\nOptions:\n ")),
-
+
ARGPARSE_s_n (oVerbose, "verbose", N_("verbose")),
ARGPARSE_s_n (oQuiet, "quiet", N_("be somewhat more quiet")),
- ARGPARSE_s_s (oKeyring, "keyring",
+ ARGPARSE_s_s (oKeyring, "keyring",
N_("|FILE|take the keys from the keyring FILE")),
ARGPARSE_s_n (oIgnoreTimeConflict, "ignore-time-conflict",
N_("make timestamp conflicts only a warning")),
@@ -92,7 +92,7 @@ make_libversion (const char *libname, const char *(*getfnc)(const char*))
{
const char *s;
char *result;
-
+
s = getfnc (NULL);
result = xmalloc (strlen (libname) + 1 + strlen (s) + 1);
strcpy (stpcpy (stpcpy (result, libname), " "), s);
@@ -143,14 +143,14 @@ main( int argc, char **argv )
strlist_t nrings = NULL;
unsigned configlineno;
ctrl_t ctrl;
-
+
set_strusage (my_strusage);
log_set_prefix ("gpgv", 1);
-
+
/* Make sure that our subsystems are ready. */
i18n_init();
init_common_subsystems (&argc, &argv);
-
+
gnupg_init_signals (0, NULL);
opt.command_fd = -1; /* no command fd */
@@ -164,7 +164,7 @@ main( int argc, char **argv )
tty_no_terminal(1);
tty_batchmode(1);
disable_dotlock();
-
+
pargs.argc = &argc;
pargs.argv = &argv;
pargs.flags= 1; /* do not remove the args */
@@ -173,14 +173,14 @@ main( int argc, char **argv )
switch (pargs.r_opt)
{
case oQuiet: opt.quiet = 1; break;
- case oVerbose:
- opt.verbose++;
+ case oVerbose:
+ opt.verbose++;
opt.list_sigs=1;
gcry_control (GCRYCTL_SET_VERBOSITY, (int)opt.verbose);
break;
case oKeyring: append_to_strlist( &nrings, pargs.r.ret_str); break;
case oStatusFD: set_status_fd( pargs.r.ret_int ); break;
- case oLoggerFD:
+ case oLoggerFD:
log_set_fd (translate_sys2libc_fd_int (pargs.r.ret_int, 1));
break;
case oHomedir: opt.homedir = pargs.r.ret_str; break;
@@ -188,7 +188,7 @@ main( int argc, char **argv )
default : pargs.err = ARGPARSE_PRINT_ERROR; break;
}
}
-
+
if (log_get_errorcount (0))
g10_exit(2);
@@ -200,14 +200,14 @@ main( int argc, char **argv )
keydb_add_resource ("trustedkeys" EXTSEP_S "gpg", 8);
for (sl = nrings; sl; sl = sl->next)
keydb_add_resource (sl->d, 8);
-
+
FREE_STRLIST (nrings);
ctrl = xcalloc (1, sizeof *ctrl);
-
+
if ((rc = verify_signatures (ctrl, argc, argv)))
log_error("verify signatures failed: %s\n", g10_errstr(rc) );
-
+
xfree (ctrl);
/* cleanup */
@@ -225,7 +225,7 @@ g10_exit( int rc )
/* Stub:
- * We have to override the trustcheck from pkclist.c becuase
+ * We have to override the trustcheck from pkclist.c becuase
* this utility assumes that all keys in the keyring are trustworthy
*/
int
@@ -237,7 +237,7 @@ check_signatures_trust( PKT_signature *sig )
void
read_trust_options(byte *trust_model, ulong *created, ulong *nextcheck,
- byte *marginals, byte *completes, byte *cert_depth)
+ byte *marginals, byte *completes, byte *cert_depth)
{
(void)trust_model;
(void)created;
@@ -247,7 +247,7 @@ read_trust_options(byte *trust_model, ulong *created, ulong *nextcheck,
(void)cert_depth;
}
-/* Stub:
+/* Stub:
* We don't have the trustdb , so we have to provide some stub functions
* instead
*/
@@ -260,7 +260,7 @@ cache_disabled_value(PKT_public_key *pk)
}
void
-check_trustdb_stale(void)
+check_trustdb_stale(void)
{
}
@@ -319,7 +319,7 @@ struct keyserver_spec *
keyserver_match (struct keyserver_spec *spec)
{
(void)spec;
- return NULL;
+ return NULL;
}
int
@@ -334,7 +334,7 @@ int
keyserver_import_cert (const char *name)
{
(void)name;
- return -1;
+ return -1;
}
int
@@ -413,7 +413,7 @@ check_secret_key (PKT_public_key *pk, int n)
}
/* Stub:
- * No secret key, so no passphrase needed
+ * No secret key, so no passphrase needed
*/
DEK *
passphrase_to_dek (u32 *keyid, int pubkey_algo,
@@ -441,7 +441,7 @@ passphrase_clear_cache (u32 *keyid, const char *cacheid, int algo)
}
struct keyserver_spec *
-parse_preferred_keyserver(PKT_signature *sig)
+parse_preferred_keyserver(PKT_signature *sig)
{
(void)sig;
return NULL;
@@ -458,14 +458,14 @@ parse_keyserver_uri (const char *uri, int require_scheme,
return NULL;
}
-void
+void
free_keyserver_spec (struct keyserver_spec *keyserver)
{
(void)keyserver;
}
/* Stubs to avoid linking to photoid.c */
-void
+void
show_photos (const struct user_attribute *attrs, int count, PKT_public_key *pk)
{
(void)attrs;
@@ -473,7 +473,7 @@ show_photos (const struct user_attribute *attrs, int count, PKT_public_key *pk)
(void)pk;
}
-int
+int
parse_image_header (const struct user_attribute *attr, byte *type, u32 *len)
{
(void)attr;
@@ -491,7 +491,7 @@ image_type_to_string (byte type, int string)
}
#ifdef ENABLE_CARD_SUPPORT
-int
+int
agent_scd_getattr (const char *name, struct agent_card_info_s *info)
{
(void)name;
@@ -501,19 +501,19 @@ agent_scd_getattr (const char *name, struct agent_card_info_s *info)
#endif /* ENABLE_CARD_SUPPORT */
/* We do not do any locking, so use these stubs here */
-void
+void
disable_dotlock (void)
{
}
-dotlock_t
+dotlock_t
create_dotlock (const char *file_to_lock)
{
(void)file_to_lock;
return NULL;
}
-void
+void
destroy_dotlock (dotlock_t h)
{
(void)h;
@@ -534,7 +534,7 @@ release_dotlock (dotlock_t h)
return 0;
}
-void
+void
remove_lockfiles (void)
{
}
@@ -563,4 +563,3 @@ agent_get_keyinfo (ctrl_t ctrl, const char *hexkeygrip, char **r_serialno)
*r_serialno = NULL;
return gpg_error (GPG_ERR_NO_SECKEY);
}
-
diff --git a/g10/helptext.c b/g10/helptext.c
index bf818fa43..f1e01ca93 100644
--- a/g10/helptext.c
+++ b/g10/helptext.c
@@ -77,12 +77,10 @@ display_online_help( const char *keyword )
need_final_lf = 0;
xfree (result);
}
- else
+ else
{
tty_printf (_("No help available for `%s'"), keyword );
}
if (need_final_lf)
tty_printf("\n");
}
-
-
diff --git a/g10/kbnode.c b/g10/kbnode.c
index 7309af12a..1a8b91e43 100644
--- a/g10/kbnode.c
+++ b/g10/kbnode.c
@@ -184,7 +184,7 @@ find_next_kbnode( KBNODE node, int pkttype )
for( node=node->next ; node; node = node->next ) {
if( !pkttype )
return node;
- else if( pkttype == PKT_USER_ID
+ else if( pkttype == PKT_USER_ID
&& ( node->pkt->pkttype == PKT_PUBLIC_KEY
|| node->pkt->pkttype == PKT_SECRET_KEY ) )
return NULL;
@@ -338,7 +338,7 @@ move_kbnode( KBNODE *root, KBNODE node, KBNODE where )
void
dump_kbnode (KBNODE node)
{
- for (; node; node = node->next )
+ for (; node; node = node->next )
{
const char *s;
switch (node->pkt->pkttype)
@@ -395,12 +395,12 @@ dump_kbnode (KBNODE node)
log_printf (" keyid=%08lX a=%d u=%d %c%c%c%c\n",
(ulong)keyid_from_pk( pk, NULL ),
pk->pubkey_algo, pk->pubkey_usage,
- pk->has_expired? 'e':'.',
- pk->flags.revoked? 'r':'.',
+ pk->has_expired? 'e':'.',
+ pk->flags.revoked? 'r':'.',
pk->flags.valid? 'v':'.',
pk->flags.mdc? 'm':'.');
}
-
+
log_flush ();
}
}
diff --git a/g10/keydb.c b/g10/keydb.c
index 2e90604a0..d9e01dced 100644
--- a/g10/keydb.c
+++ b/g10/keydb.c
@@ -1,5 +1,5 @@
/* keydb.c - key database dispatcher
- * Copyright (C) 2001, 2002, 2003, 2004, 2005,
+ * Copyright (C) 2001, 2002, 2003, 2004, 2005,
* 2008, 2009 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
@@ -34,7 +34,7 @@
#include "main.h" /*try_make_homedir ()*/
#include "packet.h"
#include "keyring.h"
-#include "keydb.h"
+#include "keydb.h"
#include "i18n.h"
static int active_handles;
@@ -45,7 +45,7 @@ typedef enum {
} KeydbResourceType;
#define MAX_KEYDB_RESOURCES 40
-struct resource_item
+struct resource_item
{
KeydbResourceType type;
union {
@@ -91,7 +91,7 @@ maybe_create_keyring (char *filename, int force)
/* If we don't want to create a new file at all, there is no need to
go any further - bail out right here. */
- if (!force)
+ if (!force)
return gpg_error (GPG_ERR_ENOENT);
/* First of all we try to create the home directory. Note, that we
@@ -114,9 +114,9 @@ maybe_create_keyring (char *filename, int force)
save_slash = *last_slash_in_filename;
*last_slash_in_filename = 0;
if (access(filename, F_OK))
- {
+ {
static int tried;
-
+
if (!tried)
{
tried = 1;
@@ -144,8 +144,8 @@ maybe_create_keyring (char *filename, int force)
if (opt.verbose)
log_info ("can't allocate lock for `%s'\n", filename );
- if (!force)
- return gpg_error (GPG_ERR_ENOENT);
+ if (!force)
+ return gpg_error (GPG_ERR_ENOENT);
else
return gpg_error (GPG_ERR_GENERAL);
}
@@ -175,7 +175,7 @@ maybe_create_keyring (char *filename, int force)
else
iobuf = iobuf_create (filename);
umask (oldmask);
- if (!iobuf)
+ if (!iobuf)
{
rc = gpg_error_from_syserror ();
log_error ( _("error creating keyring `%s': %s\n"),
@@ -293,7 +293,7 @@ keydb_add_resource (const char *url, int flags)
{
if (used_resources >= MAX_KEYDB_RESOURCES)
rc = G10ERR_RESOURCE_LIMIT;
- else
+ else
{
if(flags&2)
primary_keyring=token;
@@ -338,10 +338,10 @@ keydb_new (void)
{
KEYDB_HANDLE hd;
int i, j;
-
+
hd = xmalloc_clear (sizeof *hd);
hd->found = -1;
-
+
assert (used_resources <= MAX_KEYDB_RESOURCES);
for (i=j=0; i < used_resources; i++)
{
@@ -362,12 +362,12 @@ keydb_new (void)
}
}
hd->used = j;
-
+
active_handles++;
return hd;
}
-void
+void
keydb_release (KEYDB_HANDLE hd)
{
int i;
@@ -406,19 +406,19 @@ keydb_get_resource_name (KEYDB_HANDLE hd)
int idx;
const char *s = NULL;
- if (!hd)
+ if (!hd)
return NULL;
- if ( hd->found >= 0 && hd->found < hd->used)
+ if ( hd->found >= 0 && hd->found < hd->used)
idx = hd->found;
- else if ( hd->current >= 0 && hd->current < hd->used)
+ else if ( hd->current >= 0 && hd->current < hd->used)
idx = hd->current;
else
idx = 0;
switch (hd->active[idx].type) {
case KEYDB_RESOURCE_TYPE_NONE:
- s = NULL;
+ s = NULL;
break;
case KEYDB_RESOURCE_TYPE_KEYRING:
s = keyring_get_resource_name (hd->active[idx].u.kr);
@@ -430,7 +430,7 @@ keydb_get_resource_name (KEYDB_HANDLE hd)
-static int
+static int
lock_all (KEYDB_HANDLE hd)
{
int i, rc = 0;
@@ -487,7 +487,7 @@ unlock_all (KEYDB_HANDLE hd)
/*
* Return the last found keyring. Caller must free it.
* The returned keyblock has the kbode flag bit 0 set for the node with
- * the public key used to locate the keyblock or flag bit 1 set for
+ * the public key used to locate the keyblock or flag bit 1 set for
* the user ID node.
*/
int
@@ -498,7 +498,7 @@ keydb_get_keyblock (KEYDB_HANDLE hd, KBNODE *ret_kb)
if (!hd)
return G10ERR_INV_ARG;
- if ( hd->found < 0 || hd->found >= hd->used)
+ if ( hd->found < 0 || hd->found >= hd->used)
return -1; /* nothing found */
switch (hd->active[hd->found].type) {
@@ -513,7 +513,7 @@ keydb_get_keyblock (KEYDB_HANDLE hd, KBNODE *ret_kb)
return rc;
}
-/*
+/*
* update the current keyblock with KB
*/
int
@@ -524,7 +524,7 @@ keydb_update_keyblock (KEYDB_HANDLE hd, KBNODE kb)
if (!hd)
return G10ERR_INV_ARG;
- if ( hd->found < 0 || hd->found >= hd->used)
+ if ( hd->found < 0 || hd->found >= hd->used)
return -1; /* nothing found */
if( opt.dry_run )
@@ -548,8 +548,8 @@ keydb_update_keyblock (KEYDB_HANDLE hd, KBNODE kb)
}
-/*
- * Insert a new KB into one of the resources.
+/*
+ * Insert a new KB into one of the resources.
*/
int
keydb_insert_keyblock (KEYDB_HANDLE hd, KBNODE kb)
@@ -557,15 +557,15 @@ keydb_insert_keyblock (KEYDB_HANDLE hd, KBNODE kb)
int rc = -1;
int idx;
- if (!hd)
+ if (!hd)
return G10ERR_INV_ARG;
if( opt.dry_run )
return 0;
- if ( hd->found >= 0 && hd->found < hd->used)
+ if ( hd->found >= 0 && hd->found < hd->used)
idx = hd->found;
- else if ( hd->current >= 0 && hd->current < hd->used)
+ else if ( hd->current >= 0 && hd->current < hd->used)
idx = hd->current;
else
return G10ERR_GENERAL;
@@ -588,7 +588,7 @@ keydb_insert_keyblock (KEYDB_HANDLE hd, KBNODE kb)
}
-/*
+/*
* The current keyblock will be deleted.
*/
int
@@ -599,7 +599,7 @@ keydb_delete_keyblock (KEYDB_HANDLE hd)
if (!hd)
return G10ERR_INV_ARG;
- if ( hd->found < 0 || hd->found >= hd->used)
+ if ( hd->found < 0 || hd->found >= hd->used)
return -1; /* nothing found */
if( opt.dry_run )
@@ -626,7 +626,7 @@ keydb_delete_keyblock (KEYDB_HANDLE hd)
/*
* Locate the default writable key resource, so that the next
* operation (which is only relevant for inserts) will be done on this
- * resource.
+ * resource.
*/
int
keydb_locate_writable (KEYDB_HANDLE hd, const char *reserved)
@@ -637,7 +637,7 @@ keydb_locate_writable (KEYDB_HANDLE hd, const char *reserved)
if (!hd)
return G10ERR_INV_ARG;
-
+
rc = keydb_search_reset (hd); /* this does reset hd->current */
if (rc)
return rc;
@@ -661,9 +661,9 @@ keydb_locate_writable (KEYDB_HANDLE hd, const char *reserved)
return rc;
}
- for ( ; hd->current >= 0 && hd->current < hd->used; hd->current++)
+ for ( ; hd->current >= 0 && hd->current < hd->used; hd->current++)
{
- switch (hd->active[hd->current].type)
+ switch (hd->active[hd->current].type)
{
case KEYDB_RESOURCE_TYPE_NONE:
BUG();
@@ -674,7 +674,7 @@ keydb_locate_writable (KEYDB_HANDLE hd, const char *reserved)
break;
}
}
-
+
return -1;
}
@@ -685,7 +685,7 @@ void
keydb_rebuild_caches (int noisy)
{
int i, rc;
-
+
for (i=0; i < used_resources; i++)
{
if (!keyring_is_writable (all_resources[i].token))
@@ -706,10 +706,10 @@ keydb_rebuild_caches (int noisy)
-/*
+/*
* Start the next search on this handle right at the beginning
*/
-int
+int
keydb_search_reset (KEYDB_HANDLE hd)
{
int i, rc = 0;
@@ -717,7 +717,7 @@ keydb_search_reset (KEYDB_HANDLE hd)
if (!hd)
return G10ERR_INV_ARG;
- hd->current = 0;
+ hd->current = 0;
hd->found = -1;
/* and reset all resources */
for (i=0; !rc && i < hd->used; i++) {
@@ -729,15 +729,15 @@ keydb_search_reset (KEYDB_HANDLE hd)
break;
}
}
- return rc;
+ return rc;
}
-/*
+/*
* Search through all keydb resources, starting at the current position,
* for a keyblock which contains one of the keys described in the DESC array.
*/
-int
+int
keydb_search2 (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc,
size_t ndesc, size_t *descindex)
{
@@ -757,12 +757,12 @@ keydb_search2 (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc,
break;
}
if (rc == -1) /* EOF -> switch to next resource */
- hd->current++;
+ hd->current++;
else if (!rc)
hd->found = hd->current;
}
- return rc;
+ return rc;
}
int
diff --git a/g10/keydb.h b/g10/keydb.h
index 9ec2496c5..f3a95297a 100644
--- a/g10/keydb.h
+++ b/g10/keydb.h
@@ -88,7 +88,7 @@ typedef struct keyblock_pos_struct KBPOS;
/* Structure to hold a couple of public key certificates. */
typedef struct pk_list *PK_LIST; /* Deprecated. */
typedef struct pk_list *pk_list_t;
-struct pk_list
+struct pk_list
{
PK_LIST next;
PKT_public_key *pk;
@@ -97,7 +97,7 @@ struct pk_list
/* Structure to hold a list of secret key certificates. */
typedef struct sk_list *SK_LIST;
-struct sk_list
+struct sk_list
{
SK_LIST next;
PKT_public_key *pk;
@@ -160,7 +160,7 @@ void release_pk_list (PK_LIST pk_list);
int build_pk_list (ctrl_t ctrl,
strlist_t rcpts, PK_LIST *ret_pk_list, unsigned use);
gpg_error_t find_and_check_key (ctrl_t ctrl,
- const char *name, unsigned int use,
+ const char *name, unsigned int use,
int mark_hidden, pk_list_t *pk_list_addr);
int algo_available( preftype_t preftype, int algo,
@@ -228,7 +228,7 @@ gpg_error_t get_seckey_byname (PKT_public_key *pk, const char *name);
gpg_error_t get_seckey_byfprint (PKT_public_key *pk,
const byte *fprint, size_t fprint_len);
-gpg_error_t get_seckeyblock_byfprint (kbnode_t *ret_keyblock,
+gpg_error_t get_seckeyblock_byfprint (kbnode_t *ret_keyblock,
const byte *fprint, size_t fprint_len);
gpg_error_t getkey_bynames (getkey_ctx_t *retctx, PKT_public_key *pk,
diff --git a/g10/keyedit.c b/g10/keyedit.c
index 1bd1aa6ee..973fa8d3f 100644
--- a/g10/keyedit.c
+++ b/g10/keyedit.c
@@ -523,7 +523,7 @@ sign_uids (KBNODE keyblock, strlist_t locusr, int *ret_modified,
}
/* Build a list of all signators.
- *
+ *
* We use the CERT flag to request the primary which must always
* be one which is capable of signing keys. I can't see a reason
* why to sign keys using a subkey. Implementation of USAGE_CERT
@@ -542,7 +542,7 @@ sign_uids (KBNODE keyblock, strlist_t locusr, int *ret_modified,
u32 duration = 0, timestamp = 0;
byte trust_depth = 0, trust_value = 0;
- if (local || nonrevocable || trust
+ if (local || nonrevocable || trust
|| opt.cert_policy_url || opt.cert_notations)
force_v4 = 1;
@@ -983,14 +983,14 @@ sign_uids (KBNODE keyblock, strlist_t locusr, int *ret_modified,
if (local)
{
tty_printf ("\n");
- tty_printf
+ tty_printf
(_("The signature will be marked as non-exportable.\n"));
}
if (nonrevocable)
{
tty_printf ("\n");
- tty_printf
+ tty_printf
(_("The signature will be marked as non-revocable.\n"));
}
@@ -1134,7 +1134,7 @@ change_passphrase (ctrl_t ctrl, kbnode_t keyblock)
pk = node->pkt->pkt.public_key;
keyid_from_pk (pk, subid);
-
+
xfree (hexgrip);
err = hexkeygrip_from_pk (pk, &hexgrip);
if (err)
@@ -1165,7 +1165,7 @@ change_passphrase (ctrl_t ctrl, kbnode_t keyblock)
{
if (node->pkt->pkttype == PKT_PUBLIC_KEY
|| node->pkt->pkttype == PKT_PUBLIC_SUBKEY)
- {
+ {
char *desc;
pk = node->pkt->pkt.public_key;
@@ -1175,11 +1175,11 @@ change_passphrase (ctrl_t ctrl, kbnode_t keyblock)
err = hexkeygrip_from_pk (pk, &hexgrip);
if (err)
goto leave;
-
+
desc = gpg_format_keydesc (pk, 0, 1);
err = agent_passwd (ctrl, hexgrip, desc, &cache_nonce, &passwd_nonce);
xfree (desc);
-
+
if (err)
log_log ((gpg_err_code (err) == GPG_ERR_CANCELED
|| gpg_err_code (err) == GPG_ERR_FULLY_CANCELED)
@@ -1509,7 +1509,7 @@ keyedit_menu (ctrl_t ctrl, const char *username, strlist_t locusr,
/* See whether we have a matching secret key. */
if (seckey_check)
- {
+ {
have_seckey = !agent_probe_any_secret_key (ctrl, keyblock);
if (have_seckey && !quiet)
tty_printf (_("Secret key is available.\n"));
@@ -1818,7 +1818,7 @@ keyedit_menu (ctrl_t ctrl, const char *username, strlist_t locusr,
switch (count_selected_keys (keyblock))
{
case 0:
- if (cpr_get_answer_is_yes
+ if (cpr_get_answer_is_yes
("keyedit.keytocard.use_primary",
/* TRANSLATORS: Please take care: This is about
moving the key and not about removing it. */
@@ -1981,7 +1981,7 @@ keyedit_menu (ctrl_t ctrl, const char *username, strlist_t locusr,
if (!(n1 = count_selected_uids (keyblock)))
tty_printf (_("You must select at least one user ID.\n"));
- else if (cpr_get_answer_is_yes
+ else if (cpr_get_answer_is_yes
("keyedit.revoke.uid.okay",
n1 > 1 ? _("Really revoke all selected user IDs? (y/N) ")
: _("Really revoke this user ID? (y/N) ")))
@@ -2793,7 +2793,7 @@ show_key_with_all_names (KBNODE keyblock, int only_marked, int with_revoker,
if (pk->seckey_info->ivlen == 16
&& !memcmp (pk->seckey_info->iv,
"\xD2\x76\x00\x01\x24\x01", 6))
- {
+ {
/* This is an OpenPGP card. */
for (i = 8; i < 14; i++)
{
@@ -2803,7 +2803,7 @@ show_key_with_all_names (KBNODE keyblock, int only_marked, int with_revoker,
}
}
else
- {
+ {
/* Unknown card: Print all. */
for (i = 0; i < pk->seckey_info->ivlen; i++)
tty_printf ("%02X", pk->seckey_info->iv[i]);
@@ -3142,21 +3142,21 @@ menu_delsig (KBNODE pub_keyblock)
if (valid)
{
- okay = cpr_get_answer_yes_no_quit
+ okay = cpr_get_answer_yes_no_quit
("keyedit.delsig.valid",
_("Delete this good signature? (y/N/q)"));
-
+
/* Only update trust if we delete a good signature.
The other two cases do not affect trust. */
if (okay)
update_trust = 1;
}
else if (inv_sig || other_err)
- okay = cpr_get_answer_yes_no_quit
+ okay = cpr_get_answer_yes_no_quit
("keyedit.delsig.invalid",
_("Delete this invalid signature? (y/N/q)"));
else if (no_key)
- okay = cpr_get_answer_yes_no_quit
+ okay = cpr_get_answer_yes_no_quit
("keyedit.delsig.unknown",
_("Delete this unknown signature? (y/N/q)"));
@@ -3336,7 +3336,7 @@ menu_addrevoker (ctrl_t ctrl, kbnode_t pub_keyblock, int sensitive)
tty_printf ("\n");
- answer = cpr_get_utf8
+ answer = cpr_get_utf8
("keyedit.add_revoker",
_("Enter the user ID of the designated revoker: "));
if (answer[0] == '\0' || answer[0] == CONTROL_D)
@@ -3529,7 +3529,7 @@ menu_expire (KBNODE pub_keyblock)
if ((mainkey && main_pk->version < 4)
|| (!mainkey && sub_pk->version < 4))
{
- log_info
+ log_info
(_("You can't change the expiration date of a v3 key\n"));
return 0;
}
@@ -3824,7 +3824,7 @@ menu_set_primary_uid (KBNODE pub_keyblock)
}
-/*
+/*
* Set preferences to new values for the selected user IDs
*/
static int
@@ -3879,7 +3879,7 @@ menu_set_preferences (KBNODE pub_keyblock)
}
else
{
- /* This is a selfsignature which is to be replaced
+ /* This is a selfsignature which is to be replaced
* We have to ignore v3 signatures because they are
* not able to carry the preferences. */
PKT_signature *newsig;
@@ -4006,7 +4006,7 @@ menu_set_keyserver_url (const char *url, KBNODE pub_keyblock)
" ID \"%s\": ", user);
tty_print_utf8_string (p, plen);
tty_printf ("\n");
- if (!cpr_get_answer_is_yes
+ if (!cpr_get_answer_is_yes
("keyedit.confirm_keyserver",
uri
? _("Are you sure you want to replace it? (y/N) ")
@@ -4537,12 +4537,12 @@ ask_revoke_sig (KBNODE keyblock, KBNODE node)
tty_printf (_("This signature expired on %s.\n"),
expirestr_from_sig (sig));
/* Use a different question so we can have different help text */
- doit = cpr_get_answer_is_yes
+ doit = cpr_get_answer_is_yes
("ask_revoke_sig.expired",
_("Are you sure you still want to revoke it? (y/N) "));
}
else
- doit = cpr_get_answer_is_yes
+ doit = cpr_get_answer_is_yes
("ask_revoke_sig.one",
_("Create a revocation certificate for this signature? (y/N) "));
@@ -4686,7 +4686,7 @@ menu_revsig (KBNODE keyblock)
if (!any)
return 0; /* none selected */
- if (!cpr_get_answer_is_yes
+ if (!cpr_get_answer_is_yes
("ask_revoke_sig.okay",
_("Really create the revocation certificates? (y/N) ")))
return 0; /* forget it */
@@ -4951,7 +4951,7 @@ menu_revsubkey (KBNODE pub_keyblock)
return changed;
}
changed = 1; /* we changed the keyblock */
-
+
pkt = xmalloc_clear (sizeof *pkt);
pkt->pkttype = PKT_SIGNATURE;
pkt->pkt.signature = sig;
diff --git a/g10/keylist.c b/g10/keylist.c
index 1dbd09c39..ba2a954c6 100644
--- a/g10/keylist.c
+++ b/g10/keylist.c
@@ -239,7 +239,7 @@ status_one_subpacket (sigsubpkttype_t type, size_t len, int flags,
if (len > 256)
return;
- snprintf (status, sizeof status,
+ snprintf (status, sizeof status,
"%d %u %u ", type, flags, (unsigned int) len);
write_status_text_and_buffer (STATUS_SIG_SUBPACKET, status, buf, len, 0);
@@ -455,7 +455,7 @@ list_all (int secret)
if (lastresname != resname)
{
int i;
-
+
es_fprintf (es_stdout, "%s\n", resname);
for (i = strlen (resname); i; i--)
es_putc ('-', es_stdout);
@@ -529,7 +529,7 @@ list_one (strlist_t names, int secret)
}
while (!getkey_next (ctx, NULL, &keyblock));
getkey_end (ctx);
-
+
if (opt.check_sigs && !opt.with_colons)
print_signature_stats (&stats);
}
@@ -596,7 +596,7 @@ print_capabilities (PKT_public_key *pk, KBNODE keyblock)
if (use & PUBKEY_USAGE_ENC)
es_putc ('e', es_stdout);
-
+
if (use & PUBKEY_USAGE_SIG)
{
es_putc ('s', es_stdout);
@@ -661,7 +661,7 @@ print_capabilities (PKT_public_key *pk, KBNODE keyblock)
if (disabled)
es_putc ('D', es_stdout);
}
-
+
es_putc (':', es_stdout);
}
@@ -795,10 +795,10 @@ list_keyblock_print (KBNODE keyblock, int secret, int fpr, void *opaque)
}
else
s2k_char = ' ';
-
+
check_trustdb_stale ();
- es_fprintf (es_stdout, "%s%c %4u%c/%s %s",
+ es_fprintf (es_stdout, "%s%c %4u%c/%s %s",
secret? "sec":"pub",
s2k_char,
nbits_from_pk (pk), pubkey_letter (pk->pubkey_algo),
@@ -921,7 +921,7 @@ list_keyblock_print (KBNODE keyblock, int secret, int fpr, void *opaque)
}
else
s2k_char = ' ';
-
+
es_fprintf (es_stdout, "%s%c %4u%c/%s %s",
secret? "ssb":"sub",
s2k_char,
@@ -1192,7 +1192,7 @@ list_keyblock_colon (KBNODE keyblock, int secret, int fpr)
if (attrib_fp && node->pkt->pkt.user_id->attrib_data != NULL)
dump_attribs (node->pkt->pkt.user_id, pk);
/*
- * Fixme: We need a valid flag here too
+ * Fixme: We need a valid flag here too
*/
str = uid->attrib_data ? "uat" : "uid";
if (uid->is_revoked)
diff --git a/g10/keyring.c b/g10/keyring.c
index d069b1397..12356e23c 100644
--- a/g10/keyring.c
+++ b/g10/keyring.c
@@ -31,7 +31,7 @@
#include "util.h"
#include "keyring.h"
#include "packet.h"
-#include "keydb.h"
+#include "keydb.h"
#include "options.h"
#include "main.h" /*for check_key_signature()*/
#include "i18n.h"
@@ -46,11 +46,11 @@ struct off_item {
/*off_t off;*/
};
-typedef struct off_item **OffsetHashTable;
+typedef struct off_item **OffsetHashTable;
typedef struct keyring_name *KR_NAME;
-struct keyring_name
+struct keyring_name
{
struct keyring_name *next;
int read_only;
@@ -78,7 +78,7 @@ struct keyring_handle
int error;
} current;
struct {
- CONST_KR_NAME kr;
+ CONST_KR_NAME kr;
off_t offset;
size_t pk_no;
size_t uid_no;
@@ -101,7 +101,7 @@ static struct off_item *
new_offset_item (void)
{
struct off_item *k;
-
+
k = xmalloc_clear (sizeof *k);
return k;
}
@@ -120,7 +120,7 @@ release_offset_items (struct off_item *k)
}
#endif
-static OffsetHashTable
+static OffsetHashTable
new_offset_hash_table (void)
{
struct off_item **tbl;
@@ -163,7 +163,7 @@ update_offset_hash_table (OffsetHashTable tbl, u32 *kid, off_t off)
for (k = tbl[(kid[1] & 0x07ff)]; k; k = k->next)
{
- if (k->kid[0] == kid[0] && k->kid[1] == kid[1])
+ if (k->kid[0] == kid[0] && k->kid[1] == kid[1])
{
/*k->off = off;*/
return;
@@ -193,7 +193,7 @@ update_offset_hash_table_from_kb (OffsetHashTable tbl, KBNODE node, off_t off)
}
}
-/*
+/*
* Register a filename for plain keyring files. ptr is set to a
* pointer to be used to create a handles etc, or the already-issued
* pointer if it has already been registered. The function returns 1
@@ -215,7 +215,7 @@ keyring_register_filename (const char *fname, int read_only, void **ptr)
if (read_only)
kr->read_only = 1;
*ptr=kr;
- return 0;
+ return 0;
}
}
@@ -245,11 +245,11 @@ keyring_is_writable (void *token)
return r? (r->read_only || !access (r->fname, W_OK)) : 0;
}
-
+
/* Create a new handle for the resource associated with TOKEN.
-
+
The returned handle must be released using keyring_release (). */
KEYRING_HANDLE
keyring_new (void *token)
@@ -258,14 +258,14 @@ keyring_new (void *token)
KR_NAME resource = token;
assert (resource);
-
+
hd = xmalloc_clear (sizeof *hd);
hd->resource = resource;
active_handles++;
return hd;
}
-void
+void
keyring_release (KEYRING_HANDLE hd)
{
if (!hd)
@@ -292,7 +292,7 @@ keyring_get_resource_name (KEYRING_HANDLE hd)
* Lock the keyring with the given handle, or unlock if YES is false.
* We ignore the handle and lock all registered files.
*/
-int
+int
keyring_lock (KEYRING_HANDLE hd, int yes)
{
KR_NAME kr;
@@ -315,7 +315,7 @@ keyring_lock (KEYRING_HANDLE hd, int yes)
}
if (rc)
return rc;
-
+
/* and now set the locks */
for (kr=kr_names; kr; kr = kr->next) {
if (!keyring_is_writable(kr))
@@ -326,7 +326,7 @@ keyring_lock (KEYRING_HANDLE hd, int yes)
log_info ("can't lock `%s'\n", kr->fname );
rc = G10ERR_GENERAL;
}
- else
+ else
kr->is_locked = 1;
}
}
@@ -339,10 +339,10 @@ keyring_lock (KEYRING_HANDLE hd, int yes)
;
else if (release_dotlock (kr->lockhd))
log_info ("can't unlock `%s'\n", kr->fname );
- else
+ else
kr->is_locked = 0;
}
- }
+ }
return rc;
}
@@ -352,7 +352,7 @@ keyring_lock (KEYRING_HANDLE hd, int yes)
/*
* Return the last found keyring. Caller must free it.
* The returned keyblock has the kbode flag bit 0 set for the node with
- * the public key used to locate the keyblock or flag bit 1 set for
+ * the public key used to locate the keyblock or flag bit 1 set for
* the user ID node.
*/
int
@@ -398,7 +398,7 @@ keyring_get_keyblock (KEYRING_HANDLE hd, KBNODE *ret_kb)
init_packet (pkt);
continue;
}
- if (rc) {
+ if (rc) {
log_error ("keyring_get_keyblock: read error: %s\n",
g10_errstr(rc) );
rc = G10ERR_INV_KEYRING;
@@ -418,17 +418,17 @@ keyring_get_keyblock (KEYRING_HANDLE hd, KBNODE *ret_kb)
}
in_cert = 1;
- if (pkt->pkttype == PKT_RING_TRUST)
+ if (pkt->pkttype == PKT_RING_TRUST)
{
/*(this code is duplicated after the loop)*/
- if ( lastnode
+ if ( lastnode
&& lastnode->pkt->pkttype == PKT_SIGNATURE
&& (pkt->pkt.ring_trust->sigcache & 1) ) {
- /* This is a ring trust packet with a checked signature
+ /* This is a ring trust packet with a checked signature
* status cache following directly a signature paket.
* Set the cache status into that signature packet. */
PKT_signature *sig = lastnode->pkt->pkt.signature;
-
+
sig->flags.checked = 1;
sig->flags.valid = !!(pkt->pkt.ring_trust->sigcache & 2);
}
@@ -460,7 +460,7 @@ keyring_get_keyblock (KEYRING_HANDLE hd, KBNODE *ret_kb)
if (++uid_no == hd->found.uid_no)
node->flag |= 2;
break;
-
+
default:
break;
}
@@ -470,7 +470,7 @@ keyring_get_keyblock (KEYRING_HANDLE hd, KBNODE *ret_kb)
}
set_packet_list_mode(save_mode);
- if (rc == -1 && keyblock)
+ if (rc == -1 && keyblock)
rc = 0; /* got the entire keyblock */
if (rc || !ret_kb)
@@ -478,7 +478,7 @@ keyring_get_keyblock (KEYRING_HANDLE hd, KBNODE *ret_kb)
else {
/*(duplicated form the loop body)*/
if ( pkt && pkt->pkttype == PKT_RING_TRUST
- && lastnode
+ && lastnode
&& lastnode->pkt->pkttype == PKT_SIGNATURE
&& (pkt->pkt.ring_trust->sigcache & 1) ) {
PKT_signature *sig = lastnode->pkt->pkt.signature;
@@ -492,7 +492,7 @@ keyring_get_keyblock (KEYRING_HANDLE hd, KBNODE *ret_kb)
iobuf_close(a);
/* Make sure that future search operations fail immediately when
- * we know that we are working on a invalid keyring
+ * we know that we are working on a invalid keyring
*/
if (rc == G10ERR_INV_KEYRING)
hd->current.error = rc;
@@ -563,11 +563,11 @@ keyring_insert_keyblock (KEYRING_HANDLE hd, KBNODE kb)
if (hd->current.kr->read_only)
return gpg_error (GPG_ERR_EACCES);
}
- else
+ else
fname = hd->resource? hd->resource->fname:NULL;
if (!fname)
- return G10ERR_GENERAL;
+ return G10ERR_GENERAL;
/* Close this one otherwise we will lose the position for
* a next search. Fixme: it would be better to adjust the position
@@ -582,7 +582,7 @@ keyring_insert_keyblock (KEYRING_HANDLE hd, KBNODE kb)
{
update_offset_hash_table_from_kb (kr_offtbl, kb, 0);
}
-
+
return rc;
}
@@ -631,10 +631,10 @@ keyring_delete_keyblock (KEYRING_HANDLE hd)
-/*
+/*
* Start the next search on this handle right at the beginning
*/
-int
+int
keyring_search_reset (KEYRING_HANDLE hd)
{
assert (hd);
@@ -644,17 +644,17 @@ keyring_search_reset (KEYRING_HANDLE hd)
hd->current.iobuf = NULL;
hd->current.eof = 0;
hd->current.error = 0;
-
+
hd->found.kr = NULL;
hd->found.offset = 0;
- return 0;
+ return 0;
}
static int
prepare_search (KEYRING_HANDLE hd)
{
- if (hd->current.error)
+ if (hd->current.error)
return hd->current.error; /* still in error state */
if (hd->current.kr && !hd->current.eof) {
@@ -663,7 +663,7 @@ prepare_search (KEYRING_HANDLE hd)
return 0; /* okay */
}
- if (!hd->current.kr && hd->current.eof)
+ if (!hd->current.kr && hd->current.eof)
return -1; /* still EOF */
if (!hd->current.kr) { /* start search with first keyring */
@@ -675,7 +675,7 @@ prepare_search (KEYRING_HANDLE hd)
assert (!hd->current.iobuf);
}
else { /* EOF */
- iobuf_close (hd->current.iobuf);
+ iobuf_close (hd->current.iobuf);
hd->current.iobuf = NULL;
hd->current.kr = NULL;
hd->current.eof = 1;
@@ -833,7 +833,7 @@ compare_name (int mode, const char *name, const char *uid, size_t uidlen)
int i;
const char *s, *se;
- if (mode == KEYDB_SEARCH_MODE_EXACT) {
+ if (mode == KEYDB_SEARCH_MODE_EXACT) {
for (i=0; name[i] && uidlen; i++, uidlen--)
if (uid[i] != name[i])
break;
@@ -844,7 +844,7 @@ compare_name (int mode, const char *name, const char *uid, size_t uidlen)
if (ascii_memistr( uid, uidlen, name ))
return 0;
}
- else if ( mode == KEYDB_SEARCH_MODE_MAIL
+ else if ( mode == KEYDB_SEARCH_MODE_MAIL
|| mode == KEYDB_SEARCH_MODE_MAILSUB
|| mode == KEYDB_SEARCH_MODE_MAILEND) {
for (i=0, s= uid; i < uidlen && *s != '<'; s++, i++)
@@ -856,7 +856,7 @@ compare_name (int mode, const char *name, const char *uid, size_t uidlen)
;
if (i < uidlen) {
i = se - s;
- if (mode == KEYDB_SEARCH_MODE_MAIL) {
+ if (mode == KEYDB_SEARCH_MODE_MAIL) {
if( strlen(name)-2 == i
&& !ascii_memcasecmp( s, name+1, i) )
return 0;
@@ -880,11 +880,11 @@ compare_name (int mode, const char *name, const char *uid, size_t uidlen)
}
-/*
+/*
* Search through the keyring(s), starting at the current position,
* for a keyblock which contains one of the keys described in the DESC array.
*/
-int
+int
keyring_search (KEYRING_HANDLE hd, KEYDB_SEARCH_DESC *desc,
size_t ndesc, size_t *descindex)
{
@@ -903,28 +903,28 @@ keyring_search (KEYRING_HANDLE hd, KEYDB_SEARCH_DESC *desc,
/* figure out what information we need */
need_uid = need_words = need_keyid = need_fpr = any_skip = 0;
- for (n=0; n < ndesc; n++)
+ for (n=0; n < ndesc; n++)
{
- switch (desc[n].mode)
+ switch (desc[n].mode)
{
- case KEYDB_SEARCH_MODE_EXACT:
+ case KEYDB_SEARCH_MODE_EXACT:
case KEYDB_SEARCH_MODE_SUBSTR:
case KEYDB_SEARCH_MODE_MAIL:
case KEYDB_SEARCH_MODE_MAILSUB:
case KEYDB_SEARCH_MODE_MAILEND:
need_uid = 1;
break;
- case KEYDB_SEARCH_MODE_WORDS:
+ case KEYDB_SEARCH_MODE_WORDS:
need_uid = 1;
need_words = 1;
break;
- case KEYDB_SEARCH_MODE_SHORT_KID:
+ case KEYDB_SEARCH_MODE_SHORT_KID:
case KEYDB_SEARCH_MODE_LONG_KID:
need_keyid = 1;
break;
- case KEYDB_SEARCH_MODE_FPR16:
+ case KEYDB_SEARCH_MODE_FPR16:
case KEYDB_SEARCH_MODE_FPR20:
- case KEYDB_SEARCH_MODE_FPR:
+ case KEYDB_SEARCH_MODE_FPR:
need_fpr = 1;
break;
case KEYDB_SEARCH_MODE_FIRST:
@@ -933,7 +933,7 @@ keyring_search (KEYRING_HANDLE hd, KEYDB_SEARCH_DESC *desc,
break;
default: break;
}
- if (desc[n].skipfnc)
+ if (desc[n].skipfnc)
{
any_skip = 1;
need_keyid = 1;
@@ -952,7 +952,7 @@ keyring_search (KEYRING_HANDLE hd, KEYDB_SEARCH_DESC *desc,
else if (ndesc == 1 && desc[0].mode == KEYDB_SEARCH_MODE_LONG_KID)
{
struct off_item *oi;
-
+
oi = lookup_offset_hash_table (kr_offtbl, desc[0].u.kid);
if (!oi)
{ /* We know that we don't have this key */
@@ -961,9 +961,9 @@ keyring_search (KEYRING_HANDLE hd, KEYDB_SEARCH_DESC *desc,
return -1;
}
/* We could now create a positive search status and return.
- * However the problem is that another instance of gpg may
+ * However the problem is that another instance of gpg may
* have changed the keyring so that the offsets are not valid
- * anymore - therefore we don't do it
+ * anymore - therefore we don't do it
*/
}
@@ -974,13 +974,13 @@ keyring_search (KEYRING_HANDLE hd, KEYDB_SEARCH_DESC *desc,
log_debug ("word search mode does not yet work\n");
/* FIXME: here is a long standing bug in our function and in addition we
just use the first search description */
- for (n=0; n < ndesc && !name; n++)
+ for (n=0; n < ndesc && !name; n++)
{
- if (desc[n].mode == KEYDB_SEARCH_MODE_WORDS)
+ if (desc[n].mode == KEYDB_SEARCH_MODE_WORDS)
name = desc[n].u.name;
}
assert (name);
- if ( !hd->word_match.name || strcmp (hd->word_match.name, name) )
+ if ( !hd->word_match.name || strcmp (hd->word_match.name, name) )
{
/* name changed */
xfree (hd->word_match.name);
@@ -998,29 +998,29 @@ keyring_search (KEYRING_HANDLE hd, KEYDB_SEARCH_DESC *desc,
main_offset = 0;
pk_no = uid_no = 0;
initial_skip = 1; /* skip until we see the start of a keyblock */
- while (!(rc=search_packet (hd->current.iobuf, &pkt, &offset, need_uid)))
+ while (!(rc=search_packet (hd->current.iobuf, &pkt, &offset, need_uid)))
{
byte afp[MAX_FINGERPRINT_LEN];
size_t an;
- if (pkt.pkttype == PKT_PUBLIC_KEY || pkt.pkttype == PKT_SECRET_KEY)
+ if (pkt.pkttype == PKT_PUBLIC_KEY || pkt.pkttype == PKT_SECRET_KEY)
{
main_offset = offset;
pk_no = uid_no = 0;
initial_skip = 0;
}
- if (initial_skip)
+ if (initial_skip)
{
free_packet (&pkt);
continue;
}
-
+
pk = NULL;
uid = NULL;
if ( pkt.pkttype == PKT_PUBLIC_KEY
|| pkt.pkttype == PKT_PUBLIC_SUBKEY
|| pkt.pkttype == PKT_SECRET_KEY
- || pkt.pkttype == PKT_SECRET_SUBKEY)
+ || pkt.pkttype == PKT_SECRET_SUBKEY)
{
pk = pkt.pkt.public_key;
++pk_no;
@@ -1036,31 +1036,31 @@ keyring_search (KEYRING_HANDLE hd, KEYDB_SEARCH_DESC *desc,
if (use_offtbl && !kr_offtbl_ready)
update_offset_hash_table (kr_offtbl, aki, main_offset);
}
- else if (pkt.pkttype == PKT_USER_ID)
+ else if (pkt.pkttype == PKT_USER_ID)
{
uid = pkt.pkt.user_id;
++uid_no;
}
- for (n=0; n < ndesc; n++)
+ for (n=0; n < ndesc; n++)
{
switch (desc[n].mode) {
- case KEYDB_SEARCH_MODE_NONE:
+ case KEYDB_SEARCH_MODE_NONE:
BUG ();
break;
- case KEYDB_SEARCH_MODE_EXACT:
+ case KEYDB_SEARCH_MODE_EXACT:
case KEYDB_SEARCH_MODE_SUBSTR:
case KEYDB_SEARCH_MODE_MAIL:
case KEYDB_SEARCH_MODE_MAILSUB:
case KEYDB_SEARCH_MODE_MAILEND:
- case KEYDB_SEARCH_MODE_WORDS:
+ case KEYDB_SEARCH_MODE_WORDS:
if ( uid && !compare_name (desc[n].mode,
desc[n].u.name,
- uid->name, uid->len))
+ uid->name, uid->len))
goto found;
break;
-
- case KEYDB_SEARCH_MODE_SHORT_KID:
+
+ case KEYDB_SEARCH_MODE_SHORT_KID:
if (pk && desc[n].u.kid[1] == aki[1])
goto found;
break;
@@ -1074,19 +1074,19 @@ keyring_search (KEYRING_HANDLE hd, KEYDB_SEARCH_DESC *desc,
goto found;
break;
case KEYDB_SEARCH_MODE_FPR20:
- case KEYDB_SEARCH_MODE_FPR:
+ case KEYDB_SEARCH_MODE_FPR:
if (pk && !memcmp (desc[n].u.fpr, afp, 20))
goto found;
break;
- case KEYDB_SEARCH_MODE_FIRST:
+ case KEYDB_SEARCH_MODE_FIRST:
if (pk)
goto found;
break;
- case KEYDB_SEARCH_MODE_NEXT:
+ case KEYDB_SEARCH_MODE_NEXT:
if (pk)
goto found;
break;
- default:
+ default:
rc = G10ERR_INV_ARG;
goto found;
}
@@ -1098,7 +1098,7 @@ keyring_search (KEYRING_HANDLE hd, KEYDB_SEARCH_DESC *desc,
meaningful if this function returns with no errors. */
if(descindex)
*descindex=n;
- for (n=any_skip?0:ndesc; n < ndesc; n++)
+ for (n=any_skip?0:ndesc; n < ndesc; n++)
{
if (desc[n].skipfnc
&& desc[n].skipfnc (desc[n].skipfncvalue, aki, uid))
@@ -1124,11 +1124,11 @@ keyring_search (KEYRING_HANDLE hd, KEYDB_SEARCH_DESC *desc,
if (use_offtbl && !kr_offtbl_ready)
{
KR_NAME kr;
-
+
/* First set the did_full_scan flag for this keyring. */
for (kr=kr_names; kr; kr = kr->next)
{
- if (hd->resource == kr)
+ if (hd->resource == kr)
{
kr->did_full_scan = 1;
break;
@@ -1138,14 +1138,14 @@ keyring_search (KEYRING_HANDLE hd, KEYDB_SEARCH_DESC *desc,
offtbl ready */
for (kr=kr_names; kr; kr = kr->next)
{
- if (!kr->did_full_scan)
+ if (!kr->did_full_scan)
break;
}
if (!kr)
kr_offtbl_ready = 1;
}
}
- else
+ else
hd->current.error = rc;
free_packet(&pkt);
@@ -1157,7 +1157,7 @@ keyring_search (KEYRING_HANDLE hd, KEYDB_SEARCH_DESC *desc,
static int
create_tmp_file (const char *template,
char **r_bakfname, char **r_tmpfname, IOBUF *r_fp)
-{
+{
char *bakfname, *tmpfname;
mode_t oldmask;
@@ -1181,7 +1181,7 @@ create_tmp_file (const char *template,
strcpy (tmpfname,template);
strcpy (tmpfname+strlen(template)-4, EXTSEP_S "tmp");
}
- else
+ else
{ /* file does not end with gpg; hmmm */
bakfname = xmalloc (strlen( template ) + 5);
strcpy (stpcpy(bakfname, template), EXTSEP_S "bak");
@@ -1215,7 +1215,7 @@ create_tmp_file (const char *template,
xfree (bakfname);
return rc;
}
-
+
*r_bakfname = bakfname;
*r_tmpfname = tmpfname;
return 0;
@@ -1247,7 +1247,7 @@ rename_tmp_file (const char *bakfname, const char *tmpfname, const char *fname)
fname, bakfname, strerror(errno) );
return rc;
}
-
+
/* then rename the file */
#if defined(HAVE_DOSISH_SYSTEM) || defined(__riscos__)
gnupg_remove( fname );
@@ -1289,10 +1289,10 @@ write_keyblock (IOBUF fp, KBNODE keyblock)
{
KBNODE kbctx = NULL, node;
int rc;
-
- while ( (node = walk_kbnode (keyblock, &kbctx, 0)) )
+
+ while ( (node = walk_kbnode (keyblock, &kbctx, 0)) )
{
- if (node->pkt->pkttype == PKT_RING_TRUST)
+ if (node->pkt->pkttype == PKT_RING_TRUST)
continue; /* we write it later on our own */
if ( (rc = build_packet (fp, node->pkt) ))
@@ -1301,12 +1301,12 @@ write_keyblock (IOBUF fp, KBNODE keyblock)
node->pkt->pkttype, g10_errstr(rc) );
return rc;
}
- if (node->pkt->pkttype == PKT_SIGNATURE)
+ if (node->pkt->pkttype == PKT_SIGNATURE)
{ /* always write a signature cache packet */
PKT_signature *sig = node->pkt->pkt.signature;
unsigned int cacheval = 0;
-
- if (sig->flags.checked)
+
+ if (sig->flags.checked)
{
cacheval |= 1;
if (sig->flags.valid)
@@ -1315,7 +1315,7 @@ write_keyblock (IOBUF fp, KBNODE keyblock)
iobuf_put (fp, 0xb0); /* old style packet 12, 1 byte len*/
iobuf_put (fp, 2); /* 2 bytes */
iobuf_put (fp, 0); /* unused */
- if (iobuf_put (fp, cacheval))
+ if (iobuf_put (fp, cacheval))
{
rc = gpg_error_from_syserror ();
log_error ("writing sigcache packet failed\n");
@@ -1326,7 +1326,7 @@ write_keyblock (IOBUF fp, KBNODE keyblock)
return 0;
}
-/*
+/*
* Walk over all public keyrings, check the signatures and replace the
* keyring with a new one where the signature cache is then updated.
* This is only done for the public keyrings.
@@ -1371,7 +1371,7 @@ keyring_rebuild_cache (void *token,int noisy)
* the original file is closed */
tmpfp = NULL;
}
- rc = lastresname? rename_tmp_file (bakfilename, tmpfilename,
+ rc = lastresname? rename_tmp_file (bakfilename, tmpfilename,
lastresname) : 0;
xfree (tmpfilename); tmpfilename = NULL;
xfree (bakfilename); bakfilename = NULL;
@@ -1384,10 +1384,10 @@ keyring_rebuild_cache (void *token,int noisy)
if (rc)
goto leave;
}
-
+
release_kbnode (keyblock);
rc = keyring_get_keyblock (hd, &keyblock);
- if (rc)
+ if (rc)
{
log_error ("keyring_get_keyblock failed: %s\n", g10_errstr(rc));
goto leave;
@@ -1431,7 +1431,7 @@ keyring_rebuild_cache (void *token,int noisy)
sigcount++;
}
}
-
+
/* write the keyblock to the temporary file */
rc = write_keyblock (tmpfp, keyblock);
if (rc)
@@ -1441,10 +1441,10 @@ keyring_rebuild_cache (void *token,int noisy)
log_info(_("%lu keys cached so far (%lu signatures)\n"),
count, sigcount );
- } /* end main loop */
+ } /* end main loop */
if (rc == -1)
rc = 0;
- if (rc)
+ if (rc)
{
log_error ("keyring_search failed: %s\n", g10_errstr(rc));
goto leave;
@@ -1472,8 +1472,8 @@ keyring_rebuild_cache (void *token,int noisy)
leave:
if (tmpfp)
iobuf_cancel (tmpfp);
- xfree (tmpfilename);
- xfree (bakfilename);
+ xfree (tmpfilename);
+ xfree (bakfilename);
release_kbnode (keyblock);
keyring_lock (hd, 0);
keyring_release (hd);
@@ -1496,13 +1496,13 @@ do_copy (int mode, const char *fname, KBNODE root,
char *bakfname = NULL;
char *tmpfname = NULL;
- /* Open the source file. Because we do a rename, we have to check the
+ /* Open the source file. Because we do a rename, we have to check the
permissions of the file */
if (access (fname, W_OK))
return gpg_error_from_syserror ();
fp = iobuf_open (fname);
- if (mode == 1 && !fp && errno == ENOENT) {
+ if (mode == 1 && !fp && errno == ENOENT) {
/* insert mode but file does not exist: create a new file */
KBNODE kbctx, node;
mode_t oldmask;
diff --git a/g10/main.h b/g10/main.h
index 920d82c97..9548731fc 100644
--- a/g10/main.h
+++ b/g10/main.h
@@ -124,7 +124,7 @@ char *pct_expando(const char *string,struct expando_args *args);
void deprecated_warning(const char *configname,unsigned int configlineno,
const char *option,const char *repl1,const char *repl2);
void deprecated_command (const char *name);
-void obsolete_option (const char *configname, unsigned int configlineno,
+void obsolete_option (const char *configname, unsigned int configlineno,
const char *name);
int string_to_cipher_algo (const char *string);
@@ -272,14 +272,14 @@ void try_make_homedir( const char *fname );
/*-- seskey.c --*/
void make_session_key( DEK *dek );
gcry_mpi_t encode_session_key( int openpgp_pk_algo, DEK *dek, unsigned nbits );
-gcry_mpi_t encode_md_value (PKT_public_key *pk,
+gcry_mpi_t encode_md_value (PKT_public_key *pk,
gcry_md_hd_t md, int hash_algo );
/*-- import.c --*/
int parse_import_options(char *str,unsigned int *options,int noisy);
void import_keys (ctrl_t ctrl, char **fnames, int nnames,
void *stats_hd, unsigned int options);
-int import_keys_stream (ctrl_t ctrl, iobuf_t inp, void *stats_hd,
+int import_keys_stream (ctrl_t ctrl, iobuf_t inp, void *stats_hd,
unsigned char **fpr,
size_t *fpr_len, unsigned int options);
int import_keys_es_stream (ctrl_t ctrl, estream_t fp, void *stats_handle,
@@ -298,7 +298,7 @@ int export_pubkeys (ctrl_t ctrl, strlist_t users, unsigned int options );
int export_pubkeys_stream (ctrl_t ctrl, iobuf_t out, strlist_t users,
kbnode_t *keyblock_out, unsigned int options );
gpg_error_t export_pubkey_buffer (ctrl_t ctrl, const char *keyspec,
- unsigned int options,
+ unsigned int options,
kbnode_t *r_keyblock,
void **r_data, size_t *r_datalen);
int export_seckeys (ctrl_t ctrl, strlist_t users);
diff --git a/g10/mainproc.c b/g10/mainproc.c
index dcbc4b45a..2ad941603 100644
--- a/g10/mainproc.c
+++ b/g10/mainproc.c
@@ -63,15 +63,15 @@ struct mainproc_context
md_filter_context_t mfx;
int sigs_only; /* Process only signatures and reject all other stuff. */
int encrypt_only; /* Process only encryption messages. */
-
+
/* Name of the file with the complete signature or the file with the
detached signature. This is currently only used to deduce the
file name of the data file if that has not been given. */
const char *sigfilename;
-
+
/* A structure to describe the signed data in case of a detached
signature. */
- struct
+ struct
{
/* A file descriptor of the the signed data. Only used if not -1. */
int data_fd;
@@ -82,7 +82,7 @@ struct mainproc_context
is used. This is only needed for better readability. */
int used;
} signed_data;
-
+
DEK *dek;
int last_was_session_key;
KBNODE list; /* The current list of packets. */
@@ -147,7 +147,7 @@ add_gpg_control( CTX c, PACKET *pkt )
/* New clear text signature.
* Process the last one and reset everything */
release_list(c);
- }
+ }
if( c->list ) /* add another packet */
add_kbnode( c->list, new_kbnode( pkt ));
@@ -261,7 +261,7 @@ symkey_decrypt_seskey( DEK *dek, byte *seskey, size_t slen )
/*log_hexdump( "thekey", dek->key, dek->keylen );*/
return 0;
-}
+}
static void
proc_symkey_enc( CTX c, PACKET *pkt )
@@ -446,7 +446,7 @@ print_pkenc_list( struct kidlist_item *list, int failed )
for( ; list; list = list->next ) {
PKT_public_key *pk;
const char *algstr;
-
+
if ( failed && !list->reason )
continue;
if ( !failed && list->reason )
@@ -670,7 +670,7 @@ proc_plaintext( CTX c, PACKET *pkt )
/* check that we have at least the sigclass and one hash */
if ( datalen < 2 )
- log_fatal("invalid control packet CTRLPKT_CLEARSIGN_START\n");
+ log_fatal("invalid control packet CTRLPKT_CLEARSIGN_START\n");
/* Note that we don't set the clearsig flag for not-dash-escaped
* documents */
clearsig = (*data == 0x01);
@@ -724,14 +724,14 @@ proc_plaintext( CTX c, PACKET *pkt )
{
write_status_text (STATUS_ERROR, "proc_pkt.plaintext 89_BAD_DATA");
log_inc_errorcount ();
- rc = gpg_error (GPG_ERR_UNEXPECTED);
+ rc = gpg_error (GPG_ERR_UNEXPECTED);
}
}
-
+
if(!rc)
{
rc = handle_plaintext( pt, &c->mfx, c->sigs_only, clearsig );
- if ( gpg_err_code (rc) == GPG_ERR_EACCES && !c->sigs_only )
+ if ( gpg_err_code (rc) == GPG_ERR_EACCES && !c->sigs_only )
{
/* Can't write output but we hash it anyway to check the
signature. */
@@ -750,7 +750,7 @@ proc_plaintext( CTX c, PACKET *pkt )
n = new_kbnode (create_gpg_control (CTRLPKT_PLAINTEXT_MARK, NULL, 0));
if (c->list)
add_kbnode (c->list, n);
- else
+ else
c->list = n;
}
@@ -854,7 +854,7 @@ do_check_sig( CTX c, KBNODE node, int *is_selfsig,
|| sig->sig_class == 0x1f
|| sig->sig_class == 0x20
|| sig->sig_class == 0x28
- || sig->sig_class == 0x30 ) {
+ || sig->sig_class == 0x30 ) {
if( c->list->pkt->pkttype == PKT_PUBLIC_KEY
|| c->list->pkt->pkttype == PKT_PUBLIC_SUBKEY ) {
return check_key_signature( c->list, node, is_selfsig );
@@ -1112,7 +1112,7 @@ list_node( CTX c, KBNODE node )
switch (gpg_err_code (rc2)) {
case 0: sigrc = '!'; break;
case GPG_ERR_BAD_SIGNATURE: sigrc = '-'; break;
- case GPG_ERR_NO_PUBKEY:
+ case GPG_ERR_NO_PUBKEY:
case GPG_ERR_UNUSABLE_PUBKEY: sigrc = '?'; break;
default: sigrc = '%'; break;
}
@@ -1124,7 +1124,7 @@ list_node( CTX c, KBNODE node )
|| c->list->pkt->pkttype == PKT_SECRET_KEY )
{
keyid_from_pk (c->list->pkt->pkt.public_key, keyid);
-
+
if( keyid[0] == sig->keyid[0] && keyid[1] == sig->keyid[1] )
is_selfsig = 1;
}
@@ -1214,7 +1214,7 @@ proc_signature_packets (ctrl_t ctrl, void *anchor, IOBUF a,
messages, send a NODATA status back and return an error code.
Using log_error is required because verify_files does not check
error codes for each file but we want to terminate the process
- with an error. */
+ with an error. */
if (!rc && !c->any_sig_seen)
{
write_status_text (STATUS_NODATA, "4");
@@ -1258,19 +1258,19 @@ proc_signature_packets_by_fd (ctrl_t ctrl,
messages, send a NODATA status back and return an error code.
Using log_error is required because verify_files does not check
error codes for each file but we want to terminate the process
- with an error. */
+ with an error. */
if (!rc && !c->any_sig_seen)
{
write_status_text (STATUS_NODATA, "4");
log_error (_("no signature found\n"));
rc = gpg_error (GPG_ERR_NO_DATA);
}
-
+
/* Propagate the signature seen flag upward. Do this only on success
so that we won't issue the nodata status several times. */
if (!rc && c->anchor && c->any_sig_seen)
c->anchor->any_sig_seen = 1;
-
+
xfree ( c );
return rc;
}
@@ -1395,7 +1395,7 @@ do_proc_packets( CTX c, IOBUF a )
* packet and not to reuse the current one ... It works right
* when there is a compression packet inbetween which adds just
* an extra layer.
- * Hmmm: Rewrite this whole module here??
+ * Hmmm: Rewrite this whole module here??
*/
if( pkt->pkttype != PKT_SIGNATURE && pkt->pkttype != PKT_MDC )
c->have_data = pkt->pkttype == PKT_PLAINTEXT;
@@ -1514,7 +1514,7 @@ check_sig_and_print( CTX c, KBNODE node )
O{1,n} P S{1,n} -- standard OpenPGP signature.
C P S{1,n} -- cleartext signature.
-
+
O = One-Pass Signature packet.
S = Signature packet.
P = OpenPGP Message packet (Encrypted | Compressed | Literal)
@@ -1526,7 +1526,7 @@ check_sig_and_print( CTX c, KBNODE node )
C = Marker packet for cleartext signatures.
We reject all other messages.
-
+
Actually we are calling this too often, i.e. for verification of
each message but better have some duplicate work than to silently
introduce a bug here.
@@ -1540,7 +1540,7 @@ check_sig_and_print( CTX c, KBNODE node )
n = c->list;
assert (n);
- if ( n->pkt->pkttype == PKT_SIGNATURE )
+ if ( n->pkt->pkttype == PKT_SIGNATURE )
{
/* This is either "S{1,n}" case (detached signature) or
"S{1,n} P" (old style PGP2 signature). */
@@ -1559,7 +1559,7 @@ check_sig_and_print( CTX c, KBNODE node )
else
goto ambiguous;
}
- else if (n->pkt->pkttype == PKT_ONEPASS_SIG)
+ else if (n->pkt->pkttype == PKT_ONEPASS_SIG)
{
/* This is the "O{1,n} P S{1,n}" case (standard signature). */
for (n_onepass=1, n = n->next;
@@ -1607,7 +1607,7 @@ check_sig_and_print( CTX c, KBNODE node )
if (n || !n_sig)
goto ambiguous;
}
- else
+ else
{
ambiguous:
log_error(_("can't handle this ambiguous signature data\n"));
@@ -1676,19 +1676,19 @@ check_sig_and_print( CTX c, KBNODE node )
/* If the preferred keyserver thing above didn't work, our second
try is to use the URI from a DNS PKA record. */
- if ( rc == G10ERR_NO_PUBKEY
+ if ( rc == G10ERR_NO_PUBKEY
&& opt.keyserver_options.options&KEYSERVER_AUTO_KEY_RETRIEVE
&& opt.keyserver_options.options&KEYSERVER_HONOR_PKA_RECORD)
{
const char *uri = pka_uri_from_sig (sig);
-
+
if (uri)
{
/* FIXME: We might want to locate the key using the
fingerprint instead of the keyid. */
int res;
struct keyserver_spec *spec;
-
+
spec = parse_keyserver_uri (uri, 1, NULL, 0);
if (spec)
{
@@ -1772,7 +1772,7 @@ check_sig_and_print( CTX c, KBNODE node )
keyid_str[17] = 0; /* cut off the "[uncertain]" part */
write_status_text_and_buffer (statno, keyid_str,
un->pkt->pkt.user_id->name,
- un->pkt->pkt.user_id->len,
+ un->pkt->pkt.user_id->len,
-1 );
p=utf8_to_native(un->pkt->pkt.user_id->name,
@@ -1817,7 +1817,7 @@ check_sig_and_print( CTX c, KBNODE node )
write_status_text_and_buffer (statno, keyid_str,
un? un->pkt->pkt.user_id->name:"[?]",
- un? un->pkt->pkt.user_id->len:3,
+ un? un->pkt->pkt.user_id->len:3,
-1 );
if(un)
@@ -1837,7 +1837,7 @@ check_sig_and_print( CTX c, KBNODE node )
log_printf ("\n");
}
- /* If we have a good signature and already printed
+ /* If we have a good signature and already printed
* the primary user ID, print all the other user IDs */
if ( count && !rc
&& !(opt.verify_options&VERIFY_SHOW_PRIMARY_UID_ONLY)) {
@@ -1934,7 +1934,7 @@ check_sig_and_print( CTX c, KBNODE node )
bufp = bufp + strlen (bufp);
if (!vpk->flags.primary) {
u32 akid[2];
-
+
akid[0] = vpk->main_keyid[0];
akid[1] = vpk->main_keyid[1];
free_public_key (vpk);
@@ -2097,7 +2097,7 @@ proc_tree( CTX c, KBNODE node )
log_error (_("not a detached signature\n") );
return;
}
-
+
for( n1 = node; (n1 = find_next_kbnode(n1, PKT_SIGNATURE )); )
check_sig_and_print( c, n1 );
}
@@ -2171,7 +2171,7 @@ proc_tree( CTX c, KBNODE node )
if( c->sigs_only ) {
if (c->signed_data.used && c->signed_data.data_fd != -1)
rc = hash_datafile_by_fd (c->mfx.md, c->mfx.md2,
- c->signed_data.data_fd,
+ c->signed_data.data_fd,
(sig->sig_class == 0x01));
else
rc = hash_datafiles (c->mfx.md, c->mfx.md2,
diff --git a/g10/mdfilter.c b/g10/mdfilter.c
index a00516456..708bdcdfc 100644
--- a/g10/mdfilter.c
+++ b/g10/mdfilter.c
@@ -72,4 +72,3 @@ free_md_filter_context( md_filter_context_t *mfx )
mfx->md2 = NULL;
mfx->maxbuf_size = 0;
}
-
diff --git a/g10/openfile.c b/g10/openfile.c
index 101a0f1e4..114e0add9 100644
--- a/g10/openfile.c
+++ b/g10/openfile.c
@@ -70,10 +70,10 @@ overwrite_filep( const char *fname )
{
if ( iobuf_is_pipe_filename (fname) )
return 1; /* Writing to stdout is always okay. */
-
+
if ( access( fname, F_OK ) )
return 1; /* Does not exist. */
-
+
if ( !compare_filenames (fname, NAME_OF_DEV_NULL) )
return 1; /* Does not do any harm. */
@@ -140,7 +140,7 @@ ask_outfile_name( const char *name, size_t namelen )
if ( opt.batch )
return NULL;
-
+
defname = name && namelen? make_printable_string (name, namelen, 0) : NULL;
s = _("Enter new filename");
@@ -155,9 +155,9 @@ ask_outfile_name( const char *name, size_t namelen )
cpr_kill_prompt ();
tty_disable_completion ();
xfree (prompt);
- if ( !*fname )
+ if ( !*fname )
{
- xfree (fname);
+ xfree (fname);
fname = defname;
defname = NULL;
}
@@ -188,7 +188,7 @@ open_outfile (int inp_fd, const char *iname, int mode, iobuf_t *a)
if (inp_fd != -1)
{
char xname[64];
-
+
*a = iobuf_fdopen_nc (inp_fd, "wb");
if (!*a)
{
@@ -202,7 +202,7 @@ open_outfile (int inp_fd, const char *iname, int mode, iobuf_t *a)
log_info (_("writing to `%s'\n"), xname);
}
}
- else if (iobuf_is_pipe_filename (iname) && !opt.outfile)
+ else if (iobuf_is_pipe_filename (iname) && !opt.outfile)
{
*a = iobuf_create(NULL);
if ( !*a )
@@ -217,12 +217,12 @@ open_outfile (int inp_fd, const char *iname, int mode, iobuf_t *a)
{
char *buf = NULL;
const char *name;
-
+
if (opt.dry_run)
name = NAME_OF_DEV_NULL;
else if (opt.outfile)
name = opt.outfile;
- else
+ else
{
#ifdef USE_ONLY_8DOT3
if (opt.mangle_dos_filenames)
@@ -238,7 +238,7 @@ open_outfile (int inp_fd, const char *iname, int mode, iobuf_t *a)
newsfx = (mode==1 ? ".asc" :
mode==2 ? ".sig" : ".gpg");
-
+
buf = xmalloc (strlen(iname)+4+1);
strcpy (buf, iname);
dot = strchr (buf, '.' );
@@ -253,14 +253,14 @@ open_outfile (int inp_fd, const char *iname, int mode, iobuf_t *a)
if (!buf)
#endif /* USE_ONLY_8DOT3 */
{
- buf = xstrconcat (iname,
+ buf = xstrconcat (iname,
(mode==1 ? EXTSEP_S "asc" :
mode==2 ? EXTSEP_S "sig" : EXTSEP_S "gpg"),
NULL);
}
name = buf;
}
-
+
rc = 0;
while ( !overwrite_filep (name) )
{
@@ -274,7 +274,7 @@ open_outfile (int inp_fd, const char *iname, int mode, iobuf_t *a)
xfree (buf);
name = buf = tmp;
}
-
+
if ( !rc )
{
if (is_secured_filename (name) )
@@ -294,7 +294,7 @@ open_outfile (int inp_fd, const char *iname, int mode, iobuf_t *a)
}
xfree(buf);
}
-
+
if (*a)
iobuf_ioctl (*a, IOBUF_IOCTL_NO_CACHE, 1, NULL);
@@ -400,7 +400,7 @@ copy_options_file( const char *destdir )
;
else if (c == '#')
esc = 2;
- else
+ else
any_option = 1;
}
}
diff --git a/g10/options.h b/g10/options.h
index cd0140651..e67d0ce04 100644
--- a/g10/options.h
+++ b/g10/options.h
@@ -31,7 +31,7 @@
#if defined (__riscos__) && !defined (INCLUDED_BY_MAIN_MODULE)
#define EXTERN_UNLESS_MAIN_MODULE extern
#else
-#define EXTERN_UNLESS_MAIN_MODULE
+#define EXTERN_UNLESS_MAIN_MODULE
#endif
#endif
@@ -96,7 +96,7 @@ struct
int completes_needed;
int max_cert_depth;
const char *homedir;
- const char *agent_program;
+ const char *agent_program;
/* Options to be passed to the gpg-agent */
session_env_t session_env;
@@ -202,7 +202,7 @@ struct
/* If > 0, limit the number of card insertion prompts to this
value. */
- int limit_card_insert_tries;
+ int limit_card_insert_tries;
#ifdef ENABLE_CARD_SUPPORT
/* FIXME: We don't needs this here as it is done in scdaemon. */
@@ -231,8 +231,8 @@ struct
enum {
AKL_NODEFAULT,
AKL_LOCAL,
- AKL_CERT,
- AKL_PKA,
+ AKL_CERT,
+ AKL_PKA,
AKL_LDAP,
AKL_KEYSERVER,
AKL_SPEC
diff --git a/g10/options.skel b/g10/options.skel
index 534affcd2..87bbd4e3b 100644
--- a/g10/options.skel
+++ b/g10/options.skel
@@ -4,11 +4,11 @@
# Options for GnuPG
# Copyright 1998, 1999, 2000, 2001, 2002, 2003,
# 2010 Free Software Foundation, Inc.
-#
+#
# 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 PURPOSE.
@@ -203,4 +203,3 @@ keyserver hkp://keys.gnupg.net
#
# Use your MIME handler to view photos:
# photo-viewer "metamail -q -d -b -c %T -s 'KeyID 0x%k' -f GnuPG"
-
diff --git a/g10/packet.h b/g10/packet.h
index 5411e524a..fa32ab194 100644
--- a/g10/packet.h
+++ b/g10/packet.h
@@ -49,11 +49,11 @@ typedef enum {
} preftype_t;
typedef struct {
- byte type;
+ byte type;
byte value;
} prefitem_t;
-typedef struct
+typedef struct
{
int mode; /* Must be an integer due to the GNU modes 1001 et al. */
byte hash_algo;
@@ -114,9 +114,9 @@ typedef struct
/* Object to keep information pertaining to a signature. */
-typedef struct
+typedef struct
{
- struct
+ struct
{
unsigned checked:1; /* Signature has been checked. */
unsigned valid:1; /* Signature is good (if checked is set). */
@@ -213,7 +213,7 @@ struct seckey_info
/* be decrypted before use, the protected */
/* MPIs are simply (void*) pointers to memory */
/* and should never be passed to a mpi_xxx() */
- int sha1chk:1; /* SHA1 is used instead of a 16 bit checksum */
+ int sha1chk:1; /* SHA1 is used instead of a 16 bit checksum */
u16 csum; /* Checksum for old protection modes. */
byte algo; /* Cipher used to protect the secret information. */
STRING2KEY s2k; /* S2K parameter. */
@@ -248,7 +248,7 @@ typedef struct
byte pubkey_usage; /* for now only used to pass it to getkey() */
byte req_usage; /* hack to pass a request to getkey() */
byte req_algo; /* Ditto */
- u32 has_expired; /* set to the expiration date if expired */
+ u32 has_expired; /* set to the expiration date if expired */
u32 main_keyid[2]; /* keyid of the primary key */
u32 keyid[2]; /* calculated by keyid_from_pk() */
prefitem_t *prefs; /* list of preferences (may be NULL) */
@@ -257,7 +257,7 @@ typedef struct
unsigned int mdc:1; /* MDC feature set. */
unsigned int disabled_valid:1;/* The next flag is valid. */
unsigned int disabled:1; /* The key has been disabled. */
- unsigned int primary:1; /* This is a primary key. */
+ unsigned int primary:1; /* This is a primary key. */
unsigned int revoked:2; /* Key has been revoked.
1 = revoked by the owner
2 = revoked by designated revoker. */
@@ -278,7 +278,7 @@ typedef struct
const byte *trust_regexp;
char *serialno; /* Malloced hex string or NULL if it is
likely not on a card. See also
- flags.serialno_valid. */
+ flags.serialno_valid. */
struct seckey_info *seckey_info; /* If not NULL this malloced
structure describes a secret
key. */
diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index 83be15d8c..fc11e9dbe 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -15,7 +15,7 @@
* 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/>.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
@@ -1383,7 +1383,7 @@ enum_sig_subpkt (const subpktarea_t * pktbuf, sigsubpkttype_t reqtype,
n = *buffer++;
buflen--;
if (n == 255) /* 4 byte length header. */
- {
+ {
if (buflen < 4)
goto too_short;
n = (buffer[0] << 24) | (buffer[1] << 16)
@@ -1392,7 +1392,7 @@ enum_sig_subpkt (const subpktarea_t * pktbuf, sigsubpkttype_t reqtype,
buflen -= 4;
}
else if (n >= 192) /* 4 byte special encoded length header. */
- {
+ {
if (buflen < 2)
goto too_short;
n = ((n - 192) << 8) + *buffer + 192;
@@ -1511,7 +1511,7 @@ parse_revkeys (PKT_signature * sig)
SIGSUBPKT_REV_KEY,
&len, &seq, NULL)))
{
- if (len == sizeof (struct revocation_key)
+ if (len == sizeof (struct revocation_key)
&& (revkey->class & 0x80)) /* 0x80 bit must be set. */
{
sig->revkey = xrealloc (sig->revkey,
@@ -1574,7 +1574,7 @@ parse_signature (IOBUF inp, int pkttype, unsigned long pktlen,
sig->flags.exportable = 1;
sig->flags.revocable = 1;
if (is_v4) /* Read subpackets. */
- {
+ {
n = read_16 (inp);
pktlen -= 2; /* Length of hashed data. */
if (n > 10000)
@@ -1622,7 +1622,7 @@ parse_signature (IOBUF inp, int pkttype, unsigned long pktlen,
}
if (pktlen < 5) /* Sanity check. */
- {
+ {
log_error ("packet(%d) too short\n", pkttype);
rc = G10ERR_INVALID_PACKET;
goto leave;
@@ -1634,7 +1634,7 @@ parse_signature (IOBUF inp, int pkttype, unsigned long pktlen,
pktlen--;
if (is_v4 && sig->pubkey_algo) /* Extract required information. */
- {
+ {
const byte *p;
size_t len;
@@ -2164,7 +2164,7 @@ parse_key (IOBUF inp, int pkttype, unsigned long pktlen,
}
}
else /* Old version; no S2K, so we set mode to 0, hash MD5. */
- {
+ {
/* Note that a ski->algo > 110 is illegal, but I'm not
erroring on it here as otherwise there would be no
way to delete such a key. */
@@ -2174,7 +2174,7 @@ parse_key (IOBUF inp, int pkttype, unsigned long pktlen,
es_fprintf (listfp, "\tprotect algo: %d (hash algo: %d)\n",
ski->algo, ski->s2k.hash_algo);
}
-
+
/* It is really ugly that we don't know the size
* of the IV here in cases we are not aware of the algorithm.
* so a
@@ -2233,8 +2233,8 @@ parse_key (IOBUF inp, int pkttype, unsigned long pktlen,
if (list_mode)
es_fprintf (listfp, "\tskey[%d]: [v4 protected]\n", npkey);
}
- else
- {
+ else
+ {
/* The v3 method: The mpi length is not encrypted. */
for (i = npkey; i < nskey; i++)
{
@@ -2300,7 +2300,7 @@ parse_attribute_subpkts (PKT_user_id * uid)
n = *buffer++;
buflen--;
if (n == 255) /* 4 byte length header. */
- {
+ {
if (buflen < 4)
goto too_short;
n = (buffer[0] << 24) | (buffer[1] << 16)
@@ -2309,7 +2309,7 @@ parse_attribute_subpkts (PKT_user_id * uid)
buflen -= 4;
}
else if (n >= 192) /* 2 byte special encoded length header. */
- {
+ {
if (buflen < 2)
goto too_short;
n = ((n - 192) << 8) + *buffer + 192;
@@ -2835,4 +2835,3 @@ create_gpg_control (ctrlpkttype_t type, const byte * data, size_t datalen)
return packet;
}
-
diff --git a/g10/photoid.c b/g10/photoid.c
index 2d56d80b6..9045f0c16 100644
--- a/g10/photoid.c
+++ b/g10/photoid.c
@@ -21,7 +21,7 @@
#include <errno.h>
#include <stdio.h>
#include <string.h>
-#ifdef _WIN32
+#ifdef _WIN32
# include <windows.h>
# ifndef VER_PLATFORM_WIN32_WINDOWS
# define VER_PLATFORM_WIN32_WINDOWS 1
@@ -121,7 +121,7 @@ generate_photo_id(PKT_public_key *pk,const char *photo_name)
continue;
}
-
+
len=iobuf_get_filelength(file, &overflow);
if(len>6144 || overflow)
{
diff --git a/g10/pkclist.c b/g10/pkclist.c
index ba36a0ca1..626250ff6 100644
--- a/g10/pkclist.c
+++ b/g10/pkclist.c
@@ -47,7 +47,7 @@ send_status_inv_recp (int reason, const char *name)
snprintf (buf, sizeof buf, "%d ", reason);
write_status_text_and_buffer (STATUS_INV_RECP, buf,
- name, strlen (name),
+ name, strlen (name),
-1);
}
@@ -170,7 +170,7 @@ show_revocation_reason( PKT_public_key *pk, int mode )
* mode: 0 = standard
* 1 = Without key info and additional menu option 'm'
* this does also add an option to set the key to ultimately trusted.
- * Returns:
+ * Returns:
* -2 = nothing changed - caller should show some additional info
* -1 = quit operation
* 0 = nothing changed
@@ -206,7 +206,7 @@ do_edit_ownertrust (PKT_public_key *pk, int mode,
uppercase. Below you will find the matching strings which
should be translated accordingly and the letter changed to
match the one in the answer string.
-
+
i = please show me more information
m = back to the main menu
s = skip this key
@@ -214,9 +214,9 @@ do_edit_ownertrust (PKT_public_key *pk, int mode,
*/
const char *ans = _("iImMqQsS");
- if( !did_help )
+ if( !did_help )
{
- if( !mode )
+ if( !mode )
{
KBNODE keyblock, un;
@@ -243,7 +243,7 @@ do_edit_ownertrust (PKT_public_key *pk, int mode,
if (un->pkt->pkt.user_id->is_primary
&& !un->pkt->pkt.user_id->attrib_data )
continue;
-
+
if((opt.verify_options&VERIFY_SHOW_PHOTOS)
&& un->pkt->pkt.user_id->attrib_data)
show_photos (un->pkt->pkt.user_id->attribs,
@@ -255,7 +255,7 @@ do_edit_ownertrust (PKT_public_key *pk, int mode,
tty_printf(_(" aka \"%s\"\n"),p);
}
-
+
print_fingerprint (pk, 2);
tty_printf("\n");
release_kbnode (keyblock);
@@ -313,7 +313,7 @@ do_edit_ownertrust (PKT_public_key *pk, int mode,
did_help = 0;
else if( *p && p[1] )
;
- else if( !p[1] && ((*p >= '0'+min_num) && *p <= (mode?'5':'4')) )
+ else if( !p[1] && ((*p >= '0'+min_num) && *p <= (mode?'5':'4')) )
{
unsigned int trust;
switch( *p )
@@ -339,14 +339,14 @@ do_edit_ownertrust (PKT_public_key *pk, int mode,
}
#if 0
/* not yet implemented */
- else if( *p == ans[0] || *p == ans[1] )
+ else if( *p == ans[0] || *p == ans[1] )
{
tty_printf(_("Certificates leading to an ultimately trusted key:\n"));
show = 1;
break;
}
#endif
- else if( mode && (*p == ans[2] || *p == ans[3] || *p == CONTROL_D ) )
+ else if( mode && (*p == ans[2] || *p == ans[3] || *p == CONTROL_D ) )
{
break ; /* back to the menu */
}
@@ -365,9 +365,9 @@ do_edit_ownertrust (PKT_public_key *pk, int mode,
return show? -2: quit? -1 : changed;
}
-/*
+/*
* Display a menu to change the ownertrust of the key PK (which should
- * be a primary key).
+ * be a primary key).
* For mode values see do_edit_ownertrust ()
*/
int
@@ -424,7 +424,7 @@ do_we_trust( PKT_public_key *pk, unsigned int trustlevel )
log_error ("invalid trustlevel %u returned from validation layer\n",
trustlevel);
/* fall thru */
- case TRUST_UNKNOWN:
+ case TRUST_UNKNOWN:
case TRUST_UNDEFINED:
log_info(_("%s: There is no assurance this key belongs"
" to the named user\n"),keystr_from_pk(pk));
@@ -474,12 +474,12 @@ do_we_trust_pre( PKT_public_key *pk, unsigned int trustlevel )
tty_printf("\n");
-
+
if (is_status_enabled ())
{
u32 kid[2];
char *hint_str;
-
+
keyid_from_pk (pk, kid);
hint_str = get_long_user_id_string ( kid );
write_status_text ( STATUS_USERID_HINT, hint_str );
@@ -511,7 +511,7 @@ check_signatures_trust( PKT_signature *sig )
int rc=0;
rc = get_pubkey( pk, sig->keyid );
- if (rc)
+ if (rc)
{ /* this should not happen */
log_error("Ooops; the key vanished - can't check the trust\n");
rc = G10ERR_NO_PUBKEY;
@@ -533,7 +533,7 @@ check_signatures_trust( PKT_signature *sig )
trustlevel = get_validity (pk, NULL);
- if ( (trustlevel & TRUST_FLAG_REVOKED) )
+ if ( (trustlevel & TRUST_FLAG_REVOKED) )
{
write_status( STATUS_KEYREVOKED );
if(pk->flags.revoked == 2)
@@ -544,13 +544,13 @@ check_signatures_trust( PKT_signature *sig )
log_info(_(" This could mean that the signature is forged.\n"));
show_revocation_reason( pk, 0 );
}
- else if ((trustlevel & TRUST_FLAG_SUB_REVOKED) )
+ else if ((trustlevel & TRUST_FLAG_SUB_REVOKED) )
{
write_status( STATUS_KEYREVOKED );
log_info(_("WARNING: This subkey has been revoked by its owner!\n"));
show_revocation_reason( pk, 0 );
}
-
+
if ((trustlevel & TRUST_FLAG_DISABLED))
log_info (_("Note: This key has been disabled.\n"));
@@ -583,9 +583,9 @@ check_signatures_trust( PKT_signature *sig )
"does not match DNS entry\n"), sig->pka_info->email);
}
- switch ( (trustlevel & TRUST_MASK) )
+ switch ( (trustlevel & TRUST_MASK) )
{
- case TRUST_UNKNOWN:
+ case TRUST_UNKNOWN:
case TRUST_UNDEFINED:
case TRUST_MARGINAL:
if (okay && opt.verify_options&VERIFY_PKA_TRUST_INCREASE)
@@ -607,18 +607,18 @@ check_signatures_trust( PKT_signature *sig )
}
/* Now let the user know what up with the trustlevel. */
- switch ( (trustlevel & TRUST_MASK) )
+ switch ( (trustlevel & TRUST_MASK) )
{
case TRUST_EXPIRED:
log_info(_("Note: This key has expired!\n"));
print_fingerprint (pk, 1);
break;
-
+
default:
log_error ("invalid trustlevel %u returned from validation layer\n",
trustlevel);
/* fall thru */
- case TRUST_UNKNOWN:
+ case TRUST_UNKNOWN:
case TRUST_UNDEFINED:
write_status( STATUS_TRUST_UNDEFINED );
log_info(_("WARNING: This key is not certified with"
@@ -670,7 +670,7 @@ void
release_pk_list (pk_list_t pk_list)
{
PK_LIST pk_rover;
-
+
for ( ; pk_list; pk_list = pk_rover)
{
pk_rover = pk_list->next;
@@ -778,7 +778,7 @@ expand_group(strlist_t input)
of the key. USE the requested usage and a set MARK_HIDDEN will mark
the key in the updated list as a hidden recipient. */
gpg_error_t
-find_and_check_key (ctrl_t ctrl, const char *name, unsigned int use,
+find_and_check_key (ctrl_t ctrl, const char *name, unsigned int use,
int mark_hidden, pk_list_t *pk_list_addr)
{
int rc;
@@ -815,7 +815,7 @@ find_and_check_key (ctrl_t ctrl, const char *name, unsigned int use,
/* Key found and usable. Check validity. */
trustlevel = get_validity (pk, pk->user_id);
- if ( (trustlevel & TRUST_FLAG_DISABLED) )
+ if ( (trustlevel & TRUST_FLAG_DISABLED) )
{
/* Key has been disabled. */
send_status_inv_recp (0, name);
@@ -824,7 +824,7 @@ find_and_check_key (ctrl_t ctrl, const char *name, unsigned int use,
return G10ERR_UNU_PUBKEY;
}
- if ( !do_we_trust_pre (pk, trustlevel) )
+ if ( !do_we_trust_pre (pk, trustlevel) )
{
/* We don't trust this key. */
send_status_inv_recp (10, name);
@@ -832,10 +832,10 @@ find_and_check_key (ctrl_t ctrl, const char *name, unsigned int use,
return G10ERR_UNU_PUBKEY;
}
/* Note: do_we_trust may have changed the trustlevel. */
-
+
/* Skip the actual key if the key is already present in the
list. */
- if (!key_present_in_pk_list (*pk_list_addr, pk))
+ if (!key_present_in_pk_list (*pk_list_addr, pk))
{
log_info (_("%s: skipped: public key already present\n"), name);
free_public_key (pk);
@@ -843,7 +843,7 @@ find_and_check_key (ctrl_t ctrl, const char *name, unsigned int use,
else
{
pk_list_t r;
-
+
r = xtrymalloc (sizeof *r);
if (!r)
{
@@ -856,7 +856,7 @@ find_and_check_key (ctrl_t ctrl, const char *name, unsigned int use,
r->flags = mark_hidden? 1:0;
*pk_list_addr = r;
}
-
+
return 0;
}
@@ -901,7 +901,7 @@ build_pk_list (ctrl_t ctrl,
/* Check whether there are any recipients in the list and build the
* list of the encrypt-to ones (we always trust them). */
- for ( rov = remusr; rov; rov = rov->next )
+ for ( rov = remusr; rov; rov = rov->next )
{
if ( !(rov->flags & 1) )
{
@@ -920,7 +920,7 @@ build_pk_list (ctrl_t ctrl,
compliance_failure();
}
}
- else if ( (use & PUBKEY_USAGE_ENC) && !opt.no_encrypt_to )
+ else if ( (use & PUBKEY_USAGE_ENC) && !opt.no_encrypt_to )
{
/* Encryption has been requested and --encrypt-to has not
been disabled. Check this encrypt-to key. */
@@ -931,14 +931,14 @@ build_pk_list (ctrl_t ctrl,
we pass 1for the second last argument and 1 as the last
argument to disable AKL. */
if ( (rc = get_pubkey_byname (ctrl,
- NULL, pk, rov->d, NULL, NULL, 1, 1)) )
+ NULL, pk, rov->d, NULL, NULL, 1, 1)) )
{
free_public_key ( pk ); pk = NULL;
log_error (_("%s: skipped: %s\n"), rov->d, g10_errstr(rc) );
send_status_inv_recp (0, rov->d);
goto fail;
}
- else if ( !(rc=openpgp_pk_test_algo2 (pk->pubkey_algo, use)) )
+ else if ( !(rc=openpgp_pk_test_algo2 (pk->pubkey_algo, use)) )
{
/* Skip the actual key if the key is already present
* in the list. Add it to our list if not. */
@@ -970,7 +970,7 @@ build_pk_list (ctrl_t ctrl,
}
}
}
- else
+ else
{
/* The public key is not usable for encryption or not
available. */
@@ -984,8 +984,8 @@ build_pk_list (ctrl_t ctrl,
/* If we don't have any recipients yet and we are not in batch mode
drop into interactive selection mode. */
- if ( !any_recipients && !opt.batch )
- {
+ if ( !any_recipients && !opt.batch )
+ {
int have_def_rec;
char *answer = NULL;
strlist_t backlog = NULL;
@@ -997,7 +997,7 @@ build_pk_list (ctrl_t ctrl,
if ( !have_def_rec )
tty_printf(_("You did not specify a user ID. (you may use \"-r\")\n"));
- for (;;)
+ for (;;)
{
rc = 0;
xfree(answer);
@@ -1007,7 +1007,7 @@ build_pk_list (ctrl_t ctrl,
answer = def_rec;
def_rec = NULL;
}
- else if (backlog)
+ else if (backlog)
{
/* This is part of our trick to expand and display groups. */
answer = strlist_pop (&backlog);
@@ -1050,8 +1050,8 @@ build_pk_list (ctrl_t ctrl,
trim_spaces(answer);
cpr_kill_prompt();
}
-
- if ( !answer || !*answer )
+
+ if ( !answer || !*answer )
{
xfree(answer);
break; /* No more recipients entered - get out of loop. */
@@ -1071,12 +1071,12 @@ build_pk_list (ctrl_t ctrl,
rc = get_pubkey_byname (ctrl, NULL, pk, answer, NULL, NULL, 0, 0 );
if (rc)
tty_printf(_("No such user ID.\n"));
- else if ( !(rc=openpgp_pk_test_algo2 (pk->pubkey_algo, use)) )
+ else if ( !(rc=openpgp_pk_test_algo2 (pk->pubkey_algo, use)) )
{
if ( have_def_rec )
{
/* No validation for a default recipient. */
- if (!key_present_in_pk_list(pk_list, pk))
+ if (!key_present_in_pk_list(pk_list, pk))
{
free_public_key (pk); pk = NULL;
log_info (_("skipped: public key "
@@ -1096,13 +1096,13 @@ build_pk_list (ctrl_t ctrl,
else
{ /* Check validity of this key. */
int trustlevel;
-
+
trustlevel = get_validity (pk, pk->user_id);
- if ( (trustlevel & TRUST_FLAG_DISABLED) )
+ if ( (trustlevel & TRUST_FLAG_DISABLED) )
{
tty_printf (_("Public key is disabled.\n") );
}
- else if ( do_we_trust_pre (pk, trustlevel) )
+ else if ( do_we_trust_pre (pk, trustlevel) )
{
/* Skip the actual key if the key is already
* present in the list */
@@ -1134,7 +1134,7 @@ build_pk_list (ctrl_t ctrl,
pk = NULL;
}
}
- else if ( !any_recipients && (def_rec = default_recipient()) )
+ else if ( !any_recipients && (def_rec = default_recipient()) )
{
/* We are in batch mode and have only a default recipient. */
pk = xmalloc_clear( sizeof *pk );
@@ -1145,7 +1145,7 @@ build_pk_list (ctrl_t ctrl,
rc = get_pubkey_byname (ctrl, NULL, pk, def_rec, NULL, NULL, 1, 1);
if (rc)
log_error(_("unknown default recipient \"%s\"\n"), def_rec );
- else if ( !(rc=openpgp_pk_test_algo2(pk->pubkey_algo, use)) )
+ else if ( !(rc=openpgp_pk_test_algo2(pk->pubkey_algo, use)) )
{
/* Mark any_recipients here since the default recipient
would have been used if it wasn't already there. It
@@ -1155,7 +1155,7 @@ build_pk_list (ctrl_t ctrl,
if (!key_present_in_pk_list(pk_list, pk))
log_info (_("skipped: public key already set "
"as default recipient\n"));
- else
+ else
{
PK_LIST r = xmalloc( sizeof *r );
r->pk = pk; pk = NULL;
@@ -1171,11 +1171,11 @@ build_pk_list (ctrl_t ctrl,
}
xfree(def_rec); def_rec = NULL;
}
- else
+ else
{
/* General case: Check all keys. */
any_recipients = 0;
- for (; remusr; remusr = remusr->next )
+ for (; remusr; remusr = remusr->next )
{
if ( (remusr->flags & 1) )
continue; /* encrypt-to keys are already handled. */
@@ -1187,14 +1187,14 @@ build_pk_list (ctrl_t ctrl,
any_recipients = 1;
}
}
-
- if ( !rc && !any_recipients )
+
+ if ( !rc && !any_recipients )
{
log_error(_("no valid addressees\n"));
write_status_text (STATUS_NO_RECP, "0");
rc = G10ERR_NO_USER_ID;
}
-
+
fail:
if ( rc )
@@ -1233,7 +1233,7 @@ algo_available( preftype_t preftype, int algo, const union pref_hint *hint)
&& algo != CIPHER_ALGO_3DES
&& algo != CIPHER_ALGO_CAST5))
return 0;
-
+
if(PGP7 && (algo != CIPHER_ALGO_IDEA
&& algo != CIPHER_ALGO_3DES
&& algo != CIPHER_ALGO_CAST5
@@ -1439,7 +1439,7 @@ select_algo_from_prefs(PK_LIST pk_list, int preftype,
if(result==-1)
{
- unsigned int best=-1;
+ unsigned int best=-1;
/* At this point, we have not selected an algorithm due to a
special request or via personal prefs. Pick the highest
@@ -1497,11 +1497,11 @@ select_mdc_from_pklist (PK_LIST pk_list)
if ( !pk_list )
return 0;
-
- for (pkr = pk_list; pkr; pkr = pkr->next)
+
+ for (pkr = pk_list; pkr; pkr = pkr->next)
{
int mdc;
-
+
if (pkr->pk->user_id) /* selected by user ID */
mdc = pkr->pk->user_id->flags.mdc;
else
@@ -1518,8 +1518,8 @@ void
warn_missing_mdc_from_pklist (PK_LIST pk_list)
{
PK_LIST pkr;
-
- for (pkr = pk_list; pkr; pkr = pkr->next)
+
+ for (pkr = pk_list; pkr; pkr = pkr->next)
{
int mdc;
@@ -1537,8 +1537,8 @@ void
warn_missing_aes_from_pklist (PK_LIST pk_list)
{
PK_LIST pkr;
-
- for (pkr = pk_list; pkr; pkr = pkr->next)
+
+ for (pkr = pk_list; pkr; pkr = pkr->next)
{
const prefitem_t *prefs;
int i;
@@ -1548,7 +1548,7 @@ warn_missing_aes_from_pklist (PK_LIST pk_list)
if (prefs)
{
for (i=0; !gotit && prefs[i].type; i++ )
- if (prefs[i].type == PREFTYPE_SYM
+ if (prefs[i].type == PREFTYPE_SYM
&& prefs[i].value == CIPHER_ALGO_AES)
gotit++;
}
diff --git a/g10/plaintext.c b/g10/plaintext.c
index 17f8ea58b..e4e0ea10d 100644
--- a/g10/plaintext.c
+++ b/g10/plaintext.c
@@ -71,18 +71,18 @@ handle_plaintext (PKT_plaintext * pt, md_filter_context_t * mfx,
status message. */
es_fflush (es_stdout);
- snprintf (status, sizeof status,
+ snprintf (status, sizeof status,
"%X %lu ", (byte) pt->mode, (ulong) pt->timestamp);
write_status_text_and_buffer (STATUS_PLAINTEXT,
status, pt->name, pt->namelen, 0);
-
+
if (!pt->is_partial)
{
snprintf (status, sizeof status, "%lu", (ulong) pt->len);
write_status_text (STATUS_PLAINTEXT_LENGTH, status);
}
}
-
+
/* Create the filename as C string. */
if (nooutput)
;
@@ -145,14 +145,14 @@ handle_plaintext (PKT_plaintext * pt, md_filter_context_t * mfx,
{
xfree (tmp);
/* FIXME: Below used to be G10ERR_CREATE_FILE */
- err = gpg_error (GPG_ERR_GENERAL);
+ err = gpg_error (GPG_ERR_GENERAL);
goto leave;
}
xfree (fname);
fname = tmp;
}
}
-
+
#ifndef __riscos__
if (opt.outfp && is_secured_file (es_fileno (opt.outfp)))
{
@@ -390,7 +390,7 @@ handle_plaintext (PKT_plaintext * pt, md_filter_context_t * mfx,
pt->buf = NULL;
}
else /* Clear text signature - don't hash the last CR,LF. */
- {
+ {
int state = 0;
while ((c = iobuf_get (pt->buf)) != -1)
diff --git a/g10/progress.c b/g10/progress.c
index d0aa926ed..ca2022352 100644
--- a/g10/progress.c
+++ b/g10/progress.c
@@ -115,9 +115,9 @@ progress_filter (void *opaque, int control,
|| timestamp - pfx->last_time > 0)
{
char buffer[50];
-
+
sprintf (buffer, "%.20s ? %lu %lu",
- pfx->what? pfx->what : "?",
+ pfx->what? pfx->what : "?",
pfx->offset,
pfx->total);
write_status_text (STATUS_PROGRESS, buffer);
diff --git a/g10/revoke.c b/g10/revoke.c
index f7af5c34f..3beeacfe1 100644
--- a/g10/revoke.c
+++ b/g10/revoke.c
@@ -239,7 +239,7 @@ gen_desig_revoke( const char *uname, strlist_t locusr )
/* get the key from the keyblock */
node = find_kbnode( keyblock, PKT_PUBLIC_KEY );
- if( !node )
+ if( !node )
BUG ();
pk=node->pkt->pkt.public_key;
@@ -482,7 +482,7 @@ gen_revoke (const char *uname)
/* Get the keyid from the keyblock. */
node = find_kbnode (keyblock, PKT_PUBLIC_KEY);
- if (!node)
+ if (!node)
BUG ();
psk = node->pkt->pkt.public_key;
@@ -504,19 +504,19 @@ gen_revoke (const char *uname)
rc = 0;
goto leave;
}
-
+
if (psk->version >= 4 || opt.force_v4_certs)
{
/* Get the reason for the revocation. */
reason = ask_revocation_reason (1, 0, 1);
if (!reason)
- {
+ {
/* user decided to cancel */
rc = 0;
goto leave;
}
}
-
+
if (!opt.armor)
tty_printf (_("ASCII armored output forced.\n"));
@@ -536,7 +536,7 @@ gen_revoke (const char *uname)
log_error (_("make_keysig_packet failed: %s\n"), g10_errstr (rc));
goto leave;
}
-
+
if (PGP2 || PGP6 || PGP7 || PGP8)
{
/* Use a minimal pk for PGPx mode, since PGP can't import bare
@@ -550,15 +550,15 @@ gen_revoke (const char *uname)
init_packet( &pkt );
pkt.pkttype = PKT_SIGNATURE;
pkt.pkt.signature = sig;
-
+
rc = build_packet (out, &pkt);
- if (rc)
+ if (rc)
{
log_error(_("build_packet failed: %s\n"), g10_errstr(rc) );
goto leave;
}
}
-
+
/* and issue a usage notice */
tty_printf (_(
"Revocation certificate created.\n\n"
diff --git a/g10/rmd160.c b/g10/rmd160.c
index febfa618a..8eb005f54 100644
--- a/g10/rmd160.c
+++ b/g10/rmd160.c
@@ -55,7 +55,7 @@ rol (u32 x, int n)
#endif
/* Structure holding the context for the RIPE-MD160 computation. */
-typedef struct
+typedef struct
{
u32 h0, h1, h2, h3, h4;
u32 nblocks;
@@ -88,10 +88,10 @@ transform (rmd160_context_t *hd, const unsigned char *data)
u32 a,b,c,d,e,aa,bb,cc,dd,ee,t;
#ifdef BIG_ENDIAN_HOST
u32 x[16];
- {
+ {
int i;
unsigned char *p2, *p1;
- for (i=0, p1=data, p2=(unsigned char*)x; i < 16; i++, p2 += 4 )
+ for (i=0, p1=data, p2=(unsigned char*)x; i < 16; i++, p2 += 4 )
{
p2[3] = *p1++;
p2[2] = *p1++;
@@ -315,8 +315,8 @@ transform (rmd160_context_t *hd, const unsigned char *data)
static void
rmd160_write (rmd160_context_t *hd, const unsigned char *inbuf, size_t inlen)
{
- if( hd->count == 64 )
- {
+ if( hd->count == 64 )
+ {
/* Flush the buffer. */
transform (hd, hd->buf);
hd->count = 0;
@@ -371,7 +371,7 @@ rmd160_final( rmd160_context_t *hd )
msb |= t >> 29;
if (hd->count < 56)
- {
+ {
/* Enough room. */
hd->buf[hd->count++] = 0x80; /* Pad character. */
while (hd->count < 56)
@@ -396,7 +396,7 @@ rmd160_final( rmd160_context_t *hd )
hd->buf[62] = msb >> 16;
hd->buf[63] = msb >> 24;
transform (hd, hd->buf);
-
+
p = hd->buf;
#define X(a) do { *p++ = hd->h##a; *p++ = hd->h##a >> 8; \
*p++ = hd->h##a >> 16; *p++ = hd->h##a >> 24; } while(0)
@@ -417,7 +417,7 @@ void
rmd160_hash_buffer (void *outbuf, const void *buffer, size_t length)
{
rmd160_context_t hd;
-
+
rmd160_init (&hd);
rmd160_write (&hd, buffer, length);
rmd160_final (&hd);
diff --git a/g10/seckey-cert.c b/g10/seckey-cert.c
index 4bf0dd2d2..ec866b309 100644
--- a/g10/seckey-cert.c
+++ b/g10/seckey-cert.c
@@ -132,7 +132,7 @@ xxxx_do_check( PKT_secret_key *sk, const char *tryagain_text, int mode,
attack */
sk->csum = 0;
csum = 1;
- if( ndata < 20 )
+ if( ndata < 20 )
log_error("not enough bytes for SHA-1 checksum\n");
else {
gcry_md_hd_t h;
@@ -142,7 +142,7 @@ xxxx_do_check( PKT_secret_key *sk, const char *tryagain_text, int mode,
gcry_md_write (h, data, ndata - 20);
gcry_md_final (h);
if (!memcmp (gcry_md_read (h, DIGEST_ALGO_SHA1),
- data + ndata - 20, 20) )
+ data + ndata - 20, 20) )
{
/* Digest does match. We have to keep the old
style checksum in sk->csum, so that the
@@ -150,7 +150,7 @@ xxxx_do_check( PKT_secret_key *sk, const char *tryagain_text, int mode,
This test gets used when we are adding new
keys. */
sk->csum = csum = checksum (data, ndata-20);
- }
+ }
gcry_md_close (h);
}
}
@@ -259,6 +259,3 @@ xxxx_do_check( PKT_secret_key *sk, const char *tryagain_text, int mode,
return 0;
}
-
-
-
diff --git a/g10/server.c b/g10/server.c
index 1c534f1e5..d8871d059 100644
--- a/g10/server.c
+++ b/g10/server.c
@@ -40,12 +40,12 @@
/* Data used to associate an Assuan context with local server data. */
-struct server_local_s
+struct server_local_s
{
/* Our current Assuan context. */
- assuan_context_t assuan_ctx;
+ assuan_context_t assuan_ctx;
/* File descriptor as set by the MESSAGE command. */
- gnupg_fd_t message_fd;
+ gnupg_fd_t message_fd;
/* List of prepared recipients. */
pk_list_t recplist;
@@ -55,14 +55,14 @@ struct server_local_s
/* Helper to close the message fd if it is open. */
-static void
+static void
close_message_fd (ctrl_t ctrl)
{
if (ctrl->server_local->message_fd != GNUPG_INVALID_FD)
{
assuan_sock_close (ctrl->server_local->message_fd);
ctrl->server_local->message_fd = GNUPG_INVALID_FD;
- }
+ }
}
@@ -89,7 +89,7 @@ has_option (const char *line, const char *name)
{
const char *s;
int n = strlen (name);
-
+
s = strstr (line, name);
if (s && s >= skip_options (line))
return 0;
@@ -188,7 +188,7 @@ static gpg_error_t
output_notify (assuan_context_t ctx, char *line)
{
/* ctrl_t ctrl = assuan_get_pointer (ctx); */
-
+
(void)ctx;
if (strstr (line, "--armor"))
@@ -231,9 +231,9 @@ cmd_recipient (assuan_context_t ctx, char *line)
remusr = rcpts;
*/
- err = find_and_check_key (ctrl, line, PUBKEY_USAGE_ENC, hidden,
+ err = find_and_check_key (ctrl, line, PUBKEY_USAGE_ENC, hidden,
&ctrl->server_local->recplist);
-
+
if (err)
log_error ("command '%s' failed: %s\n", "RECIPIENT", gpg_strerror (err));
return err;
@@ -266,7 +266,7 @@ cmd_signer (assuan_context_t ctx, char *line)
-/* ENCRYPT
+/* ENCRYPT
Do the actual encryption process. Takes the plaintext from the
INPUT command, writes the ciphertext to the file descriptor set
@@ -294,7 +294,7 @@ cmd_encrypt (assuan_context_t ctx, char *line)
(void)line; /* LINE is not used. */
- if ( !ctrl->server_local->recplist )
+ if ( !ctrl->server_local->recplist )
{
write_status_text (STATUS_NO_RECP, "0");
err = gpg_error (GPG_ERR_NO_USER_ID);
@@ -318,12 +318,12 @@ cmd_encrypt (assuan_context_t ctx, char *line)
PGP-2 mode. Do all the other checks we do in gpg.c for aEncr.
Maybe we should drop the PGP2 compatibility. */
-
+
/* FIXME: GPGSM does this here: Add all encrypt-to marked recipients
from the default list. */
/* fixme: err = ctrl->audit? 0 : start_audit_session (ctrl);*/
-
+
err = encrypt_crypt (ctrl, inp_fd, NULL, NULL, 0,
ctrl->server_local->recplist,
out_fd);
@@ -389,7 +389,7 @@ cmd_decrypt (assuan_context_t ctx, char *line)
This does a verify operation on the message send to the input-FD.
The result is written out using status lines. If an output FD was
given, the signed text will be written to that.
-
+
If the signature is a detached one, the server will inquire about
the signed material and the client must provide it.
*/
@@ -404,7 +404,7 @@ cmd_verify (assuan_context_t ctx, char *line)
/* FIXME: Revamp this code it is nearly to 3 years old and was only
intended as a quick test. */
-
+
(void)line;
if (fd == GNUPG_INVALID_FD)
@@ -620,7 +620,7 @@ cmd_passwd (assuan_context_t ctx, char *line)
static int
register_commands (assuan_context_t ctx)
{
- static struct
+ static struct
{
const char *name;
assuan_handler_t handler;
@@ -634,8 +634,8 @@ register_commands (assuan_context_t ctx)
{ "SIGN", cmd_sign },
{ "IMPORT", cmd_import },
{ "EXPORT", cmd_export },
- { "INPUT", NULL },
- { "OUTPUT", NULL },
+ { "INPUT", NULL },
+ { "OUTPUT", NULL },
{ "MESSAGE", cmd_message },
{ "LISTKEYS", cmd_listkeys },
{ "LISTSECRETKEYS",cmd_listsecretkeys },
@@ -653,7 +653,7 @@ register_commands (assuan_context_t ctx)
table[i].handler, table[i].help);
if (rc)
return rc;
- }
+ }
return 0;
}
@@ -683,7 +683,7 @@ gpg_server (ctrl_t ctrl)
gpg_strerror (rc));
goto leave;
}
-
+
rc = assuan_init_pipe_server (ctx, filedes);
if (rc)
{
@@ -748,7 +748,7 @@ gpg_server (ctrl_t ctrl)
log_info ("Assuan accept problem: %s\n", gpg_strerror (rc));
break;
}
-
+
rc = assuan_process (ctx);
if (rc)
{
@@ -768,4 +768,3 @@ gpg_server (ctrl_t ctrl)
assuan_release (ctx);
return rc;
}
-
diff --git a/g10/sig-check.c b/g10/sig-check.c
index 4bd7aef88..531497e81 100644
--- a/g10/sig-check.c
+++ b/g10/sig-check.c
@@ -60,7 +60,7 @@ signature_check (PKT_signature *sig, gcry_md_hd_t digest)
}
int
-signature_check2 (PKT_signature *sig, gcry_md_hd_t digest, u32 *r_expiredate,
+signature_check2 (PKT_signature *sig, gcry_md_hd_t digest, u32 *r_expiredate,
int *r_expired, int *r_revoked, PKT_public_key *ret_pk )
{
PKT_public_key *pk = xmalloc_clear( sizeof *pk );
@@ -130,8 +130,8 @@ signature_check2 (PKT_signature *sig, gcry_md_hd_t digest, u32 *r_expiredate,
* and the timestamp, but the drawback of this is, that it is
* not possible to sign more than one identical document within
* one second. Some remote batch processing applications might
- * like this feature here.
- *
+ * like this feature here.
+ *
* Note that before 2.0.10, we used RIPE-MD160 for the hash
* and accidently didn't include the timestamp and algorithm
* information in the hash. Given that this feature is not
@@ -431,13 +431,13 @@ check_revocation_keys(PKT_public_key *pk,PKT_signature *sig)
for(i=0;i<pk->numrevkeys;i++)
{
u32 keyid[2];
-
+
keyid_from_fingerprint(pk->revkey[i].fpr,MAX_FINGERPRINT_LEN,keyid);
-
+
if(keyid[0]==sig->keyid[0] && keyid[1]==sig->keyid[1])
{
gcry_md_hd_t md;
-
+
if (gcry_md_open (&md, sig->digest_algo, 0))
BUG ();
hash_public_key(md,pk);
@@ -451,7 +451,7 @@ check_revocation_keys(PKT_public_key *pk,PKT_signature *sig)
busy=0;
return rc;
-}
+}
/* Backsigs (0x19) have the same format as binding sigs (0x18), but
this function is simpler than check_key_signature in a few ways.
@@ -536,8 +536,8 @@ check_key_signature2( KBNODE root, KBNODE node, PKT_public_key *check_pk,
cache refresh detects and clears these cases. */
if ( !opt.no_sig_cache ) {
if (sig->flags.checked) { /*cached status available*/
- if( is_selfsig ) {
- u32 keyid[2];
+ if( is_selfsig ) {
+ u32 keyid[2];
keyid_from_pk( pk, keyid );
if( keyid[0] == sig->keyid[0] && keyid[1] == sig->keyid[1] )
@@ -557,7 +557,7 @@ check_key_signature2( KBNODE root, KBNODE node, PKT_public_key *check_pk,
return rc;
if( sig->sig_class == 0x20 ) { /* key revocation */
- u32 keyid[2];
+ u32 keyid[2];
keyid_from_pk( pk, keyid );
/* is it a designated revoker? */
diff --git a/g10/signal.c b/g10/signal.c
index 11ebc5208..6c8a40b58 100644
--- a/g10/signal.c
+++ b/g10/signal.c
@@ -57,7 +57,7 @@ init_one_signal (int sig, RETSIGTYPE (*handler)(int), int check_ign )
sigemptyset (&nact.sa_mask);
nact.sa_flags = 0;
sigaction ( sig, &nact, NULL);
-#else
+#else
RETSIGTYPE (*ohandler)(int);
ohandler = signal (sig, handler);
diff --git a/g10/skclist.c b/g10/skclist.c
index 4ec5df055..912104ef5 100644
--- a/g10/skclist.c
+++ b/g10/skclist.c
@@ -144,7 +144,7 @@ build_sk_list (strlist_t locusr, SK_LIST *ret_sk_list, unsigned int use)
else
{
SK_LIST r;
-
+
if (random_is_faked () && !is_insecure (pk))
{
log_info (_("key is not flagged as insecure - "
@@ -212,7 +212,7 @@ build_sk_list (strlist_t locusr, SK_LIST *ret_sk_list, unsigned int use)
else
{
SK_LIST r;
-
+
if (pk->version == 4 && (use & PUBKEY_USAGE_SIG)
&& pk->pubkey_algo == PUBKEY_ALGO_ELGAMAL_E)
{
@@ -256,7 +256,7 @@ build_sk_list (strlist_t locusr, SK_LIST *ret_sk_list, unsigned int use)
write_status_text (STATUS_NO_SGNR, "0");
err = gpg_error (GPG_ERR_NO_USER_ID);
}
-
+
if (err)
release_sk_list (sk_list);
else
diff --git a/g10/t-rmd160.c b/g10/t-rmd160.c
index d48e3f2ed..ea2933f07 100644
--- a/g10/t-rmd160.c
+++ b/g10/t-rmd160.c
@@ -33,7 +33,7 @@
static void
run_test (void)
{
- static struct
+ static struct
{
const char *data;
const char *expect;
@@ -71,7 +71,7 @@ run_test (void)
for (idx=0; testtbl[idx].data; idx++)
{
- rmd160_hash_buffer (digest,
+ rmd160_hash_buffer (digest,
testtbl[idx].data, strlen(testtbl[idx].data));
if (memcmp (digest, testtbl[idx].expect, 20))
fail (idx);
@@ -84,9 +84,8 @@ main (int argc, char **argv)
{
(void)argc;
(void)argv;
-
+
run_test ();
return 0;
}
-
diff --git a/g10/tdbdump.c b/g10/tdbdump.c
index b68cde2f6..25a916e5b 100644
--- a/g10/tdbdump.c
+++ b/g10/tdbdump.c
@@ -68,16 +68,16 @@ void
list_trustdb( const char *username )
{
TRUSTREC rec;
-
+
(void)username;
-
+
init_trustdb();
/* For now we ignore the user ID. */
if (1)
{
ulong recnum;
int i;
-
+
printf("TrustDB: %s\n", tdbio_get_dbname() );
for(i=9+strlen(tdbio_get_dbname()); i > 0; i-- )
putchar('-');
@@ -187,7 +187,7 @@ import_ownertrust( const char *fname )
fpr[fprlen++] = HEXTOBIN(p[0]) * 16 + HEXTOBIN(p[1]);
while (fprlen < 20)
fpr[fprlen++] = 0;
-
+
rc = tdbio_search_trust_byfpr (fpr, &rec);
if( !rc ) { /* found: update */
if (rec.r.trust.ownertrust != otrust)
@@ -220,7 +220,7 @@ import_ownertrust( const char *fname )
log_error ( _("read error in `%s': %s\n"), fname, strerror(errno) );
if( !is_stdin )
fclose(fp);
-
+
if (any)
{
revalidation_mark ();
@@ -228,7 +228,5 @@ import_ownertrust( const char *fname )
if (rc)
log_error (_("trustdb: sync failed: %s\n"), g10_errstr(rc) );
}
-
-}
-
+}
diff --git a/g10/tdbio.c b/g10/tdbio.c
index 1c775d22d..45ec73bae 100644
--- a/g10/tdbio.c
+++ b/g10/tdbio.c
@@ -456,7 +456,7 @@ create_version_record (void)
{
TRUSTREC rec;
int rc;
-
+
memset( &rec, 0, sizeof rec );
rec.r.ver.version = 3;
rec.r.ver.created = make_timestamp();
@@ -724,7 +724,7 @@ tdbio_read_model(void)
{
TRUSTREC vr;
int rc;
-
+
rc = tdbio_read_record( 0, &vr, RECTYPE_VER );
if( rc )
log_fatal( _("%s: error reading version record: %s\n"),
@@ -1042,7 +1042,7 @@ drop_from_hashtable( ulong table, byte *key, int keylen, ulong recnum )
*/
static int
lookup_hashtable( ulong table, const byte *key, size_t keylen,
- int (*cmpfnc)(const void*, const TRUSTREC *),
+ int (*cmpfnc)(const void*, const TRUSTREC *),
const void *cmpdata, TRUSTREC *rec )
{
int rc;
@@ -1539,4 +1539,3 @@ tdbio_invalid(void)
how_to_fix_the_trustdb ();
g10_exit (2);
}
-
diff --git a/g10/tdbio.h b/g10/tdbio.h
index ddc5afccf..c2434faa4 100644
--- a/g10/tdbio.h
+++ b/g10/tdbio.h
@@ -56,7 +56,7 @@ struct trust_record {
byte trust_model;
ulong created; /* timestamp of trustdb creation */
ulong nextcheck; /* timestamp of next scheduled check */
- ulong reserved;
+ ulong reserved;
ulong reserved2;
ulong firstfree;
ulong reserved3;
@@ -81,7 +81,7 @@ struct trust_record {
} trust;
struct {
byte namehash[20];
- ulong next;
+ ulong next;
byte validity;
byte full_count;
byte marginal_count;
diff --git a/g10/trustdb.c b/g10/trustdb.c
index dbd593a53..c8964323e 100644
--- a/g10/trustdb.c
+++ b/g10/trustdb.c
@@ -44,7 +44,7 @@
/*
* A structure to store key identification as well as some stuff needed
- * for validation
+ * for validation
*/
struct key_item {
struct key_item *next;
@@ -60,7 +60,7 @@ typedef struct key_item **KeyHashTable; /* see new_key_hash_table() */
/*
* Structure to keep track of keys, this is used as an array wherre
- * the item right after the last one has a keyblock set to NULL.
+ * the item right after the last one has a keyblock set to NULL.
* Maybe we can drop this thing and replace it by key_item
*/
struct key_array {
@@ -92,7 +92,7 @@ static struct key_item *
new_key_item (void)
{
struct key_item *k;
-
+
k = xmalloc_clear (sizeof *k);
return k;
}
@@ -114,11 +114,11 @@ release_key_items (struct key_item *k)
* For fast keylook up we need a hash table. Each byte of a KeyIDs
* should be distributed equally over the 256 possible values (except
* for v3 keyIDs but we consider them as not important here). So we
- * can just use 10 bits to index a table of 1024 key items.
+ * can just use 10 bits to index a table of 1024 key items.
* Possible optimization: Don not use key_items but other hash_table when the
- * duplicates lists gets too large.
+ * duplicates lists gets too large.
*/
-static KeyHashTable
+static KeyHashTable
new_key_hash_table (void)
{
struct key_item **tbl;
@@ -139,7 +139,7 @@ release_key_hash_table (KeyHashTable tbl)
xfree (tbl);
}
-/*
+/*
* Returns: True if the keyID is in the given hash table
*/
static int
@@ -164,7 +164,7 @@ add_key_hash_table (KeyHashTable tbl, u32 *kid)
for (k = tbl[(kid[1] & 0x03ff)]; k; k = k->next)
if (k->kid[0] == kid[0] && k->kid[1] == kid[1])
return; /* already in table */
-
+
kk = new_key_item ();
kk->kid[0] = kid[0];
kk->kid[1] = kid[1];
@@ -236,7 +236,7 @@ add_utk (u32 *kid)
{
struct key_item *k;
- for (k = utk_list; k; k = k->next)
+ for (k = utk_list; k; k = k->next)
{
if (k->kid[0] == kid[0] && k->kid[1] == kid[1])
{
@@ -271,15 +271,15 @@ verify_own_keys(void)
return;
/* scan the trustdb to find all ultimately trusted keys */
- for (recnum=1; !tdbio_read_record (recnum, &rec, 0); recnum++ )
+ for (recnum=1; !tdbio_read_record (recnum, &rec, 0); recnum++ )
{
- if ( rec.rectype == RECTYPE_TRUST
+ if ( rec.rectype == RECTYPE_TRUST
&& (rec.r.trust.ownertrust & TRUST_MASK) == TRUST_ULTIMATE)
{
byte *fpr = rec.r.trust.fingerprint;
int fprlen;
u32 kid[2];
-
+
/* Problem: We do only use fingerprints in the trustdb but
* we need the keyID here to indetify the key; we can only
* use that ugly hack to distinguish between 16 and 20
@@ -295,9 +295,9 @@ verify_own_keys(void)
}
/* Put any --trusted-key keys into the trustdb */
- for (k = user_utk_list; k; k = k->next)
+ for (k = user_utk_list; k; k = k->next)
{
- if ( add_utk (k->kid) )
+ if ( add_utk (k->kid) )
{ /* not yet in trustDB as ultimately trusted */
PKT_public_key pk;
@@ -494,7 +494,7 @@ init_trustdb()
static int
trust_letter (unsigned int value)
{
- switch( (value & TRUST_MASK) )
+ switch( (value & TRUST_MASK) )
{
case TRUST_UNKNOWN: return '-';
case TRUST_EXPIRED: return 'e';
@@ -543,7 +543,7 @@ uid_trust_string_fixed(PKT_public_key *key,PKT_user_id *uid)
const char *
trust_value_to_string (unsigned int value)
{
- switch( (value & TRUST_MASK) )
+ switch( (value & TRUST_MASK) )
{
case TRUST_UNKNOWN: return _("unknown");
case TRUST_EXPIRED: return _("expired");
@@ -612,7 +612,7 @@ check_trustdb ()
/*
- * Recreate the WoT.
+ * Recreate the WoT.
*/
void
update_trustdb()
@@ -684,29 +684,29 @@ read_trust_options(byte *trust_model,ulong *created,ulong *nextcheck,
*********** Ownertrust et al. ****************
***********************************************/
-static int
+static int
read_trust_record (PKT_public_key *pk, TRUSTREC *rec)
{
int rc;
-
+
init_trustdb();
rc = tdbio_search_trust_bypk (pk, rec);
if (rc == -1)
return -1; /* no record yet */
- if (rc)
+ if (rc)
{
log_error ("trustdb: searching trust record failed: %s\n",
g10_errstr (rc));
- return rc;
+ return rc;
}
-
+
if (rec->rectype != RECTYPE_TRUST)
{
log_error ("trustdb: record %lu is not a trust record\n",
rec->recnum);
- return G10ERR_TRUSTDB;
- }
-
+ return G10ERR_TRUSTDB;
+ }
+
return 0;
}
@@ -714,16 +714,16 @@ read_trust_record (PKT_public_key *pk, TRUSTREC *rec)
* Return the assigned ownertrust value for the given public key.
* The key should be the primary key.
*/
-unsigned int
+unsigned int
get_ownertrust ( PKT_public_key *pk)
{
TRUSTREC rec;
int rc;
-
+
rc = read_trust_record (pk, &rec);
if (rc == -1)
return TRUST_UNKNOWN; /* no record yet */
- if (rc)
+ if (rc)
{
tdbio_invalid ();
return rc; /* actually never reached */
@@ -732,16 +732,16 @@ get_ownertrust ( PKT_public_key *pk)
return rec.r.trust.ownertrust;
}
-unsigned int
+unsigned int
get_min_ownertrust (PKT_public_key *pk)
{
TRUSTREC rec;
int rc;
-
+
rc = read_trust_record (pk, &rec);
if (rc == -1)
return TRUST_UNKNOWN; /* no record yet */
- if (rc)
+ if (rc)
{
tdbio_invalid ();
return rc; /* actually never reached */
@@ -804,7 +804,7 @@ update_ownertrust (PKT_public_key *pk, unsigned int new_trust )
{
TRUSTREC rec;
int rc;
-
+
rc = read_trust_record (pk, &rec);
if (!rc)
{
@@ -836,7 +836,7 @@ update_ownertrust (PKT_public_key *pk, unsigned int new_trust )
do_sync ();
rc = 0;
}
- else
+ else
{
tdbio_invalid ();
}
@@ -890,7 +890,7 @@ update_min_ownertrust (u32 *kid, unsigned int new_trust )
do_sync ();
rc = 0;
}
- else
+ else
{
tdbio_invalid ();
}
@@ -903,7 +903,7 @@ clear_ownertrusts (PKT_public_key *pk)
{
TRUSTREC rec;
int rc;
-
+
rc = read_trust_record (pk, &rec);
if (!rc)
{
@@ -931,8 +931,8 @@ clear_ownertrusts (PKT_public_key *pk)
return 0;
}
-/*
- * Note: Caller has to do a sync
+/*
+ * Note: Caller has to do a sync
*/
static void
update_validity (PKT_public_key *pk, PKT_user_id *uid,
@@ -951,7 +951,7 @@ update_validity (PKT_public_key *pk, PKT_user_id *uid,
return;
}
if (rc == -1) /* no record yet - create a new one */
- {
+ {
size_t dummy;
rc = 0;
@@ -1016,10 +1016,10 @@ cache_disabled_value (PKT_public_key *pk)
}
if (rc == -1) /* no record found, so assume not disabled */
goto leave;
-
+
if (trec.r.trust.ownertrust & TRUST_FLAG_DISABLED)
disabled = 1;
-
+
/* Cache it for later so we don't need to look at the trustdb every
time */
pk->flags.disabled = disabled;
@@ -1044,7 +1044,7 @@ check_trustdb_stale(void)
scheduled = tdbio_read_nextcheck ();
if (scheduled && scheduled <= make_timestamp ())
{
- if (opt.no_auto_check_trustdb)
+ if (opt.no_auto_check_trustdb)
{
pending_check_trustdb = 1;
log_info (_("please do a --check-trustdb\n"));
@@ -1061,7 +1061,7 @@ check_trustdb_stale(void)
/*
* Return the validity information for PK. If the namehash is not
* NULL, the validity of the corresponsing user ID is returned,
- * otherwise, a reasonable value for the entire key is returned.
+ * otherwise, a reasonable value for the entire key is returned.
*/
unsigned int
get_validity (PKT_public_key *pk, PKT_user_id *uid)
@@ -1090,7 +1090,7 @@ get_validity (PKT_public_key *pk, PKT_user_id *uid)
log_error ("error getting main key %s of subkey %s: %s\n",
tempkeystr, keystr(kid), g10_errstr(rc));
xfree(tempkeystr);
- validity = TRUST_UNKNOWN;
+ validity = TRUST_UNKNOWN;
goto leave;
}
}
@@ -1113,7 +1113,7 @@ get_validity (PKT_public_key *pk, PKT_user_id *uid)
}
if (rc == -1) /* no record found */
{
- validity = TRUST_UNKNOWN;
+ validity = TRUST_UNKNOWN;
goto leave;
}
@@ -1146,7 +1146,7 @@ get_validity (PKT_public_key *pk, PKT_user_id *uid)
recno = vrec.r.valid.next;
}
-
+
if ( (trec.r.trust.ownertrust & TRUST_FLAG_DISABLED) )
{
validity |= TRUST_FLAG_DISABLED;
@@ -1166,7 +1166,7 @@ get_validity (PKT_public_key *pk, PKT_user_id *uid)
* I initially designed it that way */
if (main_pk->has_expired || pk->has_expired)
validity = (validity & ~TRUST_MASK) | TRUST_EXPIRED;
-
+
if (pending_check_trustdb)
validity |= TRUST_FLAG_PENDING_CHECK;
@@ -1179,10 +1179,10 @@ int
get_validity_info (PKT_public_key *pk, PKT_user_id *uid)
{
int trustlevel;
-
+
if (!pk)
return '?'; /* Just in case a NULL PK is passed. */
-
+
trustlevel = get_validity (pk, uid);
if ( (trustlevel & TRUST_FLAG_REVOKED) )
return 'r';
@@ -1309,7 +1309,7 @@ ask_ownertrust (u32 *kid,int minimum)
keystr(kid), g10_errstr(rc) );
return TRUST_UNKNOWN;
}
-
+
if(opt.force_ownertrust)
{
log_info("force trust for key %s to %s\n",
@@ -1383,7 +1383,7 @@ dump_key_array (int depth, struct key_array *keys)
}
}
}
-}
+}
static void
@@ -1406,7 +1406,7 @@ store_validation_status (int depth, KBNODE keyblock, KeyHashTable stored)
status = TRUST_UNDEFINED;
else
status = 0;
-
+
if (status)
{
update_validity (keyblock->pkt->pkt.public_key,
@@ -1421,7 +1421,7 @@ store_validation_status (int depth, KBNODE keyblock, KeyHashTable stored)
if (any)
do_sync ();
-}
+}
/*
* check whether the signature sig is in the klist k
@@ -1453,7 +1453,7 @@ mark_usable_uid_certs (KBNODE keyblock, KBNODE uidnode,
{
KBNODE node;
PKT_signature *sig;
-
+
/* first check all signatures */
for (node=uidnode->next; node; node = node->next)
{
@@ -1486,7 +1486,7 @@ mark_usable_uid_certs (KBNODE keyblock, KBNODE uidnode,
continue;
}
node->flag |= 1<<9;
- }
+ }
/* reset the remaining flags */
for (; node; node = node->next)
node->flag &= ~(1<<8 | 1<<9 | 1<<10 | 1<<11 | 1<<12);
@@ -1534,7 +1534,7 @@ mark_usable_uid_certs (KBNODE keyblock, KBNODE uidnode,
older: if signode was older then we don't want to take n
as signode is nonrevocable. If n was older then we're
automatically fine. */
-
+
if(((IS_UID_SIG(signode->pkt->pkt.signature) &&
!signode->pkt->pkt.signature->flags.revocable &&
(signode->pkt->pkt.signature->expiredate==0 ||
@@ -1550,7 +1550,7 @@ mark_usable_uid_certs (KBNODE keyblock, KBNODE uidnode,
n was older then we don't want to take signode as n is
nonrevocable. If signode was older then we're
automatically fine. */
-
+
if((!(IS_UID_SIG(signode->pkt->pkt.signature) &&
!signode->pkt->pkt.signature->flags.revocable &&
(signode->pkt->pkt.signature->expiredate==0 ||
@@ -1581,7 +1581,7 @@ mark_usable_uid_certs (KBNODE keyblock, KBNODE uidnode,
sig = signode->pkt->pkt.signature;
if (IS_UID_SIG (sig))
- { /* this seems to be a usable one which is not revoked.
+ { /* this seems to be a usable one which is not revoked.
* Just need to check whether there is an expiration time,
* We do the expired certification after finding a suitable
* certification, the assumption is that a signator does not
@@ -1590,7 +1590,7 @@ mark_usable_uid_certs (KBNODE keyblock, KBNODE uidnode,
* different expiration time */
const byte *p;
u32 expire;
-
+
p = parse_sig_subpkt (sig->hashed, SIGSUBPKT_SIG_EXPIRE, NULL );
expire = p? sig->timestamp + buffer_to_u32(p) : 0;
@@ -1677,7 +1677,7 @@ clean_sigs_from_uid(KBNODE keyblock,KBNODE uidnode,int noisy,int self_only)
delete_kbnode(node);
deleted++;
}
-
+
return deleted;
}
@@ -1936,7 +1936,7 @@ validate_one_keyblock (KBNODE kb, struct key_item *klist,
{
if (uid->help_full_count >= opt.completes_needed
|| uid->help_marginal_count >= opt.marginals_needed )
- uidnode->flag |= 4;
+ uidnode->flag |= 4;
else if (uid->help_full_count || uid->help_marginal_count)
uidnode->flag |= 2;
uidnode->flag |= 1;
@@ -1951,7 +1951,7 @@ validate_one_keyblock (KBNODE kb, struct key_item *klist,
issigned = 0;
get_validity_counts(pk,uid);
- mark_usable_uid_certs (kb, uidnode, main_kid, klist,
+ mark_usable_uid_certs (kb, uidnode, main_kid, klist,
curtime, next_expire);
}
else if (node->pkt->pkttype == PKT_SIGNATURE
@@ -1959,15 +1959,15 @@ validate_one_keyblock (KBNODE kb, struct key_item *klist,
{
/* Note that we are only seeing unrevoked sigs here */
PKT_signature *sig = node->pkt->pkt.signature;
-
+
kr = is_in_klist (klist, sig);
/* If the trust_regexp does not match, it's as if the sig
did not exist. This is safe for non-trust sigs as well
since we don't accept a regexp on the sig unless it's a
trust sig. */
- if (kr && (!kr->trust_regexp
- || opt.trust_model != TM_PGP
- || (uidnode
+ if (kr && (!kr->trust_regexp
+ || opt.trust_model != TM_PGP
+ || (uidnode
&& check_regexp(kr->trust_regexp,
uidnode->pkt->pkt.user_id->name))))
{
@@ -2031,7 +2031,7 @@ validate_one_keyblock (KBNODE kb, struct key_item *klist,
pk->trust_value = sig->trust_value;
pk->trust_depth = depth-1;
-
+
/* If the trust sig contains a regexp, record it
on the pk for the next round. */
if (sig->trust_regexp)
@@ -2054,7 +2054,7 @@ validate_one_keyblock (KBNODE kb, struct key_item *klist,
{
if (uid->help_full_count >= opt.completes_needed
|| uid->help_marginal_count >= opt.marginals_needed )
- uidnode->flag |= 4;
+ uidnode->flag |= 4;
else if (uid->help_full_count || uid->help_marginal_count)
uidnode->flag |= 2;
uidnode->flag |= 1;
@@ -2078,7 +2078,7 @@ search_skipfnc (void *opaque, u32 *kid, PKT_user_id *dummy)
* kllist. The caller has to pass keydb handle so that we don't use
* to create our own. Returns either a key_array or NULL in case of
* an error. No results found are indicated by an empty array.
- * Caller hast to release the returned array.
+ * Caller hast to release the returned array.
*/
static struct key_array *
validate_key_list (KEYDB_HANDLE hd, KeyHashTable full_trust,
@@ -2089,11 +2089,11 @@ validate_key_list (KEYDB_HANDLE hd, KeyHashTable full_trust,
size_t nkeys, maxkeys;
int rc;
KEYDB_SEARCH_DESC desc;
-
+
maxkeys = 1000;
keys = xmalloc ((maxkeys+1) * sizeof *keys);
nkeys = 0;
-
+
rc = keydb_search_reset (hd);
if (rc)
{
@@ -2118,21 +2118,21 @@ validate_key_list (KEYDB_HANDLE hd, KeyHashTable full_trust,
xfree (keys);
return NULL;
}
-
+
desc.mode = KEYDB_SEARCH_MODE_NEXT; /* change mode */
do
{
PKT_public_key *pk;
-
+
rc = keydb_get_keyblock (hd, &keyblock);
- if (rc)
+ if (rc)
{
log_error ("keydb_get_keyblock failed: %s\n", g10_errstr(rc));
xfree (keys);
return NULL;
}
-
- if ( keyblock->pkt->pkttype != PKT_PUBLIC_KEY)
+
+ if ( keyblock->pkt->pkttype != PKT_PUBLIC_KEY)
{
log_debug ("ooops: invalid pkttype %d encountered\n",
keyblock->pkt->pkttype);
@@ -2142,7 +2142,7 @@ validate_key_list (KEYDB_HANDLE hd, KeyHashTable full_trust,
}
/* prepare the keyblock for further processing */
- merge_keys_and_selfsig (keyblock);
+ merge_keys_and_selfsig (keyblock);
clear_kbnode_flags (keyblock);
pk = keyblock->pkt->pkt.public_key;
if (pk->has_expired || pk->flags.revoked)
@@ -2179,9 +2179,9 @@ validate_key_list (KEYDB_HANDLE hd, KeyHashTable full_trust,
release_kbnode (keyblock);
keyblock = NULL;
- }
+ }
while ( !(rc = keydb_search (hd, &desc, 1)) );
- if (rc && rc != -1)
+ if (rc && rc != -1)
{
log_error ("keydb_search_next failed: %s\n", g10_errstr(rc));
xfree (keys);
@@ -2190,7 +2190,7 @@ validate_key_list (KEYDB_HANDLE hd, KeyHashTable full_trust,
keys[nkeys].keyblock = NULL;
return keys;
-}
+}
/* Caller must sync */
static void
@@ -2200,7 +2200,7 @@ reset_trust_records(void)
ulong recnum;
int count = 0, nreset = 0;
- for (recnum=1; !tdbio_read_record (recnum, &rec, 0); recnum++ )
+ for (recnum=1; !tdbio_read_record (recnum, &rec, 0); recnum++ )
{
if(rec.rectype==RECTYPE_TRUST)
{
@@ -2239,7 +2239,7 @@ reset_trust_records(void)
* Step 2: loop max_cert_times
* Step 3: if OWNERTRUST of any key in klist is undefined
* ask user to assign ownertrust
- * Step 4: Loop over all keys in the keyDB which are not marked seen
+ * Step 4: Loop over all keys in the keyDB which are not marked seen
* Step 5: if key is revoked or expired
* mark key as seen
* continue loop at Step 4
@@ -2251,7 +2251,7 @@ reset_trust_records(void)
* End Loop
* Step 8: Build a new klist from all fully trusted keys from step 6
* End Loop
- * Ready
+ * Ready
*
*/
static int
@@ -2321,7 +2321,7 @@ validate_keys (int interactive)
if ( pk->expiredate && pk->expiredate >= start_time
&& pk->expiredate < next_expire)
next_expire = pk->expiredate;
-
+
release_kbnode (keyblock);
do_sync ();
}
@@ -2397,7 +2397,7 @@ validate_keys (int interactive)
/* Find all keys which are signed by a key in kdlist */
keys = validate_key_list (kdb, full_trust, klist,
start_time, &next_expire);
- if (!keys)
+ if (!keys)
{
log_error ("validate_key_list failed\n");
rc = G10ERR_GENERAL;
@@ -2415,9 +2415,9 @@ validate_keys (int interactive)
store_validation_status (depth, kar->keyblock, stored);
log_info (_("depth: %d valid: %3d signed: %3d"
- " trust: %d-, %dq, %dn, %dm, %df, %du\n"),
+ " trust: %d-, %dq, %dn, %dm, %df, %du\n"),
depth, valids, key_count, ot_unknown, ot_undefined,
- ot_never, ot_marginal, ot_full, ot_ultimate );
+ ot_never, ot_marginal, ot_full, ot_ultimate );
/* Build a new kdlist from all fully valid keys in KEYS */
if (klist != utk_list)
@@ -2479,10 +2479,10 @@ validate_keys (int interactive)
if (!rc && !quit) /* mark trustDB as checked */
{
if (next_expire == 0xffffffff || next_expire < start_time )
- tdbio_write_nextcheck (0);
+ tdbio_write_nextcheck (0);
else
{
- tdbio_write_nextcheck (next_expire);
+ tdbio_write_nextcheck (next_expire);
log_info (_("next trustdb check due at %s\n"),
strtimestamp (next_expire));
}
diff --git a/g10/verify.c b/g10/verify.c
index 925618c67..ed6ab4a43 100644
--- a/g10/verify.c
+++ b/g10/verify.c
@@ -80,9 +80,9 @@ verify_signatures (ctrl_t ctrl, int nfiles, char **files )
* case 4 with a file2 of "-".
*
* Actually we don't have to change anything here but can handle
- * that all quite easily in mainproc.c
+ * that all quite easily in mainproc.c
*/
-
+
sigfile = nfiles? *files : NULL;
/* open the signature file */
@@ -225,7 +225,7 @@ verify_files (ctrl_t ctrl, int nfiles, char **files )
/* Perform a verify operation. To verify detached signatures, DATA_FD
shall be the descriptor of the signed data; for regular signatures
it needs to be -1. If OUT_FP is not NULL and DATA_FD is not -1 the
- the signed material gets written that stream.
+ the signed material gets written that stream.
FIXME: OUTFP is not yet implemented.
*/
@@ -268,10 +268,9 @@ gpg_verify (ctrl_t ctrl, int sig_fd, int data_fd, estream_t out_fp)
&& (rc == -1 || gpg_err_code (rc) == GPG_ERR_EOF) )
rc = gpg_error (GPG_ERR_NO_DATA);
- leave:
+ leave:
iobuf_close (fp);
release_progress_context (pfx);
release_armor_context (afx);
return rc;
}
-