mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
gpg: Extend free_packet to handle a packet parser context.
* g10/packet.h (struct parse_packet_ctx_s): Add fields LAST_PKT and FREE_LAST_PKT. (init_parse_packet): Clear them. (deinit_parse_packet): New macro. Change all users if init_parse_packet to also call this macro. * g10/free-packet.c (free_packet): Add arg PARSECTX and handle shallow packet copies in the context. Change all callers. * g10/parse-packet.c (parse): Store certain packets in the parse context. -- Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
ba57f8302a
commit
afa8680908
12 changed files with 124 additions and 53 deletions
|
@ -575,7 +575,7 @@ write_onepass_sig_packets (SK_LIST sk_list, IOBUF out, int sigclass )
|
|||
pkt.pkttype = PKT_ONEPASS_SIG;
|
||||
pkt.pkt.onepass_sig = ops;
|
||||
rc = build_packet (out, &pkt);
|
||||
free_packet (&pkt);
|
||||
free_packet (&pkt, NULL);
|
||||
if (rc) {
|
||||
log_error ("build onepass_sig packet failed: %s\n",
|
||||
gpg_strerror (rc));
|
||||
|
@ -645,7 +645,7 @@ write_plaintext_packet (IOBUF out, IOBUF inp, const char *fname, int ptmode)
|
|||
log_error ("build_packet(PLAINTEXT) failed: %s\n",
|
||||
gpg_strerror (rc) );
|
||||
pt->buf = NULL;
|
||||
free_packet (&pkt);
|
||||
free_packet (&pkt, NULL);
|
||||
}
|
||||
else {
|
||||
byte copy_buffer[4096];
|
||||
|
@ -732,7 +732,7 @@ write_signature_packets (SK_LIST sk_list, IOBUF out, gcry_md_hd_t hash,
|
|||
rc = build_packet (out, &pkt);
|
||||
if (!rc && is_status_enabled())
|
||||
print_status_sig_created (pk, sig, status_letter);
|
||||
free_packet (&pkt);
|
||||
free_packet (&pkt, NULL);
|
||||
if (rc)
|
||||
log_error ("build signature packet failed: %s\n",
|
||||
gpg_strerror (rc));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue