Skip to content

Commit

Permalink
MAINT: Deal with cryptography>=43 moving ARC4 (#2765)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinThoma authored Jul 21, 2024
1 parent 4a41c53 commit 926fa7f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pypdf/_crypt_providers/_cryptography.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@

from cryptography import __version__
from cryptography.hazmat.primitives import padding
from cryptography.hazmat.primitives.ciphers.algorithms import AES, ARC4
from cryptography.hazmat.primitives.ciphers.algorithms import AES

try:
# 43.0.0 - https://cryptography.io/en/latest/changelog/#v43-0-0
from cryptography.hazmat.decrepit.ciphers.algorithms import ARC4
except ImportError:
from cryptography.hazmat.primitives.ciphers.algorithms import ARC4
from cryptography.hazmat.primitives.ciphers.base import Cipher
from cryptography.hazmat.primitives.ciphers.modes import CBC, ECB

Expand Down

0 comments on commit 926fa7f

Please sign in to comment.