diff options
author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2008-04-08 21:02:35 -0400 |
---|---|---|
committer | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2008-04-08 21:02:35 -0400 |
commit | 29b46325c50f7b767d1027c817c4e050806f2aa1 (patch) | |
tree | 0aab0b9299d0044dd7379758d77f81647ce74c77 /gnutls-helpers.c | |
parent | 106d82cc8db97956d373f09e44dcdee661918c90 (diff) |
working with subkeys: preparing to write a gnutls-based gpg2ssh capable of feeding the monkeysphere.
Diffstat (limited to 'gnutls-helpers.c')
-rw-r--r-- | gnutls-helpers.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gnutls-helpers.c b/gnutls-helpers.c index f5d37e6..a2f8446 100644 --- a/gnutls-helpers.c +++ b/gnutls-helpers.c @@ -18,6 +18,24 @@ void logfunc(int level, const char* string) { fprintf(stderr, "GnuTLS Logging (%d): %s\n", level, string); } +void init_keyid(gnutls_openpgp_keyid_t keyid) { + memset(keyid, 'x', sizeof(gnutls_openpgp_keyid_t)); +} + + + +void make_keyid_printable(printable_keyid out, gnutls_openpgp_keyid_t keyid) +{ + static const char hex[16] = "0123456789ABCDEF"; + unsigned int kix = 0, outix = 0; + + while (kix < sizeof(gnutls_openpgp_keyid_t)) { + out[outix] = hex[(keyid[kix] >> 4) & 0x0f]; + out[outix + 1] = hex[keyid[kix] & 0x0f]; + kix++; + outix += 2; + } +} int init_gnutls() { |