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

[#4116] Decryption failed or bad mac record in Android 5.0 #4678

Closed
wants to merge 1 commit into from

Conversation

normanmaurer
Copy link
Member

Motivation:

Android 5.0 (API version 21) has a bug which not correctly set the bytesConsumed of SSLEngineResult when HandshakeStatus is FINISHED. Because of this we need to special handle the status and so workaround the Android bug.

Modifications:

  • Break the unwrap for (;;) loop when HandshakeStatus is FINISHED and bytesConsumed == 0 && bytesProduced == 0.

Result:

SslHandler works with all known version of Android.

Motivation:

Android 5.0 (API version 21) has a bug which not correctly set the bytesConsumed of SSLEngineResult when HandshakeStatus is FINISHED.  Because of this we need to special handle the status and so workaround the Android bug.

Modifications:

- Break the unwrap for (;;) loop when HandshakeStatus is FINISHED and bytesConsumed == 0 && bytesProduced == 0.

Result:

SslHandler works with all known version of Android.
@normanmaurer normanmaurer self-assigned this Jan 8, 2016
@normanmaurer normanmaurer added this to the 4.0.34.Final milestone Jan 8, 2016
@normanmaurer
Copy link
Member Author

@trustin @Scottmitch @nmittler PTAL. Tested with android studio ....

@Scottmitch
Copy link
Member

Is this currently broken in android? Do we need to open an android issue for this?

@normanmaurer
Copy link
Member Author

In android 5.0 which is old so I think there are no more updates to it

@nmittler
Copy link
Member

@normanmaurer LGTM

@normanmaurer
Copy link
Member Author

@nmittler should we open a bug-report for android or is this version so old that you think it makes no sense ?

@nmittler
Copy link
Member

@normanmaurer Probably worth opening the bug ... they can close if it's the case.

@normanmaurer
Copy link
Member Author

@normanmaurer
Copy link
Member Author

Cherry-picked into 4.0 (8fdf2f5) and 4.1 (da01b1d)

@normanmaurer normanmaurer deleted the android_21_ssl_workaround branch January 11, 2016 08:36
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

4 participants