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

[WIP] Optimized JSSEngine #591

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

cipherboy
Copy link
Member

Whee!


This adds an optimized JSSEngine! More description Monday. :)

@cipherboy cipherboy added the javax Work to support javax.net.ssl interfaces label Jul 2, 2020
@cipherboy cipherboy added this to the 4.7.0 milestone Jul 2, 2020
@cipherboy cipherboy self-assigned this Jul 2, 2020
@cipherboy cipherboy changed the title Optimized JSSEngine [WIP] Optimized JSSEngine Jul 2, 2020
@cipherboy cipherboy force-pushed the optimized-jssengine branch 2 times, most recently from 1386601 to dce02ea Compare July 6, 2020 21:06
@cipherboy cipherboy removed this from the 4.7.0 milestone Jul 8, 2020
@cipherboy cipherboy removed their assignment Mar 23, 2021
cipherboy and others added 14 commits September 8, 2021 15:46
j_bytebuffer wraps the byte array underlying a ByteBuffer; this allows
us to call PR.Read and have it read directly from the underlying
ByteBuffer, rather than copying it into a temporary buffer before the
Read call. This, in turn, means we're making fewer JNI round-trips: we
only need to pass the array to the underlying j_bytebuffer, call
PR_Read, and it'll handle getting all the data it can in a single pass,
resulting in fewer loops inside JSSEngine.

Signed-off-by: Alexander Scheel <[email protected]>
Like BufferPRFD, ByteBufferPRFD implements a NSPR PRFileDesc layer.
Instead of maintaining a set of buffers up front, ByteBufferPRFD holds
a reference to a pair of j_bytebuffers, each of which in turn wraps a
single ByteBuffer instance. This allows for direct reading/writing of
the buffers passed to a SSLEngine's wrap/unwrap call without first
copying to an intermediate buffer.

Signed-off-by: Alexander Scheel <[email protected]>
These wrap the j_bytebuffer implementation from a previous call and
expose them via the Java layer for use by other callers.

Signed-off-by: Alexander Scheel <[email protected]>
Signed-off-by: Alexander Scheel <[email protected]>
Signed-off-by: Alexander Scheel <[email protected]>
Signed-off-by: Alexander Scheel <[email protected]>
Signed-off-by: Alexander Scheel <[email protected]>
@sonarcloud
Copy link

sonarcloud bot commented Sep 8, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug C 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell B 197 Code Smells

0.0% 0.0% Coverage
13.7% 13.7% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javax Work to support javax.net.ssl interfaces
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant