- Fix unbound local variable error when processing signatures with an x

tag, but no t tag (LP: #1739637)
This commit is contained in:
Scott Kitterman committed 2017-12-21 16:35:42 -05:00
1 parent 6b80254bd9
commit 10e12c60d8
2 files changed
+4

No files matched your search

+2
View File
@@ -260,6 +260,8 @@ def validate_signature_fields(sig, mandatory_fields=[b'v', b'a', b'b', b'bh', b'
raise ValidationError(
"x= value is not a decimal integer (%s)" % sig[b'x'])
x_sign = int(sig[b'x'])
now = int(time.time())
slop = 36000 # 10H leeway for mailers with inaccurate clocks
if x_sign < now - slop:
raise ValidationError(
"x= value is past (%s)" % sig[b'x'])