2016-02-03 11:36:19 |
toxinu |
description |
This bug only occur with Python 3 (tested with 3.4).
`references` header field in DKIM.SHOULD is not represented as bytes.
Test that show bug:
```
def test_simple_signature(self):
# A message verifies after being signed with SHOULD headers
for header_algo in (b"simple", b"relaxed"):
for body_algo in (b"simple", b"relaxed"):
sig = dkim.sign(
self.message, b"test", b"example.com", self.key,
canonicalize=(header_algo, body_algo),
include_headers=(b'from',) + dkim.DKIM.SHOULD)
res = dkim.verify(sig + self.message, dnsfunc=self.dnsfunc)
self.assertTrue(res)
```
======================================================================
ERROR: test_simple_signature (dkim.tests.test_dkim.TestSignAndVerify)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/glehee/Documents/Repositories/dkimpy/dkim/tests/test_dkim.py", line 87, in test_simple_signature
include_headers=(b'from',) + dkim.DKIM.SHOULD)
File "/home/glehee/Documents/Repositories/dkimpy/dkim/__init__.py", line 620, in sign
return d.sign(selector, domain, privkey, identity=identity, canonicalize=canonicalize, include_headers=include_headers, length=length)
File "/home/glehee/Documents/Repositories/dkimpy/dkim/__init__.py", line 471, in sign
(b'h', b" : ".join(include_headers)),
TypeError: sequence item 20: expected a bytes-like object, str found
You can found this work on our github branch here: https://github.com/oasiswork/dkimpy/commit/6a4dd61b86f8358d4632c17ea6636651387874c7 |
This bug only occur with Python 3 (tested with 3.4).
`references` header field in DKIM.SHOULD is not represented as bytes.
Test that show bug:
```
def test_simple_signature(self):
# A message verifies after being signed with SHOULD headers
for header_algo in (b"simple", b"relaxed"):
for body_algo in (b"simple", b"relaxed"):
sig = dkim.sign(
self.message, b"test", b"example.com", self.key,
canonicalize=(header_algo, body_algo),
include_headers=(b'from',) + dkim.DKIM.SHOULD)
res = dkim.verify(sig + self.message, dnsfunc=self.dnsfunc)
self.assertTrue(res)
```
======================================================================
ERROR: test_simple_signature (dkim.tests.test_dkim.TestSignAndVerify)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/glehee/Documents/Repositories/dkimpy/dkim/tests/test_dkim.py", line 87, in test_simple_signature
include_headers=(b'from',) + dkim.DKIM.SHOULD)
File "/home/glehee/Documents/Repositories/dkimpy/dkim/__init__.py", line 620, in sign
return d.sign(selector, domain, privkey, identity=identity, canonicalize=canonicalize, include_headers=include_headers, length=length)
File "/home/glehee/Documents/Repositories/dkimpy/dkim/__init__.py", line 471, in sign
(b'h', b" : ".join(include_headers)),
TypeError: sequence item 20: expected a bytes-like object, str found
You can found this work on our github branch here:
https://github.com/oasiswork/dkimpy/commit/6a4dd61b86f8358d4632c17ea6636651387874c7 |
|