mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-31 11:41:32 +01:00
gpg: Initialize the primary key when generating a key.
* g10/keygen.c (do_generate_keypair): Initialize pri_psk->flags.primary, pri_psk->keyid and pri_psk->main_keyid. -- Signed-off-by: Neal H. Walfield <neal@g10code.com>
This commit is contained in:
parent
c45633a571
commit
bf9d1248c8
@ -4079,6 +4079,13 @@ do_generate_keypair (ctrl_t ctrl, struct para_data_s *para,
|
||||
assert (pri_psk);
|
||||
}
|
||||
|
||||
/* Make sure a few fields are correctly set up before going further. */
|
||||
pri_psk->flags.primary = 1;
|
||||
keyid_from_pk (pri_psk, NULL);
|
||||
/* We don't use pk_keyid to get keyid, because it also asserts that
|
||||
main_keyid is set! */
|
||||
keyid_copy (pri_psk->main_keyid, pri_psk->keyid);
|
||||
|
||||
if (!err && (revkey = get_parameter_revkey (para, pREVOKER)))
|
||||
err = write_direct_sig (pub_root, pri_psk, revkey, timestamp, cache_nonce);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user