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

Corrected fix for RCS-350 #1316

Merged
merged 3 commits into from Jun 8, 2016
Merged

Corrected fix for RCS-350 #1316

merged 3 commits into from Jun 8, 2016

Conversation

tburghart
Copy link

@tburghart tburghart commented Jun 4, 2016

This is a revision of the changes in #1293

That code happened to work when encoding/decoding UUIDs because their encoded length hit the midpoint in calculating how many '=' characters belong at the tail the properly encoded Base64. The padding length was calculated incorrectly, though, so variable length data wound up improperly formatted and triggered a crash if the Base64 encoding had an odd number of trailing '=' characters.

Additionally, the regular expression used in the test code would never match an improperly encoded result. Since the test only used UUIDs, which by chance produced the right result because of their length, the test never saw data that exposed the padding flaw.

These changes are cherry-picked from the RCS-366 patch branch, which was based on a different version, so some of its changes were already present (hence the apparently trivial changes). The relevant changes are those in the base64url module.

@JeetKunDoug
Copy link

+1 f69aea8

borshop added a commit that referenced this pull request Jun 8, 2016
Corrected fix for RCS-350

Reviewed-by: JeetKunDoug
@tburghart tburghart merged commit fb00fc0 into 2.1 Jun 8, 2016
@tburghart tburghart deleted the bugfix-rcs-350 branch June 8, 2016 19:07
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.

None yet

3 participants