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.
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
JSSEngine - Initial ALPN support #526
base: master
Are you sure you want to change the base?
JSSEngine - Initial ALPN support #526
Changes from all commits
12e4bc5
326dc83
d38661f
1f5f18a
784501a
31257d1
9c259f2
a380911
9b7b794
5998295
f50bf1c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
should also check
alpn_protocols.length > 0
.update: make that a MUST.
SSLParameters
class sets default value of protocols to empty array. This results in emptywire_data
which results inSECFailure
when setting ALPN data and theRuntimeException
gets raised below.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.
What
SSLParameters
class? We explicitly downcast intoJSSParameters
withinJSSEngine
so we can use a simplenull
check.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.
In the process of doing that downcast from
SSLParameters
toJSSParameters
, we take the ALPN value as-is (seehttps://github.com/dogtagpki/jss/pull/526/files#r503618760). So if we construct a
JSSEngine
with an "native"SSLParameters
, and have not overridden the ALPN data, then we get an empty list. This is why the check is necessary.This is not a theoretical issue - I hit it with my test program.
But even so, it is just a good defensive coding practice. If the type admits an invalid datum (it does), we should code up checks against it - or change the type (not practical here because
String[]
is imposed).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.
@cipherboy I've tested this PR and it's almost there. We really do need this length check though.
Feel free to just apply this patch or modify the relevant commit: whichever you prefer: