1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00
putty-source/proxy
Simon Tatham ce1774282c HTTP proxy: correctly handle multiple auth headers.
This is a piece I forgot in the initial implementation of HTTP Digest:
an HTTP server can send _more than one_ authentication request header
(WWW-Authenticate for normal servers, Proxy-Authenticate for proxies),
and if it does, they're supposed to be treated as alternatives to each
other, so that the client chooses one to reply to.

I suppose that technically we were 'complying' with that spec already,
in that HttpProxyNegotiator would have read each new header and
overwritten all the fields set by the previous one, so we'd always
have gone with the last header presented by the server. But that seems
inelegant: better to choose the one we actually like best.

So now we do that. All the details of an auth header are moved out of
the main HttpProxyNegotiator struct into a sub-struct we can have
multiple copies of. Each new header is parsed into a fresh struct of
that kind, and then we can compare it with the previous one and decide
which we prefer.

The preference order, naturally, is 'more secure is better': Digest
beats Basic, and between two Digest headers, SHA-256 beats MD5. (And
anything beats a header we can't make sense of at all.)

Another side effect of this change is that a 407 response which
contains _no_ Proxy-Authenticate headers will trigger an error message
saying so, instead of just going with whatever happened to be left in
the relevant variables from the previous attempt.
2021-12-21 09:36:25 +00:00
..
cproxy.c Withdraw support for SHA-512-256 in HTTP Digest. 2021-11-27 11:41:00 +00:00
cproxy.h HTTP proxy: correctly handle multiple auth headers. 2021-12-21 09:36:25 +00:00
http.c HTTP proxy: correctly handle multiple auth headers. 2021-12-21 09:36:25 +00:00
interactor.c Fix Plink's handling of interactor_announce() blank lines. 2021-11-06 14:48:26 +00:00
nocproxy.c Withdraw support for SHA-512-256 in HTTP Digest. 2021-11-27 11:41:00 +00:00
noproxy.c Pass an Interactor to new_connection(). 2021-10-30 18:19:56 +01:00
nosshproxy.c Pass an Interactor to new_connection(). 2021-10-30 18:19:56 +01:00
pproxy.c Move proxy-related source files into a subdirectory. 2021-10-30 17:29:24 +01:00
proxy.c Send ProxyNegotiator output even when pn->done is set. 2021-11-19 16:39:25 +00:00
proxy.h HTTP proxy: implement Digest authentication. 2021-11-20 15:08:19 +00:00
socks4.c Reorganise proxy system into coroutines. 2021-11-19 15:09:17 +00:00
socks5.c Support interactive password prompts in SOCKS 5. 2021-11-19 15:40:10 +00:00
socks.h Pull out SOCKS protocol constants into a header. 2021-11-19 15:09:17 +00:00
sshproxy.c New Seat query, has_mixed_input_stream(). 2021-11-06 14:48:26 +00:00
telnet.c Telnet proxy: censor the password in the log file. 2021-11-19 18:34:10 +00:00