Add a bug-compatibility flag to disable the
[sgt/putty] / cmdgen.c
index 9cd5b52..5b0e54d 100644 (file)
--- a/cmdgen.c
+++ b/cmdgen.c
@@ -257,11 +257,11 @@ static char *blobfp(char *alg, int bits, unsigned char *blob, int bloblen)
 int main(int argc, char **argv)
 {
     char *infile = NULL;
-    Filename *infilename, *outfilename;
+    Filename *infilename = NULL, *outfilename = NULL;
     enum { NOKEYGEN, RSA1, RSA2, DSA } keytype = NOKEYGEN;    
     char *outfile = NULL, *outfiletmp = NULL;
     enum { PRIVATE, PUBLIC, PUBLICO, FP, OPENSSH, SSHCOM } outtype = PRIVATE;
-    int bits = 1024;
+    int bits = 2048;
     char *comment = NULL, *origcomment = NULL;
     int change_passphrase = FALSE;
     int errs = FALSE, nogo = FALSE;
@@ -667,7 +667,7 @@ int main(int argc, char **argv)
            return 1;
        }
        random_add_heavynoise(entropy, bits / 8);
-       memset(entropy, 0, bits/8);
+       smemclr(entropy, bits/8);
        sfree(entropy);
 
        if (keytype == DSA) {
@@ -720,7 +720,7 @@ int main(int argc, char **argv)
            int ret;
            p->to_server = FALSE;
            p->name = dupstr("SSH key passphrase");
-           add_prompt(p, dupstr("Enter passphrase to load key: "), FALSE, 512);
+           add_prompt(p, dupstr("Enter passphrase to load key: "), FALSE);
            ret = console_get_userpass_input(p, NULL, 0);
            assert(ret >= 0);
            if (!ret) {
@@ -845,8 +845,8 @@ int main(int argc, char **argv)
 
        p->to_server = FALSE;
        p->name = dupstr("New SSH key passphrase");
-       add_prompt(p, dupstr("Enter passphrase to save key: "), FALSE, 512);
-       add_prompt(p, dupstr("Re-enter passphrase to verify: "), FALSE, 512);
+       add_prompt(p, dupstr("Enter passphrase to save key: "), FALSE);
+       add_prompt(p, dupstr("Re-enter passphrase to verify: "), FALSE);
        ret = console_get_userpass_input(p, NULL, 0);
        assert(ret >= 0);
        if (!ret) {
@@ -860,7 +860,7 @@ int main(int argc, char **argv)
                return 1;
            }
            if (passphrase) {
-               memset(passphrase, 0, strlen(passphrase));
+               smemclr(passphrase, strlen(passphrase));
                sfree(passphrase);
            }
            passphrase = dupstr(p->prompts[0]->result);
@@ -1035,7 +1035,7 @@ int main(int argc, char **argv)
     }
 
     if (passphrase) {
-       memset(passphrase, 0, strlen(passphrase));
+       smemclr(passphrase, strlen(passphrase));
        sfree(passphrase);
     }