mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
gpg: New option --default-new-key-adsk and "addadsk" for edit-key.
* g10/free-packet.c (copy_public_key): Factor some code out to ...
(copy_public_key_basics): new.
* keygen.c (keygen_add_key_flags_and_expire): Rewrite and make public.
* g10/keyedit.c (enum cmdids): Add cmdADDADSK.
(keyedit_menu): Add command "addadsk".
(menu_addadsk): New.
* g10/options.h (opt): Add field def_new_key_adsks.
* g10/gpg.c (oDefaultNewKeyADSK): New.
(opts): Add --default-new-key-adsk.
(main): Parse option.
* g10/keyedit.c (menu_addadsk): Factor some code out to ...
(append_adsk_to_key): new. Add compliance check.
* g10/keygen.c (pADSK): New.
(para_data_s): Add adsk to the union.
(release_parameter_list): Free the adsk.
(prepare_adsk): New.
(get_parameter_adsk): New.
(get_parameter_revkey): Remove unneeded arg key and change callers.
(proc_parameter_file): Prepare adsk parameter from the configured
fingerprints.
(do_generate_keypair): Create adsk.
--
GnuPG-bug-id: 6882
(cherry picked from commit ed118e2ed5
)
and modified to adjust to other code changes
This commit is contained in:
parent
7eb39815bd
commit
eafe175320
12 changed files with 495 additions and 55 deletions
11
g10/packet.h
11
g10/packet.h
|
@ -68,6 +68,11 @@
|
|||
/* The usage bits which define encryption. */
|
||||
#define PUBKEY_USAGE_XENC_MASK (PUBKEY_USAGE_ENC | PUBKEY_USAGE_RENC)
|
||||
|
||||
/* Bitflags to convey hints on what kind of signature is created. */
|
||||
#define SIGNHINT_KEYSIG 1
|
||||
#define SIGNHINT_SELFSIG 2
|
||||
#define SIGNHINT_ADSK 4
|
||||
|
||||
|
||||
/* Helper macros. */
|
||||
#define is_RSA(a) ((a)==PUBKEY_ALGO_RSA || (a)==PUBKEY_ALGO_RSA_E \
|
||||
|
@ -863,7 +868,8 @@ gpg_error_t gpg_mpi_write_nohdr (iobuf_t out, gcry_mpi_t a);
|
|||
u32 calc_packet_length( PACKET *pkt );
|
||||
void build_sig_subpkt( PKT_signature *sig, sigsubpkttype_t type,
|
||||
const byte *buffer, size_t buflen );
|
||||
void build_sig_subpkt_from_sig (PKT_signature *sig, PKT_public_key *pksk);
|
||||
void build_sig_subpkt_from_sig (PKT_signature *sig, PKT_public_key *pksk,
|
||||
unsigned int signhints);
|
||||
int delete_sig_subpkt(subpktarea_t *buffer, sigsubpkttype_t type );
|
||||
void build_attribute_subpkt(PKT_user_id *uid,byte type,
|
||||
const void *buf,u32 buflen,
|
||||
|
@ -885,7 +891,10 @@ void free_user_id( PKT_user_id *uid );
|
|||
void free_comment( PKT_comment *rem );
|
||||
void free_packet (PACKET *pkt, parse_packet_ctx_t parsectx);
|
||||
prefitem_t *copy_prefs (const prefitem_t *prefs);
|
||||
|
||||
PKT_public_key *copy_public_key_basics (PKT_public_key *d, PKT_public_key *s);
|
||||
PKT_public_key *copy_public_key( PKT_public_key *d, PKT_public_key *s );
|
||||
|
||||
PKT_signature *copy_signature( PKT_signature *d, PKT_signature *s );
|
||||
PKT_user_id *scopy_user_id (PKT_user_id *sd );
|
||||
int cmp_public_keys( PKT_public_key *a, PKT_public_key *b );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue