]> git.proxmox.com Git - libgit2.git/blobdiff - src/transports/auth_negotiate.c
New upstream version 1.3.0+dfsg.1
[libgit2.git] / src / transports / auth_negotiate.c
index 8a614b81a3a2f24f7d861ce14a2906ed39dc5ab4..31469933e74825613657f64e4148f418ff54a26a 100644 (file)
@@ -65,7 +65,9 @@ static int negotiate_set_challenge(
 {
        http_auth_negotiate_context *ctx = (http_auth_negotiate_context *)c;
 
-       assert(ctx && ctx->configured && challenge);
+       GIT_ASSERT_ARG(ctx);
+       GIT_ASSERT_ARG(challenge);
+       GIT_ASSERT(ctx->configured);
 
        git__free(ctx->challenge);
 
@@ -108,7 +110,12 @@ static int negotiate_next_token(
        size_t challenge_len;
        int error = 0;
 
-       assert(buf && ctx && ctx->configured && cred && cred->credtype == GIT_CREDENTIAL_DEFAULT);
+       GIT_ASSERT_ARG(buf);
+       GIT_ASSERT_ARG(ctx);
+       GIT_ASSERT_ARG(cred);
+
+       GIT_ASSERT(ctx->configured);
+       GIT_ASSERT(cred->credtype == GIT_CREDENTIAL_DEFAULT);
 
        if (ctx->complete)
                return 0;
@@ -202,7 +209,7 @@ static int negotiate_is_complete(git_http_auth_context *c)
 {
        http_auth_negotiate_context *ctx = (http_auth_negotiate_context *)c;
 
-       assert(ctx);
+       GIT_ASSERT_ARG(ctx);
 
        return (ctx->complete == 1);
 }
@@ -260,7 +267,7 @@ static int negotiate_init_context(
 
        if (!ctx->oid) {
                git_error_set(GIT_ERROR_NET, "negotiate authentication is not supported");
-               return -1;
+               return GIT_EAUTH;
        }
 
        git_buf_puts(&ctx->target, "HTTP@");