diff options
author | Werner Koch <wk@gnupg.org> | 2014-06-25 20:25:28 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2014-06-30 16:40:55 +0200 |
commit | 03018ef9eec75e4d91ea53c95547a77dedef8f80 (patch) | |
tree | b0d129512c829f5c94f35ce76933861bd44b1d15 /g10/keyid.c | |
parent | estream: Fix minor glitch in "%.*s" format. (diff) | |
download | gnupg2-03018ef9eec75e4d91ea53c95547a77dedef8f80.tar.xz gnupg2-03018ef9eec75e4d91ea53c95547a77dedef8f80.zip |
gpg: Auto-create revocation certificates.
* configure.ac (GNUPG_OPENPGP_REVOC_DIR): New config define.
* g10/revoke.c (create_revocation): Add arg "leadin".
(gen_standard_revoke): New.
* g10/openfile.c (get_openpgp_revocdir): New.
(open_outfile): Add MODE value 3.
* g10/keyid.c (hexfingerprint): New.
* g10/keygen.c (do_generate_keypair): Call gen_standard_revoke.
--
GnuPG-bug-id: 1042
Diffstat (limited to 'g10/keyid.c')
-rw-r--r-- | g10/keyid.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/g10/keyid.c b/g10/keyid.c index 9c94bd6b2..6ce6f3277 100644 --- a/g10/keyid.c +++ b/g10/keyid.c @@ -772,6 +772,20 @@ fingerprint_from_pk (PKT_public_key *pk, byte *array, size_t *ret_len) } +/* Return an allocated buffer with the fingerprint of PK formatted as + a plain hexstring. */ +char * +hexfingerprint (PKT_public_key *pk) +{ + unsigned char fpr[MAX_FINGERPRINT_LEN]; + size_t len; + char *result; + + fingerprint_from_pk (pk, fpr, &len); + result = xmalloc (2 * len + 1); + bin2hex (fpr, len, result); + return result; +} |