Skip to content

Commit

Permalink
fix import for 43+
Browse files Browse the repository at this point in the history
  • Loading branch information
reaperhulk committed Feb 18, 2024
1 parent 09106cf commit 21736c4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scapy/layers/tls/crypto/cipher_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
from cryptography.hazmat.primitives.ciphers import (Cipher, algorithms, modes, # noqa: E501
BlockCipherAlgorithm,
CipherAlgorithm)
from cryptography.hazmat.backends.openssl.backend import (backend,
GetCipherByName)
from cryptography.hazmat.backends.openssl.backend import backend


_tls_block_cipher_algs = {}
Expand Down Expand Up @@ -196,6 +195,9 @@ class Cipher_SEED_CBC(_BlockCipher):
rc2_available = backend.cipher_supported(RC2, modes.CBC)
except ImportError:
# Legacy path for cryptography < 43.0.0
from cryptography.hazmat.backends.openssl.backend import (
GetCipherByName
)
_gcbn_format = "{cipher.name}-{mode.name}"

class RC2(BlockCipherAlgorithm, CipherAlgorithm):
Expand Down

0 comments on commit 21736c4

Please sign in to comment.