From 7aabd94b8103432b42cd909e911bf0c645e0298c Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Sat, 28 May 2022 17:37:34 +0200 Subject: [PATCH] gpg: Setup the 'usage' filter property for export. * g10/export.c (do_export_stream): Merge the key to get the properties ready. -- This makes gpg --export --export-filter 'drop-subkey=usage=~a' (Export all subkeys but those with the auth usage) work without using the workaound of adding --export-options export-clean --- g10/export.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/g10/export.c b/g10/export.c index 1eec70935..edf27bc4d 100644 --- a/g10/export.c +++ b/g10/export.c @@ -2066,6 +2066,12 @@ do_export_stream (ctrl_t ctrl, iobuf_t out, strlist_t users, int secret, NULL, NULL); commit_kbnode (&keyblock); } + else if (export_keep_uid || export_drop_subkey) + { + /* Need to merge so that for example the "usage" property + * has been setup. */ + merge_keys_and_selfsig (ctrl, keyblock); + } if (export_keep_uid) {