From 4079b79abc52cea8abefdb69190109cb97c5788c Mon Sep 17 00:00:00 2001 From: Gene Shuman Date: Wed, 1 Mar 2017 16:48:32 -0800 Subject: [PATCH] Fix byte casting issues & typos --- ChangeLog | 1 + dkim/__init__.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7c0fb03..b6014a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ UNRELEASED Version 0.6.2 - Fixed python3.4 string interpolation issue + - Fix some byte casting issues & typos 2017-01-27 Version 0.6.1 - Fixed python3 dns lookup issue diff --git a/dkim/__init__.py b/dkim/__init__.py index 480045d..46b2c4c 100644 --- a/dkim/__init__.py +++ b/dkim/__init__.py @@ -390,9 +390,9 @@ class DomainSigner(object): SHOULD = ( b'sender', b'reply-to', b'subject', b'date', b'message-id', b'to', b'cc', b'mime-version', b'content-type', b'content-transfer-encoding', - b'content-id', b'content- description', b'resent-date', b'resent-from', + b'content-id', b'content-description', b'resent-date', b'resent-from', b'resent-sender', b'resent-to', b'resent-cc', b'resent-message-id', - b'in-reply-to', 'references', b'list-id', b'list-help', b'list-unsubscribe', + b'in-reply-to', b'references', b'list-id', b'list-help', b'list-unsubscribe', b'list-subscribe', b'list-post', b'list-owner', b'list-archive' ) @@ -656,7 +656,7 @@ class DKIM(DomainSigner): (b'c', canon_policy.to_c_value()), (b'd', domain), (b'i', identity or b"@"+domain), - length and (b'l', len(body)), + length and (b'l', str(len(body)).encode('ascii')), (b'q', b"dns/txt"), (b's', selector), (b't', str(int(time.time())).encode('ascii')), @@ -810,7 +810,7 @@ class ARC(DomainSigner): arc_headers = [y for x,y in arc_headers_w_instance] # Compute ARC-Authentication-Results - aar_value = (b"i=%d; " % instance) + auth_results + aar_value = ("i=%d; " % instance).encode('utf-8') + auth_results if aar_value[-1] != b'\n': aar_value += b'\r\n' new_arc_set.append(b"ARC-Authentication-Results: " + aar_value)