mirror of
https://github.com/curl/curl.git
synced 2026-08-25 21:03:34 +03:00
removed space after if and while before the parenthesis for better source code
consistency
This commit is contained in:
parent
af29dcbafb
commit
ad6e28073c
24 changed files with 1070 additions and 1068 deletions
|
|
@ -64,13 +64,13 @@ get_gss_name(struct connectdata *conn, bool proxy, gss_name_t *server)
|
|||
|
||||
/* IIS uses the <service>@<fqdn> form but uses 'http' as the service name */
|
||||
|
||||
if (neg_ctx->gss)
|
||||
if(neg_ctx->gss)
|
||||
service = "KHTTP";
|
||||
else
|
||||
service = "HTTP";
|
||||
|
||||
token.length = strlen(service) + 1 + strlen(proxy ? conn->proxy.name : conn->host.name) + 1;
|
||||
if (token.length + 1 > sizeof(name))
|
||||
if(token.length + 1 > sizeof(name))
|
||||
return EMSGSIZE;
|
||||
|
||||
snprintf(name, sizeof(name), "%s@%s", service, proxy ? conn->proxy.name : conn->host.name);
|
||||
|
|
@ -102,13 +102,13 @@ log_gss_error(struct connectdata *conn, OM_uint32 error_status, char *prefix)
|
|||
GSS_C_NO_OID,
|
||||
&msg_ctx,
|
||||
&status_string);
|
||||
if (sizeof(buf) > len + status_string.length + 1) {
|
||||
if(sizeof(buf) > len + status_string.length + 1) {
|
||||
snprintf(buf + len, sizeof(buf) - len,
|
||||
": %s", (char*) status_string.value);
|
||||
len += status_string.length;
|
||||
}
|
||||
gss_release_buffer(&min_stat, &status_string);
|
||||
} while (!GSS_ERROR(maj_stat) && msg_ctx != 0);
|
||||
} while(!GSS_ERROR(maj_stat) && msg_ctx != 0);
|
||||
|
||||
infof(conn->data, "%s", buf);
|
||||
}
|
||||
|
|
@ -130,15 +130,15 @@ int Curl_input_negotiate(struct connectdata *conn, bool proxy, const char *heade
|
|||
protocol = "GSS-Negotiate";
|
||||
gss = TRUE;
|
||||
}
|
||||
else if (checkprefix("Negotiate", header)) {
|
||||
else if(checkprefix("Negotiate", header)) {
|
||||
protocol = "Negotiate";
|
||||
gss = FALSE;
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
|
||||
if (neg_ctx->context) {
|
||||
if (neg_ctx->gss != gss) {
|
||||
if(neg_ctx->context) {
|
||||
if(neg_ctx->gss != gss) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
@ -147,7 +147,7 @@ int Curl_input_negotiate(struct connectdata *conn, bool proxy, const char *heade
|
|||
neg_ctx->gss = gss;
|
||||
}
|
||||
|
||||
if (neg_ctx->context && neg_ctx->status == GSS_S_COMPLETE) {
|
||||
if(neg_ctx->context && neg_ctx->status == GSS_S_COMPLETE) {
|
||||
/* We finished succesfully our part of authentication, but server
|
||||
* rejected it (since we're again here). Exit with an error since we
|
||||
* can't invent anything better */
|
||||
|
|
@ -155,7 +155,7 @@ int Curl_input_negotiate(struct connectdata *conn, bool proxy, const char *heade
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (neg_ctx->server_name == NULL &&
|
||||
if(neg_ctx->server_name == NULL &&
|
||||
(ret = get_gss_name(conn, proxy, &neg_ctx->server_name)))
|
||||
return ret;
|
||||
|
||||
|
|
@ -164,14 +164,14 @@ int Curl_input_negotiate(struct connectdata *conn, bool proxy, const char *heade
|
|||
header++;
|
||||
|
||||
len = strlen(header);
|
||||
if (len > 0) {
|
||||
if(len > 0) {
|
||||
int rawlen = Curl_base64_decode(header, (unsigned char **)&input_token.value);
|
||||
if (rawlen < 0)
|
||||
if(rawlen < 0)
|
||||
return -1;
|
||||
input_token.length = rawlen;
|
||||
|
||||
#ifdef HAVE_SPNEGO /* Handle SPNEGO */
|
||||
if (checkprefix("Negotiate", header)) {
|
||||
if(checkprefix("Negotiate", header)) {
|
||||
ASN1_OBJECT * object = NULL;
|
||||
int rc = 1;
|
||||
unsigned char * spnegoToken = NULL;
|
||||
|
|
@ -180,12 +180,12 @@ int Curl_input_negotiate(struct connectdata *conn, bool proxy, const char *heade
|
|||
size_t mechTokenLength = 0;
|
||||
|
||||
spnegoToken = malloc(input_token.length);
|
||||
if (input_token.value == NULL)
|
||||
if(input_token.value == NULL)
|
||||
return ENOMEM;
|
||||
spnegoTokenLength = input_token.length;
|
||||
|
||||
object = OBJ_txt2obj ("1.2.840.113554.1.2.2", 1);
|
||||
if (!parseSpnegoTargetToken(spnegoToken,
|
||||
if(!parseSpnegoTargetToken(spnegoToken,
|
||||
spnegoTokenLength,
|
||||
NULL,
|
||||
NULL,
|
||||
|
|
@ -224,17 +224,17 @@ int Curl_input_negotiate(struct connectdata *conn, bool proxy, const char *heade
|
|||
&output_token,
|
||||
NULL,
|
||||
NULL);
|
||||
if (input_token.length > 0)
|
||||
if(input_token.length > 0)
|
||||
gss_release_buffer(&minor_status2, &input_token);
|
||||
neg_ctx->status = major_status;
|
||||
if (GSS_ERROR(major_status)) {
|
||||
if(GSS_ERROR(major_status)) {
|
||||
/* Curl_cleanup_negotiate(conn->data) ??? */
|
||||
log_gss_error(conn, minor_status,
|
||||
(char *)"gss_init_sec_context() failed: ");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (output_token.length == 0) {
|
||||
if(output_token.length == 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -253,7 +253,7 @@ CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy)
|
|||
int len;
|
||||
|
||||
#ifdef HAVE_SPNEGO /* Handle SPNEGO */
|
||||
if (checkprefix("Negotiate",neg_ctx->protocol)) {
|
||||
if(checkprefix("Negotiate",neg_ctx->protocol)) {
|
||||
ASN1_OBJECT * object = NULL;
|
||||
int rc = 1;
|
||||
unsigned char * spnegoToken = NULL;
|
||||
|
|
@ -262,14 +262,14 @@ CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy)
|
|||
size_t responseTokenLength = 0;
|
||||
|
||||
responseToken = malloc(neg_ctx->output_token.length);
|
||||
if ( responseToken == NULL)
|
||||
if( responseToken == NULL)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
memcpy(responseToken, neg_ctx->output_token.value,
|
||||
neg_ctx->output_token.length);
|
||||
responseTokenLength = neg_ctx->output_token.length;
|
||||
|
||||
object=OBJ_txt2obj ("1.2.840.113554.1.2.2", 1);
|
||||
if (!makeSpnegoInitialToken (object,
|
||||
if(!makeSpnegoInitialToken (object,
|
||||
responseToken,
|
||||
responseTokenLength,
|
||||
&spnegoToken,
|
||||
|
|
@ -295,7 +295,7 @@ CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy)
|
|||
neg_ctx->output_token.length,
|
||||
&encoded);
|
||||
|
||||
if (len == 0)
|
||||
if(len == 0)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
conn->allocptr.userpwd =
|
||||
|
|
@ -310,13 +310,13 @@ void Curl_cleanup_negotiate(struct SessionHandle *data)
|
|||
OM_uint32 minor_status;
|
||||
struct negotiatedata *neg_ctx = &data->state.negotiate;
|
||||
|
||||
if (neg_ctx->context != GSS_C_NO_CONTEXT)
|
||||
if(neg_ctx->context != GSS_C_NO_CONTEXT)
|
||||
gss_delete_sec_context(&minor_status, &neg_ctx->context, GSS_C_NO_BUFFER);
|
||||
|
||||
if (neg_ctx->output_token.length != 0)
|
||||
if(neg_ctx->output_token.length != 0)
|
||||
gss_release_buffer(&minor_status, &neg_ctx->output_token);
|
||||
|
||||
if (neg_ctx->server_name != GSS_C_NO_NAME)
|
||||
if(neg_ctx->server_name != GSS_C_NO_NAME)
|
||||
gss_release_name(&minor_status, &neg_ctx->server_name);
|
||||
|
||||
memset(neg_ctx, 0, sizeof(*neg_ctx));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue