mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
Minor code cleanups.
* keyid.c (hash_public_key): Remove shadowing NBITS. * misc.c (pubkey_nbits): Replace GCRY_PK_ by PUBKEY_ALGO_. (get_signature_count): Remove warning.
This commit is contained in:
parent
ea41f5b4c1
commit
aeb324273a
@ -1,5 +1,10 @@
|
||||
2011-03-03 Werner Koch <wk@g10code.com>
|
||||
|
||||
* keyid.c (hash_public_key): Remove shadowing NBITS.
|
||||
|
||||
* misc.c (pubkey_nbits): Replace GCRY_PK_ by PUBKEY_ALGO_.
|
||||
(get_signature_count): Remove warning.
|
||||
|
||||
* armor.c (armor_filter): Don't take a copy of radbuf while
|
||||
writing the checksum. This works around a faulty gcc 4.4 warning.
|
||||
|
||||
|
@ -99,7 +99,6 @@ hash_public_key (gcry_md_hd_t md, PKT_public_key *pk)
|
||||
{
|
||||
if (gcry_mpi_get_flag (pk->pkey[i], GCRYMPI_FLAG_OPAQUE))
|
||||
{
|
||||
size_t nbits;
|
||||
const void *p;
|
||||
|
||||
p = gcry_mpi_get_opaque (pk->pkey[i], &nbits);
|
||||
|
12
g10/misc.c
12
g10/misc.c
@ -569,7 +569,8 @@ get_signature_count (PKT_public_key *pk)
|
||||
{
|
||||
#ifdef ENABLE_CARD_SUPPORT
|
||||
struct agent_card_info_s info;
|
||||
#warning fixme: We should check that the correct card has been inserted
|
||||
|
||||
(void)pk;
|
||||
if (!agent_scd_getattr ("SIG-COUNTER",&info))
|
||||
return info.sig_counter;
|
||||
else
|
||||
@ -1453,20 +1454,17 @@ pubkey_nbits( int algo, gcry_mpi_t *key )
|
||||
int rc, nbits;
|
||||
gcry_sexp_t sexp;
|
||||
|
||||
#warning FIXME: We are mixing OpenPGP And CGrypt Ids
|
||||
assert( algo != GCRY_PK_ECDSA && algo != GCRY_PK_ECDH );
|
||||
|
||||
if( algo == GCRY_PK_DSA ) {
|
||||
if( algo == PUBKEY_ALGO_DSA ) {
|
||||
rc = gcry_sexp_build ( &sexp, NULL,
|
||||
"(public-key(dsa(p%m)(q%m)(g%m)(y%m)))",
|
||||
key[0], key[1], key[2], key[3] );
|
||||
}
|
||||
else if( algo == GCRY_PK_ELG || algo == GCRY_PK_ELG_E ) {
|
||||
else if( algo == PUBKEY_ALGO_ELGAMAL || algo == PUBKEY_ALGO_ELGAMAL_E ) {
|
||||
rc = gcry_sexp_build ( &sexp, NULL,
|
||||
"(public-key(elg(p%m)(g%m)(y%m)))",
|
||||
key[0], key[1], key[2] );
|
||||
}
|
||||
else if( algo == GCRY_PK_RSA ) {
|
||||
else if( is_RSA (algo) ) {
|
||||
rc = gcry_sexp_build ( &sexp, NULL,
|
||||
"(public-key(rsa(n%m)(e%m)))",
|
||||
key[0], key[1] );
|
||||
|
Loading…
x
Reference in New Issue
Block a user