Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add encrypted viewstate support. Issue #10 #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rpimonitrbtch
Copy link

No description provided.

@yuvadm
Copy link
Owner

yuvadm commented Feb 26, 2020

@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
Copy link
Author

rpimonitrbtch commented Feb 28, 2020 via email

Copy link
Owner

@yuvadm yuvadm left a comment

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!

try:
from Crypto.Cipher import AES, DES3, DES
except ImportError:
from Cryptodome.Cipher import AES, DES3, DES
Copy link
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?

if not self.is_valid():
raise ViewStateException("Cannot decode invalid viewstate, bad preamble")
if self.decrypt:
if self.mac_mode == MAC.HMACMD5:
Copy link
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?

pp = pprint.PrettyPrinter(indent=4)
pp.pprint(vs.decode())

def getOptions(args=sys.argv[1:]):
Copy link
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