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

Comments

2 participants
@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

This comment has been minimized.

Show comment
Hide comment
@nopper

nopper 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
>>>

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

This comment has been minimized.

Show comment
Hide comment
@yann2192

yann2192 Mar 13, 2014

Owner

@nopper Does this fix works for you ?

Owner

yann2192 commented Mar 13, 2014

@nopper Does this fix works for you ?

@nopper

This comment has been minimized.

Show comment
Hide comment
@nopper

nopper 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.

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

This comment has been minimized.

Show comment
Hide comment
@yann2192

yann2192 Mar 13, 2014

Owner

Yes, I agree

Owner

yann2192 commented Mar 13, 2014

Yes, I agree

@hoffmabc hoffmabc referenced this issue in genjix/darkmarket Apr 24, 2014

Open

Can't get this to work with OSX 10.9 #2

@yann2192 yann2192 referenced this issue May 14, 2014

Closed

AES-GCM support #16

@yann2192 yann2192 closed this Apr 25, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.