Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curl tool: erase some more sensitive command line arguments #7964

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 22 additions & 13 deletions src/tool_getparam.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2021, Daniel Stenberg, <[email protected]>, et al.
* Copyright (C) 1998 - 2022, Daniel Stenberg, <[email protected]>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
Expand Down Expand Up @@ -669,6 +669,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
break;
case 'B': /* OAuth 2.0 bearer token */
GetStr(&config->oauth_bearer, nextarg);
cleanarg(nextarg);
config->authtype |= CURLAUTH_BEARER;
break;
case 'c': /* connect-timeout */
Expand Down Expand Up @@ -1617,16 +1618,20 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
GetStr(&config->crlfile, nextarg);
break;
case 'k': /* TLS username */
if(curlinfo->features & CURL_VERSION_TLSAUTH_SRP)
GetStr(&config->tls_username, nextarg);
else
if(!(curlinfo->features & CURL_VERSION_TLSAUTH_SRP)) {
cleanarg(nextarg);
return PARAM_LIBCURL_DOESNT_SUPPORT;
}
GetStr(&config->tls_username, nextarg);
cleanarg(nextarg);
break;
case 'l': /* TLS password */
if(curlinfo->features & CURL_VERSION_TLSAUTH_SRP)
GetStr(&config->tls_password, nextarg);
else
if(!(curlinfo->features & CURL_VERSION_TLSAUTH_SRP)) {
cleanarg(nextarg);
return PARAM_LIBCURL_DOESNT_SUPPORT;
}
GetStr(&config->tls_password, nextarg);
cleanarg(nextarg);
break;
case 'm': /* TLS authentication type */
if(curlinfo->features & CURL_VERSION_TLSAUTH_SRP) {
Expand Down Expand Up @@ -1687,17 +1692,21 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
break;

case 'u': /* TLS username for proxy */
if(curlinfo->features & CURL_VERSION_TLSAUTH_SRP)
GetStr(&config->proxy_tls_username, nextarg);
else
if(!(curlinfo->features & CURL_VERSION_TLSAUTH_SRP)) {
cleanarg(nextarg);
return PARAM_LIBCURL_DOESNT_SUPPORT;
}
GetStr(&config->proxy_tls_username, nextarg);
cleanarg(nextarg);
break;

case 'v': /* TLS password for proxy */
if(curlinfo->features & CURL_VERSION_TLSAUTH_SRP)
GetStr(&config->proxy_tls_password, nextarg);
else
if(!(curlinfo->features & CURL_VERSION_TLSAUTH_SRP)) {
cleanarg(nextarg);
return PARAM_LIBCURL_DOESNT_SUPPORT;
}
GetStr(&config->proxy_tls_password, nextarg);
cleanarg(nextarg);
break;

case 'w': /* TLS authentication type for proxy */
Expand Down