FS#63439 - [kodi] python2-pycryptodome dependency uses "crypto" namespace instead of "cryptodome"

Attached to Project: Community Packages
Opened by Kevin (kevku) - Monday, 12 August 2019, 06:16 GMT
Last edited by Ike Devolder (BlackEagle) - Monday, 30 September 2019, 18:37 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Ike Devolder (BlackEagle)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

python2-pycryptodome uses "crypto" namespace for some compatibility? reasons but kodi addons expect cryptodome
for example the netflix kodi addon:
https://github.com/asciidisco/plugin.video.netflix/blob/6fbe820e9391b9f5567e9f3c5eaacaaed7ff76a4/resources/lib/NetflixCredentials.py#L2
This task depends upon

Closed by  Ike Devolder (BlackEagle)
Monday, 30 September 2019, 18:37 GMT
Reason for closing:  Fixed
Additional comments about closing:  kodi 18.4 now properly depends on python2-pycrypdodomex
Comment by Eli Schwartz (eschwartz) - Monday, 12 August 2019, 06:42 GMT
For the general reasons of compatibility as described in https://pycryptodome.readthedocs.io/en/latest/src/installation.html

If you want the Cryptodome namespace, you need to install python-pycryptodomex (note the "x" at the end).

But this is *WRONG* for Kodi. Kodi has an officially exported interface for plugins and guarantees that the "Crypto" module is available (and that's why it is a dependency of our package). Any Kodi add-on that expects the Cryptodome module, like the Netflix addon you linked, is violating the Kodi development guidelines.

Tell your add-on developer that they must switch to requiring script.module.pycryptodome in their manifest, and import from Crypto, not Cryptodome.

They should NOT be using pycryptodomex under any circumstances.
Comment by Kevin (kevku) - Tuesday, 20 August 2019, 02:02 GMT
  • Field changed: Percent Complete (100% → 0%)
both Kodi Windows and android packages use the Cryptodome namespace

7z l kodi-18.3-Leia-armeabi-v7a.apk| grep Crypto
assets/python2.7/lib/python2.7/site-packages/Cryptodome/Cipher/AES.py

7z l kodi-18.3-Leia-x86.exe | grep Crypto
addons/script.module.pycryptodome/lib/Cryptodome/Cipher/AES.py
Comment by Eli Schwartz (eschwartz) - Tuesday, 20 August 2019, 02:04 GMT
Huh. They added this in https://github.com/xbmc/xbmc/pull/11477 which used the Crypto namespace, and packaged a "pycryptodome" addon, then they switched it in https://github.com/xbmc/xbmc/commit/9af495eb1852b2f91cb73925beaf1f5e2a22feda (but still named it pycryptodome). Looks like I was wrong. I apologize.
Comment by Eli Schwartz (eschwartz) - Tuesday, 20 August 2019, 02:05 GMT
So yeah, we should be requiring the version that Kodi's API officially exports.

Loading...