Add new method authenticationMethodsPacked to avoid string and array allocation#968
Open
doom369 wants to merge 1 commit into
Open
Add new method authenticationMethodsPacked to avoid string and array allocation#968doom369 wants to merge 1 commit into
doom369 wants to merge 1 commit into
Conversation
chrisvest
reviewed
Apr 15, 2026
| * <li>{@code 0x0001} (SSL_aRSA) - RSA authentication (RSA, DHE_RSA, ECDHE_RSA)</li> | ||
| * <li>{@code 0x0002} (SSL_aDSS) - DSS authentication (DHE_DSS)</li> | ||
| * <li>{@code 0x0004} (SSL_aNULL) - no auth / anonymous (DH_anon, ECDH_anon)</li> | ||
| * <li>{@code 0x0040} (SSL_aECDSA) - ECDSA authentication (ECDHE_ECDSA)</li> |
Member
There was a problem hiding this comment.
I'm wondering is if we should expose these constants through static fields in SSL, initialized from NativeStaticallyReferencedJniMethods calls.
Contributor
Author
There was a problem hiding this comment.
It's a good idea actually, minimizes the chance for error.
| #define TCN_SSL_aDSS 0x00000002L | ||
| #define TCN_SSL_aNULL 0x00000004L | ||
| #define TCN_SSL_aECDSA 0x00000040L | ||
| #define TCN_SSL_aALL (TCN_SSL_aRSA | TCN_SSL_aDSS | TCN_SSL_aNULL | TCN_SSL_aECDSA) |
Member
There was a problem hiding this comment.
Not great to define them again. Maybe they can be moved to ssl_private.h?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently,
authenticationMethods()allocates multiple strings and a string array during initial connection. This could be avoided with a new method, where we pack all auth methods into a single int. This will also simplify code on the Netty side (2 switch statements could be removed inOpenSslKeyMaterialManager.setKeyMaterialServerSide).