UnboundLocalError: local variable 'now' referenced before assignment

Bug #1739637 reported by Cyril N.
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dkimpy
Fix Released
High
Scott Kitterman

Bug Description

Running the dkim.verify() code, I got the following exception on some cases:

  File "/var/www/venv/local/lib/python2.7/site-packages/dkim/__init__.py", line 1037, in verify │
    return d.verify(dnsfunc=dnsfunc) │
  File "/var/www/venv/local/lib/python2.7/site-packages/dkim/__init__.py", line 704, in verify │
    validate_signature_fields(sig) │
  File "/var/www/venv/local/lib/python2.7/site-packages/dkim/__init__.py", line 252, in validate_signature_fields │
    if x_sign < now - slop: │
UnboundLocalError: local variable 'now' referenced before assignment

Changed in dkimpy:
importance: Undecided → High
status: New → Triaged
assignee: nobody → Scott Kitterman (kitterman)
milestone: none → 0.7.0
Revision history for this message
Scott Kitterman (kitterman) wrote :

Thanks. I see the problem.

'now' is set when the t= Signature Timestamp signature tag is parsed and then used when the x= Signature Expiration tag is parsed and evaluated as well.

Changed in dkimpy:
status: Triaged → Fix Committed
Revision history for this message
Cyril N. (cnicodeme) wrote :

Wow that was fast! Nice job! Thank you :)

Revision history for this message
Scott Kitterman (kitterman) wrote :

Fixed in 0.7.0.

Changed in dkimpy:
milestone: 0.7.0 → none
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.