]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - cmdgen.c
Fix an EOF-testing goof in winhandl.c.
[PuTTY.git] / cmdgen.c
index 94ce49eaaebc190c37add9b6050fdc9ba1fe1d42..d6c1f72115ac3080b17e7750aa1ee15350637e08 100644 (file)
--- a/cmdgen.c
+++ b/cmdgen.c
@@ -129,7 +129,9 @@ void sk_cleanup(void)
 
 void showversion(void)
 {
-    printf("puttygen: %s\n", ver);
+    char *buildinfo_text = buildinfo("\n");
+    printf("puttygen: %s\n%s", ver, buildinfo_text);
+    sfree(buildinfo_text);
 }
 
 void usage(int standalone)
@@ -223,6 +225,8 @@ static char *readpassphrase(const char *filename)
     return line;
 }
 
+#define DEFAULT_RSADSA_BITS 2048
+
 int main(int argc, char **argv)
 {
     char *infile = NULL;
@@ -500,7 +504,7 @@ int main(int argc, char **argv)
             bits = 256;
             break;
           default:
-            bits = 2048;
+            bits = DEFAULT_RSADSA_BITS;
             break;
         }
     }
@@ -520,6 +524,11 @@ int main(int argc, char **argv)
             fprintf(stderr, "puttygen: cannot generate %s keys shorter than"
                     " 256 bits\n", (keytype == DSA ? "DSA" : "RSA"));
             errs = TRUE;
+        } else if (bits < DEFAULT_RSADSA_BITS) {
+            fprintf(stderr, "puttygen: warning: %s keys shorter than"
+                    " %d bits are probably not secure\n",
+                    (keytype == DSA ? "DSA" : "RSA"), DEFAULT_RSADSA_BITS);
+            /* but this is just a warning, so proceed anyway */
         }
     }