[13] RFR JDK-8216597 "SIGBUS in Java_sun_security_pkcs11_wrapper_PKCS11_getNativeKeyInfo after JDK-6913047"

2019-02-07 Thread Valerie Peng

Hi,

Anyone can help review this fix? More detailed info on cause and fixes 
can be found in the bug report and fix has been verified through mach5 run.


Bug: https://bugs.openjdk.java.net/browse/JDK-8216597

Webrev: http://cr.openjdk.java.net/~valeriep/8216597/webrev.00/

Thanks!
Valerie


Re: High memory usage / leaks was: Best mailing list for JVM embedding

2019-02-07 Thread Robert Marcano
On Tue, Jan 22, 2019, 5:53 AM Alan Bateman  On 22/01/2019 4:48 am, Robert Marcano wrote:
> >> :
> >>
> >> So the question now is, why signed jars could affect the memory usage
> >> of an application (we aren't doing JAR verification on our custom
> >> launcher, yet), just by being on the java.class.path? IIRC the
> >> initial application classpath JARs were never verified previously (by
> >> the java launcher alone, without JNLP around).
> >>
> >> Note: Tested with JARs signed with a self signed certificate and with
> >> one signed with a private CA. At most, signing the JARs could slow
> >> down the start up if it is now expected to these being verified by
> >> the java launcher (is it true?) but not higher memory usage and no
> >> reductions after a GC cycle but constants heap size increases.
> Signed JARs can be expensive to verify, esp. on first usage as the
> verification is likely to result in early loading of a lot of security
> classes and infrastructure. If you can narrow down the apparently memory
> leak to a small test case with analysis to suggest it's a JDK bug then
> it would be good to get a bug submitted.
>
> -Alan


Greeting. Sure, I will work on a distributable reproduction of the problem
today but it is new to me that the java launcher do JARs verification now.
If it is doing it I doesn't make sense to me, because a self signed or
unrecognized  CA doesn't trigger a validation error.

>


Re: Not possible to disable new TLS extensions for TLS 1.2 connections

2019-02-07 Thread Amir Khassaia
Xuelei,
The certificate in the connection is a red herring and not important. It's
actually a very unusual behaviour by talk.google.com endpoint to
encapsulate an error message inside a certificate.

As per the output I included:

