Formatting

This commit is contained in:
sepro 2024-11-01 20:51:21 +01:00
parent c49820880c
commit 0ab8840a80

View file

@ -459,7 +459,9 @@ def decrypt(self, encrypted_value):
if self._v11_key is None:
self._logger.warning('cannot decrypt v11 cookies: no key found', only_once=True)
return None
return _decrypt_aes_cbc_multi(ciphertext, (self._v11_key, self._empty_key), self._logger, prepended_sig=self._meta_version>=24)
return _decrypt_aes_cbc_multi(
ciphertext, (self._v11_key, self._empty_key), self._logger,
prepended_sig=self._meta_version >= 24)
else:
self._logger.warning(f'unknown cookie version: "{version}"', only_once=True)
@ -491,7 +493,8 @@ def decrypt(self, encrypted_value):
self._logger.warning('cannot decrypt v10 cookies: no key found', only_once=True)
return None
return _decrypt_aes_cbc_multi(ciphertext, (self._v10_key,), self._logger, prepended_sig=self._meta_version>=24)
return _decrypt_aes_cbc_multi(
ciphertext, (self._v10_key,), self._logger, prepended_sig=self._meta_version >= 24)
else:
self._cookie_counts['other'] += 1
@ -529,7 +532,9 @@ def decrypt(self, encrypted_value):
ciphertext = raw_ciphertext[nonce_length:-authentication_tag_length]
authentication_tag = raw_ciphertext[-authentication_tag_length:]
return _decrypt_aes_gcm(ciphertext, self._v10_key, nonce, authentication_tag, self._logger, prepended_sig=self._meta_version>=24)
return _decrypt_aes_gcm(
ciphertext, self._v10_key, nonce, authentication_tag, self._logger,
prepended_sig=self._meta_version >= 24)
else:
self._cookie_counts['other'] += 1