Take advantage of PUT_32BIT_MSB_FIRST when constructing sequence numbers
[sgt/putty] / cmdgen.c
index 50f99f7..254ae6a 100644 (file)
--- a/cmdgen.c
+++ b/cmdgen.c
@@ -118,10 +118,7 @@ void sk_cleanup(void)
 
 void showversion(void)
 {
-    char *verstr = dupstr(ver);
-    verstr[0] = tolower((unsigned char)verstr[0]);
-    printf("PuTTYgen %s\n", verstr);
-    sfree(verstr);
+    printf("puttygen: %s\n", ver);
 }
 
 void usage(int standalone)
@@ -667,7 +664,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) {
@@ -766,6 +763,9 @@ int main(int argc, char **argv)
                }
                ssh1key->comment = dupstr(origcomment);
                ssh1key->private_exponent = NULL;
+               ssh1key->p = NULL;
+               ssh1key->q = NULL;
+               ssh1key->iqmp = NULL;
            } else {
                ret = loadrsakey(infilename, ssh1key, passphrase, &error);
            }
@@ -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);
     }