Skip to content

add encrypted viewstate support. Issue #10#14

Open
rpimonitrbtch wants to merge 1 commit into
yuvadm:masterfrom
rpimonitrbtch:master
Open

add encrypted viewstate support. Issue #10#14
rpimonitrbtch wants to merge 1 commit into
yuvadm:masterfrom
rpimonitrbtch:master

Conversation

@rpimonitrbtch

Copy link
Copy Markdown

No description provided.

@yuvadm

yuvadm commented Feb 26, 2020

Copy link
Copy Markdown
Owner

@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?

@rpimonitrbtch

rpimonitrbtch commented Feb 28, 2020 via email

Copy link
Copy Markdown
Author

@yuvadm yuvadm left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Comment thread viewstate/viewstate.py
try:
from Crypto.Cipher import AES, DES3, DES
except ImportError:
from Cryptodome.Cipher import AES, DES3, DES

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

Comment thread viewstate/viewstate.py
if not self.is_valid():
raise ViewStateException("Cannot decode invalid viewstate, bad preamble")
if self.decrypt:
if self.mac_mode == MAC.HMACMD5:

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps these elif blocks can be shrunk down to a single dict that holds all these values?

Comment thread viewstate/__main__.py
pp = pprint.PrettyPrinter(indent=4)
pp.pprint(vs.decode())

def getOptions(args=sys.argv[1:]):

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of argparse here makes perfect sense, nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants