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

oletools 0.54.2 install fails on PyPy on Windows due to cryptography missing OpenSSL #473

Closed
decalage2 opened this issue Jul 29, 2019 · 2 comments

Comments

@decalage2
Copy link
Owner

decalage2 commented Jul 29, 2019

When attempting to install oletools 0.54.2 on PyPy on Windows using pip, the msoffcrypto-tool package is required, which in turn requires cryptography. It looks like cryptography on PyPy (unlike on CPython) is not statically linked to OpenSSL, and it fails to install when it cannot find OpenSSL to compile it:

build\temp.win32-2.7\Release\_openssl.c(498) : fatal error C1083: Cannot open include file: 'openssl/opensslv.h': No such file or directory
error: command 'C:\\Users\\xxx\\AppDats\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2

Ref about cryptography install: https://cryptography.io/en/latest/installation/
Workaround:
Use oletools 0.54.1, which does not require msoffcrypto-tool, until a fix is found:
pypy -m pip install oletools==0.54.1

@decalage2
Copy link
Owner Author

I still get an error when installing oletools 0.56 on PyPy 2.7 on Windows: decalage2/ViperMonkey#106

The only solution seems to make msoffcrypto-tool an optional dependency, as it was the case until oletools 0.54.1.

@decalage2
Copy link
Owner Author

decalage2 commented Mar 3, 2021

I found a way to fix this with a conditional dependency in setup.py and requirements.txt: msoffcrypto-tool will only be installed if the platform is not PyPy or not Windows (which is the same as not(PyPy and Windows)):

msoffcrypto-tool; platform_python_implementation!="PyPy" or platform_system!="Windows"

This also contributes to fixing decalage2/ViperMonkey#106

@decalage2 decalage2 modified the milestones: oletools 0.55, oletools 0.56 Mar 3, 2021
decalage2 added a commit that referenced this issue Mar 6, 2021
c-rosenberg pushed a commit to HeinleinSupport/oletools that referenced this issue Mar 31, 2021
c-rosenberg pushed a commit to HeinleinSupport/oletools that referenced this issue Mar 31, 2021
c-rosenberg pushed a commit to HeinleinSupport/oletools that referenced this issue Dec 2, 2021
ljuturu pushed a commit to ljuturu/oletools that referenced this issue Apr 21, 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

1 participant