openairplay/airplay2-receiver

cannot import name 'ChaCha20_Poly1305' from 'Crypto.Cipher'

Opened this issue · 2 comments

The problem

I cloned the repo on a Raspberry Pi 4 and followed the instructions to build with Docker but I am unable to run the built image.

git clone https://github.com/openairplay/airplay2-receiver.git
cd airplay2-receiver
docker build -f docker/Dockerfile -t ap2-receiver .

I'm using a CM4 with builtin eMMC.

What commit exhibits the issue?

6c343d3

Was there a last known working commit?

No response

What type of installation are you running?

Docker

With which python3 version do you run Receiver?

3.7.3

OS the receiver runs on

Raspberry Pi OS (bookworm, 64-bit)

OS the sender runs

Which sender client was used

No response

Command invocation

docker run -it --rm --device /dev/snd --net host --volume pwd/pairings/:/airplay2/pairings/ --env AP2IFACE=eth0 ap2-receiver

Please include --debug output which helps to illustrate the problem

$ docker run -it --rm --device /dev/snd --net host --volume `pwd`/pairings/:/airplay2/pairings/ --env AP2IFACE=eth0  ap2-receiver 
[ ok ] Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon.
Traceback (most recent call last):
  File "ap2-receiver.py", line 23, in <module>
    from ap2.pairing.hap import Hap, HAPSocket, LTPK, DeviceProperties
  File "/airplay2/ap2/pairing/hap.py", line 15, in <module>
    from Crypto.Cipher import ChaCha20_Poly1305  # PyCryptodome
ImportError: cannot import name 'ChaCha20_Poly1305' from 'Crypto.Cipher' (/usr/lib/python3/dist-packages/Crypto/Cipher/__init__.py)

Additional information

$ docker run -it --rm ap2-receiver /usr/bin/env python3
Python 3.7.3 (default, Mar 23 2024, 16:12:05) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import Crypto.Cipher
>>> Crypto.Cipher.__all__
['AES', 'ARC2', 'ARC4', 'Blowfish', 'CAST', 'DES', 'DES3', 'XOR', 'PKCS1_v1_5', 'PKCS1_OAEP']
>>>

At a guess, it looks like the available Crypto Cipher libs don't have ChaCha. Is a newer Python available? These wheels must be compilable on the target platform in order to support the suites necessary.

You would do well to ask at https://github.com/Legrandin/pycryptodome

pycryptodome in requirements.txt is not version anchored, so this is not an AP2 problem, but a platform/wheel problem, I think.