diff --git a/TODO b/TODO index 2e3dcdb..9113974 100644 --- a/TODO +++ b/TODO @@ -1,11 +1,11 @@ TODO 0.9.1 (Alpha) -Sign rsa/ed25519 +Sign rsa/ed25519 implemented Verify rsa/ed25519 implemented Domain implemented KeyFile implemented -KeyFileEd25519 +KeyFileEd25519 implemented Mode implemented PidFile implemented verified Selector implemented @@ -51,6 +51,7 @@ FixCRLF KeepAuthResults KeepTemporaryFiles KeyTable +KeytableEd25519 LogResults LogWhy MaximumHeaders diff --git a/dkimpy-milter.conf.5 b/dkimpy-milter.conf.5 index 35e4eec..4069803 100644 --- a/dkimpy-milter.conf.5 +++ b/dkimpy-milter.conf.5 @@ -310,7 +310,7 @@ containing the process ID. .TP .I Selector (string) -Defines the name of the selector to be used when signing messages. +Defines the name of the selector to be used when signing messages using RSA. See the .B DKIM specification for details. Used only when signing with a single key; @@ -322,6 +322,20 @@ This parameter is ignored if a .I KeyTable is defined. [KeyTable NOT IMPLEMENTED] +.TP +.I SelectorEd25519 (string) +Defines the name of the selector to be used when signing messages using Ed25519. +See the +.B DKIM +specification for details. Used only when signing with a single key; +see the +.I SigningTable +parameter below for more information. + +This parameter is ignored if a +.I KeyTableEd25519 +is defined. [KeyTable NOT IMPLEMENTED] + .TP .I Socket (string) Specifies the socket that should be established by the filter to receive diff --git a/dkimpy_milter/__init__.py b/dkimpy_milter/__init__.py index 69ee682..27e56a7 100644 --- a/dkimpy_milter/__init__.py +++ b/dkimpy_milter/__init__.py @@ -176,6 +176,12 @@ class dkimMilter(Milter.Base): canonicalize=('relaxed','simple')) name,val = h.split(': ',1) self.addheader(name,val.strip().replace('\r\n','\n'),0) + if conf.get('KeyFileEd25519'): + d = dkim.DKIM(txt) + h = d.sign(conf.get('SelectorEd25519'),conf.get('Domain'),conf.get('KeyFileEd25519'), + canonicalize=('relaxed','simple')) + name,val = h.split(': ',1) + self.addheader(name,val.strip().replace('\r\n','\n'),0) except dkim.DKIMException as x: if milterconfig.get('Syslog'): syslog.syslog('DKIM: %s'%x)