Skip to content

tls/crypto /cipher_block.py relies on cryptography internal details that are going away eventually #4237

@alex

Description

@alex

Brief description

if GetCipherByName(_gcbn_format)(backend, _ARC2, modes.CBC) != \
backend._ffi.NULL:
class Cipher_RC2_CBC(_BlockCipher):
pc_cls = _ARC2
pc_cls_mode = modes.CBC
block_size = 8
key_len = 16
class Cipher_RC2_CBC_40(Cipher_RC2_CBC):
expanded_key_len = 16
key_len = 5
backend.register_cipher_adapter(Cipher_RC2_CBC.pc_cls,
Cipher_RC2_CBC.pc_cls_mode,
GetCipherByName(_gcbn_format))

This relies on register_cipher_adapter and GetCipherByName which are not documented public APIs, and will be removed in pyca/cryptography#9859

This PR is expected to land in May, so there's a bit of time to resolve.

If there's a missing API in cryptography, please let us know so we can find a proper solution.

Scapy version

main

Python version

all

Operating system

all

Additional environment information

No response

How to reproduce

n/a

Actual result

No response

Expected result

No response

Related resources

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions