1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

gpg: Correctly set the ownertrust for a new key.

* g10/keygen.c (do_generate_keypair): Use update_ownertrust.
--

GnuPG-bug-id: 5742
This commit is contained in:
Werner Koch 2021-12-20 22:02:05 +01:00
parent 69195ab255
commit 6105287252
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

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