1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-09-21 15:01:41 +02:00

Removed some set but unused vars.

This commit is contained in:
Werner Koch 2011-08-09 10:54:22 +02:00
parent 0ad1458f82
commit a95143e225
14 changed files with 132 additions and 119 deletions

View File

@ -1,3 +1,11 @@
2011-08-09 Werner Koch <wk@g10code.com>
* rijndael.c (u32_a_t): New.
(do_encrypt_aligned, do_decrypt): Use the new type to avoid
problems with strict aliasing rules.
* dynload.c (register_cipher_extension): Remove unused var.
2010-10-18 Werner Koch <wk@g10code.com> 2010-10-18 Werner Koch <wk@g10code.com>
* rndw32.c (slow_gatherer_windowsNT): Add GNUPG_RNDW32_NOPERF envvar. * rndw32.c (slow_gatherer_windowsNT): Add GNUPG_RNDW32_NOPERF envvar.
@ -153,7 +161,7 @@
2005-03-23 Werner Koch <wk@g10code.com> 2005-03-23 Werner Koch <wk@g10code.com>
* rndw32.c (rndw32_gather_random_fast): While adding data use the * rndw32.c (rndw32_gather_random_fast): While adding data use the
size of the object and not the one of its address. Bug reported by size of the object and not the one of its address. Bug reported by
Sascha Kiefer. Sascha Kiefer.
2005-03-07 Werner Koch <wk@g10code.com> 2005-03-07 Werner Koch <wk@g10code.com>
@ -170,7 +178,7 @@
* idea-stub.c (dlopen, dlsym): Use w32_strerror instead of * idea-stub.c (dlopen, dlsym): Use w32_strerror instead of
just showing the error number. just showing the error number.
2004-10-14 Werner Koch <wk@g10code.com> 2004-10-14 Werner Koch <wk@g10code.com>
* rndunix.c (start_gatherer) [ENABLE_SELINUX_HACKS]: Don't allow * rndunix.c (start_gatherer) [ENABLE_SELINUX_HACKS]: Don't allow
@ -418,7 +426,7 @@
* blowfish.h, cast5.h, des.h: Removed after moving all prototypes to * blowfish.h, cast5.h, des.h: Removed after moving all prototypes to
* algorithms.h: here. Changed all sources to use this one. * algorithms.h: here. Changed all sources to use this one.
2002-08-03 Stefan Bellon <sbellon@sbellon.de> 2002-08-03 Stefan Bellon <sbellon@sbellon.de>
* idea-stub.c (idea_get_info): RISC OS' Norcroft C needs a cast. * idea-stub.c (idea_get_info): RISC OS' Norcroft C needs a cast.
@ -433,7 +441,7 @@
2002-08-02 Werner Koch <wk@gnupg.org> 2002-08-02 Werner Koch <wk@gnupg.org>
The big extension removal. The big extension removal.
* Makefile.am: Removed all extension stuff. * Makefile.am: Removed all extension stuff.
* dynload.c: Removed everything except for * dynload.c: Removed everything except for
register_cipher_extension. register_cipher_extension.
@ -453,7 +461,7 @@
(load_digest_module): Simplified by removing all the dynload code. (load_digest_module): Simplified by removing all the dynload code.
* algorithms.h: New. * algorithms.h: New.
* md5.c (md5_get_info): Made global. Removed all dynload stuff. * md5.c (md5_get_info): Made global. Removed all dynload stuff.
* rmd160.c (rmd160_get_info): Likewise. * rmd160.c (rmd160_get_info): Likewise.
* sha1.c (sha1_get_info): Likewise. * sha1.c (sha1_get_info): Likewise.
* tiger.c (tiger_get_info): Likewise. Return NULL if we can't use * tiger.c (tiger_get_info): Likewise. Return NULL if we can't use
this module. this module.
@ -572,7 +580,7 @@
RISC OS. Nearly all of these patches are identified by the RISC OS. Nearly all of these patches are identified by the
__riscos__ macro. __riscos__ macro.
* blowfish.c, twofish.c: Added pragmas for use with a Norcraft * blowfish.c, twofish.c: Added pragmas for use with a Norcraft
compiler. compiler.
* dynload.c, md5.c, rmd160.c, sha1.c: Minor patches for RISC OS. * dynload.c, md5.c, rmd160.c, sha1.c: Minor patches for RISC OS.
* rndriscos.c: New. * rndriscos.c: New.
* rnd-internal.h: Added prototype. * rnd-internal.h: Added prototype.
@ -595,7 +603,7 @@
* rndlinux.c (gather_random): casted a size_t arg to int so that * rndlinux.c (gather_random): casted a size_t arg to int so that
the format string is correct. Casting is okay here and avoids the format string is correct. Casting is okay here and avoids
translation changes. translation changes.
2001-06-12 Werner Koch <wk@gnupg.org> 2001-06-12 Werner Koch <wk@gnupg.org>
@ -635,7 +643,7 @@
* md5.c, sha1.c, rmd160.c, tiger.c (burn_stack): Likewise. * md5.c, sha1.c, rmd160.c, tiger.c (burn_stack): Likewise.
* random.c (burn_stack): New. * random.c (burn_stack): New.
(mix_pool): Use it here to burn the stack of the mixblock function. (mix_pool): Use it here to burn the stack of the mixblock function.
2001-04-02 Werner Koch <wk@gnupg.org> 2001-04-02 Werner Koch <wk@gnupg.org>
* primegen.c (generate_elg_prime): I was not initialized for mode * primegen.c (generate_elg_prime): I was not initialized for mode

View File

