kurtbrose / pyjks

a pure python Java KeyStore file parser, including private key decryption
MIT License
130 stars 35 forks source link

Issue while building python code in lambda #42

Open shivgit87 opened 6 years ago

shivgit87 commented 6 years ago

I have built JKS package and trying to execute the code in Lambda by uploading as a zip. While trying to test the code I am getting following error :-1:

START RequestId: d210481c-b1d6-11e8-96b2-dbaf32b85648 Version: $LATEST module initialization error: Cannot load native module 'Crypto.Hash._MD5': Trying '_MD5.cpython-36m-x86_64-linux-gnu.so': /var/task/Crypto/Util/../Hash/_MD5.cpython-36m-x86_64-linux-gnu.so: cannot open shared object file: No such file or directory, Trying '_MD5.abi3.so': /var/task/Crypto/Util/../Hash/_MD5.abi3.so: cannot open shared object file: No such file or directory, Trying '_MD5.so': /var/task/Crypto/Util/../Hash/_MD5.so: cannot open shared object file: No such file or directory

END RequestId: d210481c-b1d6-11e8-96b2-dbaf32b85648 REPORT RequestId: d210481c-b1d6-11e8-96b2-dbaf32b85648 Duration: 516.12 ms Billed Duration: 600 ms Memory Size: 128 MB Max Memory Used: 29 MB
module initialization error Cannot load native module 'Crypto.Hash._MD5': Trying '_MD5.cpython-36m-x86_64-linux-gnu.so': /var/task/Crypto/Util/../Hash/_MD5.cpython-36m-x86_64-linux-gnu.so: cannot open shared object file: No such file or directory, Trying '_MD5.abi3.so': /var/task/Crypto/Util/../Hash/_MD5.abi3.so: cannot open shared object file: No such file or directory, Trying '_MD5.so': /var/task/Crypto/Util/../Hash/_MD5.so: cannot open shared object file: No such file or directory

It says Cannot load native module.

mahmoud commented 6 years ago

Hmm, seems like a packaging issue that's affecting the Crypto package (we use pycryptodome). Are other binary dependencies working?

I'm not familiar with Lambda's packaging requirements, but you may want to post in the appropriate support forums or on StackOverflow.

MikeArchbold commented 3 years ago

Came across this same issue. You need to install the runtime on linux system as cryptodome is os specific and lambda runs with linux backend source - https://github.com/Legrandin/pycryptodome/issues/69

Steps I followed