- gnupg-2.0.22/tools/gpgkey2ssh.c 2013-10-02 09:30:15.000000000 +0200
+++ gnupg-2.0.22-patched/tools/gpgkey2ssh.c 2014-01-26 07:03:33.025215169 +0100
@@ -261,9 +261,25 @@
algorithm_id = 0; /* (avoid cc warning) */ identifier = NULL; /* (avoid cc warning) */
- assert (argc == 2);
+ if(2!=argc) {
+ puts("Wrong number of arguments!");
+ puts("Usage gpg2sshkey keyid!");
+ exit (1);
+ }
+
keyid = argv[1];
+ if(! keyid) {
+ puts("No keyid");
+ exit (1);
+ }
+
+ int len;
+ len = strlen(keyid);
+ if (len <8) {
+ puts("keyid to small");
+ exit (1);
+ }
ret = asprintf (&command, "gpg --list-keys --with-colons --with-key-data '%s'",
Greetings
Simon
.