1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-02 12:01:32 +01:00

gpg: Replace an obsolete trustdb function.

* g10/trustdb.c (tdb_register_trusted_keyid): Make static.
(tdb_register_trusted_key): Replace register_trusted_keyid by
tdb_register_trusted_key.
* g10/keygen.c (do_generate_keypair): Ditto.
* g10/trust.c (register_trusted_keyid): Remove.
This commit is contained in:
Werner Koch 2021-04-23 20:45:25 +02:00
parent 0b875aa11a
commit 3cbc66410d
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
4 changed files with 7 additions and 19 deletions

View File

@ -5576,6 +5576,7 @@ do_generate_keypair (ctrl_t ctrl, struct para_data_s *para,
{ {
int no_enc_rsa; int no_enc_rsa;
PKT_public_key *pk; PKT_public_key *pk;
char hexfpr[2*MAX_FINGERPRINT_LEN + 1];
no_enc_rsa = ((get_parameter_algo (ctrl, para, pKEYTYPE, NULL) no_enc_rsa = ((get_parameter_algo (ctrl, para, pKEYTYPE, NULL)
== PUBKEY_ALGO_RSA) == PUBKEY_ALGO_RSA)
@ -5585,8 +5586,8 @@ do_generate_keypair (ctrl_t ctrl, struct para_data_s *para,
pk = find_kbnode (pub_root, PKT_PUBLIC_KEY)->pkt->pkt.public_key; pk = find_kbnode (pub_root, PKT_PUBLIC_KEY)->pkt->pkt.public_key;
keyid_from_pk (pk, pk->main_keyid); hexfingerprint (pk, hexfpr, sizeof hexfpr);
register_trusted_keyid (pk->main_keyid); register_trusted_key (hexfpr);
if (!opt.flags.no_auto_trust_new_key) if (!opt.flags.no_auto_trust_new_key)
update_ownertrust (ctrl, pk, update_ownertrust (ctrl, pk,

View File

@ -49,17 +49,6 @@ cache_disabled_value (ctrl_t ctrl, PKT_public_key *pk)
} }
void
register_trusted_keyid (u32 *keyid)
{
#ifdef NO_TRUST_MODELS
(void)keyid;
#else
tdb_register_trusted_keyid (keyid);
#endif
}
void void
register_trusted_key (const char *string) register_trusted_key (const char *string)
{ {

View File

@ -232,7 +232,7 @@ release_key_array ( struct key_array *keys )
* before initializing the validation module. * before initializing the validation module.
* FIXME: Should be replaced by a function to add those keys to the trustdb. * FIXME: Should be replaced by a function to add those keys to the trustdb.
*/ */
void static void
tdb_register_trusted_keyid (u32 *keyid) tdb_register_trusted_keyid (u32 *keyid)
{ {
struct key_item *k; struct key_item *k;
@ -257,21 +257,21 @@ tdb_register_trusted_key (const char *string)
{ {
if (desc.mode == KEYDB_SEARCH_MODE_LONG_KID) if (desc.mode == KEYDB_SEARCH_MODE_LONG_KID)
{ {
register_trusted_keyid (desc.u.kid); tdb_register_trusted_keyid (desc.u.kid);
return; return;
} }
if (desc.mode == KEYDB_SEARCH_MODE_FPR && desc.fprlen == 20) if (desc.mode == KEYDB_SEARCH_MODE_FPR && desc.fprlen == 20)
{ {
kid[0] = buf32_to_u32 (desc.u.fpr+12); kid[0] = buf32_to_u32 (desc.u.fpr+12);
kid[1] = buf32_to_u32 (desc.u.fpr+16); kid[1] = buf32_to_u32 (desc.u.fpr+16);
register_trusted_keyid (kid); tdb_register_trusted_keyid (kid);
return; return;
} }
if (desc.mode == KEYDB_SEARCH_MODE_FPR && desc.fprlen == 32) if (desc.mode == KEYDB_SEARCH_MODE_FPR && desc.fprlen == 32)
{ {
kid[0] = buf32_to_u32 (desc.u.fpr); kid[0] = buf32_to_u32 (desc.u.fpr);
kid[1] = buf32_to_u32 (desc.u.fpr+4); kid[1] = buf32_to_u32 (desc.u.fpr+4);
register_trusted_keyid (kid); tdb_register_trusted_keyid (kid);
return; return;
} }
} }

View File

@ -48,7 +48,6 @@
/*-- trust.c --*/ /*-- trust.c --*/
int cache_disabled_value (ctrl_t ctrl, PKT_public_key *pk); int cache_disabled_value (ctrl_t ctrl, PKT_public_key *pk);
void register_trusted_keyid (u32 *keyid);
void register_trusted_key (const char *string); void register_trusted_key (const char *string);
const char *trust_value_to_string (unsigned int value); const char *trust_value_to_string (unsigned int value);
@ -75,7 +74,6 @@ const char *get_validity_string (ctrl_t ctrl,
/*-- trustdb.c --*/ /*-- trustdb.c --*/
void tdb_register_trusted_keyid (u32 *keyid);
void tdb_register_trusted_key (const char *string); void tdb_register_trusted_key (const char *string);
/* Returns whether KID is on the list of ultimately trusted keys. */ /* Returns whether KID is on the list of ultimately trusted keys. */
int tdb_keyid_is_utk (u32 *kid); int tdb_keyid_is_utk (u32 *kid);