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

Prevent adding newline if Base64 buffer encoded ends directly on MAX_… #4595

Closed
wants to merge 1 commit into from

Conversation

normanmaurer
Copy link
Member

…LINE_LENGTH

Motivation:

We need to ensure we not add a newline if the Base64 encoded buffer ends directly on the MAX_LINE_LENGTH. If we miss to do so this produce invalid data.
Because of this bug OpenSslServerContext and OpenSslClientContext may fail to load a cert.

Modifications:

  • Only add NEW_LINE if we not are on the end of the dst buffer.
  • Add unit test

Result:

Correct result in all cases

…LINE_LENGTH

Motivation:

We need to ensure we not add a newline if the Base64 encoded buffer ends directly on the MAX_LINE_LENGTH. If we miss to do so this produce invalid data.
Because of this bug OpenSslServerContext and OpenSslClientContext may fail to load a cert.

Modifications:

- Only add NEW_LINE if we not are on the end of the dst buffer.
- Add unit test

Result:

Correct result in all cases
@normanmaurer normanmaurer self-assigned this Dec 18, 2015
@normanmaurer normanmaurer added this to the 4.1.0.CR1 milestone Dec 18, 2015
@normanmaurer
Copy link
Member Author

@Scottmitch @trustin @blucas PTAL

@blucas
Copy link
Contributor

blucas commented Dec 18, 2015

Works for me! 🍻 for Norman

@Scottmitch
Copy link
Member

lgtm. +1 for unit tests!

@normanmaurer
Copy link
Member Author

Cherry-picked into 4.0 (2e73890) and 4.1 (63426fc)

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

Successfully merging this pull request may close these issues.

None yet

3 participants