diff options
author | Werner Koch <[email protected]> | 2017-03-29 08:02:40 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2017-03-29 08:06:29 +0000 |
commit | 0526c99164d3531b5ec763ffc672407eb24b2296 (patch) | |
tree | 0deb94a79a1cb2b916548e5d5cbb58114402dc2e /g10/keyedit.c | |
parent | gpg: Export ring trust packets in backup mode. (diff) | |
download | gnupg-0526c99164d3531b5ec763ffc672407eb24b2296.tar.gz gnupg-0526c99164d3531b5ec763ffc672407eb24b2296.zip |
gpg: Change parse_packet to take a context.
* g10/packet.h (struct parse_packet_ctx_s): New.
(parse_packet_ctx_t): New type.
(init_parse_packet): New macro.
* g10/parse-packet.c (parse_packet, dbg_parse_packet): Change to take
a parse context. Change all callers to provide a context instead of
directly supplying the input stream.
(search_packet, dbg_search_packet): Ditto.
(copy_all_packets, dbg_copy_all_packets): Init an use a parse context.
(copy_some_packets, dbg_copy_some_packets): Ditto.
(skip_some_packets, dbg_skip_some_packets): Ditto.
--
We will need this change to handle ring packets inside the parser.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to '')
-rw-r--r-- | g10/keyedit.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/g10/keyedit.c b/g10/keyedit.c index 9a7fe1308..76d188927 100644 --- a/g10/keyedit.c +++ b/g10/keyedit.c @@ -2431,6 +2431,7 @@ keyedit_menu (ctrl_t ctrl, const char *username, strlist_t locusr, char *fname; PACKET *pkt; IOBUF a; + struct parse_packet_ctx_s parsectx; if (!*arg_string) { @@ -2464,7 +2465,8 @@ keyedit_menu (ctrl_t ctrl, const char *username, strlist_t locusr, /* Parse and check that file. */ pkt = xmalloc (sizeof *pkt); init_packet (pkt); - err = parse_packet (a, pkt); + init_parse_packet (&parsectx, a); + err = parse_packet (&parsectx, pkt); iobuf_close (a); iobuf_ioctl (NULL, IOBUF_IOCTL_INVALIDATE_CACHE, 0, (char *) fname); if (!err && pkt->pkttype != PKT_SECRET_KEY |