1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-06-20 20:47:58 +02:00

Remove trailing white space from some files.

--
This commit is contained in:
Werner Koch 2013-01-03 20:11:54 +01:00
parent f484d8b28b
commit c291ebaf6f
2 changed files with 85 additions and 85 deletions

View File

@ -17,7 +17,7 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef GNUPG_G10_GPG_H #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 /* Note, that this file should be the first one after the system
header files. This is required to set the error source to the header files. This is required to set the error source to the
@ -41,8 +41,8 @@
#define MAX_FINGERPRINT_LEN 20 #define MAX_FINGERPRINT_LEN 20
/* /*
Forward declarations. Forward declarations.
*/ */
/* Object used to keep state locally to server.c . */ /* Object used to keep state locally to server.c . */
@ -67,7 +67,7 @@ struct server_control_s
/* /*
Compatibility stuff to be faded out over time. Compatibility stuff to be faded out over time.
*/ */
@ -78,45 +78,45 @@ struct server_control_s
/* Mapping of the old error codes to the gpg-error ones. Fixme: This /* 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() is just a temporary solution: We need to do all these gpg_error()
calls in the code. */ calls in the code. */
#define G10ERR_BAD_KEY GPG_ERR_BAD_KEY #define G10ERR_BAD_KEY GPG_ERR_BAD_KEY
#define G10ERR_BAD_PASS GPG_ERR_BAD_PASS #define G10ERR_BAD_PASS GPG_ERR_BAD_PASS
#define G10ERR_BAD_PUBKEY GPG_ERR_BAD_PUBKEY #define G10ERR_BAD_PUBKEY GPG_ERR_BAD_PUBKEY
#define G10ERR_BAD_SIGN GPG_ERR_BAD_SIGNATURE #define G10ERR_BAD_SIGN GPG_ERR_BAD_SIGNATURE
#define G10ERR_BAD_URI GPG_ERR_BAD_URI #define G10ERR_BAD_URI GPG_ERR_BAD_URI
#define G10ERR_CHECKSUM GPG_ERR_CHECKSUM #define G10ERR_CHECKSUM GPG_ERR_CHECKSUM
#define G10ERR_CIPHER_ALGO GPG_ERR_CIPHER_ALGO #define G10ERR_CIPHER_ALGO GPG_ERR_CIPHER_ALGO
#define G10ERR_CLOSE_FILE GPG_ERR_CLOSE_FILE #define G10ERR_CLOSE_FILE GPG_ERR_CLOSE_FILE
#define G10ERR_COMPR_ALGO GPG_ERR_COMPR_ALGO #define G10ERR_COMPR_ALGO GPG_ERR_COMPR_ALGO
#define G10ERR_CREATE_FILE GPG_ERR_CREATE_FILE #define G10ERR_CREATE_FILE GPG_ERR_CREATE_FILE
#define G10ERR_DIGEST_ALGO GPG_ERR_DIGEST_ALGO #define G10ERR_DIGEST_ALGO GPG_ERR_DIGEST_ALGO
#define G10ERR_FILE_EXISTS GPG_ERR_EEXIST #define G10ERR_FILE_EXISTS GPG_ERR_EEXIST
#define G10ERR_GENERAL GPG_ERR_GENERAL #define G10ERR_GENERAL GPG_ERR_GENERAL
#define G10ERR_INV_ARG GPG_ERR_INV_ARG #define G10ERR_INV_ARG GPG_ERR_INV_ARG
#define G10ERR_INV_KEYRING GPG_ERR_INV_KEYRING #define G10ERR_INV_KEYRING GPG_ERR_INV_KEYRING
#define G10ERR_INV_USER_ID GPG_ERR_INV_USER_ID #define G10ERR_INV_USER_ID GPG_ERR_INV_USER_ID
#define G10ERR_INVALID_ARMOR GPG_ERR_INV_ARMOR #define G10ERR_INVALID_ARMOR GPG_ERR_INV_ARMOR
#define G10ERR_INVALID_PACKET GPG_ERR_INV_PACKET #define G10ERR_INVALID_PACKET GPG_ERR_INV_PACKET
#define G10ERR_KEYRING_OPEN GPG_ERR_KEYRING_OPEN #define G10ERR_KEYRING_OPEN GPG_ERR_KEYRING_OPEN
#define G10ERR_KEYSERVER GPG_ERR_KEYSERVER #define G10ERR_KEYSERVER GPG_ERR_KEYSERVER
#define G10ERR_NO_DATA GPG_ERR_NO_DATA #define G10ERR_NO_DATA GPG_ERR_NO_DATA
#define G10ERR_NO_PUBKEY GPG_ERR_NO_PUBKEY #define G10ERR_NO_PUBKEY GPG_ERR_NO_PUBKEY
#define G10ERR_NO_SECKEY GPG_ERR_NO_SECKEY #define G10ERR_NO_SECKEY GPG_ERR_NO_SECKEY
#define G10ERR_NO_USER_ID GPG_ERR_NO_USER_ID #define G10ERR_NO_USER_ID GPG_ERR_NO_USER_ID
#define G10ERR_NOT_PROCESSED GPG_ERR_NOT_PROCESSED #define G10ERR_NOT_PROCESSED GPG_ERR_NOT_PROCESSED
#define G10ERR_OPEN_FILE GPG_ERR_OPEN_FILE #define G10ERR_OPEN_FILE GPG_ERR_OPEN_FILE
#define G10ERR_PASSPHRASE GPG_ERR_PASSPHRASE #define G10ERR_PASSPHRASE GPG_ERR_PASSPHRASE
#define G10ERR_PUBKEY_ALGO GPG_ERR_PUBKEY_ALGO #define G10ERR_PUBKEY_ALGO GPG_ERR_PUBKEY_ALGO
#define G10ERR_READ_FILE GPG_ERR_READ_FILE #define G10ERR_READ_FILE GPG_ERR_READ_FILE
#define G10ERR_RENAME_FILE GPG_ERR_RENAME_FILE #define G10ERR_RENAME_FILE GPG_ERR_RENAME_FILE
#define G10ERR_RESOURCE_LIMIT GPG_ERR_RESOURCE_LIMIT #define G10ERR_RESOURCE_LIMIT GPG_ERR_RESOURCE_LIMIT
#define G10ERR_SIG_CLASS GPG_ERR_SIG_CLASS #define G10ERR_SIG_CLASS GPG_ERR_SIG_CLASS
#define G10ERR_TIME_CONFLICT GPG_ERR_TIME_CONFLICT #define G10ERR_TIME_CONFLICT GPG_ERR_TIME_CONFLICT
#define G10ERR_TRUSTDB GPG_ERR_TRUSTDB #define G10ERR_TRUSTDB GPG_ERR_TRUSTDB
#define G10ERR_UNEXPECTED GPG_ERR_UNEXPECTED #define G10ERR_UNEXPECTED GPG_ERR_UNEXPECTED
#define G10ERR_UNKNOWN_PACKET GPG_ERR_UNKNOWN_PACKET #define G10ERR_UNKNOWN_PACKET GPG_ERR_UNKNOWN_PACKET
#define G10ERR_UNSUPPORTED GPG_ERR_UNSUPPORTED #define G10ERR_UNSUPPORTED GPG_ERR_UNSUPPORTED
#define G10ERR_UNU_PUBKEY GPG_ERR_UNUSABLE_PUBKEY #define G10ERR_UNU_PUBKEY GPG_ERR_UNUSABLE_PUBKEY
#define G10ERR_UNU_SECKEY GPG_ERR_UNUSABLE_SECKEY #define G10ERR_UNU_SECKEY GPG_ERR_UNUSABLE_SECKEY
#define G10ERR_WRONG_SECKEY GPG_ERR_WRONG_SECKEY #define G10ERR_WRONG_SECKEY GPG_ERR_WRONG_SECKEY
#endif /*GNUPG_G10_GPG_H*/ #endif /*GNUPG_G10_GPG_H*/

