Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scapy does not support cryptography modules past cryptography 41.0.7 #4239

Closed
russdm opened this issue Jan 30, 2024 · 3 comments
Closed

scapy does not support cryptography modules past cryptography 41.0.7 #4239

russdm opened this issue Jan 30, 2024 · 3 comments

Comments

@russdm
Copy link

russdm commented Jan 30, 2024

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

@gpotter2
Copy link
Member

This is fixed on master. See #4236

@dkbarn
Copy link

dkbarn commented Apr 1, 2024

@gpotter2 you've only fixed this in master branch which currently has no ETA for a release since it's blocked by #4196

Please can a patch version of 2.5.x be released which pins the dependency to cryptography<42 ? As it stands the version of scapy on PyPI is broken because of this.

@russdm
Copy link
Author

russdm commented Apr 2, 2024

It works if you use the master from github, just patch it yourself and copy and paste the files from the scapy module on github into the C:\Users\username\AppData\Local\Programs\Python\Python312\Lib\site-packages\scapy folder until your cryptography module errors disappear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants