diff options
author | Daniel Stenberg <daniel@haxx.se> | 2001-03-12 16:02:29 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2001-03-12 16:02:29 +0000 |
commit | fb7a6e3423e6aba4d4cf0522a24b7e0b84236c22 (patch) | |
tree | 1a1053dfdf1ff5d72bbcbf749f3b60fbaff010b0 | |
parent | cc99e3f7decd0d0596a4d24091e3d18f074c75cb (diff) |
added --random-file and --egd-file to the command line client
-rw-r--r-- | CHANGES | 7 | ||||
-rw-r--r-- | src/main.c | 66 |
2 files changed, 51 insertions, 22 deletions
@@ -8,6 +8,13 @@ Daniel (12 March 2001) +- Added CURLOPT_RANDOM_FILE and CURLOPT_EGDSOCKET to libcurl for seeding the + SSL random engine. The random seeding support was also brought to the curl + client with the new options --random-file <file> and --egd-file <file>. I + need some people to really test this to know they work as supposed. Remember + that libcurl now informs (if verbose is on) if the random seed is considered + weak (HTTPS connections). + - Made the chunked transfer-encoding engine detected bad formatted data length and return error if so (we can't possibly extract sensible data if this is the case). Added a test case that detects this. Number 36. Now there are 60 diff --git a/src/main.c b/src/main.c index 253daae67..8d100b0bd 100644 --- a/src/main.c +++ b/src/main.c @@ -295,7 +295,9 @@ static void help(void) " -3/--sslv3 Force usage of SSLv3 (H)"); puts(" -#/--progress-bar Display transfer progress as a progress bar\n" " --crlf Convert LF to CRLF in upload. Useful for MVS (OS/390)\n" - " --stderr <file> Where to redirect stderr. - means stdout."); + " --stderr <file> Where to redirect stderr. - means stdout.\n" + " --random-file <file> File to use for reading random data from (SSL)\n" + " --egd-file <file> EGD socket path for random data (SSL)"); } struct LongShort { @@ -305,6 +307,8 @@ struct LongShort { }; struct Configurable { + char *random_file; + char *egd_file; char *useragent; char *cookie; bool use_resume; @@ -524,6 +528,8 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */ {"7", "interface", TRUE}, {"6", "krb4", TRUE}, {"5", "url", TRUE}, + {"5a", "random-file", TRUE}, + {"5b", "egd-file", TRUE}, {"2", "sslv2", FALSE}, {"3", "sslv3", FALSE}, @@ -673,29 +679,37 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */ GetStr(&config->krb4level, nextarg); break; case '5': - /* the URL! */ - { - struct getout *url; - if(config->url_get || (config->url_get=config->url_list)) { - /* there's a node here, if it already is filled-in continue to find - an "empty" node */ - while(config->url_get && (config->url_get->flags&GETOUT_URL)) - config->url_get = config->url_get->next; - } + switch(subletter) { + case 'a': /* random-file */ + GetStr(&config->random_file, nextarg); + break; + case 'b': /* egd-file */ + GetStr(&config->egd_file, nextarg); + break; + default: /* the URL! */ + { + struct getout *url; + if(config->url_get || (config->url_get=config->url_list)) { + /* there's a node here, if it already is filled-in continue to find + an "empty" node */ + while(config->url_get && (config->url_get->flags&GETOUT_URL)) + config->url_get = config->url_get->next; + } - /* now there might or might not be an available node to fill in! */ + /* now there might or might not be an available node to fill in! */ - if(config->url_get) - /* existing node */ - url = config->url_get; - else - /* there was no free node, create one! */ - url=new_getout(config); - - if(url) { - /* fill in the URL */ - GetStr(&url->url, nextarg); - url->flags |= GETOUT_URL; + if(config->url_get) + /* existing node */ + url = config->url_get; + else + /* there was no free node, create one! */ + url=new_getout(config); + + if(url) { + /* fill in the URL */ + GetStr(&url->url, nextarg); + url->flags |= GETOUT_URL; + } } } break; @@ -1367,6 +1381,10 @@ void progressbarinit(struct ProgressData *bar) void free_config_fields(struct Configurable *config) { + if(config->random_file) + free(config->random_file); + if(config->egd_file) + free(config->egd_file); if(config->userpwd) free(config->userpwd); if(config->postfields) @@ -1819,6 +1837,10 @@ operate(struct Configurable *config, int argc, char *argv[]) /* new in libcurl 7.6.2: */ curl_easy_setopt(curl, CURLOPT_TELNETOPTIONS, config->telnet_options); + + /* new in libcurl 7.7: */ + curl_easy_setopt(curl, CURLOPT_RANDOM_FILE, config->random_file); + curl_easy_setopt(curl, CURLOPT_EGDSOCKET, config->egd_file); res = curl_easy_perform(curl); |