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

Correctly implement SSL.getSigAlgs(...) for BoringSSL #412

Merged
merged 1 commit into from
Nov 14, 2018

Conversation

normanmaurer
Copy link
Member

Motivation:

While BoringSSL does not support SSL_get_sig_algs(...) we can make use of SSL_get0_peer_verify_algorithms for our use case.

Modifications:

Use SSL_get0_peer_verify_algorithms when BoringSSL is used and so have a correct implemention there as well (which is needed for ExtendedSSLSession in java).

Result:

Be able to correctly implement ExtendedSSLSession.getPeerSupportedSignatureAlgorithms() when using BoringSSL.

Motivation:

While BoringSSL does not support SSL_get_sig_algs(...) we can make use of SSL_get0_peer_verify_algorithms for our use case.

Modifications:

Use SSL_get0_peer_verify_algorithms when BoringSSL is used and so have a correct implemention there as well (which is needed for ExtendedSSLSession in java).

Result:

Be able to correctly implement ExtendedSSLSession.getPeerSupportedSignatureAlgorithms() when using BoringSSL.
@normanmaurer normanmaurer requested review from carl-mastrangelo and ejona86 and removed request for carl-mastrangelo November 8, 2018 19:44
@normanmaurer
Copy link
Member Author

@davidben FYI...

@normanmaurer normanmaurer added this to the 2.0.20.Final milestone Nov 8, 2018
@normanmaurer normanmaurer self-assigned this Nov 8, 2018
@normanmaurer
Copy link
Member Author

may also be interesting for Conscrypt...

int i;
jobjectArray array;
jstring algString;
const uint16_t *peer_sigalgs;
Copy link
Member

Choose a reason for hiding this comment

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

Does this need to be freed?

Copy link
Member Author

Choose a reason for hiding this comment

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

@ejona86 nope... get0 does not transfer ownership.

@normanmaurer normanmaurer merged commit bccb0ad into master Nov 14, 2018
@normanmaurer normanmaurer deleted the sigalgs_boringssl branch November 14, 2018 15:34
for (i = 0; i < num_peer_sigalgs; i++) {
algString = (*e)->NewStringUTF(e, SSL_get_signature_algorithm_name(peer_sigalgs[i], SSL_version(ssl_) != TLS1_2_VERSION));
if (algString == NULL) {
// something is wrong we should better just return here
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't array need to be freed here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point... this problem exists in other places as well (as this code was mostly a copy + modify of existing code). I will do a pr shortly.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually no it does not need to be freed as it will be handled by the GC:

https://stackoverflow.com/a/12207973/1074097

fzakaria pushed a commit to fzakaria/netty-tcnative that referenced this pull request Feb 4, 2019
Motivation:

While BoringSSL does not support SSL_get_sig_algs(...) we can make use of SSL_get0_peer_verify_algorithms for our use case.

Modifications:

Use SSL_get0_peer_verify_algorithms when BoringSSL is used and so have a correct implemention there as well (which is needed for ExtendedSSLSession in java).

Result:

Be able to correctly implement ExtendedSSLSession.getPeerSupportedSignatureAlgorithms() when using BoringSSL.
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.

3 participants