*"certificate" : {
*>*  "version": "v3",
*>*  "serial number"  : "00 90 76 89 18 E9 33 93 A0",
*>*  "signature algorithm": "SHA256withRSA",
*>*  "issuer" : "CN=invalid2.invalid, OU="No SNI provided;
*>* please fix your client."",
*>*  "not before" : "2015-01-01 11:00:00.000 AEDT",
*>*  "not  after" : "2030-01-01 11:00:00.000 AEDT",
*>*  "subject": "CN=invalid2.invalid, OU="No SNI provided;
*>* please fix your client."",*


This certificate simply masks the TLS interoperability issue as an
untrusted certificate issue.

The fact is, some of the extensions sent by JSSE are changes to TLS 1.2 to
support TLS 1.3, this however affects some clients adversely in practice
and usually JDK provides properties to turn new enhancements off and work
around such behaviour, for the extensions I mentioned this is not provided
and hence they are always sent for client sockets unless TLSv1.2 is not in
use.

The impact to us is that upgrading to JDK11 means for some endpoints or
devices that are not 100% compliant to the spec the security is reduced as
we have to now work around to drop connections to these to TLSv1.1 or
TLS1.0 or not to move to Java 11 at all.

My request is simply to have all of the new extensions configurable on
individual basis so that they can be turned off if needed for
compatibility just like most other security enhancements that were
delivered in the past.

It appears some of the issues can come from

- inclusion of RSASSA-PSS alg in TLS 1.2 handshakes but these can disabled
at least

-signature_algorithms_cert and supported_versions extensions which seem to
be hardcoded for TLS 1.2 (I was not able to conclusively identify which of
these caused my troubles)

https://tools.ietf.org/html/rfc8446#section-1.3 does say that TLS 1.2
clients are affected but in an optional manner.Just today I've encountered
another Java 11 interop issue with TLS but this time with a physical device
which can have a long shelf life yet running a simple client socket
handshake abruptly terminates the connection upon client hello (no
server_hello at all), and downgrading the JRE below 11 works fine. I'm
including a trace for that as well:


javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.395
AEDT|SSLCipher.java:437|jdk.tls.keyLimits:  entry = AES/GCM/NoPadding
KeyUpdate 2^37. AES/GCM/NOPADDING:KEYUPDATE = 137438953472

javax.net.ssl|WARNING|01|main|2019-01-08 13:40:14.433
AEDT|ServerNameExtension.java:255|Unable to indicate server name

javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.433
AEDT|SSLExtensions.java:235|Ignore, context unavailable extension:
server_name

javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.433
AEDT|SSLExtensions.java:235|Ignore, context unavailable extension:
status_request

javax.net.ssl|WARNING|01|main|2019-01-08 13:40:14.443
AEDT|SignatureScheme.java:282|Signature algorithm, ed25519, is not
supported by the underlying providers

javax.net.ssl|WARNING|01|main|2019-01-08 13:40:14.444
AEDT|SignatureScheme.java:282|Signature algorithm, ed448, is not
supported by the underlying providers

javax.net.ssl|INFO|01|main|2019-01-08 13:40:14.449
AEDT|AlpnExtension.java:161|No available application protocols

javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.449
AEDT|SSLExtensions.java:235|Ignore, context unavailable extension:
application_layer_protocol_negotiation

javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.450
AEDT|SSLExtensions.java:235|Ignore, context unavailable extension:
status_request_v2

javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.453
AEDT|ClientHello.java:651|Produced ClientHello handshake message (

"ClientHello": {

  "client version"  : "TLSv1.2",

  "random"  : "1A BA E8 FC 59 00 AB DF 9A 1A 07 94 24 7F
34 3D 0B D2 7D 10 72 52 54 CD 44 43 62 E8 8B 42 C6 68",

  "session id"  : "",

  "cipher suites"   :
"[TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256(0xC023),
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256(0xC027),
TLS_RSA_WITH_AES_128_CBC_SHA256(0x003C),
TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256(0xC029),
TLS_RSA_WITH_AES_128_CBC_SHA(0x002F)]",

  "compression methods" : "00",

  "extensions"  : [

"supported_groups (10)": {

  "versions": [secp256r1, secp384r1, secp521r1, secp160k1]

},

"ec_point_formats (11)": {

  "formats": [uncompressed]

},

"signature_algorithms (13)": {

  "signature schemes": [ecdsa_secp256r1_sha256,
ecdsa_secp384r1_sha384, ecdsa_secp512r1_sha512, rsa_pss_rsae_sha256,
rsa_pss_rsae_sha384, rsa_pss_rsae_sha512, rsa_pss_pss_sha256,
rsa_pss_pss_sha384, rsa_pss_pss_sha512, rsa_pkcs1_sha256,
rsa_pkcs1_sha384, rsa_pkcs1_sha512, dsa_sha256, ecdsa_sha224,
rsa_sha224, dsa_sha224, ecdsa_sha1, rsa_pkcs1_sha1, dsa_sha1, rsa

Re: XML Digital Signature throws NAMESPACE_ERR exception under OpenJDK 11 that works under Java SE 8, 9 and 10

2019-02-07 Thread Sean Mullan

On 2/6/19 4:51 PM, Open eSignForms wrote:
I have a test version of the code that can run standalone and shows the 
bug.  I'm not sure how best to transfer this information to the forum 
for those to play with, but it is included below.


Thanks, I can reproduce the issue now. I will need to debug further to 
see what might be causing this.


--Sean


Re: RFR: 8218553: Enhance keystore load debug output

2019-02-07 Thread Seán Coffey



On 06/02/2019 16:24, Weijun Wang wrote:

Hi Séan,

Change looks fine.

I usually think there is no need to provide data in the debug output that were already 
available from public APIs (i.e. they are not something that can only be revealed from 
"internally"), but these numbers could help a supporter engineer to quickly 
find out if there is some really simple error in a customer's environment. So, good to 
have them.

And I definitely believe you know better that I what a support engineer needs.


Thanks for review. Yes - use of APIs to retrieve such data is not an 
option when someone is trying to debug a live production issue. I think 
this will help admins to confirm if keystore configuration looks correct 
in such environments.


regards,
Sean.



Thanks,
Max


On Feb 6, 2019, at 11:32 PM, Seán Coffey  wrote:

Looking to improve debug output in the keystore area.

It's useful to know how many keys/certs are found in such stores
to ensure correct set up.

https://bugs.openjdk.java.net/browse/JDK-8218553
http://cr.openjdk.java.net/~coffeys/webrev.8218553/webrev/

--
Regards,
Sean.