Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/saml2/cryptography/symmetric.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
from .errors import SymmetricCryptographyError


try:
# cryptography >= 47 moved CFB here; use it to avoid CryptographyDeprecationWarning.
from cryptography.hazmat.decrepit.ciphers.modes import CFB as _CFB
except ImportError:
# older cryptography versions don't have the "decrepit" module yet.
_CFB = _ciphers.modes.CFB


logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -105,7 +113,7 @@ class AESCipher:

POSTFIX_MODE = {
"cbc": _ciphers.modes.CBC,
"cfb": _ciphers.modes.CFB,
"cfb": _CFB,
}

AES_BLOCK_SIZE = int(_ciphers.algorithms.AES.block_size / 8)
Expand Down