diff --git a/cipher/ChangeLog b/cipher/ChangeLog index 5497117fb..a96580ca1 100644 --- a/cipher/ChangeLog +++ b/cipher/ChangeLog @@ -1,3 +1,9 @@ +2004-03-29 Werner Koch + + * elgamal.c (verify): s/exp/exponent/ to shutup a compiler + warning. + * dsa.c (verify): Ditto. + 2003-11-29 David Shaw * elgamal.c (gen_k): New arg SMALL_K. diff --git a/cipher/dsa.c b/cipher/dsa.c index d728a1b10..a2167adb2 100644 --- a/cipher/dsa.c +++ b/cipher/dsa.c @@ -320,7 +320,7 @@ verify(MPI r, MPI s, MPI hash, DSA_public_key *pkey ) int rc; MPI w, u1, u2, v; MPI base[3]; - MPI exp[3]; + MPI exponent[3]; if( !(mpi_cmp_ui( r, 0 ) > 0 && mpi_cmp( r, pkey->q ) < 0) ) @@ -343,10 +343,10 @@ verify(MPI r, MPI s, MPI hash, DSA_public_key *pkey ) mpi_mulm( u2, r, w, pkey->q ); /* v = g^u1 * y^u2 mod p mod q */ - base[0] = pkey->g; exp[0] = u1; - base[1] = pkey->y; exp[1] = u2; - base[2] = NULL; exp[2] = NULL; - mpi_mulpowm( v, base, exp, pkey->p ); + base[0] = pkey->g; exponent[0] = u1; + base[1] = pkey->y; exponent[1] = u2; + base[2] = NULL; exponent[2] = NULL; + mpi_mulpowm( v, base, exponent, pkey->p ); mpi_fdiv_r( v, v, pkey->q ); rc = !mpi_cmp( v, r ); diff --git a/cipher/elgamal.c b/cipher/elgamal.c index aff9a7e30..0cab9d547 100644 --- a/cipher/elgamal.c +++ b/cipher/elgamal.c @@ -458,7 +458,7 @@ verify(MPI a, MPI b, MPI input, ELG_public_key *pkey ) MPI t1; MPI t2; MPI base[4]; - MPI exp[4]; + MPI exponent[4]; if( !(mpi_cmp_ui( a, 0 ) > 0 && mpi_cmp( a, pkey->p ) < 0) ) return 0; /* assertion 0 < a < p failed */ @@ -478,10 +478,10 @@ verify(MPI a, MPI b, MPI input, ELG_public_key *pkey ) rc = !mpi_cmp( t1, t2 ); #elif 0 /* t1 = (y^a mod p) * (a^b mod p) mod p */ - base[0] = pkey->y; exp[0] = a; - base[1] = a; exp[1] = b; - base[2] = NULL; exp[2] = NULL; - mpi_mulpowm( t1, base, exp, pkey->p ); + base[0] = pkey->y; exponent[0] = a; + base[1] = a; exponent[1] = b; + base[2] = NULL; exponent[2] = NULL; + mpi_mulpowm( t1, base, exponent, pkey->p ); /* t2 = g ^ input mod p */ mpi_powm( t2, pkey->g, input, pkey->p ); @@ -490,11 +490,11 @@ verify(MPI a, MPI b, MPI input, ELG_public_key *pkey ) #else /* t1 = g ^ - input * y ^ a * a ^ b mod p */ mpi_invm(t2, pkey->g, pkey->p ); - base[0] = t2 ; exp[0] = input; - base[1] = pkey->y; exp[1] = a; - base[2] = a; exp[2] = b; - base[3] = NULL; exp[3] = NULL; - mpi_mulpowm( t1, base, exp, pkey->p ); + base[0] = t2 ; exponent[0] = input; + base[1] = pkey->y; exponent[1] = a; + base[2] = a; exponent[2] = b; + base[3] = NULL; exponent[3] = NULL; + mpi_mulpowm( t1, base, exponent, pkey->p ); rc = !mpi_cmp_ui( t1, 1 ); #endif diff --git a/g10/ChangeLog b/g10/ChangeLog index 944c65551..d75de0f45 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,8 @@ +2004-03-29 Werner Koch + + * g10.c: New command --gpgconf-list. + (gpgconf_list): New. + 2004-03-27 David Shaw * keyedit.c (keyedit_menu): Request a trustdb update when adding a diff --git a/g10/g10.c b/g10/g10.c index bf31fc8e1..dbdb2e51c 100644 --- a/g10/g10.c +++ b/g10/g10.c @@ -91,6 +91,7 @@ enum cmd_and_opt_values aNRSignKey, aNRLSignKey, aListConfig, + aGPGConfList, aListPackets, aEditKey, aDeleteKeys, @@ -361,6 +362,7 @@ static ARGPARSE_OPTS opts[] = { { aImport, "import", 256, N_("import/merge keys")}, { aFastImport, "fast-import", 256, "@"}, { aListConfig, "list-config", 256, "@"}, + { aGPGConfList, "gpgconf-list", 256, "@" }, { aListPackets,"list-packets",256,N_("list only the sequence of packets")}, { aExportOwnerTrust, "export-ownertrust", 256, N_("export the ownertrust values")}, @@ -1220,6 +1222,27 @@ list_config(char *items) } +/* List options and default values in the GPG Conf format. This is a + new tool distributed with gnupg 1.9.x but we also want some limited + support in older gpg versions. The output is the name of the + configuration file and a list of options available for editing by + gpgconf. */ +static void +gpgconf_list (const char *configfile) +{ + /* The following definitions are taken from gnupg/tools/gpgconf-comp.c. */ +#define GC_OPT_FLAG_NONE 0UL +#define GC_OPT_FLAG_DEFAULT (1UL << 4) + + printf ("gpgconf-gpg.conf:%lu:\"%s\n", + GC_OPT_FLAG_DEFAULT,configfile?configfile:"/dev/null"); + printf ("verbose:%lu:\n", GC_OPT_FLAG_NONE); + printf ("quiet:%lu:\n", GC_OPT_FLAG_NONE); + printf ("keyserver:%lu:\n", GC_OPT_FLAG_NONE); +} + + + /* Collapses argc/argv into a single string that must be freed */ static char * collapse_args(int argc,char *argv[]) @@ -1263,6 +1286,7 @@ main( int argc, char **argv ) int detached_sig = 0; FILE *configfp = NULL; char *configname = NULL; + char *save_configname = NULL; unsigned configlineno; int parse_debug = 0; int default_config = 1; @@ -1463,16 +1487,20 @@ main( int argc, char **argv ) { switch( pargs.r_opt ) { - case aCheckKeys: set_cmd( &cmd, aCheckKeys); break; - case aListConfig: set_cmd( &cmd, aListConfig); break; - case aListPackets: set_cmd( &cmd, aListPackets); break; - case aImport: set_cmd( &cmd, aImport); break; - case aFastImport: set_cmd( &cmd, aFastImport); break; - case aSendKeys: set_cmd( &cmd, aSendKeys); break; - case aRecvKeys: set_cmd( &cmd, aRecvKeys); break; - case aSearchKeys: set_cmd( &cmd, aSearchKeys); break; - case aRefreshKeys: set_cmd( &cmd, aRefreshKeys); break; - case aExport: set_cmd( &cmd, aExport); break; + case aCheckKeys: + case aListConfig: + case aGPGConfList: + case aListPackets: + case aImport: + case aFastImport: + case aSendKeys: + case aRecvKeys: + case aSearchKeys: + case aRefreshKeys: + case aExport: + set_cmd (&cmd, pargs.r_opt); + break; + case aExportAll: opt.export_options|=EXPORT_INCLUDE_NON_RFC; set_cmd(&cmd,aExport); @@ -1946,15 +1974,31 @@ main( int argc, char **argv ) } } + if( configfp ) { fclose( configfp ); configfp = NULL; - m_free(configname); configname = NULL; + /* Remember the first config file name. */ + if (!save_configname) + save_configname = configname; + else + m_free(configname); + configname = NULL; goto next_pass; } m_free( configname ); configname = NULL; if( log_get_errorcount(0) ) g10_exit(2); + + /* The command --gpgconf-list is pretty simple and may be called + directly after the option parsing. */ + if (cmd == aGPGConfList) + { + gpgconf_list (save_configname); + g10_exit (0); + } + m_free (save_configname); + if( nogreeting ) greeting = 0; diff --git a/include/ChangeLog b/include/ChangeLog index b461ce3b2..235da89a4 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,7 @@ +2004-03-29 Werner Koch + + * mpi.h: s/exp/exponent/ to shutup a compiler warning. + 2004-01-13 David Shaw * util.h: Add prototype for print_string2(). diff --git a/include/mpi.h b/include/mpi.h index 3198584a2..da2cabd79 100644 --- a/include/mpi.h +++ b/include/mpi.h @@ -166,7 +166,7 @@ int mpi_gcd( MPI g, MPI a, MPI b ); /*-- mpi-pow.c --*/ void mpi_pow( MPI w, MPI u, MPI v); -void mpi_powm( MPI res, MPI base, MPI exp, MPI mod); +void mpi_powm( MPI res, MPI base, MPI exponent, MPI mod); /*-- mpi-mpow.c --*/ void mpi_mulpowm( MPI res, MPI *basearray, MPI *exparray, MPI mod); diff --git a/mpi/ChangeLog b/mpi/ChangeLog index 940f77c33..1f849bf59 100644 --- a/mpi/ChangeLog +++ b/mpi/ChangeLog @@ -1,3 +1,8 @@ +2004-03-29 Werner Koch + + * mpi-pow.c (mpi_powm): s/exp/exponent/ to shutup a compiler + warning. + 2004-01-20 David Shaw * hppa1.1/udiv-qrnnd.S: Alignment fix from Lamont Jones for diff --git a/mpi/mpi-pow.c b/mpi/mpi-pow.c index d65258b0f..73d28970c 100644 --- a/mpi/mpi-pow.c +++ b/mpi/mpi-pow.c @@ -39,7 +39,7 @@ * RES = BASE ^ EXP mod MOD */ void -mpi_powm( MPI res, MPI base, MPI exp, MPI mod) +mpi_powm( MPI res, MPI base, MPI exponent, MPI mod) { mpi_ptr_t rp, ep, mp, bp; mpi_size_t esize, msize, bsize, rsize; @@ -55,19 +55,19 @@ mpi_powm( MPI res, MPI base, MPI exp, MPI mod) mpi_size_t tsize=0; /* to avoid compiler warning */ /* fixme: we should check that the warning is void*/ - esize = exp->nlimbs; + esize = exponent->nlimbs; msize = mod->nlimbs; size = 2 * msize; - esign = exp->sign; + esign = exponent->sign; msign = mod->sign; - esec = mpi_is_secure(exp); + esec = mpi_is_secure(exponent); msec = mpi_is_secure(mod); bsec = mpi_is_secure(base); rsec = mpi_is_secure(res); rp = res->d; - ep = exp->d; + ep = exponent->d; if( !msize ) msize = 1 / msize; /* provoke a signal */ @@ -129,7 +129,7 @@ mpi_powm( MPI res, MPI base, MPI exp, MPI mod) rp = res->d; } } - else { /* Make BASE, EXP and MOD not overlap with RES. */ + else { /* Make BASE, EXPONENT and MOD not overlap with RES. */ if( rp == bp ) { /* RES and BASE are identical. Allocate temp. space for BASE. */ assert( !bp_marker ); @@ -137,7 +137,8 @@ mpi_powm( MPI res, MPI base, MPI exp, MPI mod) MPN_COPY(bp, rp, bsize); } if( rp == ep ) { - /* RES and EXP are identical. Allocate temp. space for EXP. */ + /* RES and EXPONENT are identical. + Allocate temp. space for EXPONENT. */ ep = ep_marker = mpi_alloc_limb_space( esize, esec ); MPN_COPY(ep, rp, esize); }