aboutsummaryrefslogtreecommitdiffstats
path: root/g10/gpgv.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2020-03-13 16:14:34 +0000
committerWerner Koch <[email protected]>2020-03-13 16:14:34 +0000
commit6a4443c8425fd548020553b22d5a16ffad98371f (patch)
tree75da2b6c4ce956ef3923abef180ba079a40d770e /g10/gpgv.c
parentgpg: New option --include-key-block. (diff)
downloadgnupg-6a4443c8425fd548020553b22d5a16ffad98371f.tar.gz
gnupg-6a4443c8425fd548020553b22d5a16ffad98371f.zip
gpg: Make use of the included key block in a signature.
* g10/import.c (read_key_from_file): Rename to ... (read_key_from_file_or_buffer): this and add new parameters. Adjust callers. (import_included_key_block): New. * g10/packet.h (PKT_signature): Add field flags.key_block. * g10/parse-packet.c (parse_signature): Set that flags. * g10/sig-check.c (check_signature2): Add parm forced_pk and change all callers. * g10/mainproc.c (do_check_sig): Ditto. (check_sig_and_print): Try the included key block if no key is available. -- This is is the second part to support the new Key Block subpacket. The idea is that after having received a signed mail, it is instantly possible to reply encrypted - without the need for any centralized infrastructure. There is one case where this does not work: A signed mail is received using a specified signer ID (e.g. using gpg --sender option) and the key block with only that user ID is thus imported. The next time a mail is received using the same key but with a different user ID; the signatures checks out using the key imported the last time. However, the new user id is not imported. Now when trying to reply to that last mail, no key will be found. We need to see whether we can update a key in such a case. GnuPG-bug-id: 4856 Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/gpgv.c')
-rw-r--r--g10/gpgv.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/g10/gpgv.c b/g10/gpgv.c
index ae37fa340..65f5f89c7 100644
--- a/g10/gpgv.c
+++ b/g10/gpgv.c
@@ -484,14 +484,26 @@ keyserver_import_ldap (const char *name)
gpg_error_t
-read_key_from_file (ctrl_t ctrl, const char *fname, kbnode_t *r_keyblock)
+read_key_from_file_or_buffer (ctrl_t ctrl, const char *fname,
+ const void *buffer, size_t buflen,
+ kbnode_t *r_keyblock)
{
(void)ctrl;
(void)fname;
+ (void)buffer;
+ (void)buflen;
(void)r_keyblock;
return -1;
}
+gpg_error_t
+import_included_key_block (ctrl_t ctrl, kbnode_t keyblock)
+{
+ (void)ctrl;
+ (void)keyblock;
+ return -1;
+}
+
/* Stub:
* No encryption here but mainproc links to these functions.