bytearray index out of range in DKIM.verify()

Bug #1145013 reported by Stuart Gathman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dkimpy
Status tracked in Trunk
Trunk
Fix Released
Medium
Stuart Gathman

Bug Description

2013Feb26 18:49:11 check_dkim: bytearray index out of range
Traceback (most recent call last):
  File "bms.py", line 1877, in check_dkim
    res = d.verify()
  File "/usr/lib/python2.6/site-packages/dkim/__init__.py", line 546, in verify
    pk = parse_public_key(base64.b64decode(pub[b'p']))
  File "/usr/lib/python2.6/site-packages/dkim/crypto.py", line 112, in parse_public_key
    x = asn1_parse(ASN1_Object, data)
  File "/usr/lib/python2.6/site-packages/dkim/asn1.py", line 57, in asn1_parse
    tag = data[i]
IndexError: bytearray index out of range

Revision history for this message
Stuart Gathman (stuart-gathman) wrote :
Revision history for this message
Stuart Gathman (stuart-gathman) wrote :

Unfortunately, my milter does not capture the DNS record. It works now, so they must have fixed it. Now I'll have to tinker to find how to break it in a similar way. In addition to a test case and fix, the goal is to save the raw DNS record on exceptions involving the public key.

Revision history for this message
Stuart Gathman (stuart-gathman) wrote :

Committed test case and fix as revision 102.

Changed in dkimpy:
assignee: nobody → Stuart Gathman (stuart-gathman)
importance: Undecided → Medium
status: New → Fix Committed
Revision history for this message
Scott Kitterman (kitterman) wrote :

Fixed in 0.5.4.

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.