From 24837b3e9cc64430eacf46849567f973640eb663 Mon Sep 17 00:00:00 2001 From: Guillaume Valadon Date: Wed, 29 Apr 2020 15:41:58 +0200 Subject: [PATCH 1/2] Advanced cryptogaphy comment --- scapy/config.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scapy/config.py b/scapy/config.py index d76d5d53a50..6ecc82ac060 100755 --- a/scapy/config.py +++ b/scapy/config.py @@ -378,8 +378,8 @@ def _version_checker(module, minver): def isCryptographyValid(): """ - Check if the cryptography library is present, and if it is recent enough - for most usages in scapy (v1.7 or later). + Check if the cryptography module >= 1.7 is present. This is the minimum + version for most usages in Scapy. """ try: import cryptography @@ -390,8 +390,12 @@ def isCryptographyValid(): def isCryptographyAdvanced(): """ - Check if the cryptography library is present, and if it supports X25519, - ChaCha20Poly1305 and such (v2.0 or later). + Check if the cryptography module is present, and if it supports X25519, + ChaCha20Poly1305 and such. + + Notes: + - cryptography >= 2.0 is required + - OpenSSL >= 1.1.0 is required """ try: from cryptography.hazmat.primitives.asymmetric.x25519 import X25519PrivateKey # noqa: E501 From 0993ce8909172b91dc8615c0934d618164c110a1 Mon Sep 17 00:00:00 2001 From: Guillaume Valadon Date: Sat, 2 May 2020 17:31:01 +0200 Subject: [PATCH 2/2] Check if cryptography >= 2.0.0 is available --- scapy/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scapy/config.py b/scapy/config.py index 6ecc82ac060..fbb7ec14f03 100755 --- a/scapy/config.py +++ b/scapy/config.py @@ -378,14 +378,14 @@ def _version_checker(module, minver): def isCryptographyValid(): """ - Check if the cryptography module >= 1.7 is present. This is the minimum + Check if the cryptography module >= 2.0.0 is present. This is the minimum version for most usages in Scapy. """ try: import cryptography except ImportError: return False - return _version_checker(cryptography, (1, 7)) + return _version_checker(cryptography, (2, 0, 0)) def isCryptographyAdvanced():