- 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
2017-12-21 16:35:42 -05:00
parent 6b80254bd9
commit 10e12c60d8
2 changed files with 4 additions and 0 deletions
+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'])