Code Monkey home page Code Monkey logo

Comments (9)

DrMcCoy avatar DrMcCoy commented on June 26, 2024

Oops, I missed this here, sorry about that.

I can't really test this little script anymore, since opted to upgrade to the Fritz!Box, now that it's actually available from Vodafone.

That's pretty annoying, though, that they're removing features like that. :/

Because I can't really test this script anymore, I don't really feel comfortable just replacing the package myself. I can leave this issue open for others to see. Fair?

from tg3442_firewall.

DrMcCoy avatar DrMcCoy commented on June 26, 2024

Oh, and thanks for the heads-up, of course :)

from tg3442_firewall.

DrMcCoy avatar DrMcCoy commented on June 26, 2024

Ah, okay, reading about it more, it's rather that PyCrypto seems to be abandoned. MODE_CCM was introduced with an experimental version in 2013 that barely anybody has picked up.

PyCryptodome seems to be the recommended implementation for it now, acting as a drop-in replacement. It even puts stuff into Crypto.*, like PyCrypto used to do. I too have PyCryptodome installed through the Gentoo package manager, not PyCrypto.

So I guess the correct fix for this issue is not to change anything in script, but people need to just install PyCryptodome instead of PyCrypto.

from tg3442_firewall.

wklaebe avatar wklaebe commented on June 26, 2024

On Debian (and Devuan), there's python3-pycryptodome, and Crypto.Cipher exists too (in python3-crypto), but without AES_CCM; so there the change is needed.

from tg3442_firewall.

DrMcCoy avatar DrMcCoy commented on June 26, 2024

Ugh, that's a bit of a mess :/

On Debian, what's the namespace of the crypto with AES_CCM, then? CryptoDome.Cipher?

from tg3442_firewall.

wklaebe avatar wklaebe commented on June 26, 2024

Cryptodome.Cipher.
As in:
from Cryptodome.Cipher import AES
print(AES.AES_CCM)

from tg3442_firewall.

DrMcCoy avatar DrMcCoy commented on June 26, 2024

Hmm, here on Gentoo, it's not within Cryptodome, but Crypto.

It seems Cryptodome can be packaged either way, with the version with the Cryptodome namespace being called cryptodomex?

I guess what this script needs, then, is a conditional import. I admit I'm not really that firm in Python (I just use it occasionally, mostly for things like IDAPython or somesuch).

Is there a way to probe for what's available? Or alternatively, would something like

try:
    from Cryptodome.Cipher import AES
except ImportError:
    from Crypto.Cipher import AES

work? I.e. try to import from Cryptodome, and if that doesn't exist (because Cryptodome has been packaged ito the Crypto namespace instead) use Crypto?

from tg3442_firewall.

wklaebe avatar wklaebe commented on June 26, 2024

That's a pattern that I have seen, yes, that should work.

from tg3442_firewall.

DrMcCoy avatar DrMcCoy commented on June 26, 2024

Okay, pushed this as a fix as 27020d8. Thanks! :)

Feel free to poke me if this still doesn't work for you.

from tg3442_firewall.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.