Staging
v0.5.1
https://github.com/python/cpython
Revision 07432c33a0cab9d40ec71b274ec4bca5c57ca6e9 authored by Miss Islington (bot) on 22 November 2019, 23:38:37 UTC, committed by GitHub on 22 November 2019, 23:38:37 UTC

* fix HTTP Digest handling in request.py

There is a bug triggered when server replies to a request with `WWW-Authenticate: Digest` where `qop="auth,auth-int"` rather than mere `qop="auth"`. Having both `auth` and `auth-int` is legitimate according to the `qop-options` rule in §3.2.1 of [[https://www.ietf.org/rfc/rfc2617.txt|RFC 2617]]:
>      qop-options       = "qop" "=" <"> 1GH-qop-value <">
>      qop-value         = "auth" | "auth-int" | token
> **qop-options**: [...] If present, it is a quoted string **of one or more** tokens indicating the "quality of protection" values supported by the server.  The value `"auth"` indicates authentication; the value `"auth-int"` indicates authentication with integrity protection

This is description confirmed by the definition of the [//n//]`GH-`[//m//]//rule// extended-BNF pattern defined in §2.1 of [[https://www.ietf.org/rfc/rfc2616.txt|RFC 2616]] as 'a comma-separated list of //rule// with at least //n// and at most //m// items'.

When this reply is parsed by `get_authorization`, request.py only tests for identity with `'auth'`, failing to recognize it as one of the supported modes the server announced, and claims that `"qop 'auth,auth-int' is not supported"`.

* 📜🤖 Added by blurb_it.

* bpo-38686 review fix: remember why.

* fix trailing space in Lib/urllib/request.py

Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
(cherry picked from commit 14a89c47983f2fb9e7fdf33c769e622eefd3a14a)

Co-authored-by: PypeBros <PypeBros@users.noreply.github.com>
1 parent c58a811
History
Tip revision: 07432c33a0cab9d40ec71b274ec4bca5c57ca6e9 authored by Miss Islington (bot) on 22 November 2019, 23:38:37 UTC
bpo-38686: fix HTTP Digest handling in request.py (GH-17045)
Tip revision: 07432c3
File Mode Size
internal
Python-ast.h -rw-r--r-- 21.3 KB
Python.h -rw-r--r-- 3.5 KB
abstract.h -rw-r--r-- 39.8 KB
accu.h -rw-r--r-- 1016 bytes
asdl.h -rw-r--r-- 1.2 KB
ast.h -rw-r--r-- 641 bytes
bitset.h -rw-r--r-- 810 bytes
bltinmodule.h -rw-r--r-- 264 bytes
boolobject.h -rw-r--r-- 886 bytes
bytearrayobject.h -rw-r--r-- 2.1 KB
bytes_methods.h -rw-r--r-- 3.2 KB
bytesobject.h -rw-r--r-- 8.3 KB
cellobject.h -rw-r--r-- 713 bytes
ceval.h -rw-r--r-- 8.5 KB
classobject.h -rw-r--r-- 1.6 KB
code.h -rw-r--r-- 5.9 KB
codecs.h -rw-r--r-- 6.6 KB
compile.h -rw-r--r-- 2.9 KB
complexobject.h -rw-r--r-- 1.8 KB
context.h -rw-r--r-- 2.0 KB
datetime.h -rw-r--r-- 9.6 KB
descrobject.h -rw-r--r-- 3.1 KB
dictobject.h -rw-r--r-- 7.2 KB
dtoa.h -rw-r--r-- 458 bytes
dynamic_annotations.h -rw-r--r-- 21.9 KB
enumobject.h -rw-r--r-- 253 bytes
errcode.h -rw-r--r-- 1.7 KB
eval.h -rw-r--r-- 1.2 KB
fileobject.h -rw-r--r-- 1.8 KB
fileutils.h -rw-r--r-- 4.4 KB
floatobject.h -rw-r--r-- 4.7 KB
frameobject.h -rw-r--r-- 3.2 KB
funcobject.h -rw-r--r-- 4.1 KB
genobject.h -rw-r--r-- 3.6 KB
graminit.h -rw-r--r-- 1.9 KB
grammar.h -rw-r--r-- 2.3 KB
import.h -rw-r--r-- 4.9 KB
intrcheck.h -rw-r--r-- 861 bytes
iterobject.h -rw-r--r-- 567 bytes
listobject.h -rw-r--r-- 2.9 KB
longintrepr.h -rw-r--r-- 3.7 KB
longobject.h -rw-r--r-- 8.4 KB
marshal.h -rw-r--r-- 803 bytes
memoryobject.h -rw-r--r-- 2.7 KB
metagrammar.h -rw-r--r-- 253 bytes
methodobject.h -rw-r--r-- 4.4 KB
modsupport.h -rw-r--r-- 8.4 KB
moduleobject.h -rw-r--r-- 2.2 KB
namespaceobject.h -rw-r--r-- 349 bytes
node.h -rw-r--r-- 1.1 KB
object.h -rw-r--r-- 40.9 KB
objimpl.h -rw-r--r-- 14.1 KB
odictobject.h -rw-r--r-- 1.2 KB
opcode.h -rw-r--r-- 5.0 KB
osdefs.h -rw-r--r-- 691 bytes
osmodule.h -rw-r--r-- 291 bytes
parsetok.h -rw-r--r-- 2.8 KB
patchlevel.h -rw-r--r-- 1.3 KB
pgen.h -rw-r--r-- 253 bytes
pgenheaders.h -rw-r--r-- 1.2 KB
py_curses.h -rw-r--r-- 4.0 KB
pyarena.h -rw-r--r-- 2.7 KB
pyatomic.h -rw-r--r-- 15.7 KB
pycapsule.h -rw-r--r-- 1.7 KB
pyctype.h -rw-r--r-- 1.3 KB
pydebug.h -rw-r--r-- 1.2 KB
pydtrace.d -rw-r--r-- 969 bytes
pydtrace.h -rw-r--r-- 2.2 KB
pyerrors.h -rw-r--r-- 17.0 KB
pyexpat.h -rw-r--r-- 2.4 KB
pyfpe.h -rw-r--r-- 341 bytes
pyhash.h -rw-r--r-- 4.0 KB
pylifecycle.h -rw-r--r-- 7.6 KB
pymacconfig.h -rw-r--r-- 2.9 KB
pymacro.h -rw-r--r-- 3.5 KB
pymath.h -rw-r--r-- 8.1 KB
pymem.h -rw-r--r-- 8.8 KB
pyport.h -rw-r--r-- 27.6 KB
pystate.h -rw-r--r-- 15.9 KB
pystrcmp.h -rw-r--r-- 436 bytes
pystrhex.h -rw-r--r-- 495 bytes
pystrtod.h -rw-r--r-- 1.4 KB
pythonrun.h -rw-r--r-- 6.1 KB
pythread.h -rw-r--r-- 5.2 KB
pytime.h -rw-r--r-- 8.7 KB
rangeobject.h -rw-r--r-- 629 bytes
setobject.h -rw-r--r-- 3.3 KB
sliceobject.h -rw-r--r-- 2.4 KB
structmember.h -rw-r--r-- 2.0 KB
structseq.h -rw-r--r-- 1.3 KB
symtable.h -rw-r--r-- 4.8 KB
sysmodule.h -rw-r--r-- 1.5 KB
token.h -rw-r--r-- 2.4 KB
traceback.h -rw-r--r-- 3.6 KB
tupleobject.h -rw-r--r-- 2.4 KB
typeslots.h -rw-r--r-- 2.2 KB
ucnhash.h -rw-r--r-- 1.0 KB
unicodeobject.h -rw-r--r-- 80.3 KB
warnings.h -rw-r--r-- 1.7 KB
weakrefobject.h -rw-r--r-- 2.8 KB

back to top