Add support for specifying MinimumKeyBits for RSA signatures

This commit is contained in:
Scott Kitterman
2019-10-30 16:29:00 -04:00
parent 472fc753e1
commit e83d4b9306
7 changed files with 24 additions and 2 deletions
+6
View File
@@ -39,6 +39,7 @@ defaultConfigData = {
'SyslogFacility': 'mail',
'UMask': 0o07,
'Mode': 'sv',
'MinimumKeyBits': 1024,
'Socket': None,
'PidFile': None,
'UserID': 'dkimpy-milter',
@@ -336,6 +337,7 @@ def _readConfigFile(path, configData=None, configGlobal={}):
'SyslogSuccess': 'bool',
'UMask': 'int',
'Mode': 'str',
'MinimumKeyBits': 'int',
'Socket': 'str',
'PidFile': 'str',
'UserID': 'str',
@@ -421,6 +423,10 @@ def _readConfigFile(path, configData=None, configGlobal={}):
else:
configData[name] = str(value)
elif conversion == 'int':
if name == 'MinimumKeyBits':
if int(value) == 0:
# Odd inheritence from OpenDKIM where value of 0 means use default.
value = configData.get(name)
configData[name] = int(value)
elif conversion == 'dataset':
configData[name] = _dataset_to_list(value)