Implemented signing both RSA and Ed25519, updated TODO. Required creation of SelectorEd25519 option.

This commit is contained in:
Scott Kitterman
2018-02-16 18:10:51 -05:00
parent 2399ee0010
commit 5fbe139faa
3 changed files with 24 additions and 3 deletions
+3 -2
View File
@@ -1,11 +1,11 @@
TODO TODO
0.9.1 (Alpha) 0.9.1 (Alpha)
Sign rsa/ed25519 Sign rsa/ed25519 implemented
Verify rsa/ed25519 implemented Verify rsa/ed25519 implemented
Domain implemented Domain implemented
KeyFile implemented KeyFile implemented
KeyFileEd25519 KeyFileEd25519 implemented
Mode implemented Mode implemented
PidFile implemented verified PidFile implemented verified
Selector implemented Selector implemented
@@ -51,6 +51,7 @@ FixCRLF
KeepAuthResults KeepAuthResults
KeepTemporaryFiles KeepTemporaryFiles
KeyTable KeyTable
KeytableEd25519
LogResults LogResults
LogWhy LogWhy
MaximumHeaders MaximumHeaders
+15 -1
View File
@@ -310,7 +310,7 @@ containing the process ID.
.TP .TP
.I Selector (string) .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 See the
.B DKIM .B DKIM
specification for details. Used only when signing with a single key; specification for details. Used only when signing with a single key;
@@ -322,6 +322,20 @@ This parameter is ignored if a
.I KeyTable .I KeyTable
is defined. [KeyTable NOT IMPLEMENTED] 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 .TP
.I Socket (string) .I Socket (string)
Specifies the socket that should be established by the filter to receive Specifies the socket that should be established by the filter to receive
+6
View File
@@ -176,6 +176,12 @@ class dkimMilter(Milter.Base):
canonicalize=('relaxed','simple')) canonicalize=('relaxed','simple'))
name,val = h.split(': ',1) name,val = h.split(': ',1)
self.addheader(name,val.strip().replace('\r\n','\n'),0) 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: except dkim.DKIMException as x:
if milterconfig.get('Syslog'): if milterconfig.get('Syslog'):
syslog.syslog('DKIM: %s'%x) syslog.syslog('DKIM: %s'%x)