Closed 811Alex closed 2 years ago
I'll update encode.py in a bit. Let me know if you want any changes in these, in the meantime.
Can the config XML be encrypted for type 4 (without any additional changes)?
I need to update aes_encrypt() in encryption.py and encode.py. That should be it, though.
There is no script yet that can re-encrypt this model's config file.
If we can decrypt, why can't we encrypt? Or are you just saying there's no script yet?
Re: other changes, I don't really like the way is_digi/is_t4 are arguments to aes_decrypt
, feels very un-SOLID.. but I've not got the time to refactor it. So I'll let it slide..
There's no script yet!
yet this is a draft, I'll add the encryption in a moment
As for the aes_decrypt() arguments, I feel you, but at the same time, they have to get to digi_key() somehow. I'm definitely open to ideas though.
Would you feel better about it if it was a single Enum?
It's fine - next time this function is touched I'll enforce that it's improved :)
Is it possible to add a test/tests for the type 4?
Added the encryption and the tests.
I also made it byte-perfect, with https://github.com/mkst/zte-config-utility/pull/29/commits/26374c80a7e89b703452c7dddfd3cc52096a6cf6 I compared a couple of type 4s and a couple of type 2s and it seems that type 4s actually set the "unencrypted data length" bytes properly, hence that change. Not the biggest sample, but I think it's good enough for me.
I think that's about it for this one. How does it look?
If you're happy with this PR I'll merge it :+1:
Yup, go for it :)
Chapter Close!
This will add support for ZXHN H168N V3.5. The new key/IV generation is based on another script by Felis-Sapiens. Tested on files provided by @minanagehsalalma & @kies83. Fixes https://github.com/mkst/zte-config-utility/issues/11