aboutsummaryrefslogtreecommitdiffstats
path: root/g10/keyid.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2010-10-01 20:33:53 +0000
committerWerner Koch <[email protected]>2010-10-01 20:33:53 +0000
commitbfbd80feb95fba36292cd9dab43016f17b1e6972 (patch)
tree9afbfd29e8aeb78fa34a1a49d8b8071554d4f593 /g10/keyid.c
parent* options.skel: Make the example for force-v3-sigs match reality (it (diff)
downloadgnupg-bfbd80feb95fba36292cd9dab43016f17b1e6972.tar.gz
gnupg-bfbd80feb95fba36292cd9dab43016f17b1e6972.zip
Exporting secret keys via gpg-agent is now basically supported.
A couple of forward ported changes. Doc updates.
Diffstat (limited to 'g10/keyid.c')
-rw-r--r--g10/keyid.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/g10/keyid.c b/g10/keyid.c
index 1d0972649..a11769d67 100644
--- a/g10/keyid.c
+++ b/g10/keyid.c
@@ -242,9 +242,12 @@ keystr_with_sub (u32 *main_kid, u32 *sub_kid)
char *p;
mem2str (buffer, keystr (main_kid), KEYID_STR_SIZE);
- p = buffer + strlen (buffer);
- *p++ = '/';
- mem2str (p, keystr (sub_kid), KEYID_STR_SIZE);
+ if (sub_kid)
+ {
+ p = buffer + strlen (buffer);
+ *p++ = '/';
+ mem2str (p, keystr (sub_kid), KEYID_STR_SIZE);
+ }
return buffer;
}
@@ -262,9 +265,10 @@ const char *
keystr_from_pk_with_sub (PKT_public_key *main_pk, PKT_public_key *sub_pk)
{
keyid_from_pk (main_pk, NULL);
- keyid_from_pk (sub_pk, NULL);
+ if (sub_pk)
+ keyid_from_pk (sub_pk, NULL);
- return keystr_with_sub (main_pk->keyid, sub_pk->keyid);
+ return keystr_with_sub (main_pk->keyid, sub_pk? sub_pk->keyid:NULL);
}