add encrypted viewstate support. Issue #10#14
Conversation
|
@rpimonitrbtch thanks for the PR, not sure how I missed it up until now. Is it ready for review or do you have more work on it? |
|
I think it's ready for review
…On February 26, 2020 7:18:56 AM EST, Yuval Adam ***@***.***> wrote:
@rpimonitrbtch thanks for the PR, not sure how I missed it up until
now. Is it ready for review or do you have more work on it?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#14 (comment)
|
yuvadm
left a comment
There was a problem hiding this comment.
Thanks for the work done here @rpimonitrbtch, generally looks good! I have some comments and questions inline.
Also if you can run your patch via black and pylint and maybe even add some unit tests that would be awesome.
Thanks again for the contribution!
| try: | ||
| from Crypto.Cipher import AES, DES3, DES | ||
| except ImportError: | ||
| from Cryptodome.Cipher import AES, DES3, DES |
There was a problem hiding this comment.
@rpimonitrbtch can you please describe where these dependencies come from? Are they expected to be built-in to the users Python installation? Do we need to bring them in as dependencies in setup.py?
| if not self.is_valid(): | ||
| raise ViewStateException("Cannot decode invalid viewstate, bad preamble") | ||
| if self.decrypt: | ||
| if self.mac_mode == MAC.HMACMD5: |
There was a problem hiding this comment.
Perhaps these elif blocks can be shrunk down to a single dict that holds all these values?
| pp = pprint.PrettyPrinter(indent=4) | ||
| pp.pprint(vs.decode()) | ||
|
|
||
| def getOptions(args=sys.argv[1:]): |
There was a problem hiding this comment.
The use of argparse here makes perfect sense, nice!
No description provided.