Skip to content
This repository has been archived by the owner. It is now read-only.

Issues on Mac OS #11

Closed
nopper opened this issue Feb 22, 2014 · 4 comments
Closed

Issues on Mac OS #11

nopper opened this issue Feb 22, 2014 · 4 comments

Comments

@nopper
Copy link

@nopper nopper commented Feb 22, 2014

I have some problems with Mac OS that is bundled with openssl OpenSSL 0.9.8y. Here's the traceback:

>>> import pyelliptic
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/nopper/.pyenv/versions/mpotr/lib/python2.7/site-packages/pyelliptic/__init__.py", line 14, in <module>
    from .openssl import OpenSSL
  File "/Users/nopper/.pyenv/versions/mpotr/lib/python2.7/site-packages/pyelliptic/openssl.py", line 398, in <module>
    OpenSSL = _OpenSSL(libname)
  File "/Users/nopper/.pyenv/versions/mpotr/lib/python2.7/site-packages/pyelliptic/openssl.py", line 171, in __init__
    self.EVP_aes_128_ctr = self._lib.EVP_aes_128_ctr
  File "/Users/nopper/.pyenv/versions/2.7.5/lib/python2.7/ctypes/__init__.py", line 378, in __getattr__
    func = self.__getitem__(name)
  File "/Users/nopper/.pyenv/versions/2.7.5/lib/python2.7/ctypes/__init__.py", line 383, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(0x1006166f0, EVP_aes_128_ctr): symbol not found

I would suggest to implement a try catch mechanism that simlpy disables functions that can not be imported from the .dylib.

@nopper
Copy link
Author

@nopper nopper commented Feb 22, 2014

Of course using a more update version of openssl would do the trick:

DYLD_LIBRARY_PATH=/usr/local/Cellar/openssl/1.0.1f/lib python
>>> import pyelliptic
>>>
yann2192 added a commit that referenced this issue Mar 13, 2014
@yann2192
Copy link
Owner

@yann2192 yann2192 commented Mar 13, 2014

@nopper Does this fix works for you ?

@nopper
Copy link
Author

@nopper nopper commented Mar 13, 2014

Nope. I am attaching a traceback:

On the master branch:

Traceback (most recent call last):
  File "test.py", line 4, in <module>
    from pyelliptic import Cipher, ECC
  File "/private/tmp/pyelliptic/pyelliptic/__init__.py", line 14, in <module>
    from .openssl import OpenSSL
  File "/private/tmp/pyelliptic/pyelliptic/openssl.py", line 398, in <module>
    OpenSSL = _OpenSSL(libname)
  File "/private/tmp/pyelliptic/pyelliptic/openssl.py", line 171, in __init__
    self.EVP_aes_128_ctr = self._lib.EVP_aes_128_ctr
  File "/Users/nopper/.pyenv/versions/2.7.5/lib/python2.7/ctypes/__init__.py", line 378, in __getattr__
    func = self.__getitem__(name)
  File "/Users/nopper/.pyenv/versions/2.7.5/lib/python2.7/ctypes/__init__.py", line 383, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(0x10050e7b0, EVP_aes_128_ctr): symbol not found

On the origin/licence_issue branch where your fix exists:

Traceback (most recent call last):
  File "test.py", line 4, in <module>
    from pyelliptic import Cipher, ECC
  File "/private/tmp/pyelliptic/pyelliptic/__init__.py", line 14, in <module>
    from .openssl import OpenSSL
  File "/private/tmp/pyelliptic/pyelliptic/openssl.py", line 415, in <module>
    OpenSSL = _OpenSSL(libname)
  File "/private/tmp/pyelliptic/pyelliptic/openssl.py", line 283, in __init__
    self.PKCS5_PBKDF2_HMAC = self._lib.PKCS5_PBKDF2_HMAC
  File "/Users/nopper/.pyenv/versions/2.7.5/lib/python2.7/ctypes/__init__.py", line 378, in __getattr__
    func = self.__getitem__(name)
  File "/Users/nopper/.pyenv/versions/2.7.5/lib/python2.7/ctypes/__init__.py", line 383, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(0x10060cef0, PKCS5_PBKDF2_HMAC): symbol not found

I would suggest using a wrapper function to automatically manage the binding through try/except of every function exposed by OpenSSL instead of copy/pasting the same code over and over.

@yann2192
Copy link
Owner

@yann2192 yann2192 commented Mar 13, 2014

Yes, I agree

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.