mirror of
https://github.com/mirror/wget.git
synced 2025-01-07 19:00:30 +08:00
[svn] Implement EGD support.
Submitted by Christian Fraenkel in <005501c17920$1312d440$4a05a8c0@isn>.
This commit is contained in:
parent
0f56f4056a
commit
ae3c268719
@ -1,3 +1,11 @@
|
|||||||
|
2001-11-30 Christian Fraenkel <c.fraenkel@gmx.net>
|
||||||
|
|
||||||
|
* init.c: New command `ssl_egd_sock'.
|
||||||
|
|
||||||
|
* main.c (main): New option `--sslegdsock'.
|
||||||
|
|
||||||
|
* gen_sslfunc.c (ssl_init_prng): Seed the RNG using EGD.
|
||||||
|
|
||||||
2001-11-29 Hrvoje Niksic <hniksic@arsdigita.com>
|
2001-11-29 Hrvoje Niksic <hniksic@arsdigita.com>
|
||||||
|
|
||||||
* cmpt.c (memmove): Include a simple memmove implementation.
|
* cmpt.c (memmove): Include a simple memmove implementation.
|
||||||
|
@ -53,11 +53,13 @@ ssl_init_prng (void)
|
|||||||
{
|
{
|
||||||
char rand_file[256];
|
char rand_file[256];
|
||||||
time_t t;
|
time_t t;
|
||||||
pid_t pid;
|
|
||||||
long l,seed;
|
long l,seed;
|
||||||
|
|
||||||
t = time(NULL);
|
t = time(NULL);
|
||||||
pid = getpid();
|
/* gets random data from egd if opt.sslegdsock was set */
|
||||||
|
if (opt.sslegdsock != NULL)
|
||||||
|
RAND_egd(opt.sslegdsock);
|
||||||
|
/* gets the file ~/.rnd or $RANDFILE if set */
|
||||||
RAND_file_name(rand_file, 256);
|
RAND_file_name(rand_file, 256);
|
||||||
if (rand_file != NULL)
|
if (rand_file != NULL)
|
||||||
{
|
{
|
||||||
@ -66,8 +68,6 @@ ssl_init_prng (void)
|
|||||||
}
|
}
|
||||||
/* Seed in time (mod_ssl does this) */
|
/* Seed in time (mod_ssl does this) */
|
||||||
RAND_seed((unsigned char *)&t, sizeof(time_t));
|
RAND_seed((unsigned char *)&t, sizeof(time_t));
|
||||||
/* Seed in pid (mod_ssl does this) */
|
|
||||||
RAND_seed((unsigned char *)&pid, sizeof(pid_t));
|
|
||||||
/* Initialize system's random number generator */
|
/* Initialize system's random number generator */
|
||||||
RAND_bytes((unsigned char *)&seed, sizeof(long));
|
RAND_bytes((unsigned char *)&seed, sizeof(long));
|
||||||
srand48(seed);
|
srand48(seed);
|
||||||
|
@ -179,6 +179,7 @@ static struct {
|
|||||||
#ifdef HAVE_SSL
|
#ifdef HAVE_SSL
|
||||||
{ "sslcertfile", &opt.sslcertfile, cmd_file },
|
{ "sslcertfile", &opt.sslcertfile, cmd_file },
|
||||||
{ "sslcertkey", &opt.sslcertkey, cmd_file },
|
{ "sslcertkey", &opt.sslcertkey, cmd_file },
|
||||||
|
{ "sslegdsock", &opt.sslegdsock, cmd_file },
|
||||||
#endif /* HAVE_SSL */
|
#endif /* HAVE_SSL */
|
||||||
{ "timeout", &opt.timeout, cmd_time },
|
{ "timeout", &opt.timeout, cmd_time },
|
||||||
{ "timestamping", &opt.timestamping, cmd_boolean },
|
{ "timestamping", &opt.timestamping, cmd_boolean },
|
||||||
|
@ -146,6 +146,7 @@ Logging and input file:\n\
|
|||||||
-B, --base=URL prepends URL to relative links in -F -i file.\n\
|
-B, --base=URL prepends URL to relative links in -F -i file.\n\
|
||||||
--sslcertfile=FILE optional client certificate.\n\
|
--sslcertfile=FILE optional client certificate.\n\
|
||||||
--sslcertkey=KEYFILE optional keyfile for this certificate.\n\
|
--sslcertkey=KEYFILE optional keyfile for this certificate.\n\
|
||||||
|
--sslegdsock=FILE socket to the egd daemon(random data source).\n\
|
||||||
\n"), stdout);
|
\n"), stdout);
|
||||||
fputs (_("\
|
fputs (_("\
|
||||||
Download:\n\
|
Download:\n\
|
||||||
@ -320,6 +321,7 @@ main (int argc, char *const *argv)
|
|||||||
#ifdef HAVE_SSL
|
#ifdef HAVE_SSL
|
||||||
{ "sslcertfile", required_argument, NULL, 158 },
|
{ "sslcertfile", required_argument, NULL, 158 },
|
||||||
{ "sslcertkey", required_argument, NULL, 159 },
|
{ "sslcertkey", required_argument, NULL, 159 },
|
||||||
|
{ "sslegdsock", required_argument, NULL, 166 },
|
||||||
#endif /* HAVE_SSL */
|
#endif /* HAVE_SSL */
|
||||||
{ "wait", required_argument, NULL, 'w' },
|
{ "wait", required_argument, NULL, 'w' },
|
||||||
{ "waitretry", required_argument, NULL, 152 },
|
{ "waitretry", required_argument, NULL, 152 },
|
||||||
@ -540,6 +542,9 @@ GNU General Public License for more details.\n"));
|
|||||||
case 159:
|
case 159:
|
||||||
setval ("sslcertkey", optarg);
|
setval ("sslcertkey", optarg);
|
||||||
break;
|
break;
|
||||||
|
case 166:
|
||||||
|
setval ("sslegdsock", optarg);
|
||||||
|
break;
|
||||||
#endif /* HAVE_SSL */
|
#endif /* HAVE_SSL */
|
||||||
case 'A':
|
case 'A':
|
||||||
setval ("accept", optarg);
|
setval ("accept", optarg);
|
||||||
|
@ -160,6 +160,7 @@ struct options
|
|||||||
char *sslcertkey; /* the keyfile for this certificate
|
char *sslcertkey; /* the keyfile for this certificate
|
||||||
(if not internal) included in the
|
(if not internal) included in the
|
||||||
certfile. */
|
certfile. */
|
||||||
|
char *sslegdsock; /* optional socket of the egd daemon */
|
||||||
#endif /* HAVE_SSL */
|
#endif /* HAVE_SSL */
|
||||||
|
|
||||||
int cookies;
|
int cookies;
|
||||||
|
Loading…
Reference in New Issue
Block a user