Skip to content

Correctly convert between openssl / boringssl and java cipher names w…#8485

Merged
normanmaurer merged 1 commit into4.1from
ssl_cipher
Nov 14, 2018
Merged

Correctly convert between openssl / boringssl and java cipher names w…#8485
normanmaurer merged 1 commit into4.1from
ssl_cipher

Conversation

@normanmaurer
Copy link
Copy Markdown
Member

…hen using TLSv1.3

Motivation:

We did not correctly convert between openssl / boringssl and java ciphers when using TLV1.3 which had different effects when either using openssl or boringssl.

  • When using openssl and TLSv1.3 we always returned SSL_NULL_WITH_NULL_NULL as cipher name
  • When using boringssl with TLSv1.3 we always returned an incorrect constructed cipher name which does not match what is defined by Java.

Modifications:

  • Add correct mappings in CipherSuiteConverter for both openssl and boringssl
  • Add unit tests for CipherSuiteConvert
  • Add unit in SSLEngine which checks that we do not return SSL_NULL_WITH_NULL_NULL ever and that server and client returns the same cipher name.

Result:

Fixes #8477.

@normanmaurer normanmaurer requested review from carl-mastrangelo, ejona86 and trustin and removed request for trustin November 9, 2018 13:24
@normanmaurer
Copy link
Copy Markdown
Member Author

Also @rkapsi

@rkapsi
Copy link
Copy Markdown
Member

rkapsi commented Nov 9, 2018

@normanmaurer tested the branch, works! Thanks!

@normanmaurer
Copy link
Copy Markdown
Member Author

@rkapsi <3 .... This was really a PITA to fix

…hen using TLSv1.3

Motivation:

We did not correctly convert between openssl / boringssl and java ciphers when using TLV1.3 which had different effects when either using openssl or boringssl.
 - When using openssl and TLSv1.3 we always returned SSL_NULL_WITH_NULL_NULL as cipher name
 - When using boringssl with TLSv1.3 we always returned an incorrect constructed cipher name which does not match what is defined by Java.

Modifications:

 - Add correct mappings in CipherSuiteConverter for both openssl and boringssl
 - Add unit tests for CipherSuiteConvert
 - Add unit in SSLEngine which checks that we do not return SSL_NULL_WITH_NULL_NULL ever and that server and client returns the same cipher name.

Result:

Fixes #8477.
@normanmaurer
Copy link
Copy Markdown
Member Author

did adjust the tests a bit to even capture more stuff and verify.

@normanmaurer
Copy link
Copy Markdown
Member Author

Merging as @rkapsi verified the fix

@normanmaurer normanmaurer merged commit d165448 into 4.1 Nov 14, 2018
@normanmaurer normanmaurer deleted the ssl_cipher branch November 14, 2018 07:49
tlsv13Supported = true;
}

} catch (Exception ignore) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering there is much more logic in the Try block, I don't know it's still okay to ignore this. Maybe log?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me just move most of it out of the block.

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.

3 participants