aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/curl/lib/http_negotiate.c
diff options
context:
space:
mode:
authordeshevoy <deshevoy@yandex-team.ru>2022-02-10 16:46:56 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:56 +0300
commite988f30484abe5fdeedcc7a5d3c226c01a21800c (patch)
tree0a217b173aabb57b7e51f8a169989b1a3e0309fe /contrib/libs/curl/lib/http_negotiate.c
parent33ee501c05d3f24036ae89766a858930ae66c548 (diff)
downloadydb-e988f30484abe5fdeedcc7a5d3c226c01a21800c.tar.gz
Restoring authorship annotation for <deshevoy@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/curl/lib/http_negotiate.c')
-rw-r--r--contrib/libs/curl/lib/http_negotiate.c90
1 files changed, 45 insertions, 45 deletions
diff --git a/contrib/libs/curl/lib/http_negotiate.c b/contrib/libs/curl/lib/http_negotiate.c
index 872d172fc6..1274232112 100644
--- a/contrib/libs/curl/lib/http_negotiate.c
+++ b/contrib/libs/curl/lib/http_negotiate.c
@@ -22,42 +22,42 @@
#include "curl_setup.h"
-#if !defined(CURL_DISABLE_HTTP) && defined(USE_SPNEGO)
+#if !defined(CURL_DISABLE_HTTP) && defined(USE_SPNEGO)
#include "urldata.h"
#include "sendf.h"
#include "http_negotiate.h"
-#include "vauth/vauth.h"
-
-/* The last 3 #include files should be in this order */
-#include "curl_printf.h"
+#include "vauth/vauth.h"
+
+/* The last 3 #include files should be in this order */
+#include "curl_printf.h"
#include "curl_memory.h"
#include "memdebug.h"
-CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
- const char *header)
+CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
+ const char *header)
{
- CURLcode result;
- struct Curl_easy *data = conn->data;
+ CURLcode result;
+ struct Curl_easy *data = conn->data;
size_t len;
- /* Point to the username, password, service and host */
- const char *userp;
- const char *passwdp;
- const char *service;
- const char *host;
+ /* Point to the username, password, service and host */
+ const char *userp;
+ const char *passwdp;
+ const char *service;
+ const char *host;
- /* Point to the correct struct with this */
- struct negotiatedata *neg_ctx;
+ /* Point to the correct struct with this */
+ struct negotiatedata *neg_ctx;
curlnegotiate state;
- if(proxy) {
+ if(proxy) {
#ifndef CURL_DISABLE_PROXY
- userp = conn->http_proxy.user;
- passwdp = conn->http_proxy.passwd;
- service = data->set.str[STRING_PROXY_SERVICE_NAME] ?
- data->set.str[STRING_PROXY_SERVICE_NAME] : "HTTP";
- host = conn->http_proxy.host.name;
+ userp = conn->http_proxy.user;
+ passwdp = conn->http_proxy.passwd;
+ service = data->set.str[STRING_PROXY_SERVICE_NAME] ?
+ data->set.str[STRING_PROXY_SERVICE_NAME] : "HTTP";
+ host = conn->http_proxy.host.name;
neg_ctx = &conn->proxyneg;
state = conn->proxy_negotiate_state;
#else
@@ -65,39 +65,39 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
#endif
}
else {
- userp = conn->user;
- passwdp = conn->passwd;
- service = data->set.str[STRING_SERVICE_NAME] ?
- data->set.str[STRING_SERVICE_NAME] : "HTTP";
- host = conn->host.name;
+ userp = conn->user;
+ passwdp = conn->passwd;
+ service = data->set.str[STRING_SERVICE_NAME] ?
+ data->set.str[STRING_SERVICE_NAME] : "HTTP";
+ host = conn->host.name;
neg_ctx = &conn->negotiate;
state = conn->http_negotiate_state;
}
- /* Not set means empty */
- if(!userp)
- userp = "";
+ /* Not set means empty */
+ if(!userp)
+ userp = "";
- if(!passwdp)
- passwdp = "";
+ if(!passwdp)
+ passwdp = "";
- /* Obtain the input token, if any */
- header += strlen("Negotiate");
+ /* Obtain the input token, if any */
+ header += strlen("Negotiate");
while(*header && ISSPACE(*header))
header++;
len = strlen(header);
neg_ctx->havenegdata = len != 0;
- if(!len) {
+ if(!len) {
if(state == GSS_AUTHSUCC) {
infof(conn->data, "Negotiate auth restarted\n");
Curl_http_auth_cleanup_negotiate(conn);
}
else if(state != GSS_AUTHNONE) {
/* The server rejected our authentication and hasn't supplied any more
- negotiation mechanisms */
+ negotiation mechanisms */
Curl_http_auth_cleanup_negotiate(conn);
- return CURLE_LOGIN_DENIED;
+ return CURLE_LOGIN_DENIED;
}
}
@@ -106,14 +106,14 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
neg_ctx->sslContext = conn->sslContext;
#endif
- /* Initialize the security context and decode our challenge */
- result = Curl_auth_decode_spnego_message(data, userp, passwdp, service,
- host, header, neg_ctx);
+ /* Initialize the security context and decode our challenge */
+ result = Curl_auth_decode_spnego_message(data, userp, passwdp, service,
+ host, header, neg_ctx);
- if(result)
+ if(result)
Curl_http_auth_cleanup_negotiate(conn);
- return result;
+ return result;
}
CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy)
@@ -125,10 +125,10 @@ CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy)
curlnegotiate *state = proxy ? &conn->proxy_negotiate_state :
&conn->http_negotiate_state;
struct Curl_easy *data = conn->data;
- char *base64 = NULL;
+ char *base64 = NULL;
size_t len = 0;
char *userp;
- CURLcode result;
+ CURLcode result;
authp->done = FALSE;
@@ -222,4 +222,4 @@ void Curl_http_auth_cleanup_negotiate(struct connectdata *conn)
Curl_auth_cleanup_spnego(&conn->proxyneg);
}
-#endif /* !CURL_DISABLE_HTTP && USE_SPNEGO */
+#endif /* !CURL_DISABLE_HTTP && USE_SPNEGO */