diff options
author | Werner Koch <[email protected]> | 2016-09-29 15:55:32 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2016-09-29 15:59:41 +0000 |
commit | 33800280da55a859e08dfa57f29144c89dd1bead (patch) | |
tree | 5c36328d866ad1bd0a49fef51a4ac7935d4009c7 /tools/gpg-wks.h | |
parent | tools: Convey signeddata also to the part_data callback in mime-parser. (diff) | |
download | gnupg-33800280da55a859e08dfa57f29144c89dd1bead.tar.gz gnupg-33800280da55a859e08dfa57f29144c89dd1bead.zip |
wks: Partly implement draft-koch-openpgp-webkey-service-02.
* tools/gpg-wks.h (WKS_RECEIVE_DRAFT2): New.
* tools/wks-receive.c: Include rfc822parse.h.
(struct receive_ctx_s): Add fields PARSER, DRAFT_VERSION_2, and
MULTIPART_MIXED_SEEN.
(decrypt_data): Add --no-options.
(verify_signature): Ditto.
(new_part): Check for Wks-Draft-Version header. Take care of text
parts.
(wks_receive): Set Parser and pass a flag value to RESULT_CB.
* tools/gpg-wks-client.c (read_confirmation_request): New.
(main) <aRead>: Call read_confirmation_request instead of
process_confirmation_request.
(command_receive_cb): Ditto. Add arg FLAGS..
(decrypt_stream_status_cb, decrypt_stream): New.
(command_send): Set header Wks-Draft-Version.
* tools/gpg-wks-server.c (struct server_ctx_s): Add field
DRAFT_VERSION_2.
(sign_stream_status_cb, sign_stream): New.
(command_receive_cb): Set draft flag.
(send_confirmation_request): Rework to implement protocol draft
version 2.
* tools/gpg-wks.h (DBG_MIME_VALUE, DBG_PARSER_VALUE): New.
(DBG_MIME, DBG_PARSER, DBG_CRYPTO): New. Use instead of a plain
opt.debug where useful.
* tools/gpg-wks-client.c (debug_flags): Add "mime" and "parser".
* tools/gpg-wks-server.c (debug_flags): Ditto.
--
If a client supporting the version 2 of the protocol is used, it will
tell this the server using a mail header. An old server will ignore
that but a recent server will use the new protocol. Next task is to
actually write draft-02.
There are still a lot of FIXMEs - take care.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'tools/gpg-wks.h')
-rw-r--r-- | tools/gpg-wks.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/gpg-wks.h b/tools/gpg-wks.h index 85000cc71..f8b6cfdc4 100644 --- a/tools/gpg-wks.h +++ b/tools/gpg-wks.h @@ -39,12 +39,18 @@ struct } opt; /* Debug values and macros. */ +#define DBG_MIME_VALUE 1 /* Debug the MIME structure. */ +#define DBG_PARSER_VALUE 2 /* Debug the Mail parser. */ #define DBG_CRYPTO_VALUE 4 /* Debug low level crypto. */ #define DBG_MEMORY_VALUE 32 /* Debug memory allocation stuff. */ #define DBG_MEMSTAT_VALUE 128 /* Show memory statistics. */ #define DBG_IPC_VALUE 1024 /* Debug assuan communication. */ #define DBG_EXTPROG_VALUE 16384 /* debug external program calls */ +#define DBG_MIME (opt.debug & DBG_MIME_VALUE) +#define DBG_PARSER (opt.debug & DBG_PARSER_VALUE) +#define DBG_CRYPTO (opt.debug & DBG_CRYPTO_VALUE) + /* The parsed policy flags. */ struct policy_flags_s @@ -64,10 +70,15 @@ gpg_error_t wks_parse_policy (policy_flags_t flags, estream_t stream, int ignore_unknown); /*-- wks-receive.c --*/ + +/* Flag values for the receive callback. */ +#define WKS_RECEIVE_DRAFT2 1 + gpg_error_t wks_receive (estream_t fp, gpg_error_t (*result_cb)(void *opaque, const char *mediatype, - estream_t data), + estream_t data, + unsigned int flags), void *cb_data); |