@ -34,8 +34,8 @@ typedef struct ext_list {
static EXTLIST extensions; static EXTLIST extensions;
/* This is actually not used anymore but we keep a list of already /* This is actually not used anymore but we keep a list of already
* set extensions modules here. * set extensions modules here.
* *
* Here is the ancient comment: * Here is the ancient comment:
* Register an extension module. The last registered module will * Register an extension module. The last registered module will
@ -53,7 +53,7 @@ static EXTLIST extensions;
void void
register_cipher_extension( const char *mainpgm, const char *fname ) register_cipher_extension( const char *mainpgm, const char *fname )
{ {
EXTLIST r, el, intex; EXTLIST r, el;
char *p, *pe; char *p, *pe;
if( *fname != DIRSEP_C ) { /* do tilde expansion etc */ if( *fname != DIRSEP_C ) { /* do tilde expansion etc */
@ -76,7 +76,6 @@ register_cipher_extension( const char *mainpgm, const char *fname )
*p = *pe = 0; *p = *pe = 0;
/* check that it is not already registered */ /* check that it is not already registered */
intex = NULL;
for(r = extensions; r; r = r->next ) { for(r = extensions; r; r = r->next ) {
if( !compare_filenames(r->name, el->name) ) { if( !compare_filenames(r->name, el->name) ) {
log_info("extension `%s' already registered\n", el->name ); log_info("extension `%s' already registered\n", el->name );

View File

@ -1,5 +1,11 @@
2011-08-09 Werner Koch <wk@g10code.com> 2011-08-09 Werner Koch <wk@g10code.com>
* keyedit.c (show_key_with_all_names): Remove unused var.
* apdu.c (open_pcsc_reader_direct): Remove unused var.
* sig-check.c (do_check): Remove unused var.
* keygen.c (ask_user_id): Fix loop break condition. See bug#1307. * keygen.c (ask_user_id): Fix loop break condition. See bug#1307.
* import.c (import_keys_internal): Make breaking the loop more * import.c (import_keys_internal): Make breaking the loop more

View File

@ -343,7 +343,7 @@ new_reader_slot (void)
reader_table[reader].dump_status_reader = NULL; reader_table[reader].dump_status_reader = NULL;
reader_table[reader].set_progress_cb = NULL; reader_table[reader].set_progress_cb = NULL;
reader_table[reader].used = 1; reader_table[reader].used = 1;
reader_table[reader].any_status = 0; reader_table[reader].any_status = 0;
reader_table[reader].last_status = 0; reader_table[reader].last_status = 0;
reader_table[reader].is_t0 = 1; reader_table[reader].is_t0 = 1;
@ -394,8 +394,8 @@ host_sw_string (long err)
case SW_HOST_GENERAL_ERROR: return "general error"; case SW_HOST_GENERAL_ERROR: return "general error";
case SW_HOST_NO_READER: return "no reader"; case SW_HOST_NO_READER: return "no reader";
case SW_HOST_ABORTED: return "aborted"; case SW_HOST_ABORTED: return "aborted";
case SW_HOST_NO_KEYPAD: return "no keypad"; case SW_HOST_NO_KEYPAD: return "no keypad";
case SW_HOST_ALREADY_CONNECTED: return "already connected"; case SW_HOST_ALREADY_CONNECTED: return "already connected";
default: return "unknown host status error"; default: return "unknown host status error";
} }
} }
@ -771,7 +771,7 @@ pcsc_error_to_sw (long ec)
case PCSC_E_INVALID_TARGET: case PCSC_E_INVALID_TARGET:
case PCSC_E_INVALID_VALUE: case PCSC_E_INVALID_VALUE:
case PCSC_E_INVALID_HANDLE: case PCSC_E_INVALID_HANDLE:
case PCSC_E_INVALID_PARAMETER: case PCSC_E_INVALID_PARAMETER:
case PCSC_E_INSUFFICIENT_BUFFER: rc = SW_HOST_INV_VALUE; break; case PCSC_E_INSUFFICIENT_BUFFER: rc = SW_HOST_INV_VALUE; break;
@ -985,7 +985,7 @@ pcsc_get_status (int slot, unsigned int *status)
#ifndef NEED_PCSC_WRAPPER #ifndef NEED_PCSC_WRAPPER
static int static int
pcsc_send_apdu_direct (int slot, unsigned char *apdu, size_t apdulen, pcsc_send_apdu_direct (int slot, unsigned char *apdu, size_t apdulen,
unsigned char *buffer, size_t *buflen, unsigned char *buffer, size_t *buflen,
struct pininfo_s *pininfo) struct pininfo_s *pininfo)
{ {
long err; long err;
@ -1021,7 +1021,7 @@ pcsc_send_apdu_direct (int slot, unsigned char *apdu, size_t apdulen,
#ifdef NEED_PCSC_WRAPPER #ifdef NEED_PCSC_WRAPPER
static int static int
pcsc_send_apdu_wrapped (int slot, unsigned char *apdu, size_t apdulen, pcsc_send_apdu_wrapped (int slot, unsigned char *apdu, size_t apdulen,
unsigned char *buffer, size_t *buflen, unsigned char *buffer, size_t *buflen,
struct pininfo_s *pininfo) struct pininfo_s *pininfo)
{ {
long err; long err;
@ -1140,7 +1140,7 @@ pcsc_send_apdu_wrapped (int slot, unsigned char *apdu, size_t apdulen,
BUFLEN. Returns: A status word. */ BUFLEN. Returns: A status word. */
static int static int
pcsc_send_apdu (int slot, unsigned char *apdu, size_t apdulen, pcsc_send_apdu (int slot, unsigned char *apdu, size_t apdulen,
unsigned char *buffer, size_t *buflen, unsigned char *buffer, size_t *buflen,
struct pininfo_s *pininfo) struct pininfo_s *pininfo)
{ {
#ifdef NEED_PCSC_WRAPPER #ifdef NEED_PCSC_WRAPPER
@ -1269,7 +1269,7 @@ connect_pcsc_card (int slot)
if (err) if (err)
{ {
reader_table[slot].pcsc.card = 0; reader_table[slot].pcsc.card = 0;
if (err != PCSC_E_NO_SMARTCARD) if (err != PCSC_E_NO_SMARTCARD)
log_error ("pcsc_connect failed: %s (0x%lx)\n", log_error ("pcsc_connect failed: %s (0x%lx)\n",
pcsc_error_string (err), err); pcsc_error_string (err), err);
} }
@ -1319,7 +1319,7 @@ disconnect_pcsc_card (int slot)
assert (slot >= 0 && slot < MAX_READER); assert (slot >= 0 && slot < MAX_READER);
if (!reader_table[slot].pcsc.card) if (!reader_table[slot].pcsc.card)
return 0; return 0;
err = pcsc_disconnect (reader_table[slot].pcsc.card, PCSC_LEAVE_CARD); err = pcsc_disconnect (reader_table[slot].pcsc.card, PCSC_LEAVE_CARD);
if (err) if (err)
@ -1473,7 +1473,7 @@ open_pcsc_reader_direct (const char *portstr)
long err; long err;
int slot; int slot;
char *list = NULL; char *list = NULL;
unsigned long nreader, listlen; unsigned long nreader;
char *p; char *p;
slot = new_reader_slot (); slot = new_reader_slot ();
@ -1517,7 +1517,6 @@ open_pcsc_reader_direct (const char *portstr)
return -1; return -1;
} }
listlen = nreader;
p = list; p = list;
while (nreader) while (nreader)
{ {
@ -2606,7 +2605,7 @@ apdu_connect (int slot)
} }
else else
sw = 0; sw = 0;
/* We need to call apdu_get_status_internal, so that the last-status /* We need to call apdu_get_status_internal, so that the last-status
machinery gets setup properly even if a card is inserted while machinery gets setup properly even if a card is inserted while
scdaemon is fired up and apdu_get_status has not yet been called. scdaemon is fired up and apdu_get_status has not yet been called.
@ -2864,7 +2863,7 @@ send_apdu (int slot, unsigned char *apdu, size_t apdulen,
if (reader_table[slot].send_apdu_reader) if (reader_table[slot].send_apdu_reader)
return reader_table[slot].send_apdu_reader (slot, return reader_table[slot].send_apdu_reader (slot,
apdu, apdulen, apdu, apdulen,
buffer, buflen, buffer, buflen,
pininfo); pininfo);
else else
return SW_HOST_NOT_SUPPORTED; return SW_HOST_NOT_SUPPORTED;
@ -2892,7 +2891,7 @@ send_le (int slot, int class, int ins, int p0, int p1,
{ {
#define SHORT_RESULT_BUFFER_SIZE 258 #define SHORT_RESULT_BUFFER_SIZE 258
/* We allocate 8 extra bytes as a safety margin towards a driver bug. */ /* We allocate 8 extra bytes as a safety margin towards a driver bug. */
unsigned char short_result_buffer[SHORT_RESULT_BUFFER_SIZE+10]; unsigned char short_result_buffer[SHORT_RESULT_BUFFER_SIZE+10];
unsigned char *result_buffer = NULL; unsigned char *result_buffer = NULL;
size_t result_buffer_size; size_t result_buffer_size;
unsigned char *result; unsigned char *result;
@ -2930,16 +2929,16 @@ send_le (int slot, int class, int ins, int p0, int p1,
if (lc > 16384) if (lc > 16384)
return SW_WRONG_LENGTH; /* Sanity check. */ return SW_WRONG_LENGTH; /* Sanity check. */
if ((class&0xf0) != 0) if ((class&0xf0) != 0)
return SW_HOST_INV_VALUE; /* Upper 4 bits need to be 0. */ return SW_HOST_INV_VALUE; /* Upper 4 bits need to be 0. */
use_chaining = extended_mode == -1? 255 : -extended_mode; use_chaining = extended_mode == -1? 255 : -extended_mode;
use_chaining &= 0xff; use_chaining &= 0xff;
} }
else else
return SW_HOST_INV_VALUE; return SW_HOST_INV_VALUE;
} }
else if (lc == -1 && extended_mode > 0) else if (lc == -1 && extended_mode > 0)
use_extended_length = 1; use_extended_length = 1;
if (le != -1 && (le > (extended_mode > 0? 255:256) || le < 0)) if (le != -1 && (le > (extended_mode > 0? 255:256) || le < 0))
{ {
/* Expected Data does not fit into an APDU. What we do now /* Expected Data does not fit into an APDU. What we do now
@ -2952,7 +2951,7 @@ send_le (int slot, int class, int ins, int p0, int p1,
; /* We are already using extended length. */ ; /* We are already using extended length. */
else if (extended_mode > 0) else if (extended_mode > 0)
use_extended_length = 1; use_extended_length = 1;
else else
return SW_HOST_INV_VALUE; return SW_HOST_INV_VALUE;
} }
@ -3023,8 +3022,8 @@ send_le (int slot, int class, int ins, int p0, int p1,
} }
if (le != -1) if (le != -1)
{ {
apdu[apdulen++] = ((le >> 8) & 0xff); apdu[apdulen++] = ((le >> 8) & 0xff);
apdu[apdulen++] = (le & 0xff); apdu[apdulen++] = (le & 0xff);
} }
} }
else else
@ -3078,7 +3077,7 @@ send_le (int slot, int class, int ins, int p0, int p1,
return rc? rc : SW_HOST_INCOMPLETE_CARD_RESPONSE; return rc? rc : SW_HOST_INCOMPLETE_CARD_RESPONSE;
} }
sw = (result[resultlen-2] << 8) | result[resultlen-1]; sw = (result[resultlen-2] << 8) | result[resultlen-1];
if (!use_extended_length if (!use_extended_length
&& !did_exact_length_hack && SW_EXACT_LENGTH_P (sw)) && !did_exact_length_hack && SW_EXACT_LENGTH_P (sw))
{ {
apdu[apdulen-1] = (sw & 0x00ff); apdu[apdulen-1] = (sw & 0x00ff);
@ -3094,7 +3093,7 @@ send_le (int slot, int class, int ins, int p0, int p1,
apdu_buffer = NULL; apdu_buffer = NULL;
apdu_buffer_size = 0; apdu_buffer_size = 0;
} }
/* Store away the returned data but strip the statusword. */ /* Store away the returned data but strip the statusword. */
resultlen -= 2; resultlen -= 2;
if (DBG_CARD_IO) if (DBG_CARD_IO)
@ -3237,7 +3236,7 @@ send_le (int slot, int class, int ins, int p0, int p1,
that data will be put into *RETBUFLEN. The caller is reponsible that data will be put into *RETBUFLEN. The caller is reponsible
for releasing the buffer even in case of errors. */ for releasing the buffer even in case of errors. */
int int
apdu_send_le(int slot, int extended_mode, apdu_send_le(int slot, int extended_mode,
int class, int ins, int p0, int p1, int class, int ins, int p0, int p1,
int lc, const char *data, int le, int lc, const char *data, int le,
unsigned char **retbuf, size_t *retbuflen) unsigned char **retbuf, size_t *retbuflen)
@ -3280,7 +3279,7 @@ apdu_send_simple (int slot, int extended_mode,
int class, int ins, int p0, int p1, int class, int ins, int p0, int p1,
int lc, const char *data) int lc, const char *data)
{ {
return send_le (slot, class, ins, p0, p1, lc, data, -1, NULL, NULL, NULL, return send_le (slot, class, ins, p0, p1, lc, data, -1, NULL, NULL, NULL,
extended_mode); extended_mode);
} }
@ -3288,7 +3287,7 @@ apdu_send_simple (int slot, int extended_mode,
/* Same as apdu_send_simple but uses the keypad of the reader. */ /* Same as apdu_send_simple but uses the keypad of the reader. */
int int
apdu_send_simple_kp (int slot, int class, int ins, int p0, int p1, apdu_send_simple_kp (int slot, int class, int ins, int p0, int p1,
int lc, const char *data, int lc, const char *data,
int pin_mode, int pin_mode,
int pinlen_min, int pinlen_max, int pin_padlen) int pinlen_min, int pinlen_max, int pin_padlen)
{ {
@ -3320,7 +3319,7 @@ apdu_send_direct (int slot, size_t extended_length,
unsigned char **retbuf, size_t *retbuflen) unsigned char **retbuf, size_t *retbuflen)
{ {
#define SHORT_RESULT_BUFFER_SIZE 258 #define SHORT_RESULT_BUFFER_SIZE 258
unsigned char short_result_buffer[SHORT_RESULT_BUFFER_SIZE+10]; unsigned char short_result_buffer[SHORT_RESULT_BUFFER_SIZE+10];
unsigned char *result_buffer = NULL; unsigned char *result_buffer = NULL;
size_t result_buffer_size; size_t result_buffer_size;
unsigned char *result; unsigned char *result;

View File

@ -115,7 +115,7 @@ find_pk_from_sknode (KBNODE pub_keyblock, KBNODE sec_node)
KBNODE node = pub_keyblock; KBNODE node = pub_keyblock;
PKT_secret_key *sk; PKT_secret_key *sk;
PKT_public_key *pk; PKT_public_key *pk;
if (sec_node->pkt->pkttype == PKT_SECRET_KEY if (sec_node->pkt->pkttype == PKT_SECRET_KEY
&& node->pkt->pkttype == PKT_PUBLIC_KEY) && node->pkt->pkttype == PKT_PUBLIC_KEY)
return node->pkt->pkt.public_key; return node->pkt->pkt.public_key;
@ -129,7 +129,7 @@ find_pk_from_sknode (KBNODE pub_keyblock, KBNODE sec_node)
if (pk->keyid[0] == sk->keyid[0] && pk->keyid[1] == sk->keyid[1]) if (pk->keyid[0] == sk->keyid[0] && pk->keyid[1] == sk->keyid[1])
return pk; return pk;
} }
return NULL; return NULL;
} }
#endif /* ENABLE_CARD_SUPPORT */ #endif /* ENABLE_CARD_SUPPORT */
@ -528,7 +528,7 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified,
} }
/* build a list of all signators. /* build a list of all signators.
* *
* We use the CERT flag to request the primary which must always * 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 * 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 * why to sign keys using a subkey. Implementation of USAGE_CERT
@ -705,7 +705,7 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified,
{ {
tty_printf(_("The self-signature on \"%s\"\n" tty_printf(_("The self-signature on \"%s\"\n"
"is a PGP 2.x-style signature.\n"),user); "is a PGP 2.x-style signature.\n"),user);
/* Note that the regular PGP2 warning below /* Note that the regular PGP2 warning below
still applies if there are no v4 sigs on still applies if there are no v4 sigs on
this key at all. */ this key at all. */
@ -1109,11 +1109,11 @@ change_passphrase( KBNODE keyblock )
sk = node->pkt->pkt.secret_key; sk = node->pkt->pkt.secret_key;
for (any = 0, node=keyblock; node; node = node->next) { for (any = 0, node=keyblock; node; node = node->next) {
if (node->pkt->pkttype == PKT_SECRET_KEY if (node->pkt->pkttype == PKT_SECRET_KEY
|| node->pkt->pkttype == PKT_SECRET_SUBKEY) { || node->pkt->pkttype == PKT_SECRET_SUBKEY) {
PKT_secret_key *tmpsk = node->pkt->pkt.secret_key; PKT_secret_key *tmpsk = node->pkt->pkt.secret_key;
if (!(tmpsk->is_protected if (!(tmpsk->is_protected
&& (tmpsk->protect.s2k.mode == 1001 && (tmpsk->protect.s2k.mode == 1001
|| tmpsk->protect.s2k.mode == 1002))) { || tmpsk->protect.s2k.mode == 1002))) {
any = 1; any = 1;
break; break;
@ -1125,7 +1125,7 @@ change_passphrase( KBNODE keyblock )
"no passphrase to change.\n")); "no passphrase to change.\n"));
goto leave; goto leave;
} }
/* See how to handle this key. */ /* See how to handle this key. */
switch( is_secret_key_protected( sk ) ) { switch( is_secret_key_protected( sk ) ) {
case -1: case -1:
@ -1157,7 +1157,7 @@ change_passphrase( KBNODE keyblock )
if( node->pkt->pkttype == PKT_SECRET_SUBKEY ) { if( node->pkt->pkttype == PKT_SECRET_SUBKEY ) {
PKT_secret_key *subsk = node->pkt->pkt.secret_key; PKT_secret_key *subsk = node->pkt->pkt.secret_key;
if ( !(subsk->is_protected if ( !(subsk->is_protected
&& (subsk->protect.s2k.mode == 1001 && (subsk->protect.s2k.mode == 1001
|| subsk->protect.s2k.mode == 1002))) { || subsk->protect.s2k.mode == 1002))) {
set_next_passphrase( passphrase ); set_next_passphrase( passphrase );
rc = check_secret_key( subsk, 0 ); rc = check_secret_key( subsk, 0 );
@ -1208,7 +1208,7 @@ change_passphrase( KBNODE keyblock )
if( node->pkt->pkttype == PKT_SECRET_SUBKEY ) { if( node->pkt->pkttype == PKT_SECRET_SUBKEY ) {
PKT_secret_key *subsk = node->pkt->pkt.secret_key; PKT_secret_key *subsk = node->pkt->pkt.secret_key;
if ( !(subsk->is_protected if ( !(subsk->is_protected
&& (subsk->protect.s2k.mode == 1001 && (subsk->protect.s2k.mode == 1001
|| subsk->protect.s2k.mode == 1002))) { || subsk->protect.s2k.mode == 1002))) {
subsk->protect.algo = dek->algo; subsk->protect.algo = dek->algo;
subsk->protect.s2k = *s2k; subsk->protect.s2k = *s2k;
@ -1345,7 +1345,7 @@ static struct
int flags; int flags;
const char *desc; const char *desc;
} cmds[] = } cmds[] =
{ {
{ "quit" , cmdQUIT , 0, N_("quit this menu") }, { "quit" , cmdQUIT , 0, N_("quit this menu") },
{ "q" , cmdQUIT , 0, NULL }, { "q" , cmdQUIT , 0, NULL },
{ "save" , cmdSAVE , 0, N_("save and quit") }, { "save" , cmdSAVE , 0, N_("save and quit") },
@ -1388,9 +1388,9 @@ static struct
#ifdef ENABLE_CARD_SUPPORT #ifdef ENABLE_CARD_SUPPORT
{ "addcardkey", cmdADDCARDKEY , KEYEDIT_NOT_SK|KEYEDIT_NEED_SK, { "addcardkey", cmdADDCARDKEY , KEYEDIT_NOT_SK|KEYEDIT_NEED_SK,
N_("add a key to a smartcard") }, N_("add a key to a smartcard") },
{ "keytocard", cmdKEYTOCARD , KEYEDIT_NEED_SK|KEYEDIT_ONLY_SK, { "keytocard", cmdKEYTOCARD , KEYEDIT_NEED_SK|KEYEDIT_ONLY_SK,
N_("move a key to a smartcard")}, N_("move a key to a smartcard")},
{ "bkuptocard", cmdBKUPTOCARD , KEYEDIT_NEED_SK|KEYEDIT_ONLY_SK, { "bkuptocard", cmdBKUPTOCARD , KEYEDIT_NEED_SK|KEYEDIT_ONLY_SK,
N_("move a backup key to a smartcard")}, N_("move a backup key to a smartcard")},
#endif /*ENABLE_CARD_SUPPORT*/ #endif /*ENABLE_CARD_SUPPORT*/
@ -1554,7 +1554,7 @@ keyedit_menu( const char *username, STRLIST locusr,
size_t an; size_t an;
fingerprint_from_pk (pk, afp, &an); fingerprint_from_pk (pk, afp, &an);
while (an < MAX_FINGERPRINT_LEN) while (an < MAX_FINGERPRINT_LEN)
afp[an++] = 0; afp[an++] = 0;
rc = keydb_search_fpr (sec_kdbhd, afp); rc = keydb_search_fpr (sec_kdbhd, afp);
} }
@ -1870,7 +1870,7 @@ keyedit_menu( const char *username, STRLIST locusr,
case 1: case 1:
for (node = sec_keyblock; node; node = node->next ) for (node = sec_keyblock; node; node = node->next )
{ {
if (node->pkt->pkttype == PKT_SECRET_SUBKEY if (node->pkt->pkttype == PKT_SECRET_SUBKEY
&& node->flag & NODFLG_SELKEY) && node->flag & NODFLG_SELKEY)
break; break;
} }
@ -1922,15 +1922,15 @@ keyedit_menu( const char *username, STRLIST locusr,
fname, strerror(errno)); fname, strerror(errno));
break; break;
} }
/* Parse and check that file. */ /* Parse and check that file. */
pkt = xmalloc (sizeof *pkt); pkt = xmalloc (sizeof *pkt);
init_packet (pkt); init_packet (pkt);
rc = parse_packet (a, pkt); rc = parse_packet (a, pkt);
iobuf_close (a); iobuf_close (a);
iobuf_ioctl (NULL, 2, 0, (char*)fname); /* (invalidate cache). */ iobuf_ioctl (NULL, 2, 0, (char*)fname); /* (invalidate cache). */
if (!rc if (!rc
&& pkt->pkttype != PKT_SECRET_KEY && pkt->pkttype != PKT_SECRET_KEY
&& pkt->pkttype != PKT_SECRET_SUBKEY) && pkt->pkttype != PKT_SECRET_SUBKEY)
rc = G10ERR_NO_SECKEY; rc = G10ERR_NO_SECKEY;
if (rc) if (rc)
@ -2309,7 +2309,7 @@ show_prefs (PKT_user_id *uid, PKT_signature *selfsig, int verbose)
for(i=any=0; prefs[i].type; i++ ) { for(i=any=0; prefs[i].type; i++ ) {
if( prefs[i].type == PREFTYPE_SYM ) { if( prefs[i].type == PREFTYPE_SYM ) {
const char *s = cipher_algo_to_string (prefs[i].value); const char *s = cipher_algo_to_string (prefs[i].value);
if (any) if (any)
tty_printf (", "); tty_printf (", ");
any = 1; any = 1;
@ -2320,7 +2320,7 @@ show_prefs (PKT_user_id *uid, PKT_signature *selfsig, int verbose)
tty_printf ("[%d]", prefs[i].value); tty_printf ("[%d]", prefs[i].value);
if (prefs[i].value == CIPHER_ALGO_3DES ) if (prefs[i].value == CIPHER_ALGO_3DES )
des_seen = 1; des_seen = 1;
} }
} }
if (!des_seen) { if (!des_seen) {
if (any) if (any)
@ -2332,7 +2332,7 @@ show_prefs (PKT_user_id *uid, PKT_signature *selfsig, int verbose)
for(i=any=0; prefs[i].type; i++ ) { for(i=any=0; prefs[i].type; i++ ) {
if( prefs[i].type == PREFTYPE_HASH ) { if( prefs[i].type == PREFTYPE_HASH ) {
const char *s = digest_algo_to_string (prefs[i].value); const char *s = digest_algo_to_string (prefs[i].value);
if (any) if (any)
tty_printf (", "); tty_printf (", ");
any = 1; any = 1;
@ -2355,7 +2355,7 @@ show_prefs (PKT_user_id *uid, PKT_signature *selfsig, int verbose)
for(i=any=0; prefs[i].type; i++ ) { for(i=any=0; prefs[i].type; i++ ) {
if( prefs[i].type == PREFTYPE_ZIP ) { if( prefs[i].type == PREFTYPE_ZIP ) {
const char *s=compress_algo_to_string(prefs[i].value); const char *s=compress_algo_to_string(prefs[i].value);
if (any) if (any)
tty_printf (", "); tty_printf (", ");
any = 1; any = 1;
@ -2489,15 +2489,15 @@ show_key_with_all_names_colon (KBNODE keyblock)
putchar(get_ownertrust_info (pk)); putchar(get_ownertrust_info (pk));
putchar(':'); putchar(':');
putchar('\n'); putchar('\n');
print_fingerprint (pk, NULL, 0); print_fingerprint (pk, NULL, 0);
print_revokers(pk); print_revokers(pk);
} }
} }
/* the user ids */ /* the user ids */
i = 0; i = 0;
for (node = keyblock; node; node = node->next) for (node = keyblock; node; node = node->next)
{ {
if ( node->pkt->pkttype == PKT_USER_ID ) if ( node->pkt->pkttype == PKT_USER_ID )
{ {
@ -2541,7 +2541,7 @@ show_key_with_all_names_colon (KBNODE keyblock)
if (pk_version>3 || uid->selfsigversion>3) if (pk_version>3 || uid->selfsigversion>3)
{ {
const prefitem_t *prefs = uid->prefs; const prefitem_t *prefs = uid->prefs;
for (j=0; prefs && prefs[j].type; j++) for (j=0; prefs && prefs[j].type; j++)
{ {
if (j) if (j)
@ -2550,12 +2550,12 @@ show_key_with_all_names_colon (KBNODE keyblock)
prefs[j].type == PREFTYPE_HASH ? 'H' : prefs[j].type == PREFTYPE_HASH ? 'H' :
prefs[j].type == PREFTYPE_ZIP ? 'Z':'?', prefs[j].type == PREFTYPE_ZIP ? 'Z':'?',
prefs[j].value); prefs[j].value);
} }
if (uid->flags.mdc) if (uid->flags.mdc)
printf (",mdc"); printf (",mdc");
if (!uid->flags.ks_modify) if (!uid->flags.ks_modify)
printf (",no-ks-modify"); printf (",no-ks-modify");
} }
putchar (':'); putchar (':');
/* flags */ /* flags */
printf ("%d,", i); printf ("%d,", i);
@ -2644,7 +2644,6 @@ show_key_with_all_names( KBNODE keyblock, int only_marked, int with_revoker,
KBNODE node; KBNODE node;
int i; int i;
int do_warn = 0; int do_warn = 0;
byte pk_version=0;
PKT_public_key *primary=NULL; PKT_public_key *primary=NULL;
if (opt.with_colons) if (opt.with_colons)
@ -2676,7 +2675,6 @@ show_key_with_all_names( KBNODE keyblock, int only_marked, int with_revoker,
do_warn = 1; do_warn = 1;
} }
pk_version=pk->version;
primary=pk; primary=pk;
} }
@ -2754,7 +2752,7 @@ show_key_with_all_names( KBNODE keyblock, int only_marked, int with_revoker,
tty_printf(_("trust: %s"), otrust); tty_printf(_("trust: %s"), otrust);
tty_printf("%*s",width,""); tty_printf("%*s",width,"");
} }
tty_printf(_("validity: %s"), trust ); tty_printf(_("validity: %s"), trust );
tty_printf("\n"); tty_printf("\n");
} }
@ -2790,7 +2788,7 @@ show_key_with_all_names( KBNODE keyblock, int only_marked, int with_revoker,
if (sk->is_protected && sk->protect.s2k.mode == 1002) if (sk->is_protected && sk->protect.s2k.mode == 1002)
{ {
tty_printf(" "); tty_printf(" ");
tty_printf(_("card-no: ")); tty_printf(_("card-no: "));
if (sk->protect.ivlen == 16 if (sk->protect.ivlen == 16
&& !memcmp (sk->protect.iv, "\xD2\x76\x00\x01\x24\x01", 6)) && !memcmp (sk->protect.iv, "\xD2\x76\x00\x01\x24\x01", 6))
{ /* This is an OpenPGP card. */ { /* This is an OpenPGP card. */
@ -2816,7 +2814,7 @@ show_key_with_all_names( KBNODE keyblock, int only_marked, int with_revoker,
if (do_warn) if (do_warn)
tty_printf (_("Please note that the shown key validity" tty_printf (_("Please note that the shown key validity"
" is not necessarily correct\n" " is not necessarily correct\n"
"unless you restart the program.\n")); "unless you restart the program.\n"));
} }
@ -2836,7 +2834,7 @@ show_basic_key_info ( KBNODE keyblock )
if (node->pkt->pkttype == PKT_PUBLIC_KEY) if (node->pkt->pkttype == PKT_PUBLIC_KEY)
{ {
PKT_public_key *pk = node->pkt->pkt.public_key; PKT_public_key *pk = node->pkt->pkt.public_key;
/* Note, we use the same format string as in other show /* Note, we use the same format string as in other show
functions to make the translation job easier. */ functions to make the translation job easier. */
tty_printf ("%s %4u%c/%s ", tty_printf ("%s %4u%c/%s ",
@ -2875,7 +2873,7 @@ show_basic_key_info ( KBNODE keyblock )
{ {
PKT_user_id *uid = node->pkt->pkt.user_id; PKT_user_id *uid = node->pkt->pkt.user_id;
++i; ++i;
tty_printf (" "); tty_printf (" ");
if (uid->is_revoked) if (uid->is_revoked)
tty_printf("[%s] ",_("revoked")); tty_printf("[%s] ",_("revoked"));
@ -3823,7 +3821,7 @@ change_primary_uid_cb ( PKT_signature *sig, void *opaque )
delete_sig_subpkt (sig->unhashed, SIGSUBPKT_PRIMARY_UID); delete_sig_subpkt (sig->unhashed, SIGSUBPKT_PRIMARY_UID);
/* if opaque is set,we want to set the primary id */ /* if opaque is set,we want to set the primary id */
if (opaque) { if (opaque) {
buf[0] = 1; buf[0] = 1;
build_sig_subpkt (sig, SIGSUBPKT_PRIMARY_UID, buf, 1 ); build_sig_subpkt (sig, SIGSUBPKT_PRIMARY_UID, buf, 1 );
} }
@ -3956,7 +3954,7 @@ menu_set_primary_uid ( KBNODE pub_keyblock, KBNODE sec_keyblock )
} }
/* /*
* Set preferences to new values for the selected user IDs * Set preferences to new values for the selected user IDs
*/ */
static int static int
@ -4007,7 +4005,7 @@ menu_set_preferences (KBNODE pub_keyblock, KBNODE sec_keyblock )
xfree(user); xfree(user);
} }
else { 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 * We have to ignore v3 signatures because they are
* not able to carry the preferences */ * not able to carry the preferences */
PKT_signature *newsig; PKT_signature *newsig;
@ -4037,7 +4035,7 @@ menu_set_preferences (KBNODE pub_keyblock, KBNODE sec_keyblock )
} }
} }
} }
free_secret_key( sk ); free_secret_key( sk );
return modified; return modified;
} }
@ -4684,7 +4682,7 @@ menu_revsig( KBNODE keyblock )
/* First check whether we have any signatures at all. */ /* First check whether we have any signatures at all. */
any = 0; any = 0;
for (node = keyblock; node; node = node->next ) for (node = keyblock; node; node = node->next )
{ {
node->flag &= ~(NODFLG_SELSIG | NODFLG_MARK_A); node->flag &= ~(NODFLG_SELSIG | NODFLG_MARK_A);
if (node->pkt->pkttype == PKT_USER_ID) { if (node->pkt->pkttype == PKT_USER_ID) {

View File

@ -36,7 +36,7 @@
#include "filter.h" #include "filter.h"
#define CONTROL_PACKET_SPACE 30 #define CONTROL_PACKET_SPACE 30
#define FAKED_LITERAL_PACKET_SPACE (9+2+2) #define FAKED_LITERAL_PACKET_SPACE (9+2+2)
@ -73,7 +73,7 @@ make_control ( byte *buf, int code, int operation )
buf[n++] = 0xff; /* new format, type 63, 1 length byte */ buf[n++] = 0xff; /* new format, type 63, 1 length byte */
n++; /* length will fixed below */ n++; /* length will fixed below */
memcpy(buf+n, sesmark, sesmarklen ); n+= sesmarklen; memcpy(buf+n, sesmark, sesmarklen ); n+= sesmarklen;
buf[n++] = CTRLPKT_PIPEMODE; buf[n++] = CTRLPKT_PIPEMODE;
buf[n++] = code; buf[n++] = code;
buf[n++] = operation; buf[n++] = operation;
buf[1] = n-2; buf[1] = n-2;
@ -85,7 +85,7 @@ make_control ( byte *buf, int code, int operation )
static int static int
pipemode_filter( void *opaque, int control, pipemode_filter( void *opaque, int control,
IOBUF a, byte *buf, size_t *ret_len) IOBUF a, byte *buf, size_t *ret_len)
{ {
size_t size = *ret_len; size_t size = *ret_len;
struct pipemode_context_s *stx = opaque; struct pipemode_context_s *stx = opaque;
int rc=0; int rc=0;
@ -104,11 +104,11 @@ pipemode_filter( void *opaque, int control,
buf[n++] = 0; buf[n++] = 0;
buf[n++] = 0; buf[n++] = 0;
} }
while ( n < size ) { while ( n < size ) {
/* FIXME: we have to make sure that we have a large enough /* FIXME: we have to make sure that we have a large enough
* buffer for a control packet even after we already read * buffer for a control packet even after we already read
* something. The easest way to do this is probably by ungetting * something. The easest way to do this is probably by ungetting
* the control sequence and returning the buffer we have * the control sequence and returning the buffer we have
* already assembled */ * already assembled */
@ -123,7 +123,7 @@ pipemode_filter( void *opaque, int control,
} }
if ( esc ) { if ( esc ) {
switch (c) { switch (c) {
case '@': case '@':
if ( stx->state == STX_text ) { if ( stx->state == STX_text ) {
buf[n++] = c; buf[n++] = c;
break; break;
@ -181,7 +181,7 @@ pipemode_filter( void *opaque, int control,
goto leave; goto leave;
case 't': /* plaintext text follows */ case 't': /* plaintext text follows */
if ( stx->state == STX_detached_signature_wait_text ) if ( stx->state == STX_detached_signature_wait_text )
stx->state = STX_detached_signature; stx->state = STX_detached_signature;
if ( stx->state == STX_detached_signature ) { if ( stx->state == STX_detached_signature ) {
if ( stx->operation != 'B' ) { if ( stx->operation != 'B' ) {
@ -215,7 +215,7 @@ pipemode_filter( void *opaque, int control,
break; break;
case '.': /* ready */ case '.': /* ready */
if ( stx->state == STX_signed_data ) { if ( stx->state == STX_signed_data ) {
if (stx->block_mode) { if (stx->block_mode) {
buf[0] = (n-2) >> 8; buf[0] = (n-2) >> 8;
buf[1] = (n-2); buf[1] = (n-2);
@ -236,7 +236,7 @@ pipemode_filter( void *opaque, int control,
stx->state = STX_wait_init; stx->state = STX_wait_init;
goto leave; goto leave;
default: default:
log_error ("invalid escape sequence 0x%02x in stream\n", log_error ("invalid escape sequence 0x%02x in stream\n",
c); c);
stx->stop = 1; stx->stop = 1;
@ -244,7 +244,7 @@ pipemode_filter( void *opaque, int control,
} }
esc = 0; esc = 0;
} }
else if (c == '@') else if (c == '@')
esc = 1; esc = 1;
else if (stx->unarmor_ctx) { else if (stx->unarmor_ctx) {
do_unarmor: /* used to handle a @@ */ do_unarmor: /* used to handle a @@ */
@ -254,7 +254,7 @@ pipemode_filter( void *opaque, int control,
else if ( c < 0 ) { else if ( c < 0 ) {
/* end of armor or error - we don't care becuase /* end of armor or error - we don't care becuase
the armor can be modified anyway. The unarmored the armor can be modified anyway. The unarmored
stuff should stand for itself. */ stuff should stand for itself. */
unarmor_pump_release (stx->unarmor_ctx); unarmor_pump_release (stx->unarmor_ctx);
stx->unarmor_ctx = NULL; stx->unarmor_ctx = NULL;
stx->state = STX_detached_signature_wait_text; stx->state = STX_detached_signature_wait_text;
@ -263,10 +263,10 @@ pipemode_filter( void *opaque, int control,
else if (stx->state == STX_detached_signature_wait_text) else if (stx->state == STX_detached_signature_wait_text)
; /* just wait */ ; /* just wait */
else else
buf[n++] = c; buf[n++] = c;
} }
leave: leave:
if ( !n ) { if ( !n ) {
stx->stop = 1; stx->stop = 1;
rc = -1; /* eof */ rc = -1; /* eof */
@ -293,7 +293,6 @@ run_in_pipemode(void)
IOBUF fp; IOBUF fp;
armor_filter_context_t afx; armor_filter_context_t afx;
struct pipemode_context_s stx; struct pipemode_context_s stx;
int rc;
memset( &afx, 0, sizeof afx); memset( &afx, 0, sizeof afx);
memset( &stx, 0, sizeof stx); memset( &stx, 0, sizeof stx);
@ -303,10 +302,10 @@ run_in_pipemode(void)
do { do {
write_status (STATUS_BEGIN_STREAM); write_status (STATUS_BEGIN_STREAM);
rc = proc_packets( NULL, fp ); proc_packets( NULL, fp );
write_status (STATUS_END_STREAM); write_status (STATUS_END_STREAM);
} while ( !stx.stop ); } while ( !stx.stop );
} }

View File

@ -54,7 +54,7 @@ signature_check( PKT_signature *sig, MD_HANDLE digest )
} }
int int
signature_check2( PKT_signature *sig, MD_HANDLE digest, u32 *r_expiredate, signature_check2( PKT_signature *sig, MD_HANDLE digest, u32 *r_expiredate,
int *r_expired, int *r_revoked, PKT_public_key *ret_pk ) int *r_expired, int *r_revoked, PKT_public_key *ret_pk )
{ {
PKT_public_key *pk = xmalloc_clear( sizeof *pk ); PKT_public_key *pk = xmalloc_clear( sizeof *pk );
@ -239,7 +239,6 @@ do_check( PKT_public_key *pk, PKT_signature *sig, MD_HANDLE digest,
{ {
MPI result = NULL; MPI result = NULL;
int rc=0; int rc=0;
struct cmp_help_context_s ctx;
if( (rc=do_check_messages(pk,sig,r_expired,r_revoked)) ) if( (rc=do_check_messages(pk,sig,r_expired,r_revoked)) )
return rc; return rc;
@ -291,8 +290,6 @@ do_check( PKT_public_key *pk, PKT_signature *sig, MD_HANDLE digest,
result = encode_md_value( pk, NULL, digest, sig->digest_algo ); result = encode_md_value( pk, NULL, digest, sig->digest_algo );
if (!result) if (!result)
return G10ERR_GENERAL; return G10ERR_GENERAL;
ctx.sig = sig;
ctx.md = digest;
rc = pubkey_verify( pk->pubkey_algo, result, sig->data, pk->pkey ); rc = pubkey_verify( pk->pubkey_algo, result, sig->data, pk->pkey );
mpi_free( result ); mpi_free( result );
@ -326,7 +323,7 @@ do_check( PKT_public_key *pk, PKT_signature *sig, MD_HANDLE digest,
warning during signature checking. Note that while validating warning during signature checking. Note that while validating
a key we might have already checked MD5 key signatures. */ a key we might have already checked MD5 key signatures. */
if (sig->digest_algo == DIGEST_ALGO_MD5) if (sig->digest_algo == DIGEST_ALGO_MD5)
md5_digest_warn (0); md5_digest_warn (0);
if( !rc && sig->flags.unknown_critical ) if( !rc && sig->flags.unknown_critical )
{ {
@ -438,13 +435,13 @@ check_revocation_keys(PKT_public_key *pk,PKT_signature *sig)
for(i=0;i<pk->numrevkeys;i++) for(i=0;i<pk->numrevkeys;i++)
{ {
u32 keyid[2]; u32 keyid[2];
keyid_from_fingerprint(pk->revkey[i].fpr,MAX_FINGERPRINT_LEN,keyid); keyid_from_fingerprint(pk->revkey[i].fpr,MAX_FINGERPRINT_LEN,keyid);
if(keyid[0]==sig->keyid[0] && keyid[1]==sig->keyid[1]) if(keyid[0]==sig->keyid[0] && keyid[1]==sig->keyid[1])
{ {
MD_HANDLE md; MD_HANDLE md;
md=md_open(sig->digest_algo,0); md=md_open(sig->digest_algo,0);
hash_public_key(md,pk); hash_public_key(md,pk);
rc=signature_check(sig,md); rc=signature_check(sig,md);
@ -457,7 +454,7 @@ check_revocation_keys(PKT_public_key *pk,PKT_signature *sig)
busy=0; busy=0;
return rc; return rc;
} }
/* Backsigs (0x19) have the same format as binding sigs (0x18), but /* Backsigs (0x19) have the same format as binding sigs (0x18), but
this function is simpler than check_key_signature in a few ways. this function is simpler than check_key_signature in a few ways.
@ -538,8 +535,8 @@ check_key_signature2( KBNODE root, KBNODE node, PKT_public_key *check_pk,
cache refresh detects and clears these cases. */ cache refresh detects and clears these cases. */
if ( !opt.no_sig_cache ) { if ( !opt.no_sig_cache ) {
if (sig->flags.checked) { /*cached status available*/ if (sig->flags.checked) { /*cached status available*/
if( is_selfsig ) { if( is_selfsig ) {
u32 keyid[2]; u32 keyid[2];
keyid_from_pk( pk, keyid ); keyid_from_pk( pk, keyid );
if( keyid[0] == sig->keyid[0] && keyid[1] == sig->keyid[1] ) if( keyid[0] == sig->keyid[0] && keyid[1] == sig->keyid[1] )
@ -559,7 +556,7 @@ check_key_signature2( KBNODE root, KBNODE node, PKT_public_key *check_pk,
return rc; return rc;
if( sig->sig_class == 0x20 ) { /* key revocation */ if( sig->sig_class == 0x20 ) { /* key revocation */
u32 keyid[2]; u32 keyid[2];
keyid_from_pk( pk, keyid ); keyid_from_pk( pk, keyid );
/* is it a designated revoker? */ /* is it a designated revoker? */

View File

@ -1,3 +1,7 @@
2011-08-09 Werner Koch <wk@g10code.com>
* gpgkeys_hkp.c (srv_replace): Remove unused var.
2009-09-02 Werner Koch <wk@g10code.com> 2009-09-02 Werner Koch <wk@g10code.com>
* Makefile.am (gpgkeys_curl_SOURCES, gpgkeys_ldap_SOURCES) * Makefile.am (gpgkeys_curl_SOURCES, gpgkeys_ldap_SOURCES)
@ -52,7 +56,7 @@
hostname to a real hostname. hostname to a real hostname.
(main): Call it from here for the HAVE_LIBCURL case (without (main): Call it from here for the HAVE_LIBCURL case (without
libcurl is handled via the curl-shim). libcurl is handled via the curl-shim).
2009-04-02 David Shaw <dshaw@jabberwocky.com> 2009-04-02 David Shaw <dshaw@jabberwocky.com>
* curl-shim.h, curl-shim.c (curl_easy_setopt, curl_easy_perform): * curl-shim.h, curl-shim.c (curl_easy_setopt, curl_easy_perform):
@ -669,7 +673,7 @@
2004-10-28 Werner Koch <wk@g10code.com> 2004-10-28 Werner Koch <wk@g10code.com>
* Makefile.am (other_libs): * Makefile.am (other_libs):
2004-10-18 David Shaw <dshaw@jabberwocky.com> 2004-10-18 David Shaw <dshaw@jabberwocky.com>

View File

@ -498,7 +498,6 @@ srv_replace(const char *srvtag)
{ {
#ifdef USE_DNS_SRV #ifdef USE_DNS_SRV
struct srventry *srvlist=NULL; struct srventry *srvlist=NULL;
int srvcount;
if(!srvtag) if(!srvtag)
return; return;
@ -511,7 +510,7 @@ srv_replace(const char *srvtag)
strcat(srvname,srvtag); strcat(srvname,srvtag);
strcat(srvname,"._tcp."); strcat(srvname,"._tcp.");
strcat(srvname,opt->host); strcat(srvname,opt->host);
srvcount=getsrv(srvname,&srvlist); getsrv(srvname,&srvlist);
} }
if(srvlist) if(srvlist)
@ -538,7 +537,7 @@ srv_replace(const char *srvtag)
} }
#endif #endif
static void static void
show_help (FILE *fp) show_help (FILE *fp)
{ {
fprintf (fp,"-h, --help\thelp\n"); fprintf (fp,"-h, --help\thelp\n");

View File

@ -1,3 +1,9 @@
2011-08-09 Werner Koch <wk@g10code.com>
* mpicoder.c (mpi_fromstr): Remove unused var.
* mpi-pow.c (mpi_powm): Remove unused var.
2011-07-04 Werner Koch <wk@g10code.com> 2011-07-04 Werner Koch <wk@g10code.com>
* longlong.h: [__arm__]: Do no use asm if thumb code generation is * longlong.h: [__arm__]: Do no use asm if thumb code generation is

View File

@ -42,7 +42,7 @@ mpi_powm( MPI res, MPI base, MPI exponent, MPI mod)
{ {
mpi_ptr_t rp, ep, mp, bp; mpi_ptr_t rp, ep, mp, bp;
mpi_size_t esize, msize, bsize, rsize; mpi_size_t esize, msize, bsize, rsize;
int esign, msign, bsign, rsign; int msign, bsign, rsign;
int esec, msec, bsec, rsec; int esec, msec, bsec, rsec;
mpi_size_t size; mpi_size_t size;
int mod_shift_cnt; int mod_shift_cnt;
@ -57,7 +57,6 @@ mpi_powm( MPI res, MPI base, MPI exponent, MPI mod)
esize = exponent->nlimbs; esize = exponent->nlimbs;
msize = mod->nlimbs; msize = mod->nlimbs;
size = 2 * msize; size = 2 * msize;
esign = exponent->sign;
msign = mod->sign; msign = mod->sign;
esec = mpi_is_secure(exponent); esec = mpi_is_secure(exponent);
@ -136,7 +135,7 @@ mpi_powm( MPI res, MPI base, MPI exponent, MPI mod)
MPN_COPY(bp, rp, bsize); MPN_COPY(bp, rp, bsize);
} }
if( rp == ep ) { if( rp == ep ) {
/* RES and EXPONENT are identical. /* RES and EXPONENT are identical.
Allocate temp. space for EXPONENT. */ Allocate temp. space for EXPONENT. */
ep = ep_marker = mpi_alloc_limb_space( esize, esec ); ep = ep_marker = mpi_alloc_limb_space( esize, esec );
MPN_COPY(ep, rp, esize); MPN_COPY(ep, rp, esize);

View File

@ -200,7 +200,7 @@ mpi_read_from_buffer(byte *buffer, unsigned int *ret_nread, int secure)
int int
mpi_fromstr(MPI val, const char *str) mpi_fromstr(MPI val, const char *str)
{ {
int hexmode=0, sign=0, prepend_zero=0, i, j, c, c1, c2; int sign=0, prepend_zero=0, i, j, c, c1, c2;
unsigned nbits, nbytes, nlimbs; unsigned nbits, nbytes, nlimbs;
mpi_limb_t a; mpi_limb_t a;
@ -209,7 +209,7 @@ mpi_fromstr(MPI val, const char *str)
str++; str++;
} }
if( *str == '0' && str[1] == 'x' ) if( *str == '0' && str[1] == 'x' )
hexmode = 1; ;
else else
return 1; /* other bases are not yet supported */ return 1; /* other bases are not yet supported */
str += 2; str += 2;

View File

@ -3,6 +3,7 @@
* pka.c (get_pka_info): Turn ANSWER into a union to avoid aliasing * pka.c (get_pka_info): Turn ANSWER into a union to avoid aliasing
problems with modern compilers. See bug#1307. Reported by Steve problems with modern compilers. See bug#1307. Reported by Steve
Grubb. Grubb.
(get_pka_info): Remove unused vars.
2010-10-27 Werner Koch <wk@g10code.com> 2010-10-27 Werner Koch <wk@g10code.com>

View File

@ -122,7 +122,7 @@ get_pka_info (const char *address, unsigned char *fpr)
HEADER h; HEADER h;
} answer; } answer;
int anslen; int anslen;
int qdcount, ancount, nscount, arcount; int qdcount, ancount;
int rc; int rc;
unsigned char *p, *pend; unsigned char *p, *pend;
const char *domain; const char *domain;
@ -151,8 +151,6 @@ get_pka_info (const char *address, unsigned char *fpr)
qdcount = ntohs (answer.h.qdcount); qdcount = ntohs (answer.h.qdcount);
ancount = ntohs (answer.h.ancount); ancount = ntohs (answer.h.ancount);
nscount = ntohs (answer.h.nscount);
arcount = ntohs (answer.h.arcount);
if (!ancount) if (!ancount)
return NULL; /* Got no answer. */ return NULL; /* Got no answer. */