@@ -101,7 +101,7 @@ def unlock_with_phrase(self, passphrase: str) -> None:
101101 self .attr .update (** _parse_dictionary (decrypted .decode ()))
102102
103103 def disks (self ) -> list [str ]:
104- """Return a list of paths to disk files"""
104+ """Return a list of paths to disk files. """
105105 dev_classes = ("scsi" , "sata" , "ide" , "nvme" )
106106 devices = {}
107107
@@ -179,7 +179,6 @@ def unseal_with_phrase(self, passphrase: str) -> bytes:
179179 @classmethod
180180 def from_text (cls , text : str ) -> KeySafe :
181181 """Parse a ``KeySafe`` from a string."""
182-
183182 # Key safes are a list of key locators. It's a key locator string with a specific prefix
184183 identifier , _ , remainder = text .partition ("/" )
185184 if identifier != "vmware:key" :
@@ -262,7 +261,6 @@ def _parse_key_locator(locator_string: str) -> Pair | Phrase | list[Pair | Phras
262261
263262 Interally called ``KeyLocator``.
264263 """
265-
266264 identifier , _ , remainder = locator_string .partition ("/" )
267265
268266 if identifier == "list" :
@@ -303,7 +301,6 @@ def _split_list(value: str) -> list[str]:
303301 Lists are wrapped by braces and separated by comma. They can contain nested lists/pairs,
304302 so we need to separate at the correct nest level.
305303 """
306-
307304 if not (match := re .match (r"\((.+)\)" , value )):
308305 raise ValueError ("Invalid list string" )
309306
@@ -337,7 +334,6 @@ def _parse_crypto_dict(dict_string: str) -> dict[str, str]:
337334
338335 Internally called ``CryptoDict``.
339336 """
340-
341337 crypto_dict = {}
342338 for part in dict_string .split (":" ):
343339 key , _ , value = part .partition ("=" )
@@ -351,7 +347,6 @@ def _decrypt_hmac(key: bytes, data: bytes, digest: str) -> bytes:
351347 First 16 bytes of the ciphertext are the IV and the last N bytes are the HMAC digest.
352348 The cleartext is padded using PKCS#7.
353349 """
354-
355350 digest , digest_size = HMAC_MAP [digest ]
356351
357352 iv , encrypted , mac = data [:16 ], data [16 :- digest_size ], data [- digest_size :]
@@ -374,7 +369,6 @@ def _create_cipher(key: bytes, iv: bytes) -> AES.CbcMode:
374369
375370 Dynamic based on the available crypto module.
376371 """
377-
378372 if HAS_PYSTANDALONE :
379373 if len (key ) == 32 :
380374 cipher = "aes-256-cbc"
0 commit comments