aboutsummaryrefslogtreecommitdiff
path: root/lib/http_negotiate.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-06-26 11:25:23 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-06-26 11:25:23 +0000
commit898e067ccc01d86e23410247fe037b14c3296c8a (patch)
tree92e2b24091e86bb3adba46da21ceaec1bdec4d57 /lib/http_negotiate.c
parent12859e345fceaa1599188e2a56419401687d1718 (diff)
kill warnings
Diffstat (limited to 'lib/http_negotiate.c')
-rw-r--r--lib/http_negotiate.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/lib/http_negotiate.c b/lib/http_negotiate.c
index 9a2d46a1f..63aa7fa40 100644
--- a/lib/http_negotiate.c
+++ b/lib/http_negotiate.c
@@ -35,14 +35,14 @@
#include "urldata.h"
#include "sendf.h"
#include "strequal.h"
-
+#include "base64.h"
#include "http_negotiate.h"
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
/* The last #include file should be: */
-#ifdef MALLOCDEBUG
+#ifdef CURLDEBUG
#include "memdebug.h"
#endif
@@ -101,7 +101,7 @@ log_gss_error(struct connectdata *conn, OM_uint32 error_status, char *prefix)
infof(conn->data, buf);
}
-CURLcode Curl_input_negotiate(struct connectdata *conn, char *header)
+int Curl_input_negotiate(struct connectdata *conn, char *header)
{
struct negotiatedata *neg_ctx = &conn->data->state.negotiate;
OM_uint32 major_status, minor_status, minor_status2;
@@ -133,13 +133,15 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, char *header)
len = strlen(header);
if (len > 0) {
+ int rawlen;
input_token.length = (len+3)/4 * 3;
input_token.value = malloc(input_token.length);
if (input_token.value == NULL)
return ENOMEM;
- input_token.length = Curl_base64_decode(header, input_token.value);
- if (input_token.length < 0)
+ rawlen = Curl_base64_decode(header, input_token.value);
+ if (rawlen < 0)
return -1;
+ input_token.length = rawlen;
}
major_status = gss_init_sec_context(&minor_status,
@@ -160,7 +162,8 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, char *header)
neg_ctx->status = major_status;
if (GSS_ERROR(major_status)) {
/* Curl_cleanup_negotiate(conn->data) ??? */
- log_gss_error(conn, minor_status, "gss_init_sec_context() failed: ");
+ log_gss_error(conn, minor_status,
+ (char *)"gss_init_sec_context() failed: ");
return -1;
}
@@ -180,19 +183,17 @@ CURLcode Curl_output_negotiate(struct connectdata *conn)
struct negotiatedata *neg_ctx = &conn->data->state.negotiate;
OM_uint32 minor_status;
char *encoded = NULL;
- size_t len;
-
- len = Curl_base64_encode(neg_ctx->output_token.value,
- neg_ctx->output_token.length,
- &encoded);
+ int len = Curl_base64_encode(neg_ctx->output_token.value,
+ neg_ctx->output_token.length,
+ &encoded);
if (len < 0)
- return -1;
+ return CURLE_OUT_OF_MEMORY;
conn->allocptr.userpwd =
aprintf("Authorization: GSS-Negotiate %s\r\n", encoded);
free(encoded);
gss_release_buffer(&minor_status, &neg_ctx->output_token);
- return (conn->allocptr.userpwd == NULL) ? ENOMEM : 0;
+ return (conn->allocptr.userpwd == NULL) ? CURLE_OUT_OF_MEMORY : CURLE_OK;
}
void Curl_cleanup_negotiate(struct SessionHandle *data)