scapy icon indicating copy to clipboard operation
scapy copied to clipboard

There seem to be a few cryptography deprecation warnings

Open evverx opened this issue 1 year ago • 0 comments

Brief description

https://download.copr.fedorainfracloud.org/results/packit/evverx-scapy-2/fedora-rawhide-x86_64/07935289-scapy/builder-live.log.gz

scapy/layers/dot11.py:1879: CryptographyDeprecationWarning: ARC4 has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.ARC4 and will be removed from this module in 48.0.0.
scapy/layers/dot11.py:1904: CryptographyDeprecationWarning: ARC4 has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.ARC4 and will be removed from this module in 48.0.0.
scapy/layers/kerberos.py:3563: CryptographyDeprecationWarning: ARC4 has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.ARC4 and will be removed from this module in 48.0.0.
scapy/layers/kerberos.py:3584: CryptographyDeprecationWarning: ARC4 has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.ARC4 and will be removed from this module in 48.0.0.
scapy/layers/kerberos.py:3706: CryptographyDeprecationWarning: ARC4 has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.ARC4 and will be removed from this module in 48.0.0.
scapy/layers/kerberos.py:3719: CryptographyDeprecationWarning: ARC4 has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.ARC4 and will be removed from this module in 48.0.0.
scapy/libs/rfc3961.py:1086: CryptographyDeprecationWarning: ARC4 has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.ARC4 and will be removed from this module in 48.0.0.
scapy/libs/rfc3961.py:881: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0.

Scapy version

97a49f32

Python version

Python 3.13.0rc1

Operating system

Fedora Rawhide

Additional environment information

python3-cryptography-43.0.0-2.fc42.x86_64

How to reproduce

python3 -Werror -Xdev -m scapy.tools.UTscapy -t test/scapy/layers/kerberos.uts

Actual result

...
###(007)=[failed] Parse and decrypt AS-REP (no preauth, RC4)
...
Traceback (most recent call last):
  File "<input>", line 2, in <module>
  File "/scapy/scapy/layers/kerberos.py", line 349, in decrypt
    d = key.decrypt(key_usage_number, self.cipher.val)
  File "/scapy/scapy/libs/rfc3961.py", line 1317, in decrypt
    return self.ep.decrypt(self, keyusage, ciphertext, **kwargs)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/scapy/scapy/libs/rfc3961.py", line 1086, in decrypt
    rc4 = Cipher(algorithms.ARC4(ke), mode=None).decryptor()
                 ^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/site-packages/cryptography/utils.py", line 70, in __getattr__
    warnings.warn(obj.message, obj.warning_class, stacklevel=2)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cryptography.utils.CryptographyDeprecationWarning: ARC4 has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.ARC4 and will be removed from this module in 48.0.0.
###(036)=[failed] RFC3691 - Test vectors for DES3

^[[34m^[[1m>>> ^[[0mdef _des3_string_to_key(text, salt):
...     k = Key.string_to_key(EncryptionType.DES3_CBC_SHA1_KD, text, salt)
...     return k.key.hex()
... 
^[[34m^[[1m>>> ^[[0massert _des3_string_to_key(b"password", b"ATHENA.MIT.EDUraeburn") == "850bb51358548cd05e86768c313e3bfef7511937dcf72c3e"
Traceback (most recent call last):
  File "<input>", line 2, in <module>
  File "<input>", line 3, in _des3_string_to_key
  File "/scapy/scapy/libs/rfc3961.py", line 1393, in string_to_key
    return ep.string_to_key(string, salt, params)
           ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/scapy/scapy/libs/rfc3961.py", line 874, in string_to_key
    key=cls.derive(k, b"kerberos"),
        ~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/scapy/scapy/libs/rfc3961.py", line 504, in derive
    ciphertext = cls.basic_encrypt(key.key, plaintext)
  File "/scapy/scapy/libs/rfc3961.py", line 881, in basic_encrypt
    des3 = Cipher(algorithms.TripleDES(key), modes.CBC(b"\0" * 8)).encryptor()
                  ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/site-packages/cryptography/utils.py", line 70, in __getattr__
    warnings.warn(obj.message, obj.warning_class, stacklevel=2)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cryptography.utils.CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0.

Expected result

No response

Related resources

No response

evverx avatar Aug 23 '24 10:08 evverx