Skip to content

scapy does not support cryptography modules past cryptography 41.0.7 #4239

@russdm

Description

@russdm

Brief description

Additional modules needed to run scapy are being removed or rewritten from the hazmat directory.
file path: C:\Users\username\AppData\Local\Programs\Python\Python312\Lib\site-packages\cryptography\hazmat\backends\openssl\

So far these modules have disappeared as of cryptography 42.0.2 in the above directory:
ec.py
rsa.py
utils.py
cmac.py

This causes reference errors in the scapy cert.py library accessing the InvalidSignature class.
from cryptography.hazmat.backends.openssl.ec import InvalidSignature

Scapy version

2.5.0

Python version

3.12.1

Operating system

Windows 11

Additional environment information

Missing modules in cryptography

How to reproduce

Update to cryptography 42.0.2

Actual result

from scapy.layers.tls.all import *
from cryptography.hazmat.backends.openssl.ec import InvalidSignature #from cryptography.hazmat.backends.openssl.ec import InvalidSignature
ModuleNotFoundError: No module named 'cryptography.hazmat.backends.openssl.ec'

Expected result

Module to be present or a work around to remove this functionality in the code as deprecated.

Related resources

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions