summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/http_negotiate.c
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2025-04-21 09:33:29 +0300
committerdartraiden <wowemuh@gmail.com>2025-04-21 09:50:38 +0300
commitcf6ba06cd445f1f4554701637d5bab581acfba98 (patch)
tree0d9b618df1c8f888cb37221be0590f4a677fe477 /libs/libcurl/src/http_negotiate.c
parent842ec200cd37ae05f2a9c56f2a4040088d2ac917 (diff)
libcurl: update to 8.13.0
Diffstat (limited to 'libs/libcurl/src/http_negotiate.c')
-rw-r--r--libs/libcurl/src/http_negotiate.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/libs/libcurl/src/http_negotiate.c b/libs/libcurl/src/http_negotiate.c
index a7a98533b3..4ee77718c4 100644
--- a/libs/libcurl/src/http_negotiate.c
+++ b/libs/libcurl/src/http_negotiate.c
@@ -32,6 +32,7 @@
#include "http_negotiate.h"
#include "vauth/vauth.h"
#include "vtls/vtls.h"
+#include "strparse.h"
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
@@ -86,8 +87,7 @@ CURLcode Curl_input_negotiate(struct Curl_easy *data, struct connectdata *conn,
/* Obtain the input token, if any */
header += strlen("Negotiate");
- while(*header && ISBLANK(*header))
- header++;
+ Curl_str_passblanks(&header);
len = strlen(header);
neg_ctx->havenegdata = len != 0;
@@ -109,9 +109,10 @@ CURLcode Curl_input_negotiate(struct Curl_easy *data, struct connectdata *conn,
neg_ctx->sslContext = conn->sslContext;
#endif
/* Check if the connection is using SSL and get the channel binding data */
-#if defined(USE_SSL) && defined(HAVE_GSSAPI)
+#ifdef HAVE_GSSAPI
+ Curl_dyn_init(&neg_ctx->channel_binding_data, SSL_CB_MAX_SIZE + 1);
+#ifdef USE_SSL
if(Curl_conn_is_ssl(conn, FIRSTSOCKET)) {
- Curl_dyn_init(&neg_ctx->channel_binding_data, SSL_CB_MAX_SIZE + 1);
result = Curl_ssl_get_channel_binding(
data, FIRSTSOCKET, &neg_ctx->channel_binding_data);
if(result) {
@@ -119,13 +120,14 @@ CURLcode Curl_input_negotiate(struct Curl_easy *data, struct connectdata *conn,
return result;
}
}
-#endif
+#endif /* USE_SSL */
+#endif /* HAVE_GSSAPI */
/* Initialize the security context and decode our challenge */
result = Curl_auth_decode_spnego_message(data, userp, passwdp, service,
host, header, neg_ctx);
-#if defined(USE_SSL) && defined(HAVE_GSSAPI)
+#ifdef HAVE_GSSAPI
Curl_dyn_free(&neg_ctx->channel_binding_data);
#endif
@@ -203,12 +205,12 @@ CURLcode Curl_output_negotiate(struct Curl_easy *data,
if(proxy) {
#ifndef CURL_DISABLE_PROXY
- Curl_safefree(data->state.aptr.proxyuserpwd);
+ free(data->state.aptr.proxyuserpwd);
data->state.aptr.proxyuserpwd = userp;
#endif
}
else {
- Curl_safefree(data->state.aptr.userpwd);
+ free(data->state.aptr.userpwd);
data->state.aptr.userpwd = userp;
}