projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
A few more modpow tests, exercising the fallback option. This is
[u/mdw/putty]
/
cmdgen.c
diff --git
a/cmdgen.c
b/cmdgen.c
index
dfca9dc
..
ae40520
100644
(file)
--- a/
cmdgen.c
+++ b/
cmdgen.c
@@
-119,7
+119,7
@@
void sk_cleanup(void)
void showversion(void)
{
char *verstr = dupstr(ver);
void showversion(void)
{
char *verstr = dupstr(ver);
- verstr[0] = tolower(verstr[0]);
+ verstr[0] = tolower(
(unsigned char)
verstr[0]);
printf("PuTTYgen %s\n", verstr);
sfree(verstr);
}
printf("PuTTYgen %s\n", verstr);
sfree(verstr);
}
@@
-640,6
+640,11
@@
int main(int argc, char **argv)
random_ref();
entropy = get_random_data(bits / 8);
random_ref();
entropy = get_random_data(bits / 8);
+ if (!entropy) {
+ fprintf(stderr, "puttygen: failed to collect entropy, "
+ "could not generate key\n");
+ return 1;
+ }
random_add_heavynoise(entropy, bits / 8);
memset(entropy, 0, bits/8);
sfree(entropy);
random_add_heavynoise(entropy, bits / 8);
memset(entropy, 0, bits/8);
sfree(entropy);
@@
-893,7
+898,7
@@
int main(int argc, char **argv)
assert(ssh1key);
if (outfile)
assert(ssh1key);
if (outfile)
- fp = f_open(outfilename, "w");
+ fp = f_open(outfilename, "w"
, FALSE
);
else
fp = stdout;
dec1 = bignum_decimal(ssh1key->exponent);
else
fp = stdout;
dec1 = bignum_decimal(ssh1key->exponent);
@@
-951,7
+956,7
@@
int main(int argc, char **argv)
*p++ = '\0';
if (outfile)
*p++ = '\0';
if (outfile)
- fp = f_open(outfilename, "w");
+ fp = f_open(outfilename, "w"
, FALSE
);
else
fp = stdout;
fprintf(fp, "%s\n", buffer);
else
fp = stdout;
fprintf(fp, "%s\n", buffer);
@@
-981,7
+986,7
@@
int main(int argc, char **argv)
}
if (outfile)
}
if (outfile)
- fp = f_open(outfilename, "w");
+ fp = f_open(outfilename, "w"
, FALSE
);
else
fp = stdout;
fprintf(fp, "%s\n", fingerprint);
else
fp = stdout;
fprintf(fp, "%s\n", fingerprint);