richardkiss / pycoin

Python-based Bitcoin and alt-coin utility library.
MIT License
1.4k stars 498 forks source link

openssl implementation not working on osx and windows #176

Open littleskunk opened 8 years ago

littleskunk commented 8 years ago

https://github.com/richardkiss/pycoin/blob/master/pycoin/ecdsa/native/library.py#L21

This line will only work for linux and doesn't support windows and osx and it should throw a exception if the env variable is set but the library can't be loaded. At the moment i set the env variable and i get no feedback.

I would prefer this implementation: https://github.com/uwdata/termite-stm/blob/master/web2py/gluon/contrib/pbkdf2_ctypes.py#L122

Tested on windows. I will create a pull request later.

littleskunk commented 8 years ago

Added windows and osx support. I did not add a exception message. I think it is needed but that is your decision.

recmo commented 8 years ago

This line will also fail in the official Python docker image python:3.6-alpine. (See issue).

The implementation of find_library is a hack. It calls ldconfig -p and parses the output, hoping that the library is in the cache. As a fallback it calls gcc to find the library. This is obviously very fragile.