View File

@ -1,5 +1,5 @@
/* keydb.c - key database dispatcher /* 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. * 2008, 2009 Free Software Foundation, Inc.
* *
* This file is part of GnuPG. * This file is part of GnuPG.
@ -34,7 +34,7 @@
#include "main.h" /*try_make_homedir ()*/ #include "main.h" /*try_make_homedir ()*/
#include "packet.h" #include "packet.h"
#include "keyring.h" #include "keyring.h"
#include "keydb.h" #include "keydb.h"
#include "i18n.h" #include "i18n.h"
static int active_handles; static int active_handles;
@ -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 /* If we don't want to create a new file at all, there is no need to
go any further - bail out right here. */ go any further - bail out right here. */
if (!force) if (!force)
return gpg_error (GPG_ERR_ENOENT); return gpg_error (GPG_ERR_ENOENT);
/* First of all we try to create the home directory. Note, that we /* 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; save_slash = *last_slash_in_filename;
*last_slash_in_filename = 0; *last_slash_in_filename = 0;
if (access(filename, F_OK)) if (access(filename, F_OK))
{ {
static int tried; static int tried;
if (!tried) if (!tried)
{ {
tried = 1; tried = 1;
@ -144,8 +144,8 @@ maybe_create_keyring (char *filename, int force)
if (opt.verbose) if (opt.verbose)
log_info ("can't allocate lock for `%s'\n", filename ); log_info ("can't allocate lock for `%s'\n", filename );
if (!force) if (!force)
return gpg_error (GPG_ERR_ENOENT); return gpg_error (GPG_ERR_ENOENT);
else else
return gpg_error (GPG_ERR_GENERAL); return gpg_error (GPG_ERR_GENERAL);
} }
@ -175,7 +175,7 @@ maybe_create_keyring (char *filename, int force)
else else
iobuf = iobuf_create (filename); iobuf = iobuf_create (filename);
umask (oldmask); umask (oldmask);
if (!iobuf) if (!iobuf)
{ {
rc = gpg_error_from_syserror (); rc = gpg_error_from_syserror ();
log_error ( _("error creating keyring `%s': %s\n"), log_error ( _("error creating keyring `%s': %s\n"),
@ -293,7 +293,7 @@ keydb_add_resource (const char *url, int flags, int secret)
{ {
if (used_resources >= MAX_KEYDB_RESOURCES) if (used_resources >= MAX_KEYDB_RESOURCES)
rc = G10ERR_RESOURCE_LIMIT; rc = G10ERR_RESOURCE_LIMIT;
else else
{ {
if(flags&2) if(flags&2)
primary_keyring=token; primary_keyring=token;
@ -352,10 +352,10 @@ keydb_new (int secret)
{ {
KEYDB_HANDLE hd; KEYDB_HANDLE hd;
int i, j; int i, j;
hd = xmalloc_clear (sizeof *hd); hd = xmalloc_clear (sizeof *hd);
hd->found = -1; hd->found = -1;
assert (used_resources <= MAX_KEYDB_RESOURCES); assert (used_resources <= MAX_KEYDB_RESOURCES);
for (i=j=0; i < used_resources; i++) for (i=j=0; i < used_resources; i++)
{ {
@ -379,12 +379,12 @@ keydb_new (int secret)
} }
} }
hd->used = j; hd->used = j;
active_handles++; active_handles++;
return hd; return hd;
} }
void void
keydb_release (KEYDB_HANDLE hd) keydb_release (KEYDB_HANDLE hd)
{ {
int i; int i;
@ -423,19 +423,19 @@ keydb_get_resource_name (KEYDB_HANDLE hd)
int idx; int idx;
const char *s = NULL; const char *s = NULL;
if (!hd) if (!hd)
return NULL; return NULL;
if ( hd->found >= 0 && hd->found < hd->used) if ( hd->found >= 0 && hd->found < hd->used)
idx = hd->found; idx = hd->found;
else if ( hd->current >= 0 && hd->current < hd->used) else if ( hd->current >= 0 && hd->current < hd->used)
idx = hd->current; idx = hd->current;
else else
idx = 0; idx = 0;
switch (hd->active[idx].type) { switch (hd->active[idx].type) {
case KEYDB_RESOURCE_TYPE_NONE: case KEYDB_RESOURCE_TYPE_NONE:
s = NULL; s = NULL;
break; break;
case KEYDB_RESOURCE_TYPE_KEYRING: case KEYDB_RESOURCE_TYPE_KEYRING:
s = keyring_get_resource_name (hd->active[idx].u.kr); s = keyring_get_resource_name (hd->active[idx].u.kr);
@ -447,7 +447,7 @@ keydb_get_resource_name (KEYDB_HANDLE hd)
static int static int
lock_all (KEYDB_HANDLE hd) lock_all (KEYDB_HANDLE hd)
{ {
int i, rc = 0; int i, rc = 0;
@ -504,7 +504,7 @@ unlock_all (KEYDB_HANDLE hd)
/* /*
* Return the last found keyring. Caller must free it. * Return the last found keyring. Caller must free it.
* The returned keyblock has the kbode flag bit 0 set for the node with * 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. * the user ID node.
*/ */
int int
@ -515,7 +515,7 @@ keydb_get_keyblock (KEYDB_HANDLE hd, KBNODE *ret_kb)
if (!hd) if (!hd)
return G10ERR_INV_ARG; return G10ERR_INV_ARG;
if ( hd->found < 0 || hd->found >= hd->used) if ( hd->found < 0 || hd->found >= hd->used)
return -1; /* nothing found */ return -1; /* nothing found */
switch (hd->active[hd->found].type) { switch (hd->active[hd->found].type) {
@ -530,7 +530,7 @@ keydb_get_keyblock (KEYDB_HANDLE hd, KBNODE *ret_kb)
return rc; return rc;
} }
/* /*
* update the current keyblock with KB * update the current keyblock with KB
*/ */
int int
@ -541,7 +541,7 @@ keydb_update_keyblock (KEYDB_HANDLE hd, KBNODE kb)
if (!hd) if (!hd)
return G10ERR_INV_ARG; return G10ERR_INV_ARG;
if ( hd->found < 0 || hd->found >= hd->used) if ( hd->found < 0 || hd->found >= hd->used)
return -1; /* nothing found */ return -1; /* nothing found */
if( opt.dry_run ) if( opt.dry_run )
@ -565,8 +565,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 int
keydb_insert_keyblock (KEYDB_HANDLE hd, KBNODE kb) keydb_insert_keyblock (KEYDB_HANDLE hd, KBNODE kb)
@ -574,15 +574,15 @@ keydb_insert_keyblock (KEYDB_HANDLE hd, KBNODE kb)
int rc = -1; int rc = -1;
int idx; int idx;
if (!hd) if (!hd)
return G10ERR_INV_ARG; return G10ERR_INV_ARG;
if( opt.dry_run ) if( opt.dry_run )
return 0; return 0;
if ( hd->found >= 0 && hd->found < hd->used) if ( hd->found >= 0 && hd->found < hd->used)
idx = hd->found; idx = hd->found;
else if ( hd->current >= 0 && hd->current < hd->used) else if ( hd->current >= 0 && hd->current < hd->used)
idx = hd->current; idx = hd->current;
else else
return G10ERR_GENERAL; return G10ERR_GENERAL;
@ -605,7 +605,7 @@ keydb_insert_keyblock (KEYDB_HANDLE hd, KBNODE kb)
} }
/* /*
* The current keyblock will be deleted. * The current keyblock will be deleted.
*/ */
int int
@ -616,7 +616,7 @@ keydb_delete_keyblock (KEYDB_HANDLE hd)
if (!hd) if (!hd)
return G10ERR_INV_ARG; return G10ERR_INV_ARG;
if ( hd->found < 0 || hd->found >= hd->used) if ( hd->found < 0 || hd->found >= hd->used)
return -1; /* nothing found */ return -1; /* nothing found */
if( opt.dry_run ) if( opt.dry_run )
@ -643,7 +643,7 @@ keydb_delete_keyblock (KEYDB_HANDLE hd)
/* /*
* Locate the default writable key resource, so that the next * Locate the default writable key resource, so that the next
* operation (which is only relevant for inserts) will be done on this * operation (which is only relevant for inserts) will be done on this
* resource. * resource.
*/ */
int int
keydb_locate_writable (KEYDB_HANDLE hd, const char *reserved) keydb_locate_writable (KEYDB_HANDLE hd, const char *reserved)
@ -654,7 +654,7 @@ keydb_locate_writable (KEYDB_HANDLE hd, const char *reserved)
if (!hd) if (!hd)
return G10ERR_INV_ARG; return G10ERR_INV_ARG;
rc = keydb_search_reset (hd); /* this does reset hd->current */ rc = keydb_search_reset (hd); /* this does reset hd->current */
if (rc) if (rc)
return rc; return rc;
@ -678,9 +678,9 @@ keydb_locate_writable (KEYDB_HANDLE hd, const char *reserved)
return rc; 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: case KEYDB_RESOURCE_TYPE_NONE:
BUG(); BUG();
@ -691,7 +691,7 @@ keydb_locate_writable (KEYDB_HANDLE hd, const char *reserved)
break; break;
} }
} }
return -1; return -1;
} }
@ -702,7 +702,7 @@ void
keydb_rebuild_caches (int noisy) keydb_rebuild_caches (int noisy)
{ {
int i, rc; int i, rc;
for (i=0; i < used_resources; i++) for (i=0; i < used_resources; i++)
{ {
if (all_resources[i].secret) if (all_resources[i].secret)
@ -725,10 +725,10 @@ keydb_rebuild_caches (int noisy)
/* /*
* Start the next search on this handle right at the beginning * Start the next search on this handle right at the beginning
*/ */
int int
keydb_search_reset (KEYDB_HANDLE hd) keydb_search_reset (KEYDB_HANDLE hd)
{ {
int i, rc = 0; int i, rc = 0;
@ -736,7 +736,7 @@ keydb_search_reset (KEYDB_HANDLE hd)
if (!hd) if (!hd)
return G10ERR_INV_ARG; return G10ERR_INV_ARG;
hd->current = 0; hd->current = 0;
hd->found = -1; hd->found = -1;
/* and reset all resources */ /* and reset all resources */
for (i=0; !rc && i < hd->used; i++) { for (i=0; !rc && i < hd->used; i++) {
@ -748,15 +748,15 @@ keydb_search_reset (KEYDB_HANDLE hd)
break; break;
} }
} }
return rc; return rc;
} }
/* /*
* Search through all keydb resources, starting at the current position, * Search through all keydb resources, starting at the current position,
* for a keyblock which contains one of the keys described in the DESC array. * 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, keydb_search2 (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc,
size_t ndesc, size_t *descindex) size_t ndesc, size_t *descindex)
{ {
@ -776,12 +776,12 @@ keydb_search2 (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc,
break; break;
} }
if (rc == -1) /* EOF -> switch to next resource */ if (rc == -1) /* EOF -> switch to next resource */
hd->current++; hd->current++;
else if (!rc) else if (!rc)
hd->found = hd->current; hd->found = hd->current;
} }
return rc; return rc;
} }
int int