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

Validate PKCS7 padding correctly #1108

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

Conversation

AdamISZ
Copy link

@AdamISZ AdamISZ commented Jan 15, 2018

The removePKCSPadding function did not valide the contents
of the padding; the format is defined in RFC2315.
This commit corrects that and some extra test cases which
trigger padding validation failure are provided.

I realise that this is most likely not important. And I am not aware of anyone using this code right now. And it actually is kind of a corner case as to whether it'd ever matter.

For back-story you might find interesting this example - we were using an old slowaes.py module which likewise did not verify padding; and it turned out that because of the way we were using it, there was indeed a corner case here where it led to something bad happening. I think that'd be rare.

The removePKCSPadding function did not valide the contents
of the padding; the format is defined in RFC2315.
This commit corrects that and some extra test cases which
trigger padding validation failure are provided.
@jakesylvestre
Copy link
Collaborator

@jcvernaleo (as per #1530)

  • Low priority
  • Bug(ish)

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

Successfully merging this pull request may close these issues.

3 participants