Commit 475db39b by Anders Borum

ignore unsupported http authentication schemes

auth_context_match returns 0 instead of -1 for unknown schemes to
not fail in situations where some authentication schemes are supported
and others are not.

apply_credentials is adjusted to handle auth_context_match returning
0 without producing authentication context.
parent a8d447f6
...@@ -142,7 +142,7 @@ static int auth_context_match( ...@@ -142,7 +142,7 @@ static int auth_context_match(
} }
if (!scheme) if (!scheme)
return -1; return 0;
/* See if authentication has already started for this scheme */ /* See if authentication has already started for this scheme */
git_vector_foreach(&t->auth_contexts, i, c) { git_vector_foreach(&t->auth_contexts, i, c) {
...@@ -188,6 +188,9 @@ static int apply_credentials(git_buf *buf, http_subtransport *t) ...@@ -188,6 +188,9 @@ static int apply_credentials(git_buf *buf, http_subtransport *t)
if (auth_context_match(&context, t, credtype_match, &cred->credtype) < 0) if (auth_context_match(&context, t, credtype_match, &cred->credtype) < 0)
return -1; return -1;
if (!context)
return 0;
return context->next_token(buf, context, cred); return context->next_token(buf, context, cred);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment