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

crypto: CryptographyDeprecationWarning on PyPy 2 triggers a WrongEncryptionPassword exception #642

Open
decalage2 opened this issue Nov 10, 2020 · 1 comment

Comments

@decalage2
Copy link
Owner

Today the tests running on PyPy 2 trigger the following error on PyPy 2 (but not CPython 2):

/home/travis/virtualenv/pypy2.7-7.1.1/site-packages/msoffcrypto/method/rc4.py:5: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
  from cryptography.hazmat.backends import default_backend
msodde 0.55 - http://decalage.info/python/oletools
THIS IS WORK IN PROGRESS - Check updates regularly!
Please report any issue at https://github.com/decalage2/oletools/issues
Opening file: /home/travis/build/decalage2/oletools/tests/test-data/encrypted/dde-test-encrypt-standardpassword.xls
ERROR    Decrypt failed, run with debug output to get details
ERROR    Given passwords could not decrypt office file /home/travis/build/decalage2/oletools/tests/test-data/encrypted/dde-test-encrypt-standardpassword.xls, use option -p to specify the password
Traceback (most recent call last):
  File "/home/travis/build/decalage2/oletools/oletools/msodde.py", line 994, in main
    field_filter_mode=args.field_filter_mode)
  File "/home/travis/build/decalage2/oletools/oletools/msodde.py", line 955, in process_maybe_encrypted
    raise crypto.WrongEncryptionPassword(filepath)
WrongEncryptionPassword: Given passwords could not decrypt office file /home/travis/build/decalage2/oletools/tests/test-data/encrypted/dde-test-encrypt-standardpassword.xls, use option -p to specify the password
@christian-intra2net
Copy link
Contributor

christian-intra2net commented Nov 25, 2022

I encountered this warning with CPython 2 as well, I think msoffcrypto should not be a required dependency for any python2-version (see #795)

However, cryptography will currently still be installed through other dependencies, so this is no solution to the problem

@decalage2 decalage2 self-assigned this Nov 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants