Nitrokey / pynitrokey

Python client for Nitrokey devices
Apache License 2.0
94 stars 28 forks source link

After updating unhandled exception #510

Closed nitrosimon closed 2 months ago

nitrosimon commented 3 months ago

Issue: Command line tool to interact with Nitrokey devices 0.4.45 Critical error: An unhandled exception occurred Exception encountered: ModuleNotFoundError("No module named 'cryptography.hazmat.backends.openssl.rsa'")

Assumed reason: update of python-cryptography 42.0.5-1

Environment: Arch Linux

robin-nitrokey commented 3 months ago

This seems to be the reason, first released in 42.0.0: https://github.com/pyca/cryptography/commit/0000b402dd5edffa6a86ca560464e83a66fd91f5

spsdk is currently pinning cryptography to <41.1 so this problem should not happen when pynitrokey is installed using pip/pipx/uv.

kinoegit commented 3 months ago

@nitrosimon did you fixed this? Would you mind to share your solution/workaround?

EDIT: downgrading cryptography < 41.1 fixed it as a workaround

nitrosimon commented 2 months ago

@kinoegit After an Update of python-spsdk everything seems to work again

robin-nitrokey commented 2 months ago

This should be fixed when using up-to-date versions of pynitrokey and spsdk. Please open a new issue if you run into other compatibility problems.