aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2008-10-20 13:53:23 +0000
committerWerner Koch <[email protected]>2008-10-20 13:53:23 +0000
commit0a5f7424660e404e5fd0361b9331d154acf01d6c (patch)
treeb84fb5a994045e12eb326441d8c924094bd915cd /g10
parentFix a bug in estream_snprintf. Found by a failed t-gettime under Windows. (diff)
downloadgnupg-0a5f7424660e404e5fd0361b9331d154acf01d6c.tar.gz
gnupg-0a5f7424660e404e5fd0361b9331d154acf01d6c.zip
Marked all unused args on non-W32 platforms.
Diffstat (limited to 'g10')
-rw-r--r--g10/ChangeLog44
-rw-r--r--g10/build-packet.c26
-rw-r--r--g10/call-agent.c10
-rw-r--r--g10/card-util.c4
-rw-r--r--g10/cpr.c2
-rw-r--r--g10/getkey.c4
-rw-r--r--g10/gpg.c2
-rw-r--r--g10/gpgv.c232
-rw-r--r--g10/import.c31
-rw-r--r--g10/keydb.c4
-rw-r--r--g10/keyedit.c2
-rw-r--r--g10/keygen.c69
-rw-r--r--g10/keyring.c6
-rw-r--r--g10/misc.c16
-rw-r--r--g10/parse-packet.c87
-rw-r--r--g10/passphrase.c4
-rw-r--r--g10/server.c39
-rw-r--r--g10/tdbdump.c31
-rw-r--r--g10/trustdb.c17
-rw-r--r--g10/verify.c3
20 files changed, 460 insertions, 173 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index a65425cce..b9a984913 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,47 @@
+2008-10-20 Werner Koch <[email protected]>
+
+ * gpgv.c: Mark all args of the stub fucntions as unused.
+
+ * card-util.c (generate_card_keys): Remove unused arg SERIALNO and
+ adjust caller.
+
+ * build-packet.c (write_sign_packet_header): Mark unused arg.
+ * gpg.c (gpg_init_default_ctrl, gpg_deinit_default_ctrl): Ditto.
+ * getkey.c (skip_unusable): Ditto.
+ (write_version): Ditto.
+ * keydb.c (keydb_locate_writable): Ditto.
+ * keyring.c (update_offset_hash_table): Ditto.
+ (keyring_lock): Ditto.
+ * misc.c (register_secured_file): Ditto.
+ (unregister_secured_file): Ditto.
+ (is_secured_file): Ditto.
+ (is_secured_filename): Ditto.
+ * parse-packet.c (parse_marker): Ditto.
+ (parse_key, parse_attribute): Ditto.
+ (parse_trust, parse_compressed, parse_mdc, parse_gpg_control): Ditto.
+ * cpr.c (progress_cb): Ditto.
+ * passphrase.c (passphrase_clear_cache): Ditto.
+ (ask_passphrase): Ditto.
+ * keyedit.c (keyedit_completion): Ditto.
+ * import.c (import_revoke_cert): Ditto.
+ (chk_self_sigs, delete_inv_parts, append_uid): Ditto.
+ (merge_sigs, merge_keysigs, append_key): Ditto.
+ * trustdb.c (list_trust_path): Ditto.
+ (enum_cert_paths, enum_cert_paths_print): Ditto.
+ * tdbdump.c (list_trustdb): Ditto.
+ * keygen.c (keygen_upd_std_prefs): Ditto.
+ (genhelp_factors): Ditto.
+ * call-agent.c (agent_scd_setattr): Ditto.
+ (agent_scd_writekey, agent_scd_change_pin, agent_scd_genkey): Ditto.
+ (agent_clear_pin_cache): Ditto.
+
+ * server.c (option_handler): Mark non yet used arg.
+ (input_notify, output_notify): Ditto.
+ (cmd_recipient, cmd_signer, cmd_encrypt, cmd_decrypt, cmd_verify)
+ (cmd_sign, cmd_import, cmd_export, cmd_delkeys, do_listkeys)
+ (cmd_genkey): Ditto.
+ * verify.c (gpg_verify): Ditto.
+
2008-10-17 Werner Koch <[email protected]>
* main.h (idea_cipher_warn): Use do while construct in place of an
diff --git a/g10/build-packet.c b/g10/build-packet.c
index c9ba9d8d1..37922d90c 100644
--- a/g10/build-packet.c
+++ b/g10/build-packet.c
@@ -1241,14 +1241,16 @@ write_header( IOBUF out, int ctb, u32 len )
static int
-write_sign_packet_header( IOBUF out, int ctb, u32 len )
+write_sign_packet_header (IOBUF out, int ctb, u32 len)
{
- /* work around a bug in the pgp read function for signature packets,
- * which are not correctly coded and silently assume at some
- * point 2 byte length headers.*/
- iobuf_put(out, 0x89 );
- iobuf_put(out, len >> 8 );
- return iobuf_put(out, len ) == -1 ? -1:0;
+ (void)ctb;
+
+ /* Work around a bug in the pgp read function for signature packets,
+ which are not correctly coded and silently assume at some point 2
+ byte length headers.*/
+ iobuf_put (out, 0x89 );
+ iobuf_put (out, len >> 8 );
+ return iobuf_put (out, len) == -1 ? -1:0;
}
/****************
@@ -1350,9 +1352,11 @@ write_new_header( IOBUF out, int ctb, u32 len, int hdrlen )
}
static int
-write_version( IOBUF out, int ctb )
+write_version (IOBUF out, int ctb)
{
- if( iobuf_put( out, 3 ) )
- return -1;
- return 0;
+ (void)ctb;
+
+ if (iobuf_put (out, 3))
+ return -1;
+ return 0;
}
diff --git a/g10/call-agent.c b/g10/call-agent.c
index 29d75a59e..15c17b038 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -418,6 +418,8 @@ agent_scd_setattr (const char *name,
char line[ASSUAN_LINELENGTH];
char *p;
+ (void)serialno;
+
if (!*name || !valuelen)
return gpg_error (GPG_ERR_INV_VALUE);
@@ -532,6 +534,8 @@ agent_scd_writekey (int keyno, const char *serialno,
char line[ASSUAN_LINELENGTH];
struct writekey_parm_s parms;
+ (void)serialno;
+
rc = start_agent ();
if (rc)
return rc;
@@ -616,6 +620,8 @@ agent_scd_genkey (struct agent_card_genkey_s *info, int keyno, int force,
char line[ASSUAN_LINELENGTH];
gnupg_isotime_t tbuf;
+ (void)serialno;
+
rc = start_agent ();
if (rc)
return rc;
@@ -775,6 +781,8 @@ agent_scd_change_pin (int chvno, const char *serialno)
char line[ASSUAN_LINELENGTH];
const char *reset = "";
+ (void)serialno;
+
if (chvno >= 100)
reset = "--reset";
chvno %= 100;
@@ -816,7 +824,7 @@ agent_scd_checkpin (const char *serialno)
void
agent_clear_pin_cache (const char *sn)
{
-
+ (void)sn;
}
diff --git a/g10/card-util.c b/g10/card-util.c
index afde4cb68..e25427f51 100644
--- a/g10/card-util.c
+++ b/g10/card-util.c
@@ -1127,7 +1127,7 @@ replace_existing_key_p (struct agent_card_info_s *info, int keyno)
static void
-generate_card_keys (const char *serialno)
+generate_card_keys (void)
{
struct agent_card_info_s info;
int forced_chv1;
@@ -1674,7 +1674,7 @@ card_edit (strlist_t commands)
break;
case cmdGENERATE:
- generate_card_keys (serialnobuf);
+ generate_card_keys ();
break;
case cmdPASSWD:
diff --git a/g10/cpr.c b/g10/cpr.c
index 83f0ccb4d..a1e904e07 100644
--- a/g10/cpr.c
+++ b/g10/cpr.c
@@ -48,6 +48,8 @@ progress_cb (void *ctx, const char *what, int printchar,
{
char buf[50];
+ (void)ctx;
+
if ( printchar == '\n' && !strcmp (what, "primegen") )
snprintf (buf, sizeof buf -1, "%.20s X 100 100", what );
else
diff --git a/g10/getkey.c b/g10/getkey.c
index 65d373b81..3b25b735d 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -760,10 +760,12 @@ classify_user_id( const char *name, KEYDB_SEARCH_DESC *desc )
static int
-skip_unusable(void *dummy,u32 *keyid,PKT_user_id *uid)
+skip_unusable (void *dummy, u32 *keyid, PKT_user_id *uid)
{
int unusable=0;
KBNODE keyblock;
+
+ (void)dummy;
keyblock=get_pubkeyblock(keyid);
if(!keyblock)
diff --git a/g10/gpg.c b/g10/gpg.c
index 9dd17906d..834936566 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -1766,6 +1766,7 @@ encode_s2k_iterations(int iterations)
static void
gpg_init_default_ctrl (ctrl_t ctrl)
{
+ (void)ctrl;
}
@@ -1774,6 +1775,7 @@ gpg_init_default_ctrl (ctrl_t ctrl)
static void
gpg_deinit_default_ctrl (ctrl_t ctrl)
{
+ (void)ctrl;
}
diff --git a/g10/gpgv.c b/g10/gpgv.c
index 9b1fe2aed..b81ae6000 100644
--- a/g10/gpgv.c
+++ b/g10/gpgv.c
@@ -200,12 +200,21 @@ g10_exit( int rc )
int
check_signatures_trust( PKT_signature *sig )
{
- return 0;
+ (void)sig;
+ return 0;
}
void
-read_trust_options(byte *trust_model,ulong *created,ulong *nextcheck,
- byte *marginals,byte *completes,byte *cert_depth) {}
+read_trust_options(byte *trust_model, ulong *created, ulong *nextcheck,
+ byte *marginals, byte *completes, byte *cert_depth)
+{
+ (void)trust_model;
+ (void)created;
+ (void)nextcheck;
+ (void)marginals;
+ (void)completes;
+ (void)cert_depth;
+}
/* Stub:
* We don't have the trustdb , so we have to provide some stub functions
@@ -215,46 +224,58 @@ read_trust_options(byte *trust_model,ulong *created,ulong *nextcheck,
int
cache_disabled_value(PKT_public_key *pk)
{
+ (void)pk;
return 0;
}
void
-check_trustdb_stale(void) {}
+check_trustdb_stale(void)
+{
+}
int
get_validity_info (PKT_public_key *pk, PKT_user_id *uid)
{
- return '?';
+ (void)pk;
+ (void)uid;
+ return '?';
}
unsigned int
get_validity (PKT_public_key *pk, PKT_user_id *uid)
{
+ (void)pk;
+ (void)uid;
return 0;
}
const char *
trust_value_to_string (unsigned int value)
{
+ (void)value;
return "err";
}
const char *
-uid_trust_string_fixed(PKT_public_key *key,PKT_user_id *uid)
+uid_trust_string_fixed (PKT_public_key *key, PKT_user_id *uid)
{
+ (void)key;
+ (void)uid;
return "err";
}
int
get_ownertrust_info (PKT_public_key *pk)
{
- return '?';
+ (void)pk;
+ return '?';
}
unsigned int
get_ownertrust (PKT_public_key *pk)
{
- return TRUST_UNKNOWN;
+ (void)pk;
+ return TRUST_UNKNOWN;
}
@@ -264,122 +285,217 @@ get_ownertrust (PKT_public_key *pk)
*/
struct keyserver_spec *
-keyserver_match(struct keyserver_spec *spec) { return NULL; }
+keyserver_match (struct keyserver_spec *spec)
+{
+ (void)spec;
+ return NULL;
+}
int
-keyserver_import_keyid( u32 *keyid, void *dummy )
+keyserver_import_keyid (u32 *keyid, void *dummy)
{
- return -1;
+ (void)keyid;
+ (void)dummy;
+ return -1;
}
int
-keyserver_import_cert(const char *name) { return -1; }
+keyserver_import_cert (const char *name)
+{
+ (void)name;
+ return -1;
+}
int
-keyserver_import_pka(const char *name,unsigned char *fpr) { return -1; }
+keyserver_import_pka (const char *name,unsigned char *fpr)
+{
+ (void)name;
+ (void)fpr;
+ return -1;
+}
int
-keyserver_import_name(const char *name,struct keyserver_spec *spec)
+keyserver_import_name (const char *name,struct keyserver_spec *spec)
{
+ (void)name;
+ (void)spec;
return -1;
}
int
-keyserver_import_ldap(const char *name) { return -1; }
+keyserver_import_ldap (const char *name)
+{
+ (void)name;
+ return -1;
+}
/* Stub:
* No encryption here but mainproc links to these functions.
*/
int
-get_session_key( PKT_pubkey_enc *k, DEK *dek )
+get_session_key (PKT_pubkey_enc *k, DEK *dek)
{
- return G10ERR_GENERAL;
+ (void)k;
+ (void)dek;
+ return G10ERR_GENERAL;
}
+
/* Stub: */
int
-get_override_session_key( DEK *dek, const char *string )
+get_override_session_key (DEK *dek, const char *string)
{
- return G10ERR_GENERAL;
+ (void)dek;
+ (void)string;
+ return G10ERR_GENERAL;
}
+
/* Stub: */
int
-decrypt_data( void *procctx, PKT_encrypted *ed, DEK *dek )
+decrypt_data (void *procctx, PKT_encrypted *ed, DEK *dek)
{
- return G10ERR_GENERAL;
+ (void)procctx;
+ (void)ed;
+ (void)dek;
+ return G10ERR_GENERAL;
}
/* Stub:
- * No interactive commnds, so we don't need the helptexts
+ * No interactive commands, so we don't need the helptexts
*/
void
-display_online_help( const char *keyword )
+display_online_help (const char *keyword)
{
+ (void)keyword;
}
/* Stub:
* We don't use secret keys, but getkey.c links to this
*/
int
-check_secret_key( PKT_secret_key *sk, int n )
+check_secret_key (PKT_secret_key *sk, int n)
{
- return G10ERR_GENERAL;
+ (void)sk;
+ (void)n;
+ return G10ERR_GENERAL;
}
/* Stub:
* No secret key, so no passphrase needed
*/
DEK *
-passphrase_to_dek( u32 *keyid, int pubkey_algo,
- int cipher_algo, STRING2KEY *s2k, int mode,
+passphrase_to_dek (u32 *keyid, int pubkey_algo,
+ int cipher_algo, STRING2KEY *s2k, int mode,
const char *tmp, int *canceled)
{
+ (void)keyid;
+ (void)pubkey_algo;
+ (void)cipher_algo;
+ (void)s2k;
+ (void)mode;
+ (void)tmp;
+
if (canceled)
*canceled = 0;
return NULL;
}
-struct keyserver_spec *parse_preferred_keyserver(PKT_signature *sig) {return NULL;}
-struct keyserver_spec *parse_keyserver_uri(const char *uri,int require_scheme,
- const char *configname,
- unsigned int configlineno)
+struct keyserver_spec *
+parse_preferred_keyserver(PKT_signature *sig)
{
+ (void)sig;
return NULL;
}
-void free_keyserver_spec(struct keyserver_spec *keyserver) {}
+struct keyserver_spec *
+parse_keyserver_uri (const char *uri, int require_scheme,
+ const char *configname, unsigned int configlineno)
+{
+ (void)uri;
+ (void)require_scheme;
+ (void)configname;
+ (void)configlineno;
+ return NULL;
+}
+
+void
+free_keyserver_spec (struct keyserver_spec *keyserver)
+{
+ (void)keyserver;
+}
/* Stubs to avoid linking to photoid.c */
-void show_photos(const struct user_attribute *attrs,int count,PKT_public_key *pk) {}
-int parse_image_header(const struct user_attribute *attr,byte *type,u32 *len) {return 0;}
-char *image_type_to_string(byte type,int string) {return NULL;}
+void
+show_photos (const struct user_attribute *attrs, int count, PKT_public_key *pk)
+{
+ (void)attrs;
+ (void)count;
+ (void)pk;
+}
+
+int
+parse_image_header (const struct user_attribute *attr, byte *type, u32 *len)
+{
+ (void)attr;
+ (void)type;
+ (void)len;
+ return 0;
+}
+
+char *
+image_type_to_string (byte type, int string)
+{
+ (void)type;
+ (void)string;
+ return NULL;
+}
#ifdef ENABLE_CARD_SUPPORT
-int agent_scd_getattr (const char *name, struct agent_card_info_s *info) {return 0;}
+int
+agent_scd_getattr (const char *name, struct agent_card_info_s *info)
+{
+ (void)name;
+ (void)info;
+ return 0;
+}
#endif /* ENABLE_CARD_SUPPORT */
-/* Stubs to void linking to ../cipher/cipher.c */
-const char *cipher_algo_to_string( int algo ) { return "?";}
-void disable_cipher_algo( int algo ) {}
-int check_cipher_algo( int algo ) { return -1;}
-unsigned int cipher_get_keylen( int algo ) { return 0; }
-unsigned int cipher_get_blocksize( int algo ) {return 0;}
-gcry_cipher_hd_t cipher_open( int algo, int mode, int secure ) { return NULL;}
-void cipher_close( gcry_cipher_hd_t c ) {}
-int cipher_setkey( gcry_cipher_hd_t c, byte *key, unsigned keylen ) { return -1;}
-void cipher_setiv( gcry_cipher_hd_t c, const byte *iv, unsigned ivlen ){}
-void cipher_encrypt( gcry_cipher_hd_t c, byte *outbuf,
- byte *inbuf, unsigned nbytes ) {}
-void cipher_decrypt( gcry_cipher_hd_t c, byte *outbuf,
- byte *inbuf, unsigned nbytes ) {}
-void cipher_sync( gcry_cipher_hd_t c ) {}
+/* We do not do any locking, so use these stubs here */
+void
+disable_dotlock (void)
+{
+}
+DOTLOCK
+create_dotlock (const char *file_to_lock)
+{
+ (void)file_to_lock;
+ return NULL;
+}
+void
+destroy_dotlock (DOTLOCK h)
+{
+ (void)h;
+}
+
+int
+make_dotlock (DOTLOCK h, long timeout)
+{
+ (void)h;
+ (void)timeout;
+ return 0;
+}
+
+int
+release_dotlock (DOTLOCK h)
+{
+ (void)h;
+ return 0;
+}
+
+void
+remove_lockfiles (void)
+{
+}
-/* We do not do any locking, so use these stubs here */
-void disable_dotlock(void) {}
-DOTLOCK create_dotlock( const char *file_to_lock ) { return NULL; }
-void destroy_dotlock (DOTLOCK h) {}
-int make_dotlock( DOTLOCK h, long timeout ) { return 0;}
-int release_dotlock( DOTLOCK h ) {return 0;}
-void remove_lockfiles(void) {}
diff --git a/g10/import.c b/g10/import.c
index 3614285c9..88eb24e57 100644
--- a/g10/import.c
+++ b/g10/import.c
@@ -1238,6 +1238,8 @@ import_revoke_cert( const char *fname, KBNODE node, struct stats_s *stats )
u32 keyid[2];
int rc = 0;
+ (void)fname;
+
assert( !node->next );
assert( node->pkt->pkttype == PKT_SIGNATURE );
assert( node->pkt->pkt.signature->sig_class == 0x20 );
@@ -1365,6 +1367,9 @@ chk_self_sigs( const char *fname, KBNODE keyblock,
u32 bsdate=0,rsdate=0;
KBNODE bsnode=NULL,rsnode=NULL;
+ (void)fname;
+ (void)pk;
+
for( n=keyblock; (n = find_next_kbnode(n, 0)); ) {
if(n->pkt->pkttype==PKT_PUBLIC_SUBKEY)
{
@@ -1537,6 +1542,8 @@ delete_inv_parts( const char *fname, KBNODE keyblock,
KBNODE node;
int nvalid=0, uid_seen=0, subkey_seen=0;
+ (void)fname;
+
for(node=keyblock->next; node; node = node->next ) {
if( node->pkt->pkttype == PKT_USER_ID ) {
uid_seen = 1;
@@ -2047,11 +2054,14 @@ merge_blocks( const char *fname, KBNODE keyblock_orig, KBNODE keyblock,
* append the userid starting with NODE and all signatures to KEYBLOCK.
*/
static int
-append_uid( KBNODE keyblock, KBNODE node, int *n_sigs,
- const char *fname, u32 *keyid )
+append_uid (KBNODE keyblock, KBNODE node, int *n_sigs,
+ const char *fname, u32 *keyid )
{
KBNODE n, n_where=NULL;
+ (void)fname;
+ (void)keyid;
+
assert(node->pkt->pkttype == PKT_USER_ID );
/* find the position */
@@ -2099,6 +2109,9 @@ merge_sigs( KBNODE dst, KBNODE src, int *n_sigs,
KBNODE n, n2;
int found=0;
+ (void)fname;
+ (void)keyid;
+
assert(dst->pkt->pkttype == PKT_USER_ID );
assert(src->pkt->pkttype == PKT_USER_ID );
@@ -2134,12 +2147,15 @@ merge_sigs( KBNODE dst, KBNODE src, int *n_sigs,
* Merge the sigs from SRC onto DST. SRC and DST are both a PKT_xxx_SUBKEY.
*/
static int
-merge_keysigs( KBNODE dst, KBNODE src, int *n_sigs,
- const char *fname, u32 *keyid )
+merge_keysigs (KBNODE dst, KBNODE src, int *n_sigs,
+ const char *fname, u32 *keyid)
{
KBNODE n, n2;
int found=0;
+ (void)fname;
+ (void)keyid;
+
assert( dst->pkt->pkttype == PKT_PUBLIC_SUBKEY
|| dst->pkt->pkttype == PKT_SECRET_SUBKEY );
@@ -2187,11 +2203,14 @@ merge_keysigs( KBNODE dst, KBNODE src, int *n_sigs,
* Mark all new and copied packets by setting flag bit 0.
*/
static int
-append_key( KBNODE keyblock, KBNODE node, int *n_sigs,
- const char *fname, u32 *keyid )
+append_key (KBNODE keyblock, KBNODE node, int *n_sigs,
+ const char *fname, u32 *keyid)
{
KBNODE n;
+ (void)fname;
+ (void)keyid;
+
assert( node->pkt->pkttype == PKT_PUBLIC_SUBKEY
|| node->pkt->pkttype == PKT_SECRET_SUBKEY );
diff --git a/g10/keydb.c b/g10/keydb.c
index 3360f6307..28595061a 100644
--- a/g10/keydb.c
+++ b/g10/keydb.c
@@ -644,7 +644,9 @@ int
keydb_locate_writable (KEYDB_HANDLE hd, const char *reserved)
{
int rc;
-
+
+ (void)reserved;
+
if (!hd)
return G10ERR_INV_ARG;
diff --git a/g10/keyedit.c b/g10/keyedit.c
index a1fa78fa0..cbb9d79bc 100644
--- a/g10/keyedit.c
+++ b/g10/keyedit.c
@@ -1494,6 +1494,8 @@ keyedit_completion(const char *text, int start, int end)
/* If we are at the start of a line, we try and command-complete.
If not, just do nothing for now. */
+ (void)end;
+
if(start==0)
return rl_completion_matches(text,command_generator);
diff --git a/g10/keygen.c b/g10/keygen.c
index a056e5320..675acf603 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -631,42 +631,45 @@ add_keyserver_modify (PKT_signature *sig,int enabled)
xfree (buf);
}
+
int
-keygen_upd_std_prefs( PKT_signature *sig, void *opaque )
+keygen_upd_std_prefs (PKT_signature *sig, void *opaque)
{
- if (!prefs_initialized)
- keygen_set_std_prefs (NULL, 0);
-
- if (nsym_prefs)
- build_sig_subpkt (sig, SIGSUBPKT_PREF_SYM, sym_prefs, nsym_prefs);
- else
- {
- delete_sig_subpkt (sig->hashed, SIGSUBPKT_PREF_SYM);
- delete_sig_subpkt (sig->unhashed, SIGSUBPKT_PREF_SYM);
- }
-
- if (nhash_prefs)
- build_sig_subpkt (sig, SIGSUBPKT_PREF_HASH, hash_prefs, nhash_prefs);
- else
- {
- delete_sig_subpkt (sig->hashed, SIGSUBPKT_PREF_HASH);
- delete_sig_subpkt (sig->unhashed, SIGSUBPKT_PREF_HASH);
- }
-
- if (nzip_prefs)
- build_sig_subpkt (sig, SIGSUBPKT_PREF_COMPR, zip_prefs, nzip_prefs);
- else
- {
- delete_sig_subpkt (sig->hashed, SIGSUBPKT_PREF_COMPR);
- delete_sig_subpkt (sig->unhashed, SIGSUBPKT_PREF_COMPR);
- }
+ (void)opaque;
+
+ if (!prefs_initialized)
+ keygen_set_std_prefs (NULL, 0);
+
+ if (nsym_prefs)
+ build_sig_subpkt (sig, SIGSUBPKT_PREF_SYM, sym_prefs, nsym_prefs);
+ else
+ {
+ delete_sig_subpkt (sig->hashed, SIGSUBPKT_PREF_SYM);
+ delete_sig_subpkt (sig->unhashed, SIGSUBPKT_PREF_SYM);
+ }
+
+ if (nhash_prefs)
+ build_sig_subpkt (sig, SIGSUBPKT_PREF_HASH, hash_prefs, nhash_prefs);
+ else
+ {
+ delete_sig_subpkt (sig->hashed, SIGSUBPKT_PREF_HASH);
+ delete_sig_subpkt (sig->unhashed, SIGSUBPKT_PREF_HASH);
+ }
- /* Make sure that the MDC feature flag is set if needed */
- add_feature_mdc (sig,mdc_available);
- add_keyserver_modify (sig,ks_modify);
- keygen_add_keyserver_url(sig,NULL);
+ if (nzip_prefs)
+ build_sig_subpkt (sig, SIGSUBPKT_PREF_COMPR, zip_prefs, nzip_prefs);
+ else
+ {
+ delete_sig_subpkt (sig->hashed, SIGSUBPKT_PREF_COMPR);
+ delete_sig_subpkt (sig->unhashed, SIGSUBPKT_PREF_COMPR);
+ }
+
+ /* Make sure that the MDC feature flag is set if needed. */
+ add_feature_mdc (sig,mdc_available);
+ add_keyserver_modify (sig,ks_modify);
+ keygen_add_keyserver_url(sig,NULL);
- return 0;
+ return 0;
}
@@ -1102,6 +1105,8 @@ genhelp_protect (DEK *dek, STRING2KEY *s2k, PKT_secret_key *sk)
static void
genhelp_factors (gcry_sexp_t misc_key_info, KBNODE sec_root)
{
+ (void)misc_key_info;
+ (void)sec_root;
#if 0 /* Not used anymore */
size_t n;
char *buf;
diff --git a/g10/keyring.c b/g10/keyring.c
index 937502ab2..ca2513198 100644
--- a/g10/keyring.c
+++ b/g10/keyring.c
@@ -158,6 +158,8 @@ update_offset_hash_table (OffsetHashTable tbl, u32 *kid, off_t off)
{
struct off_item *k;
+ (void)off;
+
for (k = tbl[(kid[1] & 0x07ff)]; k; k = k->next)
{
if (k->kid[0] == kid[0] && k->kid[1] == kid[1])
@@ -288,7 +290,7 @@ keyring_get_resource_name (KEYRING_HANDLE hd)
/*
- * Lock the keyring with the given handle, or unlok if yes is false.
+ * Lock the keyring with the given handle, or unlock if YES is false.
* We ignore the handle and lock all registered files.
*/
int
@@ -297,6 +299,8 @@ keyring_lock (KEYRING_HANDLE hd, int yes)
KR_NAME kr;
int rc = 0;
+ (void)hd;
+
if (yes) {
/* first make sure the lock handles are created */
for (kr=kr_names; kr; kr = kr->next) {
diff --git a/g10/misc.c b/g10/misc.c
index a9d4f0547..cbaee08b5 100644
--- a/g10/misc.c
+++ b/g10/misc.c
@@ -121,7 +121,9 @@ register_secured_file (const char *fname)
sf->dev = buf.st_dev;
sf->next = secured_files;
secured_files = sf;
-#endif /*ENABLE_SELINUX_HACKS*/
+#else /*!ENABLE_SELINUX_HACKS*/
+ (void)fname;
+#endif /*!ENABLE_SELINUX_HACKS*/
}
/* Remove a file registered as secure. */
@@ -152,7 +154,9 @@ unregister_secured_file (const char *fname)
return;
}
}
-#endif /*ENABLE_SELINUX_HACKS*/
+#else /*!ENABLE_SELINUX_HACKS*/
+ (void)fname;
+#endif /*!ENABLE_SELINUX_HACKS*/
}
/* Return true if FD is corresponds to a secured file. Using -1 for
@@ -182,7 +186,9 @@ is_secured_file (int fd)
if (sf->ino == buf.st_ino && sf->dev == buf.st_dev)
return 1; /* Yes. */
}
-#endif /*ENABLE_SELINUX_HACKS*/
+#else /*!ENABLE_SELINUX_HACKS*/
+ (void)fd;
+#endif /*!ENABLE_SELINUX_HACKS*/
return 0; /* No. */
}
@@ -217,7 +223,9 @@ is_secured_filename (const char *fname)
if (sf->ino == buf.st_ino && sf->dev == buf.st_dev)
return 1; /* Yes. */
}
-#endif /*ENABLE_SELINUX_HACKS*/
+#else /*!ENABLE_SELINUX_HACKS*/
+ (void)fname;
+#endif /*!ENABLE_SELINUX_HACKS*/
return 0; /* No. */
}
diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index a15038d92..57f94cd85 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -702,6 +702,8 @@ read_rest( IOBUF inp, size_t pktlen, int partial )
static int
parse_marker( IOBUF inp, int pkttype, unsigned long pktlen )
{
+ (void)pkttype;
+
if(pktlen!=3)
goto fail;
@@ -1661,8 +1663,8 @@ read_protected_v3_mpi (IOBUF inp, unsigned long *length)
static int
-parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
- byte *hdr, int hdrlen, PACKET *pkt )
+parse_key (IOBUF inp, int pkttype, unsigned long pktlen,
+ byte *hdr, int hdrlen, PACKET *pkt)
{
int i, version, algorithm;
unsigned n;
@@ -1671,6 +1673,8 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
int is_v4=0;
int rc=0;
+ (void)hdr;
+
version = iobuf_get_noeof(inp); pktlen--;
if( pkttype == PKT_PUBLIC_SUBKEY && version == '#' ) {
/* early versions of G10 use old PGP comments packets;
@@ -2170,6 +2174,8 @@ parse_attribute( IOBUF inp, int pkttype, unsigned long pktlen, PACKET *packet )
{
byte *p;
+ (void)pkttype;
+
#define EXTRA_UID_NAME_SPACE 71
packet->pkt.user_id = xmalloc_clear(sizeof *packet->pkt.user_id
+ EXTRA_UID_NAME_SPACE);
@@ -2237,6 +2243,8 @@ parse_trust( IOBUF inp, int pkttype, unsigned long pktlen, PACKET *pkt )
{
int c;
+ (void)pkttype;
+
if (pktlen)
{
c = iobuf_get_noeof(inp);
@@ -2332,20 +2340,22 @@ static int
parse_compressed( IOBUF inp, int pkttype, unsigned long pktlen,
PACKET *pkt, int new_ctb )
{
- PKT_compressed *zd;
-
- /* pktlen is here 0, but data follows
- * (this should be the last object in a file or
- * the compress algorithm should know the length)
- */
- zd = pkt->pkt.compressed = xmalloc(sizeof *pkt->pkt.compressed );
- zd->algorithm = iobuf_get_noeof(inp);
- zd->len = 0; /* not used */
- zd->new_ctb = new_ctb;
- zd->buf = inp;
- if( list_mode )
- fprintf (listfp, ":compressed packet: algo=%d\n", zd->algorithm);
- return 0;
+ PKT_compressed *zd;
+
+ /* PKTLEN is here 0, but data follows (this should be the last
+ object in a file or the compress algorithm should know the
+ length). */
+ (void)pkttype;
+ (void)pktlen;
+
+ zd = pkt->pkt.compressed = xmalloc (sizeof *pkt->pkt.compressed);
+ zd->algorithm = iobuf_get_noeof(inp);
+ zd->len = 0; /* not used */
+ zd->new_ctb = new_ctb;
+ zd->buf = inp;
+ if (list_mode)
+ fprintf (listfp, ":compressed packet: algo=%d\n", zd->algorithm);
+ return 0;
}
@@ -2412,27 +2422,30 @@ parse_encrypted( IOBUF inp, int pkttype, unsigned long pktlen,
the MDC checking is done right after the encryption in
decrypt_data. */
static int
-parse_mdc( IOBUF inp, int pkttype, unsigned long pktlen,
- PACKET *pkt, int new_ctb )
+parse_mdc (IOBUF inp, int pkttype, unsigned long pktlen,
+ PACKET *pkt, int new_ctb)
{
- int rc = 0;
- PKT_mdc *mdc;
- byte *p;
+ int rc = 0;
+ PKT_mdc *mdc;
+ byte *p;
- mdc = pkt->pkt.mdc = xmalloc(sizeof *pkt->pkt.mdc );
- if( list_mode )
- fprintf (listfp, ":mdc packet: length=%lu\n", pktlen);
- if( !new_ctb || pktlen != 20 ) {
- log_error("mdc_packet with invalid encoding\n");
- rc = gpg_error (GPG_ERR_INV_PACKET);
- goto leave;
- }
- p = mdc->hash;
- for( ; pktlen; pktlen--, p++ )
- *p = iobuf_get_noeof(inp);
+ (void)pkttype;
- leave:
- return rc;
+ mdc = pkt->pkt.mdc = xmalloc(sizeof *pkt->pkt.mdc );
+ if (list_mode)
+ fprintf (listfp, ":mdc packet: length=%lu\n", pktlen);
+ if (!new_ctb || pktlen != 20)
+ {
+ log_error("mdc_packet with invalid encoding\n");
+ rc = gpg_error (GPG_ERR_INV_PACKET);
+ goto leave;
+ }
+ p = mdc->hash;
+ for (; pktlen; pktlen--, p++)
+ *p = iobuf_get_noeof(inp);
+
+ leave:
+ return rc;
}
@@ -2448,14 +2461,16 @@ parse_mdc( IOBUF inp, int pkttype, unsigned long pktlen,
*/
static int
-parse_gpg_control( IOBUF inp, int pkttype,
- unsigned long pktlen, PACKET *packet, int partial )
+parse_gpg_control (IOBUF inp, int pkttype, unsigned long pktlen,
+ PACKET *packet, int partial)
{
byte *p;
const byte *sesmark;
size_t sesmarklen;
int i;
+ (void)pkttype;
+
if ( list_mode )
fprintf (listfp, ":packet 63: length %lu ", pktlen);
diff --git a/g10/passphrase.c b/g10/passphrase.c
index 8703580dc..15129661f 100644
--- a/g10/passphrase.c
+++ b/g10/passphrase.c
@@ -398,6 +398,8 @@ void
passphrase_clear_cache ( u32 *keyid, const char *cacheid, int algo )
{
int rc;
+
+ (void)algo;
if (!cacheid)
{
@@ -441,6 +443,8 @@ ask_passphrase (const char *description,
const char *cacheid, int *canceled)
{
char *pw = NULL;
+
+ (void)promptid;
if (canceled)
*canceled = 0;
diff --git a/g10/server.c b/g10/server.c
index 6ca7dfa8b..d0e801bd5 100644
--- a/g10/server.c
+++ b/g10/server.c
@@ -69,6 +69,9 @@ option_handler (assuan_context_t ctx, const char *key, const char *value)
{
/* ctrl_t ctrl = assuan_get_pointer (ctx); */
+ (void)ctx;
+ (void)value;
+
/* Fixme: Implement the tty and locale args. */
if (!strcmp (key, "display"))
{
@@ -120,6 +123,8 @@ input_notify (assuan_context_t ctx, const char *line)
{
/* ctrl_t ctrl = assuan_get_pointer (ctx); */
+ (void)ctx;
+
if (strstr (line, "--armor"))
; /* FIXME */
else if (strstr (line, "--base64"))
@@ -127,7 +132,9 @@ input_notify (assuan_context_t ctx, const char *line)
else if (strstr (line, "--binary"))
;
else
- ; /* FIXME (autodetect encoding) */
+ {
+ /* FIXME (autodetect encoding) */
+ }
}
@@ -136,11 +143,15 @@ static void
output_notify (assuan_context_t ctx, const char *line)
{
/* ctrl_t ctrl = assuan_get_pointer (ctx); */
+
+ (void)ctx;
if (strstr (line, "--armor"))
; /* FIXME */
else if (strstr (line, "--base64"))
- ; /* FIXME */
+ {
+ /* FIXME */
+ }
}
@@ -160,6 +171,8 @@ output_notify (assuan_context_t ctx, const char *line)
static int
cmd_recipient (assuan_context_t ctx, char *line)
{
+ (void)ctx;
+ (void)line;
return gpg_error (GPG_ERR_NOT_SUPPORTED);
}
@@ -183,6 +196,8 @@ cmd_recipient (assuan_context_t ctx, char *line)
static int
cmd_signer (assuan_context_t ctx, char *line)
{
+ (void)ctx;
+ (void)line;
return gpg_error (GPG_ERR_NOT_SUPPORTED);
}
@@ -204,6 +219,8 @@ cmd_signer (assuan_context_t ctx, char *line)
static int
cmd_encrypt (assuan_context_t ctx, char *line)
{
+ (void)ctx;
+ (void)line;
return gpg_error (GPG_ERR_NOT_SUPPORTED);
}
@@ -216,6 +233,8 @@ cmd_encrypt (assuan_context_t ctx, char *line)
static int
cmd_decrypt (assuan_context_t ctx, char *line)
{
+ (void)ctx;
+ (void)line;
return gpg_error (GPG_ERR_NOT_SUPPORTED);
}
@@ -239,6 +258,8 @@ cmd_verify (assuan_context_t ctx, char *line)
gnupg_fd_t out_fd = assuan_get_output_fd (ctx);
FILE *out_fp = NULL;
+ (void)line;
+
if (fd == GNUPG_INVALID_FD)
return gpg_error (GPG_ERR_ASS_NO_INPUT);
@@ -278,6 +299,8 @@ cmd_verify (assuan_context_t ctx, char *line)
static int
cmd_sign (assuan_context_t ctx, char *line)
{
+ (void)ctx;
+ (void)line;
return gpg_error (GPG_ERR_NOT_SUPPORTED);
}
@@ -290,6 +313,8 @@ cmd_sign (assuan_context_t ctx, char *line)
static int
cmd_import (assuan_context_t ctx, char *line)
{
+ (void)ctx;
+ (void)line;
return gpg_error (GPG_ERR_NOT_SUPPORTED);
}
@@ -308,6 +333,8 @@ cmd_import (assuan_context_t ctx, char *line)
static int
cmd_export (assuan_context_t ctx, char *line)
{
+ (void)ctx;
+ (void)line;
return gpg_error (GPG_ERR_NOT_SUPPORTED);
}
@@ -320,6 +347,8 @@ cmd_export (assuan_context_t ctx, char *line)
static int
cmd_delkeys (assuan_context_t ctx, char *line)
{
+ (void)ctx;
+ (void)line;
return gpg_error (GPG_ERR_NOT_SUPPORTED);
}
@@ -355,6 +384,10 @@ cmd_message (assuan_context_t ctx, char *line)
static int
do_listkeys (assuan_context_t ctx, char *line, int mode)
{
+ (void)ctx;
+ (void)line;
+ (void)mode;
+
return gpg_error (GPG_ERR_NOT_SUPPORTED);
}
@@ -382,6 +415,8 @@ cmd_listsecretkeys (assuan_context_t ctx, char *line)
static int
cmd_genkey (assuan_context_t ctx, char *line)
{
+ (void)ctx;
+ (void)line;
return gpg_error (GPG_ERR_NOT_SUPPORTED);
}
diff --git a/g10/tdbdump.c b/g10/tdbdump.c
index 5e7b685e2..4c3b888cb 100644
--- a/g10/tdbdump.c
+++ b/g10/tdbdump.c
@@ -67,20 +67,23 @@ write_record( TRUSTREC *rec )
void
list_trustdb( const char *username )
{
- TRUSTREC rec;
-
- 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('-');
- putchar('\n');
- for(recnum=0; !tdbio_read_record( recnum, &rec, 0); recnum++ )
- tdbio_dump_record( &rec, stdout );
+ 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('-');
+ putchar('\n');
+ for(recnum=0; !tdbio_read_record( recnum, &rec, 0); recnum++ )
+ tdbio_dump_record( &rec, stdout );
}
}
diff --git a/g10/trustdb.c b/g10/trustdb.c
index ff218ad80..265b8830d 100644
--- a/g10/trustdb.c
+++ b/g10/trustdb.c
@@ -1213,6 +1213,7 @@ get_validity_counts (PKT_public_key *pk, PKT_user_id *uid)
void
list_trust_path( const char *username )
{
+ (void)username;
}
/****************
@@ -1237,7 +1238,11 @@ int
enum_cert_paths( void **context, ulong *lid,
unsigned *ownertrust, unsigned *validity )
{
- return -1;
+ (void)context;
+ (void)lid;
+ (void)ownertrust;
+ (void)validity;
+ return -1;
}
@@ -1245,10 +1250,13 @@ enum_cert_paths( void **context, ulong *lid,
* Print the current path
*/
void
-enum_cert_paths_print( void **context, FILE *fp,
- int refresh, ulong selected_lid )
+enum_cert_paths_print (void **context, FILE *fp,
+ int refresh, ulong selected_lid)
{
- return;
+ (void)context;
+ (void)fp;
+ (void)refresh;
+ (void)selected_lid;
}
@@ -2006,6 +2014,7 @@ validate_one_keyblock (KBNODE kb, struct key_item *klist,
static int
search_skipfnc (void *opaque, u32 *kid, PKT_user_id *dummy)
{
+ (void)dummy;
return test_key_hash_table ((KeyHashTable)opaque, kid);
}
diff --git a/g10/verify.c b/g10/verify.c
index 702547ea2..484fd9c76 100644
--- a/g10/verify.c
+++ b/g10/verify.c
@@ -238,6 +238,9 @@ gpg_verify (ctrl_t ctrl, int sig_fd, int data_fd, FILE *out_fp)
armor_filter_context_t *afx = NULL;
progress_filter_context_t *pfx = new_progress_context ();
+ (void)ctrl;
+ (void)out_fp;
+
fp = iobuf_fdopen (sig_fd, "rb");
if (fp && is_secured_file (sig_fd))
{