Created attachment 932685 [details] jdk.patch When OpenJDK 8 negotiates an AES-GCM cipher suite with a TLS peer, performance is extremely poor. To a large degree, this is due to a very inefficient implementation of the GHASH primitive within the AES-GCM implementation. The upstream review thread is here: http://mail.openjdk.java.net/pipermail/security-dev/2014-August/011009.html Upstream does not appear to be inclined to review this patch at all, despite the crippling performance impact (less than 30 Mbps even on rather high-end hardware). The patch I posted (and which is attached to this bug) only removes some of the allocations in the AES-GCM implementations, so there is quite a bit of room for additional improvements. Even after these changes, the TLS implementation will allocate four bytes for every byte transferred. Changing this is not too difficult, but it is less self-contained than the GHASH performance fix and should definitely happen upstream first. Hubert Kario kindly emulated the OpenJDK TLS handshake and used his most recent scan <https://securitypitfalls.wordpress.com/2014/08/03/july-2014-scan-results/> to estimate which fraction of the servers in the set negotiates an AES-GCM cipher suite with OpenJDK 8. According to these numbers, around 40% support AES-GCM, and 20% will negotiate it with an OpenJDK peer. This makes it fairly likely that programs will run into the performance issue.
We've tried using AES-GCM cipher suites in our product but had to revert to CBC suites due to the extremely poor performance. I think this bug should have a very high priority.
Current upstream discussion (for JDK 9): <http://mail.openjdk.java.net/pipermail/security-dev/2015-January/011601.html> Most recent webrev so far: <http://cr.openjdk.java.net/~fweimer/8069072/webrev.01/>
JDK 9 change was committed upstream: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/054e5baae476 I will wait a few days and propose the backport to JDK 8 after it has soaked a bit in 9.
Backport has been committed upstream, for 8u60: http://hg.openjdk.java.net/jdk8u/jdk8u-dev/jdk/rev/5923854f14f7
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle. Changing version to '22'. More information and reason for this action is here: https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22
This was fixed in u60: https://bugs.openjdk.java.net/browse/JDK-8069072