vauth: move auth structs to conn meta data

Remove structs for negotiate, krb5, ntlm and gsasl from connectdata and
store them as connection meta data with auto cleanup.

De-complexify sasl mech selection by moving code into static functions.

Closes #17557
This commit is contained in:
Stefan Eissing 2025-06-09 15:09:28 +02:00 committed by Daniel Stenberg
parent 05ffeeda0c
commit ab650379a8
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
16 changed files with 598 additions and 396 deletions

View file

@ -3221,8 +3221,10 @@ static CURLcode http_header(struct Curl_easy *data,
}
#ifdef USE_SPNEGO
if(HD_IS(hd, hdlen, "Persistent-Auth:")) {
struct negotiatedata *negdata = &conn->negotiate;
struct negotiatedata *negdata = Curl_auth_nego_get(conn, FALSE);
struct auth *authp = &data->state.authhost;
if(!negdata)
return CURLE_OUT_OF_MEMORY;
if(authp->picked == CURLAUTH_NEGOTIATE) {
char *persistentauth = Curl_copy_header_value(hd);
if(!persistentauth)