Skip to content

Commit e57d2d9

Browse files
committed
add validation toggle per cryptsetup key
Signed-off-by: Zen <[email protected]>
1 parent 77dc435 commit e57d2d9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/ugrd/crypto/cryptsetup.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
__author__ = 'desultory'
2-
__version__ = '2.7.2'
2+
__version__ = '2.8.0'
33

44
from zenlib.util import contains
55

66
from pathlib import Path
77

88
_module_name = 'ugrd.crypto.cryptsetup'
99

10-
CRYPTSETUP_PARAMETERS = ['key_type', 'partuuid', 'uuid', 'path', 'key_file', 'header_file', 'retries', 'key_command', 'reset_command', 'try_nokey', 'include_key']
10+
CRYPTSETUP_PARAMETERS = ['key_type', 'partuuid', 'uuid', 'path', 'key_file', 'header_file', 'retries', 'key_command', 'reset_command', 'try_nokey', 'include_key', 'validate_key']
1111

1212

1313
def _merge_cryptsetup(self, mapped_name: str, config: dict) -> None:
@@ -45,8 +45,9 @@ def _process_cryptsetup_key_types_multi(self, key_type: str, config: dict) -> No
4545
def _validate_crypysetup_key(self, key_paramters: dict) -> None:
4646
""" Validates the cryptsetup key """
4747
if key_paramters.get('include_key'):
48-
self.logger.info("Skipping key validation for included key.")
49-
return
48+
return self.logger.info("Skipping key validation for included key.")
49+
elif key_paramters.get('validate_key') is False:
50+
return self.logger.info("Skipping key validation for: %s" % key_paramters['key_file'])
5051

5152
key_path = Path(key_paramters['key_file'])
5253

0 commit comments

Comments
 (0)