Update for version 0.5.4.

Fixed error in FWS regular expression that cause some valid signatures
fail verification (Thanks to Peter Palfrader (weasel) for the patch)
This commit is contained in:
Scott Kitterman
2013-06-09 22:43:29 -04:00
parent a5e10c1a98
commit fd0caddf16
5 changed files with 13 additions and 7 deletions
+2 -1
View File
@@ -118,7 +118,8 @@ def select_headers(headers, include_headers):
lastindex[h] = i
return sign_headers
FWS = r'(?:\r?\n\s+)?'
# FWS = ([*WSP CRLF] 1*WSP) / obs-FWS ; Folding white space [RFC5322]
FWS = r'(?:(?:\s*\r?\n)?\s+)?'
RE_BTAG = re.compile(r'([;\s]b'+FWS+r'=)(?:'+FWS+r'[a-zA-Z0-9+/=])*(?:\r?\n\Z)?')
def hash_headers(hasher, canonicalize_headers, headers, include_headers,