-
Notifications
You must be signed in to change notification settings - Fork 37
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
Update getSupportedSSLParameters() #215
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this cipher suite and protocol list already set when the WolfSSLContext is created, inside
createCtx()
? Around these lines:I would think since that is set into the object-level "params", that would also come through here when we call
decoupleParams()
, no?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like at line 76
ciphersIana
is set toWolfSSL.getCiphersAvailableIana()
, returning the list of "enabled ciphers":Then, at line 81,
ciphersIana
is passed into WolfSSLCustomUser and is set as thelist
variable:At line 149, because the length of
ctxAttr.list
is greater than 0,ciphersIana
is set toWolfSSL.getCiphersAvailableIana(this.currentVersion)
from above:Last, at line 167, the SSLParameters cipher suites are set to
ciphersIana
:params.setCipherSuites(WolfSSLUtil.sanitizeSuites(ciphersIana));
I think that this is why calling
getSupportedSSLParameters()
then returns an SSLParameters object with only the list of "enabled" cipher suites and why the cipher list needed to be set again ingetSupportedSSLParameters()
in order to give the full list. Given all that, do you think something else should be changed in order to return the full list of ciphers ingetSupportedSSLParameters()
?It does seem like setting the protocols again in supportedParams like I have is redundant though and I can delete that part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the Javadocs for
SSLContext.getSupportedSSLParameters()
, it says:My interpretation of "supported settings for this SSL context" means only cipher suites that are supported by this SSLContext object, which has been created with a specific TLS protocol version. Not all cipher suites compiled into native wolfSSL are supported by all protocol versions. For example, TLS 1.3 cipher suites are not supported in a TLS 1.2 SSLContext.
WolfSSL.getCiphersAvailableIana()
returns the cipher suite list "supported" by the protocol version given to it.WolfSSL.getCiphersIana()
returns the list of ALL cipher suites enabled at compile time in native wolfSSL. We want to return a filtered version ofWolfSSL.getCiphersAvailableIana()
as the "supported" cipher suites by this SSLContext.More specifically, "supported" cipher suites start with the value of
WolfSSL.getCiphersAvailableIana()
but then that list may be filtered / restricted down to a subset by the following steps:WolfSSL.getCiphersAvailableIana()
).WolfSSLCustomUser
class. By default, we pass the list from step 1 into our default implementation of WolfSSLCustomUser. It does nothing to the list and returns it as the list to use.wolfjsse.enabledCipherSuites
Security property in theirjava.security
file.All that to say, I think we are setting the SSLParameters cipher suites to the correct "supported" list for a SSLContext object. And, the params we return from
getSupportedSSLParameters()
should be accurate already.Let me know if you think this is still incorrect, thanks.