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

Rails fails to parse cookie when len(splaintext)%16 == 0 #7

Open
whoisnian opened this issue Apr 2, 2021 · 0 comments
Open

Rails fails to parse cookie when len(splaintext)%16 == 0 #7

whoisnian opened this issue Apr 2, 2021 · 0 comments

Comments

@whoisnian
Copy link

There is something wrong with func PKCS7Pad(data []byte) in https://github.com/mattetti/goRailsYourself/blob/master/crypto/pkcs7_padding.go#L5 .
We can see k k ... k k -- if lth mod k = 0 from https://tools.ietf.org/html/rfc5652#section-6.3 .
So I think it should append 16 byte(16) after origin data when dataLen%16 == 0 .

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

No branches or pull requests

1 participant