mirror of
https://github.com/curl/curl.git
synced 2026-08-26 00:13:34 +03:00
infof: remove newline from format strings, always append it
- the data needs to be "line-based" anyway since it's also passed to the debug callback/application - it makes infof() work like failf() and consistency is good - there's an assert that triggers on newlines in the format string - Also removes a few instances of "..." - Removes the code that would append "..." to the end of the data *iff* it was truncated in infof() Closes #7357
This commit is contained in:
parent
1026b36ea0
commit
e7416cfd2b
69 changed files with 936 additions and 947 deletions
|
|
@ -112,7 +112,7 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data,
|
|||
|
||||
/* Ensure we have a valid challenge message */
|
||||
if(!Curl_bufref_len(chlg)) {
|
||||
infof(data, "DIGEST-MD5 handshake failure (empty challenge message)\n");
|
||||
infof(data, "DIGEST-MD5 handshake failure (empty challenge message)");
|
||||
return CURLE_BAD_CONTENT_ENCODING;
|
||||
}
|
||||
|
||||
|
|
@ -207,7 +207,7 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data,
|
|||
if(status == SEC_E_INSUFFICIENT_MEMORY)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
infof(data, "schannel: InitializeSecurityContext failed: %s\n",
|
||||
infof(data, "schannel: InitializeSecurityContext failed: %s",
|
||||
Curl_sspi_strerror(status, buffer, sizeof(buffer)));
|
||||
|
||||
return CURLE_AUTH_ERROR;
|
||||
|
|
@ -461,7 +461,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data,
|
|||
if(status == SEC_E_OK)
|
||||
output_token_len = chlg_buf[4].cbBuffer;
|
||||
else { /* delete the context so a new one can be made */
|
||||
infof(data, "digest_sspi: MakeSignature failed, error 0x%08lx\n",
|
||||
infof(data, "digest_sspi: MakeSignature failed, error 0x%08lx",
|
||||
(long)status);
|
||||
s_pSecFn->DeleteSecurityContext(digest->http_context);
|
||||
Curl_safefree(digest->http_context);
|
||||
|
|
@ -597,7 +597,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data,
|
|||
if(status == SEC_E_INSUFFICIENT_MEMORY)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
infof(data, "schannel: InitializeSecurityContext failed: %s\n",
|
||||
infof(data, "schannel: InitializeSecurityContext failed: %s",
|
||||
Curl_sspi_strerror(status, buffer, sizeof(buffer)));
|
||||
|
||||
return CURLE_AUTH_ERROR;
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data,
|
|||
|
||||
if(chlg) {
|
||||
if(!Curl_bufref_len(chlg)) {
|
||||
infof(data, "GSSAPI handshake failure (empty challenge message)\n");
|
||||
infof(data, "GSSAPI handshake failure (empty challenge message)");
|
||||
return CURLE_BAD_CONTENT_ENCODING;
|
||||
}
|
||||
input_token.value = (void *) Curl_bufref_ptr(chlg);
|
||||
|
|
@ -199,7 +199,7 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data,
|
|||
|
||||
/* Ensure we have a valid challenge message */
|
||||
if(!Curl_bufref_len(chlg)) {
|
||||
infof(data, "GSSAPI handshake failure (empty security message)\n");
|
||||
infof(data, "GSSAPI handshake failure (empty security message)");
|
||||
return CURLE_BAD_CONTENT_ENCODING;
|
||||
}
|
||||
|
||||
|
|
@ -238,7 +238,7 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data,
|
|||
|
||||
/* Not 4 octets long so fail as per RFC4752 Section 3.1 */
|
||||
if(output_token.length != 4) {
|
||||
infof(data, "GSSAPI handshake failure (invalid security data)\n");
|
||||
infof(data, "GSSAPI handshake failure (invalid security data)");
|
||||
gss_release_buffer(&unused_status, &username_token);
|
||||
return CURLE_BAD_CONTENT_ENCODING;
|
||||
}
|
||||
|
|
@ -250,7 +250,7 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data,
|
|||
/* Extract the security layer */
|
||||
sec_layer = indata & 0x000000FF;
|
||||
if(!(sec_layer & GSSAUTH_P_NONE)) {
|
||||
infof(data, "GSSAPI handshake failure (invalid security layer)\n");
|
||||
infof(data, "GSSAPI handshake failure (invalid security layer)");
|
||||
|
||||
gss_release_buffer(&unused_status, &username_token);
|
||||
return CURLE_BAD_CONTENT_ENCODING;
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data,
|
|||
|
||||
if(chlg) {
|
||||
if(!Curl_bufref_len(chlg)) {
|
||||
infof(data, "GSSAPI handshake failure (empty challenge message)\n");
|
||||
infof(data, "GSSAPI handshake failure (empty challenge message)");
|
||||
return CURLE_BAD_CONTENT_ENCODING;
|
||||
}
|
||||
|
||||
|
|
@ -272,7 +272,7 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data,
|
|||
|
||||
/* Ensure we have a valid challenge message */
|
||||
if(!Curl_bufref_len(chlg)) {
|
||||
infof(data, "GSSAPI handshake failure (empty security message)\n");
|
||||
infof(data, "GSSAPI handshake failure (empty security message)");
|
||||
return CURLE_BAD_CONTENT_ENCODING;
|
||||
}
|
||||
|
||||
|
|
@ -312,13 +312,13 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data,
|
|||
/* Decrypt the inbound challenge and obtain the qop */
|
||||
status = s_pSecFn->DecryptMessage(krb5->context, &input_desc, 0, &qop);
|
||||
if(status != SEC_E_OK) {
|
||||
infof(data, "GSSAPI handshake failure (empty security message)\n");
|
||||
infof(data, "GSSAPI handshake failure (empty security message)");
|
||||
return CURLE_BAD_CONTENT_ENCODING;
|
||||
}
|
||||
|
||||
/* Not 4 octets long so fail as per RFC4752 Section 3.1 */
|
||||
if(input_buf[1].cbBuffer != 4) {
|
||||
infof(data, "GSSAPI handshake failure (invalid security data)\n");
|
||||
infof(data, "GSSAPI handshake failure (invalid security data)");
|
||||
return CURLE_BAD_CONTENT_ENCODING;
|
||||
}
|
||||
|
||||
|
|
@ -329,7 +329,7 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data,
|
|||
/* Extract the security layer */
|
||||
sec_layer = indata & 0x000000FF;
|
||||
if(!(sec_layer & KERB_WRAP_NO_ENCRYPT)) {
|
||||
infof(data, "GSSAPI handshake failure (invalid security layer)\n");
|
||||
infof(data, "GSSAPI handshake failure (invalid security layer)");
|
||||
return CURLE_BAD_CONTENT_ENCODING;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ static CURLcode ntlm_decode_type2_target(struct Curl_easy *data,
|
|||
(target_info_offset + target_info_len) > type2len ||
|
||||
target_info_offset < 48) {
|
||||
infof(data, "NTLM handshake failure (bad type-2 message). "
|
||||
"Target Info Offset Len is set incorrect by the peer\n");
|
||||
"Target Info Offset Len is set incorrect by the peer");
|
||||
return CURLE_BAD_CONTENT_ENCODING;
|
||||
}
|
||||
|
||||
|
|
@ -286,7 +286,7 @@ CURLcode Curl_auth_decode_ntlm_type2_message(struct Curl_easy *data,
|
|||
(memcmp(type2, NTLMSSP_SIGNATURE, 8) != 0) ||
|
||||
(memcmp(type2 + 8, type2_marker, sizeof(type2_marker)) != 0)) {
|
||||
/* This was not a good enough type-2 message */
|
||||
infof(data, "NTLM handshake failure (bad type-2 message)\n");
|
||||
infof(data, "NTLM handshake failure (bad type-2 message)");
|
||||
return CURLE_BAD_CONTENT_ENCODING;
|
||||
}
|
||||
|
||||
|
|
@ -296,7 +296,7 @@ CURLcode Curl_auth_decode_ntlm_type2_message(struct Curl_easy *data,
|
|||
if(ntlm->flags & NTLMFLAG_NEGOTIATE_TARGET_INFO) {
|
||||
result = ntlm_decode_type2_target(data, type2ref, ntlm);
|
||||
if(result) {
|
||||
infof(data, "NTLM handshake failure (bad type-2 message)\n");
|
||||
infof(data, "NTLM handshake failure (bad type-2 message)");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -533,7 +533,7 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data,
|
|||
/* Get the machine's un-qualified host name as NTLM doesn't like the fully
|
||||
qualified domain name */
|
||||
if(Curl_gethostname(host, sizeof(host))) {
|
||||
infof(data, "gethostname() failed, continuing without!\n");
|
||||
infof(data, "gethostname() failed, continuing without!");
|
||||
hostlen = 0;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ CURLcode Curl_auth_decode_ntlm_type2_message(struct Curl_easy *data,
|
|||
|
||||
/* Ensure we have a valid type-2 message */
|
||||
if(!Curl_bufref_len(type2)) {
|
||||
infof(data, "NTLM handshake failure (empty type-2 message)\n");
|
||||
infof(data, "NTLM handshake failure (empty type-2 message)");
|
||||
return CURLE_BAD_CONTENT_ENCODING;
|
||||
}
|
||||
|
||||
|
|
@ -309,7 +309,7 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data,
|
|||
&type_3_desc,
|
||||
&attrs, &expiry);
|
||||
if(status != SEC_E_OK) {
|
||||
infof(data, "NTLM handshake failure (type-3 message): Status=%x\n",
|
||||
infof(data, "NTLM handshake failure (type-3 message): Status=%x",
|
||||
status);
|
||||
|
||||
if(status == SEC_E_INSUFFICIENT_MEMORY)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -137,8 +137,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
|
|||
|
||||
/* Ensure we have a valid challenge message */
|
||||
if(!chlg) {
|
||||
infof(data, "SPNEGO handshake failure (empty challenge message)\n");
|
||||
|
||||
infof(data, "SPNEGO handshake failure (empty challenge message)");
|
||||
return CURLE_BAD_CONTENT_ENCODING;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -191,8 +191,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
|
|||
|
||||
/* Ensure we have a valid challenge message */
|
||||
if(!chlg) {
|
||||
infof(data, "SPNEGO handshake failure (empty challenge message)\n");
|
||||
|
||||
infof(data, "SPNEGO handshake failure (empty challenge message)");
|
||||
return CURLE_BAD_CONTENT_ENCODING;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue