aboutsummaryrefslogtreecommitdiffstats
path: root/g10/packet.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2018-12-04 14:43:19 +0000
committerWerner Koch <[email protected]>2018-12-04 14:43:19 +0000
commitc6e2ee020784de63edfa83c76095e086eae49eef (patch)
tree54c84e99311f06dc18cf38dfea1794a2e984b87e /g10/packet.h
parentwks: Allow reading of --install-key arguments from stdin. (diff)
downloadgnupg-c6e2ee020784de63edfa83c76095e086eae49eef.tar.gz
gnupg-c6e2ee020784de63edfa83c76095e086eae49eef.zip
gpg: Prepare revocation keys for use with v5 keys.
* g10/packet.h (struct revocation_key): Add field 'fprlen'. * g10/parse-packet.c (parse_revkeys): Set fprlen and allow for v5 keys. Also fix reading of unitialized data at place where MAX_FINGERPRINT_LEN is used. * g10/revoke.c (gen_desig_revoke): Allow for v5 keys and use fprlen. Do an explicit compare to avoid reading unitialized data. * g10/sig-check.c (check_revocation_keys): Use the fprlen. * g10/getkey.c (merge_selfsigs_main): Do an explicit copy to avoid reading unitialized data. * g10/import.c (revocation_present): Use fprlen. * g10/keyedit.c (show_key_with_all_names): Use fprlen. (menu_addrevoker): Use fprlen. Allow for v5 keys. * g10/keygen.c (keygen_add_revkey): Use fprlen. (parse_revocation_key): Allow for v5 keys. * g10/keyid.c (keyid_from_fingerprint): Allow for v5 keys. Print a better error message in case of bogus fingerprints. * g10/keylist.c (print_revokers): Use fprlen. -- The reading of uninitialized data is harmless but we better fix it to make valgrind happy. More serious was that we always passed MAX_FINGERPRINT_LEN but we will need to support 20 and 32 octet fingerprints and MAX_FINGERPRINT_LEN would be too large for a v4. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/packet.h')
-rw-r--r--g10/packet.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/g10/packet.h b/g10/packet.h
index d088bf432..1ec12d64b 100644
--- a/g10/packet.h
+++ b/g10/packet.h
@@ -180,6 +180,8 @@ struct revocation_key {
byte class;
/* The public-key algorithm ID. */
byte algid;
+ /* The length of the fingerprint. */
+ byte fprlen;
/* The fingerprint of the authorized key. */
byte fpr[MAX_FINGERPRINT_LEN];
};