[PATCH 3/4] gpgkey2ssh: accept a 0x prefix for keyid argument

Daniel Kahn Gillmor dkg at fifthhorseman.net
Tue Oct 27 22:09:42 CET 2015


* tools/gpgkey2ssh.c (main): accept keyID argument written 0xlong
  format as well as normal long format.

Signed-off-by: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
---
 tools/gpgkey2ssh.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/gpgkey2ssh.c b/tools/gpgkey2ssh.c
index 3b4b076..f700f7a 100644
--- a/tools/gpgkey2ssh.c
+++ b/tools/gpgkey2ssh.c
@@ -283,6 +283,9 @@ main (int argc, char **argv)
 
   keyid = argv[1];
 
+  if (keyid[0] == '0' && keyid[1] == 'x')
+    keyid = keyid + 2;
+
   arglen = strlen(keyid);
   if (arglen != 16)
     return gpgkey2ssh_usage(1, stderr);
-- 
2.6.1




More information about the Gnupg-devel mailing list