mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-08 03:15:46 +00:00
Merge pull request #2941 from libgit2/cmn/http-enforce-cred
http: enforce the credential types
This commit is contained in:
commit
9ce97782b4
@ -350,6 +350,11 @@ static int on_headers_complete(http_parser *parser)
|
||||
} else {
|
||||
assert(t->cred);
|
||||
|
||||
if (!(t->cred->credtype & allowed_auth_types)) {
|
||||
giterr_set(GITERR_NET, "credentials callback returned an invalid cred type");
|
||||
return t->parse_error = PARSE_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
/* Successfully acquired a credential. */
|
||||
t->parse_error = PARSE_ERROR_REPLAY;
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user