aboutsummaryrefslogtreecommitdiffstats
path: root/g10/export.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/export.c')
-rw-r--r--g10/export.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/g10/export.c b/g10/export.c
index cf1a3cc2b..26aac1969 100644
--- a/g10/export.c
+++ b/g10/export.c
@@ -230,6 +230,17 @@ do_export_stream( IOBUF out, STRLIST users, int secret,
keystr(sk_keyid));
continue;
}
+
+ /* It does not make sense to export a key with a primary
+ key on card using a non-key stub. We simply skip those
+ keys when used with --export-secret-subkeys. */
+ if (secret == 2 && sk->is_protected
+ && sk->protect.s2k.mode == 1002 )
+ {
+ log_info(_("key %s: key material on-card - skipped\n"),
+ keystr(sk_keyid));
+ continue;
+ }
}
else
{