diff options
| -rw-r--r-- | g10/decrypt.c | 8 | ||||
| -rw-r--r-- | g10/encrypt.c | 8 | ||||
| -rw-r--r-- | g10/free-packet.c | 16 | ||||
| -rw-r--r-- | g10/gpgv.c | 2 | ||||
| -rw-r--r-- | g10/main.h | 2 | ||||
| -rw-r--r-- | g10/mainproc.c | 42 | ||||
| -rw-r--r-- | g10/packet.h | 14 | ||||
| -rw-r--r-- | g10/pubkey-enc.c | 10 | ||||
| -rw-r--r-- | g10/test-stubs.c | 2 |
9 files changed, 52 insertions, 52 deletions
diff --git a/g10/decrypt.c b/g10/decrypt.c index 539637086..fb606cb0f 100644 --- a/g10/decrypt.c +++ b/g10/decrypt.c @@ -56,7 +56,7 @@ decrypt_message (ctrl_t ctrl, const char *filename, strlist_t remusr) armor_filter_context_t *afx = NULL; progress_filter_context_t *pfx; DEK *dek = NULL; - struct pubkey_enc_list *pkenc_list = NULL; + struct seskey_enc_list *sesenc_list = NULL; pfx = new_progress_context (); @@ -102,7 +102,7 @@ decrypt_message (ctrl_t ctrl, const char *filename, strlist_t remusr) if (!ctrl->modify_recipients) err = proc_encryption_packets (ctrl, NULL, fp, NULL, NULL); else - err = proc_encryption_packets (ctrl, NULL, fp, &dek, &pkenc_list); + err = proc_encryption_packets (ctrl, NULL, fp, &dek, &sesenc_list); if (opt.flags.dummy_outfile) opt.outfile = NULL; @@ -116,11 +116,11 @@ decrypt_message (ctrl_t ctrl, const char *filename, strlist_t remusr) int armor = opt.armor || (was_armored (afx) && !opt.no_armor); err = reencrypt_to_new_recipients (ctrl, armor, filename, fp, - remusr, dek, pkenc_list); + remusr, dek, sesenc_list); } xfree (dek); - free_pubkey_enc_list (pkenc_list); + free_seskey_enc_list (sesenc_list); iobuf_close (fp); release_armor_context (afx); release_progress_context (pfx); diff --git a/g10/encrypt.c b/g10/encrypt.c index eaca0a51a..b67d8039d 100644 --- a/g10/encrypt.c +++ b/g10/encrypt.c @@ -1087,7 +1087,7 @@ encrypt_crypt (ctrl_t ctrl, gnupg_fd_t filefd, const char *filename, gpg_error_t reencrypt_to_new_recipients (ctrl_t ctrl, int armor, const char *filename, iobuf_t infp, strlist_t recipients, - DEK *dek, struct pubkey_enc_list *pkenc_list) + DEK *dek, struct seskey_enc_list *sesenc_list) { gpg_error_t err; int save_no_encrypt_to; @@ -1097,7 +1097,7 @@ reencrypt_to_new_recipients (ctrl_t ctrl, int armor, const char *filename, iobuf_t outfp = NULL; armor_filter_context_t *outafx = NULL; PACKET pkt; - struct pubkey_enc_list *el; + struct seskey_enc_list *el; unsigned int count; /* Unless we want to clear the recipients, record the pubkey encrypt @@ -1105,7 +1105,7 @@ reencrypt_to_new_recipients (ctrl_t ctrl, int armor, const char *filename, * recipient. We can't do that for wildcards, though. */ if (!ctrl->clear_recipients) { - for (el = pkenc_list; el; el = el->next, count++) + for (el = sesenc_list; el; el = el->next, count++) { if (el->u_sym) continue; @@ -1148,7 +1148,7 @@ reencrypt_to_new_recipients (ctrl_t ctrl, int armor, const char *filename, goto leave; /* Write the old recipients in --add-recipients mode. */ - for (count=0, el = pkenc_list; el; el = el->next, count++) + for (count=0, el = sesenc_list; el; el = el->next, count++) if (!ctrl->clear_recipients && !el->u_sym) { if (opt.verbose) diff --git a/g10/free-packet.c b/g10/free-packet.c index 47615596a..f742022f5 100644 --- a/g10/free-packet.c +++ b/g10/free-packet.c @@ -538,18 +538,18 @@ free_packet (PACKET *pkt, parse_packet_ctx_t parsectx) } -/* Free a entire list of public key encrypted data. */ +/* Free an entire list of public or symmetric key encrypted data. */ void -free_pubkey_enc_list (struct pubkey_enc_list *pkenc_list) +free_seskey_enc_list (struct seskey_enc_list *sesenc_list) { - while (pkenc_list) + while (sesenc_list) { - struct pubkey_enc_list *tmp = pkenc_list->next; + struct seskey_enc_list *tmp = sesenc_list->next; - if (!pkenc_list->u_sym) - release_pubkey_enc_parts (&pkenc_list->u.pub); - xfree (pkenc_list); - pkenc_list = tmp; + if (!sesenc_list->u_sym) + release_pubkey_enc_parts (&sesenc_list->u.pub); + xfree (sesenc_list); + sesenc_list = tmp; } } diff --git a/g10/gpgv.c b/g10/gpgv.c index 686fc8891..b65dfa66b 100644 --- a/g10/gpgv.c +++ b/g10/gpgv.c @@ -564,7 +564,7 @@ import_included_key_block (ctrl_t ctrl, kbnode_t keyblock) * No encryption here but mainproc links to these functions. */ gpg_error_t -get_session_key (ctrl_t ctrl, struct pubkey_enc_list *k, DEK *dek) +get_session_key (ctrl_t ctrl, struct seskey_enc_list *k, DEK *dek) { (void)ctrl; (void)k; diff --git a/g10/main.h b/g10/main.h index ab01091d0..954cd1e4e 100644 --- a/g10/main.h +++ b/g10/main.h @@ -253,7 +253,7 @@ gpg_error_t reencrypt_to_new_recipients (ctrl_t ctrl, int armor, const char *filename, iobuf_t infp, strlist_t recipients, DEK *dek, - struct pubkey_enc_list *pkenc_list); + struct seskey_enc_list *sesenc_list); int encrypt_filter (void *opaque, int control, iobuf_t a, byte *buf, size_t *ret_len); diff --git a/g10/mainproc.c b/g10/mainproc.c index fc7bee32b..e2703516c 100644 --- a/g10/mainproc.c +++ b/g10/mainproc.c @@ -96,7 +96,7 @@ struct mainproc_context iobuf_t iobuf; /* Used to get the filename etc. */ int trustletter; /* Temporary usage in list_node. */ ulong symkeys; /* Number of symmetrically encrypted session keys. */ - struct pubkey_enc_list *pkenc_list; /* List of encryption packets. */ + struct seskey_enc_list *sesenc_list; /* List of encryption packets. */ struct symlist_item *symenc_list; /* List of sym. encryption packets. */ int seen_pkt_encrypted_aead; /* PKT_ENCRYPTED_AEAD packet seen. */ int seen_pkt_encrypted_mdc; /* PKT_ENCRYPTED_MDC packet seen. */ @@ -137,8 +137,8 @@ release_list( CTX c ) { proc_tree (c, c->list); release_kbnode (c->list); - free_pubkey_enc_list (c->pkenc_list); - c->pkenc_list = NULL; + free_seskey_enc_list (c->sesenc_list); + c->sesenc_list = NULL; while (c->symenc_list) { struct symlist_item *tmp = c->symenc_list->next; @@ -517,12 +517,12 @@ proc_pubkey_enc (CTX c, PACKET *pkt) if (!opt.list_only && !opt.override_session_key) { - struct pubkey_enc_list *x = xcalloc (1, sizeof *x); + struct seskey_enc_list *x = xcalloc (1, sizeof *x); copy_pubkey_enc_parts (&x->u.pub, enc); x->result = -1; - x->next = c->pkenc_list; - c->pkenc_list = x; + x->next = c->sesenc_list; + c->sesenc_list = x; } free_packet(pkt, NULL); @@ -534,7 +534,7 @@ proc_pubkey_enc (CTX c, PACKET *pkt) * not decrypt. */ static void -print_pkenc_list (ctrl_t ctrl, struct pubkey_enc_list *list) +print_sesenc_list (ctrl_t ctrl, struct seskey_enc_list *list) { for (; list; list = list->next) { @@ -589,7 +589,7 @@ proc_encrypted (CTX c, PACKET *pkt) if (pkt->pkttype == PKT_ENCRYPTED_MDC) c->seen_pkt_encrypted_mdc = 1; } - else /* No PKT indicates the the add-recipients mode. */ + else /* No PKT indicates the add-recipients mode. */ log_assert (c->ctrl->modify_recipients); if (early_plaintext) @@ -605,7 +605,7 @@ proc_encrypted (CTX c, PACKET *pkt) log_info (_("encrypted with %lu passphrases\n"), c->symkeys); else if (c->symkeys == 1) log_info (_("encrypted with 1 passphrase\n")); - print_pkenc_list (c->ctrl, c->pkenc_list); + print_sesenc_list (c->ctrl, c->sesenc_list); } /* Figure out the session key by looking at all pkenc packets. */ @@ -624,15 +624,15 @@ proc_encrypted (CTX c, PACKET *pkt) write_status_error ("pkdecrypt_failed", result); } } - else if (c->pkenc_list) + else if (c->sesenc_list) { c->dek = xmalloc_secure_clear (sizeof *c->dek); - result = get_session_key (c->ctrl, c->pkenc_list, c->dek); + result = get_session_key (c->ctrl, c->sesenc_list, c->dek); if (is_status_enabled ()) { - struct pubkey_enc_list *list; + struct seskey_enc_list *list; - for (list = c->pkenc_list; list; list = list->next) + for (list = c->sesenc_list; list; list = list->next) if (list->result && !list->u_sym) { /* Key was not tried or it caused an error. */ char buf[20]; @@ -738,7 +738,7 @@ proc_encrypted (CTX c, PACKET *pkt) } else if (!c->dek) { - if (c->symkeys && !c->pkenc_list) + if (c->symkeys && !c->sesenc_list) result = gpg_error (GPG_ERR_BAD_KEY); if (!result) @@ -766,12 +766,12 @@ proc_encrypted (CTX c, PACKET *pkt) && !unknown_ciphermode && gnupg_cipher_is_compliant (CO_DE_VS, c->dek->algo, ciphermode)) { - struct pubkey_enc_list *i; + struct seskey_enc_list *i; struct symlist_item *si; int compliant = 1; PKT_public_key *pk = xmalloc (sizeof *pk); - if ( !(c->pkenc_list || c->symkeys) ) + if ( !(c->sesenc_list || c->symkeys) ) log_debug ("%s: where else did the session key come from?\n", __func__); /* Check that all seen symmetric key packets use compliant @@ -787,7 +787,7 @@ proc_encrypted (CTX c, PACKET *pkt) /* Check that every known public key used to encrypt the session key * is compliant. */ - for (i = c->pkenc_list; i && compliant; i = i->next) + for (i = c->sesenc_list; i && compliant; i = i->next) { if (i->u_sym) continue; @@ -1639,7 +1639,7 @@ proc_signature_packets_by_fd (ctrl_t ctrl, void *anchor, iobuf_t a, * needs to release them; even if the function returns an error. */ gpg_error_t proc_encryption_packets (ctrl_t ctrl, void *anchor, iobuf_t a, - DEK **r_dek, struct pubkey_enc_list **r_list) + DEK **r_dek, struct seskey_enc_list **r_list) { CTX c = xmalloc_clear (sizeof *c); int rc; @@ -1652,8 +1652,8 @@ proc_encryption_packets (ctrl_t ctrl, void *anchor, iobuf_t a, rc = do_proc_packets (c, a, 1); *r_dek = c->dek; c->dek = NULL; - *r_list = c->pkenc_list; - c->pkenc_list = NULL; + *r_list = c->sesenc_list; + c->sesenc_list = NULL; } else rc = do_proc_packets (c, a, 0); @@ -1682,7 +1682,7 @@ check_nesting (CTX c) /* Main processing loop. If KEEP_DEK_AND_LIST is set the DEK and - * PKENC_LIST of the context C are not released at the end of the + * SESENC_LIST of the context C are not released at the end of the * function. The caller is then required to do this. */ static int do_proc_packets (CTX c, iobuf_t a, int keep_dek_and_list) diff --git a/g10/packet.h b/g10/packet.h index 52f9aef8f..8b4c3d9c2 100644 --- a/g10/packet.h +++ b/g10/packet.h @@ -172,11 +172,11 @@ typedef struct { /* An object to build a list of public-key and symkey encrypted - * session key. Note that we use a dedicated uinion here instead of - * the usual PACKET type; this the need for extra allocations. */ -struct pubkey_enc_list + * session key. Note that we use a dedicated union here instead of + * the usual PACKET type to avoid the need for extra allocations. */ +struct seskey_enc_list { - struct pubkey_enc_list *next; + struct seskey_enc_list *next; int result; int u_sym; /* Use the sym member. */ union { @@ -686,7 +686,7 @@ int proc_signature_packets_by_fd (ctrl_t ctrl, void *anchor, IOBUF a, gnupg_fd_t signed_data_fd); gpg_error_t proc_encryption_packets (ctrl_t ctrl, void *ctx, iobuf_t a, DEK **r_dek, - struct pubkey_enc_list **r_list); + struct seskey_enc_list **r_list); int list_packets( iobuf_t a ); @@ -962,7 +962,7 @@ 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 ); -void free_pubkey_enc_list (struct pubkey_enc_list *pkenc_list); +void free_seskey_enc_list (struct seskey_enc_list *sesenc_list); int cmp_public_keys( PKT_public_key *a, PKT_public_key *b ); int cmp_signatures( PKT_signature *a, PKT_signature *b ); @@ -984,7 +984,7 @@ gpg_error_t check_signature (ctrl_t ctrl, /*-- pubkey-enc.c --*/ -gpg_error_t get_session_key (ctrl_t ctrl, struct pubkey_enc_list *k, DEK *dek); +gpg_error_t get_session_key (ctrl_t ctrl, struct seskey_enc_list *k, DEK *dek); gpg_error_t get_override_session_key (DEK *dek, const char *string); /*-- compress.c --*/ diff --git a/g10/pubkey-enc.c b/g10/pubkey-enc.c index 9d6193e4d..d9a68d587 100644 --- a/g10/pubkey-enc.c +++ b/g10/pubkey-enc.c @@ -38,7 +38,7 @@ #include "../common/compliance.h" -static gpg_error_t get_it (ctrl_t ctrl, struct pubkey_enc_list *k, +static gpg_error_t get_it (ctrl_t ctrl, struct seskey_enc_list *k, DEK *dek, PKT_public_key *sk, u32 *keyid); @@ -72,14 +72,14 @@ is_algo_in_prefs (kbnode_t keyblock, preftype_t type, int algo) * which should have been allocated in secure memory by the caller. */ gpg_error_t -get_session_key (ctrl_t ctrl, struct pubkey_enc_list *list, DEK *dek) +get_session_key (ctrl_t ctrl, struct seskey_enc_list *list, DEK *dek) { PKT_public_key *sk = NULL; gpg_error_t err; void *enum_context = NULL; u32 keyid[2]; int search_for_secret_keys = 1; - struct pubkey_enc_list *k; + struct seskey_enc_list *k; if (DBG_CLOCK) log_clock ("get_session_key enter"); @@ -193,7 +193,7 @@ get_session_key (ctrl_t ctrl, struct pubkey_enc_list *list, DEK *dek) /* Build an SEXP to gpg-agent, for PKDECRYPT command. */ static gpg_error_t -ecdh_sexp_build (gcry_sexp_t *r_s_data, struct pubkey_enc_list *enc, +ecdh_sexp_build (gcry_sexp_t *r_s_data, struct seskey_enc_list *enc, PKT_public_key *sk) { gpg_error_t err; @@ -232,7 +232,7 @@ ecdh_sexp_build (gcry_sexp_t *r_s_data, struct pubkey_enc_list *enc, static gpg_error_t get_it (ctrl_t ctrl, - struct pubkey_enc_list *enc, DEK *dek, PKT_public_key *sk, u32 *keyid) + struct seskey_enc_list *enc, DEK *dek, PKT_public_key *sk, u32 *keyid) { gpg_error_t err; byte *frame = NULL; diff --git a/g10/test-stubs.c b/g10/test-stubs.c index c6d6cdae5..9b41c8929 100644 --- a/g10/test-stubs.c +++ b/g10/test-stubs.c @@ -298,7 +298,7 @@ import_included_key_block (ctrl_t ctrl, kbnode_t keyblock) * No encryption here but mainproc links to these functions. */ gpg_error_t -get_session_key (ctrl_t ctrl, struct pubkey_enc_list *k, DEK *dek) +get_session_key (ctrl_t ctrl, struct seskey_enc_list *k, DEK *dek) { (void)ctrl; (void)k; |
