espes / Slave-in-the-Magic-Mirror

Open source implementation of AirPlay Mirroring. WIP.
615 stars 117 forks source link

getting CFFI error when decrypting AirTunes key #6

Closed robertoandrade closed 9 years ago

robertoandrade commented 9 years ago

All was working fine for a while until I started hitting:

Decrypting AirTunes key...
Done! Took 0.55 seconds. AirTunes key: 6fd48ed464673ffaa3444f06c20492a6
----------------------------------------
Exception happened during processing of request from ('192.168.2.189', 49445)
Traceback (most recent call last):
  File "/usr/local/Cellar/pypy/2.5.0/libexec/lib-python/2.7/SocketServer.py", line 595, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/local/Cellar/pypy/2.5.0/libexec/lib-python/2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/local/Cellar/pypy/2.5.0/libexec/lib-python/2.7/SocketServer.py", line 651, in __init__
    self.handle()
  File "/usr/local/Cellar/pypy/2.5.0/libexec/lib-python/2.7/BaseHTTPServer.py", line 342, in handle
    self.handle_one_request()
  File "/usr/local/Cellar/pypy/2.5.0/libexec/lib-python/2.7/BaseHTTPServer.py", line 328, in handle_one_request
    method()
  File "airplay.py", line 534, in do_ANNOUNCE
    con.rtp = AirTunesRTP(con, self.path, sdp, key, iv)
  File "airplay.py", line 335, in __init__
    backend=default_backend())
  File "/usr/local/Cellar/pypy/2.5.0/libexec/site-packages/cryptography/hazmat/backends/__init__.py", line 35, in default_backend
    _default_backend = MultiBackend(_available_backends())
  File "/usr/local/Cellar/pypy/2.5.0/libexec/site-packages/cryptography/hazmat/backends/__init__.py", line 22, in _available_backends
    "cryptography.backends"
  File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources/__init__.py", line 2310, in load
    return self.resolve()
  File "build/bdist.macosx-10.9-x86_64/egg/pkg_resources/__init__.py", line 2316, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/local/Cellar/pypy/2.5.0/libexec/site-packages/cryptography/hazmat/backends/commoncrypto/__init__.py", line 7, in <module>
    from cryptography.hazmat.backends.commoncrypto.backend import backend
  File "/usr/local/Cellar/pypy/2.5.0/libexec/site-packages/cryptography/hazmat/backends/commoncrypto/backend.py", line 244, in <module>
    backend = Backend()
  File "/usr/local/Cellar/pypy/2.5.0/libexec/site-packages/cryptography/hazmat/backends/commoncrypto/backend.py", line 44, in __init__
    self._binding = Binding()
  File "/usr/local/Cellar/pypy/2.5.0/libexec/site-packages/cryptography/hazmat/bindings/commoncrypto/binding.py", line 40, in __init__
    self._ensure_ffi_initialized()
  File "/usr/local/Cellar/pypy/2.5.0/libexec/site-packages/cryptography/hazmat/bindings/commoncrypto/binding.py", line 50, in _ensure_ffi_initialized
    modules=cls._modules,
  File "/usr/local/Cellar/pypy/2.5.0/libexec/site-packages/cryptography/hazmat/bindings/utils.py", line 31, in load_library_for_binding
    lib = ffi.verifier.load_library()
  File "/usr/local/Cellar/pypy/2.5.0/libexec/lib_pypy/cffi/verifier.py", line 86, in load_library
    self._compile_module()
  File "/usr/local/Cellar/pypy/2.5.0/libexec/site-packages/cryptography/hazmat/bindings/utils.py", line 127, in _compile_module
    "Attempted implicit compile of a cffi module. All cffi modules should "
RuntimeError: Attempted implicit compile of a cffi module. All cffi modules should be pre-compiled at installation time.

Any ideas what could have caused it?

robertoandrade commented 9 years ago

Might be related to https://github.com/pyca/cryptography/issues/1524?

robertoandrade commented 9 years ago

Something really weird... just uninstalled all suggested dependency packages and reinstalled them and the problem went away :\

pypy -m pip uninstall biplist construct cryptography macholib zeroconf

pypy -m pip install biplist construct cryptography macholib zeroconf
espes commented 9 years ago

¯_(ツ)_/¯