Staging
v0.5.1
https://github.com/python/cpython
Revision b9e5547f5814962964c4a5bd5cd36a2af8fbf974 authored by Miss Islington (bot) on 22 November 2019, 23:36:38 UTC, committed by GitHub on 22 November 2019, 23:36:38 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 ca5fafc
History
Tip revision: b9e5547f5814962964c4a5bd5cd36a2af8fbf974 authored by Miss Islington (bot) on 22 November 2019, 23:36:38 UTC
bpo-38686: fix HTTP Digest handling in request.py (GH-17045)
Tip revision: b9e5547
File Mode Size
clinic
stringlib
README -rw-r--r-- 41 bytes
abstract.c -rw-r--r-- 68.6 KB
accu.c -rw-r--r-- 2.4 KB
boolobject.c -rw-r--r-- 6.6 KB
bytearrayobject.c -rw-r--r-- 70.2 KB
bytes_methods.c -rw-r--r-- 21.1 KB
bytesobject.c -rw-r--r-- 99.5 KB
call.c -rw-r--r-- 36.2 KB
capsule.c -rw-r--r-- 7.3 KB
cellobject.c -rw-r--r-- 5.7 KB
classobject.c -rw-r--r-- 19.2 KB
codeobject.c -rw-r--r-- 34.1 KB
complexobject.c -rw-r--r-- 32.5 KB
descrobject.c -rw-r--r-- 58.3 KB
dict-common.h -rw-r--r-- 2.2 KB
dictnotes.txt -rw-r--r-- 6.0 KB
dictobject.c -rw-r--r-- 138.0 KB
enumobject.c -rw-r--r-- 13.4 KB
exceptions.c -rw-r--r-- 87.2 KB
fileobject.c -rw-r--r-- 16.9 KB
floatobject.c -rw-r--r-- 71.3 KB
frameobject.c -rw-r--r-- 33.1 KB
funcobject.c -rw-r--r-- 31.1 KB
genobject.c -rw-r--r-- 66.1 KB
interpreteridobject.c -rw-r--r-- 8.5 KB
iterobject.c -rw-r--r-- 9.2 KB
listobject.c -rw-r--r-- 97.6 KB
listsort.txt -rw-r--r-- 35.3 KB
lnotab_notes.txt -rw-r--r-- 5.9 KB
longobject.c -rw-r--r-- 175.4 KB
memoryobject.c -rw-r--r-- 91.3 KB
methodobject.c -rw-r--r-- 13.8 KB
moduleobject.c -rw-r--r-- 24.8 KB
namespaceobject.c -rw-r--r-- 7.4 KB
object.c -rw-r--r-- 61.7 KB
obmalloc.c -rw-r--r-- 86.9 KB
odictobject.c -rw-r--r-- 73.2 KB
picklebufobject.c -rw-r--r-- 6.0 KB
rangeobject.c -rw-r--r-- 34.6 KB
setobject.c -rw-r--r-- 73.2 KB
sliceobject.c -rw-r--r-- 19.1 KB
structseq.c -rw-r--r-- 14.7 KB
tupleobject.c -rw-r--r-- 31.2 KB
typeobject.c -rw-r--r-- 243.5 KB
typeslots.inc -rw-r--r-- 3.9 KB
typeslots.py -rwxr-xr-x 1.2 KB
unicodectype.c -rw-r--r-- 7.5 KB
unicodeobject.c -rw-r--r-- 460.4 KB
unicodetype_db.h -rw-r--r-- 246.9 KB
weakrefobject.c -rw-r--r-- 30.8 KB

README

back to top