From christoph.langer at sap.com Fri Feb 1 12:10:32 2019 From: christoph.langer at sap.com (Langer, Christoph) Date: Fri, 1 Feb 2019 12:10:32 +0000 Subject: RFR [11u backport]: 8217579: TLS_EMPTY_RENEGOTIATION_INFO_SCSV is disabled after 8211883 In-Reply-To: <126f9dda-e20b-6971-4bcd-f12c26f1e8a6@oracle.com> References: <3aacce99786c4295ae877bc3adebffe1@sap.com> <126f9dda-e20b-6971-4bcd-f12c26f1e8a6@oracle.com> Message-ID: <98aa66447ded43679e3ffa60f9cfa4c6@sap.com> Thanks Sean. Pushed with the replacement as you suggested. > -----Original Message----- > From: Sean Mullan > Sent: Donnerstag, 31. Januar 2019 21:03 > To: Langer, Christoph ; security- > dev at openjdk.java.net > Subject: Re: RFR [11u backport]: 8217579: > TLS_EMPTY_RENEGOTIATION_INFO_SCSV is disabled after 8211883 > > CheckCipherSuites.java > > 116 // List of enabled cipher suites when the "crypto.policy" security > > typo: s/enabled/supported/ > > (I realized that typo after I had already pushed the fix to JDK 13, but > better to just fix it here now). > > Otherwise looks good. > > --Sean > > On 1/31/19 8:36 AM, Langer, Christoph wrote: > > Hi, > > > > please review the backport of the fix for 8217579 to jdk11u. > > > > Bug: https://bugs.openjdk.java.net/browse/JDK-8217579 > > > > Webrev: http://cr.openjdk.java.net/~clanger/webrevs/8217579.11u/ > > > > Original review thread: > > https://mail.openjdk.java.net/pipermail/security-dev/2019- > January/019256.html > > > > The patch did apply cleanly but I had to remove the ChaCha ciphers to > > make the test work with JDK 11. > > > > Thanks and Best regards > > > > Christoph > > From weijun.wang at oracle.com Sun Feb 3 14:44:33 2019 From: weijun.wang at oracle.com (Weijun Wang) Date: Sun, 3 Feb 2019 22:44:33 +0800 Subject: RFR 8180569: Refactor sun/security/krb5/ shell tests to plain java tests Message-ID: <004DCA97-218A-47A3-B1C2-BE0CAF2C5BEF@oracle.com> Please take a review at https://cr.openjdk.java.net/~weijun/8180569/webrev.00 I've combined ktarg.sh, ktmissing.sh, and ktzero.sh into KtabZero.java. rcache_usemd5.sh is renamed to ReplayCacheTestProcWithMD5.java. The test has no content and is only used to launch another test. I don't want to combine them because I want different working directory. runNameEquals.sh is left as a shell test. It calls quite some *nix commands and is better to stay unchanged. Thanks, Max From dpenick at gmail.com Mon Feb 4 10:08:05 2019 From: dpenick at gmail.com (David Penick) Date: Mon, 4 Feb 2019 04:08:05 -0600 Subject: Signed JCE and providers jars Message-ID: I?ve downloaded OpenJDK builds from AdoptOpenJDK and Azul Zulu, and I?ve noticed that the jce.jar, sunjce_provider.jar and sunpkcs11.jar jar files do not appear to be signed. I?m surprised they work without being signed, but I also haven?t been able to find anyone asking how to get signed versions of the Sun JCE. How can I get signed versions of the Sun JCE jars, or should I not worry about it, and if so, why not? Thanks, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From ecki at zusammenkunft.net Mon Feb 4 10:37:46 2019 From: ecki at zusammenkunft.net (Bernd Eckenfels) Date: Mon, 4 Feb 2019 10:37:46 +0000 Subject: Signed JCE and providers jars In-Reply-To: References: Message-ID: The OpenJDK JCA does not do provider signature checking. So you can install your own providers and don?t need to sign them. Gruss Bernd -- http://bernd.eckenfels.net ________________________________ Von: security-dev im Auftrag von David Penick Gesendet: Montag, Februar 4, 2019 11:18 AM An: security-dev at openjdk.java.net Betreff: Signed JCE and providers jars I?ve downloaded OpenJDK builds from AdoptOpenJDK and Azul Zulu, and I?ve noticed that the jce.jar, sunjce_provider.jar and sunpkcs11.jar jar files do not appear to be signed. I?m surprised they work without being signed, but I also haven?t been able to find anyone asking how to get signed versions of the Sun JCE. How can I get signed versions of the Sun JCE jars, or should I not worry about it, and if so, why not? Thanks, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From bradford.wetmore at oracle.com Mon Feb 4 22:08:56 2019 From: bradford.wetmore at oracle.com (Bradford Wetmore) Date: Mon, 4 Feb 2019 14:08:56 -0800 Subject: Signed JCE and providers jars In-Reply-To: References: Message-ID: Hi David, On 2/4/2019 2:08 AM, David Penick wrote: > I?ve downloaded OpenJDK builds from AdoptOpenJDK and Azul Zulu, and I?ve > noticed that the jce.jar, sunjce_provider.jar and sunpkcs11.jar jar > files do not appear to be signed. I?m surprised they work without being > signed, but I also haven?t been able to find anyone asking how to get > signed versions of the Sun JCE. > > How can I get signed versions of the Sun JCE jars, or should I not worry > about it, and if so, why not? In Oracle's JDK 8 and earlier releases, the same rules still apply in that the Oracle Framework and Providers (previously called the "Sun Framework and Providers" in jce.jar/sunjce_provider.jar/sunpkcs11.jar/sunmscapi.jar/etc.) must be signed and properly verify. This signing requirement also applies to 3rd Party Provider jar files. In Oracle's JDK 9+ releases, the Oracle Framework/Providers are now implemented as modules (java.base/jdk.crypto.cryptoki/etc.) rather than jar files, and are not signed. 3rd Party Providers must still be signed in order to be used in the commercial Oracle JDK product. 3rd Party providers do not need to be signed for use with the Oracle OpenJDK builds, which is not a commercial product. It is up to other OpenJDK-based implementations (AdoptOpenJDK/Azul/IBM/etc.) to determine whether 3rd Party providers must be signed, and make the appropriate modifications to the code. Brad From sean.mullan at oracle.com Tue Feb 5 15:21:20 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Tue, 5 Feb 2019 10:21:20 -0500 Subject: CSR Review Request, JDK-8217835, Remove the experimental SunJSSE FIPS compliant mode. In-Reply-To: <69e31dc5-647f-a19f-f9de-ae51f8110a60@oracle.com> References: <69e31dc5-647f-a19f-f9de-ae51f8110a60@oracle.com> Message-ID: <07801ca5-9768-8630-f091-e3ba6f30feab@oracle.com> Looks good -- I added my name as Reviewer. --Sean On 1/28/19 1:46 PM, Xuelei Fan wrote: > Hi, > > Could I get the CSR reviewed: > > CSR: https://bugs.openjdk.java.net/browse/JDK-8217907 > > and here is the proposed release note: > ?? https://bugs.openjdk.java.net/browse/JDK-8217911 > > If you are using this experimental feature, please let me know the > compatibility impact by the end of Jan 31, 2019. > > Thanks, > Xuelei From david at penick.net Tue Feb 5 17:41:27 2019 From: david at penick.net (David Penick) Date: Tue, 5 Feb 2019 11:41:27 -0600 Subject: Signed JCE and providers jars In-Reply-To: References: Message-ID: <6AB70F40-25DE-4DDB-80A8-3CE3F95E51C8@penick.net> Thanks Brad and Bernd! David > On Feb 4, 2019, at 4:08 PM, Bradford Wetmore wrote: > > Hi David, > >> On 2/4/2019 2:08 AM, David Penick wrote: >> I?ve downloaded OpenJDK builds from AdoptOpenJDK and Azul Zulu, and I?ve noticed that the jce.jar, sunjce_provider.jar and sunpkcs11.jar jar files do not appear to be signed. I?m surprised they work without being signed, but I also haven?t been able to find anyone asking how to get signed versions of the Sun JCE. >> How can I get signed versions of the Sun JCE jars, or should I not worry about it, and if so, why not? > > In Oracle's JDK 8 and earlier releases, the same rules still apply in that the Oracle Framework and Providers (previously called the "Sun Framework and Providers" in jce.jar/sunjce_provider.jar/sunpkcs11.jar/sunmscapi.jar/etc.) must be signed and properly verify. This signing requirement also applies to 3rd Party Provider jar files. > > In Oracle's JDK 9+ releases, the Oracle Framework/Providers are now implemented as modules (java.base/jdk.crypto.cryptoki/etc.) rather than jar files, and are not signed. > > 3rd Party Providers must still be signed in order to be used in the commercial Oracle JDK product. > > 3rd Party providers do not need to be signed for use with the Oracle OpenJDK builds, which is not a commercial product. > > It is up to other OpenJDK-based implementations (AdoptOpenJDK/Azul/IBM/etc.) to determine whether 3rd Party providers must be signed, and make the appropriate modifications to the code. > > Brad > > > From xuelei.fan at oracle.com Tue Feb 5 18:44:02 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Tue, 5 Feb 2019 10:44:02 -0800 Subject: Code Review Request, JDK-8217835, Remove the experimental SunJSSE FIPS compliant mode Message-ID: <2b0668ee-cf1f-707a-e5ae-42afffaa755a@oracle.com> Hi, Could I have the update reviewed? http://cr.openjdk.java.net/~xuelei/8217835/webrev.00/ With this update, the experimental FIPS 140 compliant mode is removed from the SunJSSE provider. As the SunJSSE provider uses the JDK default cryptography providers, alternatively applications can configure the Java Security Property to use FIPS 140 compliant cryptography providers. More details, please refer to CSR: https://bugs.openjdk.java.net/browse/JDK-8217907 Thanks & Regards, Xuelei From anthony.scarpino at oracle.com Tue Feb 5 23:52:02 2019 From: anthony.scarpino at oracle.com (Anthony Scarpino) Date: Tue, 5 Feb 2019 15:52:02 -0800 Subject: RFR[s]: 8201633 Problems with AES-GCM native acceleration Message-ID: <4e76b39c-8a6f-bf2b-7d14-177e68fe4aee@oracle.com> I need a review of this change which is to help the AES/GCM intrinsic activate on large data sizes. It's not the ideal resolution, which splits up the crypto operation in chucks, but I significantly improves performance for larger data sizes. Additionally there is an optimization to not allocated and use an unnecessary buffer in the init()-doFinal() case that helped performance with large data sizes. The final result was a 1MB file is encrypted at 2GB/sec vs 250MB/sec. This change is not meant to fix all possible performance bottlenecks. http://cr.openjdk.java.net/~ascarpino/8201633/webrev/ Tony From sean.coffey at oracle.com Wed Feb 6 15:32:59 2019 From: sean.coffey at oracle.com (=?UTF-8?Q?Se=c3=a1n_Coffey?=) Date: Wed, 6 Feb 2019 15:32:59 +0000 Subject: RFR: 8218553: Enhance keystore load debug output Message-ID: <1c3883ef-07eb-3922-a3e4-d8cf2bba43b4@oracle.com> 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. From weijun.wang at oracle.com Wed Feb 6 16:24:15 2019 From: weijun.wang at oracle.com (Weijun Wang) Date: Thu, 7 Feb 2019 00:24:15 +0800 Subject: RFR: 8218553: Enhance keystore load debug output In-Reply-To: <1c3883ef-07eb-3922-a3e4-d8cf2bba43b4@oracle.com> References: <1c3883ef-07eb-3922-a3e4-d8cf2bba43b4@oracle.com> Message-ID: <410ACC87-76B1-477C-B98F-D2F3153D21E2@oracle.com> 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, 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. > From adam.petcher at oracle.com Wed Feb 6 20:23:12 2019 From: adam.petcher at oracle.com (Adam Petcher) Date: Wed, 6 Feb 2019 15:23:12 -0500 Subject: RFR[s]: 8201633 Problems with AES-GCM native acceleration In-Reply-To: <4e76b39c-8a6f-bf2b-7d14-177e68fe4aee@oracle.com> References: <4e76b39c-8a6f-bf2b-7d14-177e68fe4aee@oracle.com> Message-ID: <87eb4cee-e568-83b9-7b73-5a91c5a1d6d3@oracle.com> I'm still not sold on this---it seems like a specific solution to a single instance of a more general problem. Have you investigated any tweaks to the JVM or compiler settings? Andrew prototyped something[1], but it looks like this is also specific to GCM. A more general solution would be some way to tell the JVM that some method should always be compiled. I think this is the exact problem that motivated per-method compile thresholds[2], though it's not clear if the current implementation of that feature helps us here. [1] http://cr.openjdk.java.net/~aph/gctr/ [2] https://bugs.openjdk.java.net/browse/JDK-8059606 On 2/5/2019 6:52 PM, Anthony Scarpino wrote: > > I need a review of this change which is to help the AES/GCM intrinsic > activate on large data sizes.? It's not the ideal resolution, which > splits up the crypto operation in chucks, but I significantly improves > performance for larger data sizes. Additionally there is an > optimization to not allocated and use an unnecessary buffer in the > init()-doFinal() case? that helped performance with large data sizes. > The final result was a 1MB file is encrypted at 2GB/sec vs 250MB/sec. > > This change is not meant to fix all possible performance bottlenecks. > > http://cr.openjdk.java.net/~ascarpino/8201633/webrev/ > > Tony From anthony.scarpino at oracle.com Wed Feb 6 21:18:34 2019 From: anthony.scarpino at oracle.com (Anthony Scarpino) Date: Wed, 6 Feb 2019 13:18:34 -0800 Subject: RFR[s]: 8201633 Problems with AES-GCM native acceleration In-Reply-To: <87eb4cee-e568-83b9-7b73-5a91c5a1d6d3@oracle.com> References: <4e76b39c-8a6f-bf2b-7d14-177e68fe4aee@oracle.com> <87eb4cee-e568-83b9-7b73-5a91c5a1d6d3@oracle.com> Message-ID: <00aa73c6-36f3-898e-1b50-b3d39fcb0330@oracle.com> Andrew's fix looked much more complicated than running a simple loop in the byte code. The way I read CompileCommand, I don't think it applies to intrinsics, or at least I don't see how it relates to make this easier. The slow start seems to be getting enough attention that addressing it is probably easier than arguing why it's not a problem. Tony On 2/6/19 12:23 PM, Adam Petcher wrote: > I'm still not sold on this---it seems like a specific solution to a > single instance of a more general problem. > > Have you investigated any tweaks to the JVM or compiler settings? Andrew > prototyped something[1], but it looks like this is also specific to GCM. > A more general solution would be some way to tell the JVM that some > method should always be compiled. I think this is the exact problem that > motivated per-method compile thresholds[2], though it's not clear if the > current implementation of that feature helps us here. > > [1] http://cr.openjdk.java.net/~aph/gctr/ > [2] https://bugs.openjdk.java.net/browse/JDK-8059606 > > On 2/5/2019 6:52 PM, Anthony Scarpino wrote: >> >> I need a review of this change which is to help the AES/GCM intrinsic >> activate on large data sizes.? It's not the ideal resolution, which >> splits up the crypto operation in chucks, but I significantly improves >> performance for larger data sizes. Additionally there is an >> optimization to not allocated and use an unnecessary buffer in the >> init()-doFinal() case? that helped performance with large data sizes. >> The final result was a 1MB file is encrypted at 2GB/sec vs 250MB/sec. >> >> This change is not meant to fix all possible performance bottlenecks. >> >> http://cr.openjdk.java.net/~ascarpino/8201633/webrev/ >> >> Tony From valerie.peng at oracle.com Wed Feb 6 22:19:52 2019 From: valerie.peng at oracle.com (Valerie Peng) Date: Wed, 6 Feb 2019 14:19:52 -0800 Subject: RFR[s]: 8201633 Problems with AES-GCM native acceleration In-Reply-To: <4e76b39c-8a6f-bf2b-7d14-177e68fe4aee@oracle.com> References: <4e76b39c-8a6f-bf2b-7d14-177e68fe4aee@oracle.com> Message-ID: <25683c00-382a-ef5d-87ca-d7f857aeda20@oracle.com> Hi Tony, Changes look fine, just some nits. - line 402, 96 bit should be 96-byte? - line 408, can we not use "l"?? It looks too similar to "1" - As for the comments on line 586, 587, It seems to be for the "else" part of this if-condition. So I find it a bit confusing. Maybe simplify it to something like "copy input data into ibuffer when there are buffered bytes or when input buffer is same as output buffer". Or, use what you have and add ", otherwise, copy input data into ibuffer". You'll probably need to add noreg-perf label. Thanks, Valerie On 2/5/2019 3:52 PM, Anthony Scarpino wrote: > > I need a review of this change which is to help the AES/GCM intrinsic > activate on large data sizes.? It's not the ideal resolution, which > splits up the crypto operation in chucks, but I significantly improves > performance for larger data sizes. Additionally there is an > optimization to not allocated and use an unnecessary buffer in the > init()-doFinal() case? that helped performance with large data sizes. > The final result was a 1MB file is encrypted at 2GB/sec vs 250MB/sec. > > This change is not meant to fix all possible performance bottlenecks. > > http://cr.openjdk.java.net/~ascarpino/8201633/webrev/ > > Tony From anthony.scarpino at oracle.com Wed Feb 6 23:22:10 2019 From: anthony.scarpino at oracle.com (Anthony Scarpino) Date: Wed, 6 Feb 2019 15:22:10 -0800 Subject: RFR[s]: 8201633 Problems with AES-GCM native acceleration In-Reply-To: <25683c00-382a-ef5d-87ca-d7f857aeda20@oracle.com> References: <4e76b39c-8a6f-bf2b-7d14-177e68fe4aee@oracle.com> <25683c00-382a-ef5d-87ca-d7f857aeda20@oracle.com> Message-ID: Agreed.. webrev updated.. I inadvertently updated in-place. Tony On 2/6/19 2:19 PM, Valerie Peng wrote: > Hi Tony, > > Changes look fine, just some nits. > > - line 402, 96 bit should be 96-byte? > > - line 408, can we not use "l"?? It looks too similar to "1" > > - As for the comments on line 586, 587, It seems to be for the "else" > part of this if-condition. So I find it a bit confusing. Maybe simplify > it to something like "copy input data into ibuffer when there are > buffered bytes or when input buffer is same as output buffer". Or, use > what you have and add ", otherwise, copy input data into ibuffer". > > You'll probably need to add noreg-perf label. > > Thanks, > > Valerie > > On 2/5/2019 3:52 PM, Anthony Scarpino wrote: >> >> I need a review of this change which is to help the AES/GCM intrinsic >> activate on large data sizes.? It's not the ideal resolution, which >> splits up the crypto operation in chucks, but I significantly improves >> performance for larger data sizes. Additionally there is an >> optimization to not allocated and use an unnecessary buffer in the >> init()-doFinal() case? that helped performance with large data sizes. >> The final result was a 1MB file is encrypted at 2GB/sec vs 250MB/sec. >> >> This change is not meant to fix all possible performance bottlenecks. >> >> http://cr.openjdk.java.net/~ascarpino/8201633/webrev/ >> >> Tony From sean.coffey at oracle.com Thu Feb 7 12:05:42 2019 From: sean.coffey at oracle.com (=?UTF-8?Q?Se=c3=a1n_Coffey?=) Date: Thu, 7 Feb 2019 12:05:42 +0000 Subject: RFR: 8218553: Enhance keystore load debug output In-Reply-To: <410ACC87-76B1-477C-B98F-D2F3153D21E2@oracle.com> References: <1c3883ef-07eb-3922-a3e4-d8cf2bba43b4@oracle.com> <410ACC87-76B1-477C-B98F-D2F3153D21E2@oracle.com> Message-ID: <7c65eae1-dd95-03f2-680c-3da3a32bd4b7@oracle.com> 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. >> From sean.mullan at oracle.com Thu Feb 7 15:49:25 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Thu, 7 Feb 2019 10:49:25 -0500 Subject: XML Digital Signature throws NAMESPACE_ERR exception under OpenJDK 11 that works under Java SE 8, 9 and 10 In-Reply-To: References: Message-ID: 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 From yozons at gmail.com Wed Feb 6 21:51:04 2019 From: yozons at gmail.com (Open eSignForms) Date: Wed, 6 Feb 2019 13:51:04 -0800 Subject: XML Digital Signature throws NAMESPACE_ERR exception under OpenJDK 11 that works under Java SE 8, 9 and 10 In-Reply-To: References: Message-ID: 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. Note that we use the BouncyCastle BC used in our code, but if you don't have or want to use the BC provider JAR, it will fallback to the SunRsaSign provider that appears to be bundled with JDKs. I get the same results with BC and SunRsaSign providers.? It's just the Java version that causes the issue. In testing with or without the BC provider, the Java 8, 9 and 10 versions run and produces the signed XML, while the Java 11 fails. java version "10.0.2" 2018-07-17 Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13) Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode) openjdk version "11.0.2" 2019-01-15 OpenJDK Runtime Environment 18.9 (build 11.0.2+9) OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode) The Java 11 exception: XmlDigitalSignature.main() exception: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces. org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces. ??? at java.xml/com.sun.org.apache.xerces.internal.dom.ElementNSImpl.setName(ElementNSImpl.java:109) ??? at java.xml/com.sun.org.apache.xerces.internal.dom.ElementNSImpl.(ElementNSImpl.java:84) ??? at java.xml/com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createElementNS(CoreDocumentImpl.java:2089) ??? at java.xml.crypto/org.jcp.xml.dsig.internal.dom.XmlWriterToTree.writeStartElement(XmlWriterToTree.java:99) ??? at java.xml.crypto/org.jcp.xml.dsig.internal.dom.Marshaller.marshalGenericNode(Marshaller.java:303) ??? at java.xml.crypto/org.jcp.xml.dsig.internal.dom.Marshaller.marshalGenericNode(Marshaller.java:286) ??? at java.xml.crypto/org.jcp.xml.dsig.internal.dom.Marshaller$14.marshalObject(Marshaller.java:251) ??? at java.xml.crypto/org.jcp.xml.dsig.internal.dom.Marshaller$14.marshalObject(Marshaller.java:247) ??? at java.xml.crypto/org.jcp.xml.dsig.internal.dom.XmlWriterToTree.marshalStructure(XmlWriterToTree.java:200) ??? at java.xml.crypto/org.jcp.xml.dsig.internal.dom.DOMXMLObject.marshal(DOMXMLObject.java:180) ??? at java.xml.crypto/org.jcp.xml.dsig.internal.dom.DOMXMLSignature.marshal(DOMXMLSignature.java:233) ??? at java.xml.crypto/org.jcp.xml.dsig.internal.dom.DOMXMLSignature.sign(DOMXMLSignature.java:325) ??? at com.esignforms.open.xmldsigbug.XmlDigitalSignature.sign(XmlDigitalSignature.java:212) ??? at com.esignforms.open.xmldsigbug.XmlDigitalSignature.main(XmlDigitalSignature.java:732) Under Java 10, the signed XML:

Dummy HTML document

]]>xbX6EvkJBIDySHYJizqf4rNkEi5eQRyWfpD5TX1xaSI7pez0isMTFwho7/F+fJioI2eHEBPpujhn wvIlHvvCOg==D6WsZi/HzkmfZCT3tg7rvoo8S3mkNx5WkEp71OiOJ+JVYG+UAF6aVadY55Jt/tR3BF/wDntWOraK gmAXZ2ifHQ==1tOD+n70iPIcUM0gylw5Wu4LpFQUyEi0L+aq0Z5RgdvO4xsoypumooQRPWWxn/esiisbbRSEbCxs 11jaahDUGQ==A9REglXLHIr8M5xFHIR8o93pNKMiCoOQTW/58WOXLnQ/8Gaw4txOTwIsnclKxG+5bkQ76/KR/It+ /ljnjdlmFw==FxFXp98EIK2+NoHlwE6ewE9En+X02tz0Fb4IBlHKLh/aRYbGQn8ceexq27nbfA3wKXYgLM5aG9Mv n+nvkLQfP+U0jXtW6En0hGnbmCa2sBevEB0l31HItXW6+KocAJBio8FT1Sps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kqhkiG9w0BAQ0FAAOCAgEAOu3Y4o7P4wel6zcwGIHfwuTuL/IX9qzYnxtPNkEHL8D8v3P4Tovk zDHOou4Ai5yycZninbaoK2WJr80p2HNfISY51fCJZ+Z16xmBlPmunnLI23cTAJGnZlI6WtsZLXQw LX91VkqKlRL73+MZECxO0m5I4hxNu8CeOIcQ7aCLvnkO8AEeCa9zAwmiL2tJ8coJvELvqS9Zaiaz syix8IWETtrZ+vv+85rASl5PSkCb0AX3eipJoqRgGazWraV7NBwDZgPEYXNQq1/jbQoirjJIzNQO KEgH3wViGFVwnW4YJ4dzbtVd6EVaHZGmYb666FpwNPz6OBLgX1sjvDTMTYGYo/VrIN02neYEvBtK GrZ5Gw7l7BOyKe92F3iQ3q90/kOBmGnEn8agkKlynv5IlJR8xOCxG1U9e8GFfmAwFS5hYtf0Gh/u FRqnOepWQKuZ3kBBR+6KttbE58aD2kVuB36et5Dij1nxr+ihL7e4V42KsQQn/VBDrMoU5xW+yZH/ aAEgpbfUm5detK5oFqs5JIILFiyUXQCrvYuNZFx4vDqrsDmmAaaAPBlcybCUXseqh4hThyrOJ0dX 3xaXcwd32t1+/aOa7jgJRTgSklxhhcRCMHI9HWNlLgUWmvZ2O5G70reY4Kyg1NAS56qX48Xbckvy VMfem/JPPYT/veThnefIgQk=2019-02-06T13:29:03-08:00descriptiontext/html
XML Digital Signature code used: // Copyright (C) 2011-2019 Yozons, Inc. // Open eSignForms - Web-based electronic contracting software // // This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License // as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // See the GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License along with this program. // If not, see or . // Contact information is via the public forums athttp://open.esignforms.com or via private email toopen-esign at yozons.com . // *package*com.esignforms.open.xmldsigbug; *import*java.io.BufferedInputStream; *import*java.io.ByteArrayInputStream; *import*java.io.StringWriter; *import*java.io.Writer; *import*java.nio.charset.StandardCharsets; *import*java.security.Key; *import*java.security.KeyException; *import*java.security.KeyFactory; *import*java.security.KeyPair; *import*java.security.NoSuchProviderException; *import*java.security.PrivateKey; *import*java.security.PublicKey; *import*java.security.cert.Certificate; *import*java.security.cert.CertificateFactory; *import*java.security.cert.X509Certificate; *import*java.security.spec.PKCS8EncodedKeySpec; *import*java.security.spec.X509EncodedKeySpec; *import*java.time.ZonedDateTime; *import*java.time.format.DateTimeFormatter; *import*java.util.Collections; *import*java.util.Iterator; *import*java.util.LinkedList; *import*java.util.List; *import*java.util.UUID; *import*javax.xml.crypto.AlgorithmMethod; *import*javax.xml.crypto.KeySelector; *import*javax.xml.crypto.KeySelectorException; *import*javax.xml.crypto.KeySelectorResult; *import*javax.xml.crypto.XMLCryptoContext; *import*javax.xml.crypto.XMLStructure; *import*javax.xml.crypto.dom.DOMStructure; *import*javax.xml.crypto.dsig.DigestMethod; *import*javax.xml.crypto.dsig.Reference; *import*javax.xml.crypto.dsig.SignatureMethod; *import*javax.xml.crypto.dsig.SignatureProperties; *import*javax.xml.crypto.dsig.SignatureProperty; *import*javax.xml.crypto.dsig.SignedInfo; *import*javax.xml.crypto.dsig.Transform; *import*javax.xml.crypto.dsig.XMLObject; *import*javax.xml.crypto.dsig.XMLSignature; *import*javax.xml.crypto.dsig.XMLSignatureFactory; *import*javax.xml.crypto.dsig.dom.DOMSignContext; *import*javax.xml.crypto.dsig.dom.DOMValidateContext; *import*javax.xml.crypto.dsig.keyinfo.KeyInfo; *import*javax.xml.crypto.dsig.keyinfo.KeyInfoFactory; *import*javax.xml.crypto.dsig.keyinfo.KeyName; *import*javax.xml.crypto.dsig.keyinfo.KeyValue; *import*javax.xml.crypto.dsig.keyinfo.X509Data; *import*javax.xml.crypto.dsig.spec.C14NMethodParameterSpec; *import*javax.xml.crypto.dsig.spec.TransformParameterSpec; *import*javax.xml.parsers.DocumentBuilderFactory; *import*javax.xml.transform.OutputKeys; *import*javax.xml.transform.Transformer; *import*javax.xml.transform.TransformerFactory; *import*javax.xml.transform.dom.DOMSource; *import*javax.xml.transform.stream.StreamResult; *import*org.w3c.dom.Document; *import*org.w3c.dom.Element; *import*org.w3c.dom.NodeList; /** * This code is adapted from the Open eSignForms source file com.esignforms.open.crypto.XmlDigitalSignature, with all platform hooks removed. * * XmlDigitalSignature provides our interface to XML Digital Signatures. * * Much of the code understanding came from Oracle's technotes: *http://download.oracle.com/javase/6/docs/technotes/guides/security/xmldsig/XMLDigitalSignature.html * **@author*Yozons, Inc. */ *public**final**class*XmlDigitalSignature { // These literals are supported as of Java 7, but are not defined in the API yet... *private**static**final*String*/SignatureMethod_RSA_SHA512/*="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"; *private**static**final*String*/CanonicalizationMethod_INCLUSIVE_C14N11_WITH_COMMENTS/*="http://www.w3.org/2006/12/xml-c14n11#WithComments"; *private*XMLSignatureFactoryxmlSignatureFactory; *public*XmlDigitalSignature() { xmlSignatureFactory= XMLSignatureFactory./getInstance/("DOM"); ? } *public*String sign(StringxmlToSign, Stringdescription, StringcontentType, SignatureKeysignatureKey)*throws*Exception { *return*sign(xmlToSign,description,contentType,signatureKey,*null*,*null*); ? } *public*String sign(StringxmlToSign, Stringdescription, StringcontentType, SignatureKeysignatureKey, StringsignerIpHost, StringsignerUserAgent)*throws*Exception { *if*(/isBlank/(xmlToSign)) *throw**new*Exception("Missing XML string to be signed."); *if*(signatureKey==*null*) *throw**new*Exception("Missing the signature key needed to sign."); *try*{ // Our KeyInfo section will have a KeyName that is our signature key's id, as well as the public key itself, // and our self-sign X.509 certificate. KeyInfoFactorykeyInfoFactory=xmlSignatureFactory.getKeyInfoFactory(); ListkeyInfoList=*new*LinkedList(); ? KeyNamekeyName=keyInfoFactory.newKeyName(signatureKey.id.toString()); keyInfoList.add(keyName); ? KeyValuekeyValue=keyInfoFactory.newKeyValue(signatureKey.keyPair.getPublic()); keyInfoList.add(keyValue); ? X509DatakeyX409Data=keyInfoFactory.newX509Data(Collections./singletonList/(signatureKey.cert)); keyInfoList.add(keyX409Data); ? KeyInfokeyInfo=keyInfoFactory.newKeyInfo(keyInfoList,"KeyInfo_ID"); // Instantiate the document to be signed DocumentBuilderFactorydbf= DocumentBuilderFactory./newInstance/(); dbf.setNamespaceAware(*true*); ? Documentdocument=dbf.newDocumentBuilder().parse(*new*BufferedInputStream(*new*ByteArrayInputStream(/stringToBytes/(xmlToSign)))); // Create a DOMSignContext and specify the RSA PrivateKey and // location of the resulting XMLSignature's parent element. DOMSignContextdomSignContext=*new*DOMSignContext(signatureKey.keyPair.getPrivate(),document.getDocumentElement()); // Add in the EU Directive extras:http://uri.etsi.org/01903/v1.4.1/ts_101903v010401p.pdf ? StringsigningTime=/toXmlWithTz/(ZonedDateTime./now/()); ? ElementqualifyingPropertiesElement=document.createElement("QualifyingProperties"); qualifyingPropertiesElement.setAttribute("Id","QualifyingProperties_ID"); qualifyingPropertiesElement.setIdAttribute("Id",*true*);// mark our id as the "Id" attribute ? ElementsignedPropertiesElement=document.createElement("SignedProperties"); ? ElementsignedSignaturePropertiesElement=document.createElement("SignedSignatureProperties"); ? ElementsigningTimeElement=document.createElement("SigningTime"); signingTimeElement.setTextContent(signingTime); ? ElementsignedDataObjectPropertiesElement=document.createElement("SignedDataObjectProperties"); ? ElementdataObjectFormatElement=document.createElement("DataObjectFormat"); dataObjectFormatElement.setAttribute("ObjectReference","#Payload_Reference_ID"); ? ElementdataObjectDescriptionElement=document.createElement("Description"); dataObjectDescriptionElement.setTextContent(/toEscapedXml/(description)); dataObjectFormatElement.appendChild(dataObjectDescriptionElement); ? ElementdataObjectMimeTypeElement=document.createElement("MimeType"); dataObjectMimeTypeElement.setTextContent(/toEscapedXml/(contentType)); dataObjectFormatElement.appendChild(dataObjectMimeTypeElement); qualifyingPropertiesElement.appendChild(signedPropertiesElement); signedPropertiesElement.appendChild(signedSignaturePropertiesElement); signedPropertiesElement.appendChild(signedDataObjectPropertiesElement); signedSignaturePropertiesElement.appendChild(signingTimeElement); signedDataObjectPropertiesElement.appendChild(dataObjectFormatElement); ? DOMStructurequalifyingPropertiesObject=*new*DOMStructure(qualifyingPropertiesElement); XMLObjectqualifyingPropertiesXMLObject=xmlSignatureFactory.newXMLObject(Collections./singletonList/(qualifyingPropertiesObject),*null*,*null*,*null*); // Our signature includes the deployment id, and the current timestamp ? ElementesignformsElement=document.createElement("OpenESignForms_XmlDigitalSignatureSeal"); esignformsElement.setAttribute("Version",/toEscapedXml/("19.1.19")); esignformsElement.setAttribute("Timestamp",signingTime); esignformsElement.setAttribute("DeploymentId","1.1.1.1"); esignformsElement.setAttribute("DeploymentHostName","open.esignforms.com"); esignformsElement.setAttribute("DeploymentHostAddress","192.1.1.1"); *if*(!/isBlank/(signerIpHost)) esignformsElement.setAttribute("SignerAddress",/toEscapedXml/(signerIpHost)); *if*(!/isBlank/(signerUserAgent)) esignformsElement.setAttribute("SignerAgent",/toEscapedXml/(signerUserAgent)); DOMStructuresignatureObject=*new*DOMStructure(esignformsElement); SignaturePropertysignatureProperty=xmlSignatureFactory.newSignatureProperty(Collections./singletonList/(signatureObject),"#OpenESignForms_Seal", "OpenESignForms_Seal_ID"); SignaturePropertiessignatureProperties=xmlSignatureFactory.newSignatureProperties(Collections./singletonList/(signatureProperty),*null*); XMLObjectsignaturePropertiesXMLObject=xmlSignatureFactory.newXMLObject(Collections./singletonList/(signatureProperties),*null*,*null*,*null*); // Sign the main payload ReferencereferencePayload=xmlSignatureFactory.newReference("",xmlSignatureFactory.newDigestMethod(DigestMethod.*/SHA512/*,*null*), Collections./singletonList/(xmlSignatureFactory.newTransform(Transform.*/ENVELOPED/*, (TransformParameterSpec)*null*)),*null*,"Payload_Reference_ID"); // Sign the KeyInfo per the EU spec ReferencereferenceKeyInfo=xmlSignatureFactory.newReference("#KeyInfo_ID",xmlSignatureFactory.newDigestMethod(DigestMethod.*/SHA512/*,*null*)); // Sign the EU qualifying properties ReferencereferenceQualifyingProperties=xmlSignatureFactory.newReference("#QualifyingProperties_ID", xmlSignatureFactory.newDigestMethod(DigestMethod.*/SHA512/*,*null*)); // Sign our seal ReferencereferenceSignatureProperties=xmlSignatureFactory.newReference("#OpenESignForms_Seal_ID", xmlSignatureFactory.newDigestMethod(DigestMethod.*/SHA512/*,*null*)); ListreferenceList=*new*LinkedList(); referenceList.add(referencePayload); referenceList.add(referenceKeyInfo); referenceList.add(referenceQualifyingProperties); referenceList.add(referenceSignatureProperties); ? SignedInfosignedInfo=xmlSignatureFactory .newSignedInfo( xmlSignatureFactory.newCanonicalizationMethod( */CanonicalizationMethod_INCLUSIVE_C14N11_WITH_COMMENTS/*/* CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS */, (C14NMethodParameterSpec)*null*), xmlSignatureFactory.newSignatureMethod(*/SignatureMethod_RSA_SHA512/*,*null*),referenceList); // Create the XMLSignature, but don't sign it yet. ListsigningXMLObjects=*new*LinkedList(); signingXMLObjects.add(qualifyingPropertiesXMLObject); signingXMLObjects.add(signaturePropertiesXMLObject); XMLSignaturexmlSignature=xmlSignatureFactory.newXMLSignature(signedInfo,keyInfo,signingXMLObjects,"OpenESignForms_Seal",*null*); // Marshal, generate, and sign the enveloped signature. xmlSignature.sign(domSignContext); ? Writerwriter=*new*StringWriter(xmlToSign.length() + 8000);// add in overhead for Signature element TransformerFactorytf= TransformerFactory./newInstance/(); Transformertransformer=tf.newTransformer(); // we don't want at the top since we embed our signed XML in other XML structures // (it's not a standalone document at all) transformer.setOutputProperty(OutputKeys.*/OMIT_XML_DECLARATION/*,"yes"); transformer.transform(*new*DOMSource(document),*new*StreamResult(writer)); *return*writer.toString(); ? }*catch*(Exceptione) { ? System.*/err/*.println("XmlDigitalSignature.sign() SERIOUS-ERROR exception: "+e.getMessage()); e.printStackTrace(); *throw*e; ? } ? } *public**void*verify(StringsignedXml, SignatureKeysignatureKey)*throws*Exception { *if*(/isBlank/(signedXml) ||signatureKey==*null*) *throw**new*Exception("Missing required parameter signedXml and/or signatureKey"); *try*{ DocumentBuilderFactorydbf= DocumentBuilderFactory./newInstance/(); dbf.setNamespaceAware(*true*); ? Documentdocument=dbf.newDocumentBuilder().parse(*new*BufferedInputStream(*new*ByteArrayInputStream(/stringToBytes/(signedXml)))); ? NodeListqualifyingPropertiesNodeList=document.getElementsByTagName("QualifyingProperties"); *if*(qualifyingPropertiesNodeList!=*null*) { *for*(*int*i= 0;ii=signature.getSignedInfo().getReferences().iterator(); *for*(*int*j= 0;i.hasNext();j++) { *boolean*refValid= ((Reference)i.next()).validate(valContext); ? System.*/err/*.println(" -> Reference["+j+"] validated: "+refValid); exceptionText.append("; ").append(/getReferenceName/(j)).append(refValid?" validated":" INVALID"); ? } *throw**new*Exception(exceptionText.toString()); ? } ? }*catch*(Exceptione) { ? System.*/err/*.println("XmlDigitalSignature.verify(SignatureKey) SERIOUS-ERROR exception: "+e.getMessage()); e.printStackTrace(); *throw*e; ? } ? } *private**static*String getReferenceName(*int*i) { *if*(i== 0) *return*"XML data payload"; *if*(i== 1) *return*"OpenESignForms Seal"; *return*"Unexpected Reference["+i+"]"; ? } *public**void*verify(StringsignedXml, PublicKeypublicKey)*throws*Exception { *if*(/isBlank/(signedXml) ||publicKey==*null*) *throw**new*Exception("Missing required parameter signedXml and/or publicKey"); *try*{ DocumentBuilderFactorydbf= DocumentBuilderFactory./newInstance/(); dbf.setNamespaceAware(*true*); ? Documentdocument=dbf.newDocumentBuilder().parse(*new*BufferedInputStream(*new*ByteArrayInputStream(/stringToBytes/(signedXml)))); ? NodeListqualifyingPropertiesNodeList=document.getElementsByTagName("QualifyingProperties"); *if*(qualifyingPropertiesNodeList!=*null*) { *for*(*int*i= 0;ii=signature.getSignedInfo().getReferences().iterator(); *for*(*int*j= 0;i.hasNext();j++) { *boolean*refValid= ((Reference)i.next()).validate(valContext); ? System.*/err/*.println(" -> Reference["+j+"] validated: "+refValid); exceptionText.append("; ").append(/getReferenceName/(j)).append(refValid?" validated":" INVALID"); ? } *throw**new*Exception(exceptionText.toString()); ? } ? }*catch*(Exceptione) { ? System.*/err/*.println("XmlDigitalSignature.verify(PublicKey) SERIOUS-ERROR exception: "+e.getMessage()); e.printStackTrace(); *throw*e; ? } ? } *public**void*verifyAcceptEmbeddedKeysIfKeyIdNotFound(StringsignedXml)*throws*Exception { *if*(/isBlank/(signedXml)) *throw**new*Exception("Missing required parameter signedXml"); *try*{ DocumentBuilderFactorydbf= DocumentBuilderFactory./newInstance/(); dbf.setNamespaceAware(*true*); ? Documentdocument=dbf.newDocumentBuilder().parse((*new*BufferedInputStream(*new*ByteArrayInputStream(/stringToBytes/(signedXml))))); ? NodeListqualifyingPropertiesNodeList=document.getElementsByTagName("QualifyingProperties"); *if*(qualifyingPropertiesNodeList!=*null*) { *for*(*int*i= 0;ii=signature.getSignedInfo().getReferences().iterator(); *for*(*int*j= 0;i.hasNext();j++) { *boolean*refValid= ((Reference)i.next()).validate(valContext); ? System.*/err/*.println(" -> Reference["+j+"] validated: "+refValid); exceptionText.append("; ").append(/getReferenceName/(j)).append(refValid?" validated":" INVALID"); ? } *throw**new*Exception(exceptionText.toString()); ? } ? }*catch*(Exceptione) { ? System.*/err/*.println("XmlDigitalSignature.verifyAcceptEmbeddedKeysIfKeyIdNotFound() SERIOUS-ERROR exception: "+e.getMessage()); e.printStackTrace(); *throw*e; ? } ? } *protected**static**class*VerifyingKeySelector*extends*KeySelector { SignatureKeysignatureKey; *public*VerifyingKeySelector(SignatureKeysignatureKey) { *this*.signatureKey=signatureKey; ? } *public*VerifyingKeySelector() { *this*.signatureKey=*null*; ? } @Override *public*KeySelectorResult select(KeyInfokeyInfo, Purposepurpose, AlgorithmMethodmethod, XMLCryptoContextcontext)*throws*KeySelectorException { *if*(keyInfo==*null*) *throw**new*KeySelectorException("NULL KeyInfo"); SignatureMethodsm= (SignatureMethod)method; Listlist=keyInfo.getContent(); ? UUIDkeyId=*null*; PublicKeypublicKey=*null*; *for*(*int*i= 0;ilist=keyInfo.getContent(); ? UUIDkeyId=*null*; PublicKeypublicKey=*null*; *for*(*int*i= 0;i'||c=='&'||c=='\''||/isUnexpectedISOControlCharacter/(c)) *break*;// we'll need to escape this one ? } // No quoting necessary, so just append the original string into the buffer. *if*(currentPos>=length) { *return*s; ? } StringBuilderbuf=*new*StringBuilder(s.length()); buf.append(s.substring(0,currentPos)); *for*(;currentPos': buf.append(">"); *break*; *case*'&': { buf.append("&"); *break*; ? } *default*: *if*(!/isUnexpectedISOControlCharacter/(c))// we won't allow these in our XML data buf.append(c); *break*; ? } ? } *return*buf.toString(); ? } *static*X509Certificate toX509CertificateFromBase64Encoded(Stringbase64EncodeCert) { *try*{ *byte*[]encodedCert= java.util.Base64./getDecoder/().decode(base64EncodeCert); *if*(encodedCert==*null*) { ? System.*/err/*.println("toX509CertificateFromBase64Encoded() - Failed to Base64 decode."); *return**null*; ? } CertificateFactoryfactory= CertificateFactory./getInstance/("X.509"); *if*(factory==*null*) { ? System.*/err/*.println("toX509CertificateFromBase64Encoded() - Failed to get an X.509 certificate factory."); *return**null*; ? } ByteArrayInputStreambais=*new*ByteArrayInputStream(encodedCert); Certificatecert= (X509Certificate)factory.generateCertificate(bais); *if*(cert*instanceof*X509Certificate) *return*(X509Certificate)cert; ? System.*/err/*.println("toX509CertificateFromBase64Encoded() certficate is not X.509 as expected. Type is: "+cert.getType()); *return**null*; ? }*catch*(java.security.cert.CertificateExceptione) { ? System.*/err/*.println("toX509CertificateFromBase64Encoded() exception: "+e.getMessage()); e.printStackTrace(); *return**null*; ? } ? } *static*PublicKey getPublicFromX509Encoded(KeyFactorykeyFactory,*byte*[]x509EncodedPublicKey) { *try*{ X509EncodedKeySpecpubKeySpec=*new*X509EncodedKeySpec(x509EncodedPublicKey); *return*keyFactory.generatePublic(pubKeySpec); ? }*catch*(Exceptione) { ? System.*/err/*.println("getPublicFromX509Encoded() Failed to decode: "+e.getMessage()); *return**null*; ? } ? } *static*PrivateKey getPrivateFromPkcs8Encoded(KeyFactorykeyFactory,*byte*[]pkcs8EncodedPrivateKey) { *try*{ PKCS8EncodedKeySpecprivKeySpec=*new*java.security.spec.PKCS8EncodedKeySpec(pkcs8EncodedPrivateKey); *return*keyFactory.generatePrivate(privKeySpec); ? }*catch*(Exceptione) { ? System.*/err/*.println("getPrivateFromPkcs8Encoded() Failed to decode: "+e.getMessage()); *return**null*; ? } ? } *static**final*String*/CERT/*="MIIKvTCCCKWgAwIBAgIJAPaU10x5GhRQMA0GCSqGSIb3DQEBDQUAMIHYMU0wSwYDVQQDDERPcGVuX2VTaWduRm9ybXNfaHR0cHM6Ly9sb2NhbGhvc3QubG9jYWxkb21haW4vb3Blbi1lU2lnbkZvcm1zVmFhZGluNzE6MDgGA1UECgwxRGVwbG95bWVudElEL2FhMGUyYjllLWM5ZDItNDk0NS04ZWVmLWI2NDhiZDYzYWFjNDE8MDoGA1UECwwzU2lnbmF0dXJlS2V5SUQvMDJkYmMwMDktMTAyYi00ZWE3LTlhYzgtNzYwZThiMzY4NTlmMQ0wCwYDVQQGEwRudWxsMB4XDTE0MTIxNjAzMjc1NVoXDTI0MTIxNjAzMjc1NVowgdgxTTBLBgNVBAMMRE9wZW5fZVNpZ25Gb3Jtc19odHRwczovL2xvY2FsaG9zdC5sb2NhbGRvbWFpbi9vcGVuLWVTaWduRm9ybXNWYWFkaW43MTowOAYDVQQKDDFEZXBsb3ltZW50SUQvYWEwZTJiOWUtYzlkMi00OTQ1LThlZWYtYjY0OGJkNjNhYWM0MTwwOgYDVQQLDDNTaWduYXR1cmVLZXlJRC8wMmRiYzAwOS0xMDJiLTRlYTctOWFjOC03NjBlOGIzNjg1OWYxDTALBgNVBAYTBG51bGwwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCQ8Kv4XLQ0idogKmfMOkYuQ1D3eR3Q3Nl9MF9A5vc9QfUG3g6sFZy9ihyHvBSbqTUiXdqmyLuzYH0Z6puHu3MXjUzC9NYE0JCDcrDcUpwXSPMpnsP6drw11znZg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CzDOdiRsH9FmtHeEnp6uv+mdbE433bW4RS25oL+qh2MytAxGYE1mIjCuTLca3NCOCPVyFzRS3IkVxn3YRIRgNS9IGMaIA7xt+dSy75BIJ3AgjMJ4H5pGCKPUQN+2EBjyXekajvppkDZF+MYj/rM0a4auQuK1AewntJppVgZ9DbiHtZnuSMyLncJW18xvoIWi08dGUPYArcPiFGaf4GmP/Ucr2X/DJeU+0jfhCalgamEuMyCOQAudgXYEzD4Z3nJvCXs7kMZTO+TOg1NYkhMAxv42CIc+ajPYMzMGIGADf27Cn8ROW8yUrEyIz3StTQVt6Ih"; *public**static**class*SignatureKey { *public*UUIDid; *public*KeyPairkeyPair; *public*X509Certificatecert; *public*SignatureKey(UUIDid) { *this*.id=id; ? Stringbase64Cert=*/CERT/*; ? Stringbase64PublicKey=*/PUBKEY/*; ? Stringbase64PrivateKey=*/PRIVKEY/*; *try*{ KeyFactorykeyFactory=*null*; *try*{ keyFactory= KeyFactory./getInstance/("RSA","BC"); ? System.*/err/*.println("SignatureKey: Using BC provider on RSA KeyFactory"); ? }*catch*(NoSuchProviderExceptione) { *try*{ keyFactory= KeyFactory./getInstance/("RSA","SunRsaSign"); ? System.*/err/*.println("SignatureKey: Using SunRsaSign provider on RSA KeyFactory"); ? }*catch*(NoSuchProviderExceptione2) { ? System.*/err/*.println("SignatureKey -- no KeyFactory provider found exception: "+e.getMessage()); e.printStackTrace(); ? System./exit/(2); ? } ? } cert=/toX509CertificateFromBase64Encoded/(base64Cert); *byte*[]encodedPublicKey= java.util.Base64./getDecoder/().decode(base64PublicKey); PublicKeypublicKey=/getPublicFromX509Encoded/(keyFactory,encodedPublicKey); *byte*[]encodedPrivateKey= java.util.Base64./getDecoder/().decode(base64PrivateKey); PrivateKeyprivateKey=/getPrivateFromPkcs8Encoded/(keyFactory,encodedPrivateKey); keyPair=*new*KeyPair(publicKey,privateKey); ? }*catch*( Exceptione) { ? System.*/err/*.println("SignatureKey - exception: "+e.getMessage()); e.printStackTrace(); ? } ? } ? } *static**final*String*/html/*="

Dummy HTML document

"; *static**final*String*/XML_NAMESPACE_2011/*="http://open.esignforms.com/XMLSchema/2011"; // Added main so can run the test under different JDKs. *public**static**void*main(String[]args) { *try*{ ? java.security.Security./setProperty/("crypto.policy","unlimited");// Should work in Java 9 to allow unlimited crypto strength. *try*{ ? ClassjceProvider= Class./forName/("org.bouncycastle.jce.provider.BouncyCastleProvider"); java.security.Providerp= (java.security.Provider)jceProvider.newInstance(); java.security.Security./addProvider/(p); p= java.security.Security./getProvider/("BC"); *if*(p==*null*) ? System.*/err/*.println("Could not find the BC JCE provider; hoping that the SunRsaSign is in there!"); *else* ? System.*/err/*.println("Found BC Provider: "+p.getInfo()); ? }*catch*(ClassNotFoundExceptione) { ? System.*/err/*.println("ClassNotFoundException: Could not find the BC JCE provider"); ? }*catch*(InstantiationExceptione) { ? System.*/err/*.println("InstantiationException: Could not find the BC JCE provider"); ? }*catch*(IllegalAccessExceptione) { ? System.*/err/*.println("IllegalAccessException: Could not find the BC JCE provider"); ? } ? StringnamespaceTimestampAttributes="xmlns=\""+*/XML_NAMESPACE_2011/*+"\" timestamp=\""+/toXmlWithTz/(ZonedDateTime./now/()) +"\""; ? Stringxml=""; SignatureKeysignatureKey=*new*SignatureKey(UUID./randomUUID/()); XmlDigitalSignaturexmldsig=*new*XmlDigitalSignature(); ? StringsignedXml=xmldsig.sign(xml,"description","text/html",signatureKey,"192.1.1.1","No-Browser-Test"); ? System.*/out/*.println("Signed XML:"); ? System.*/out/*.println(signedXml); ? }*catch*(Exceptione) { ? System.*/err/*.println("XmlDigitalSignature.main() exception: "+e.getMessage()); e.printStackTrace(); ? System./exit/(1); ? } ? System./exit/(0); ? } } On 1/30/19 1:54 PM, Sean Mullan wrote: > Hi, > > Thanks for reporting the issue. Can you please file a bug at > https://bugreport.java.com/bugreport/ so that it can be tracked and > further evaluated? > > --Sean > > On 1/30/19 3:59 PM, Open eSignForms wrote: >> >> My XML Digital Signature code runs fine under Java 8 (1.8.0_161), but >> on upgrading to OpenJDK 11 (11.0.2, ), it now traps with an >> NAMESPACE_ERR exception: >> >> org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create >> or change an object in a way which is incorrect with regard to >> namespaces. >> >> at >> java.xml/com.sun.org.apache.xerces.internal.dom.ElementNSImpl.setName(ElementNSImpl.java:109) >> >> at >> java.xml/com.sun.org.apache.xerces.internal.dom.ElementNSImpl.(ElementNSImpl.java:84) >> >> at >> java.xml/com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createElementNS(CoreDocumentImpl.java:2089) >> >> at >> java.xml.crypto/org.jcp.xml.dsig.internal.dom.XmlWriterToTree.writeStartElement(XmlWriterToTree.java:99) >> >> at >> java.xml.crypto/org.jcp.xml.dsig.internal.dom.Marshaller.marshalGenericNode(Marshaller.java:303) >> >> at >> java.xml.crypto/org.jcp.xml.dsig.internal.dom.Marshaller.marshalGenericNode(Marshaller.java:286) >> >> at >> java.xml.crypto/org.jcp.xml.dsig.internal.dom.Marshaller$14.marshalObject(Marshaller.java:251) >> >> at >> java.xml.crypto/org.jcp.xml.dsig.internal.dom.Marshaller$14.marshalObject(Marshaller.java:247) >> >> at >> java.xml.crypto/org.jcp.xml.dsig.internal.dom.XmlWriterToTree.marshalStructure(XmlWriterToTree.java:200) >> >> at >> java.xml.crypto/org.jcp.xml.dsig.internal.dom.DOMXMLObject.marshal(DOMXMLObject.java:180) >> >> at >> java.xml.crypto/org.jcp.xml.dsig.internal.dom.DOMXMLSignature.marshal(DOMXMLSignature.java:233) >> >> at >> java.xml.crypto/org.jcp.xml.dsig.internal.dom.DOMXMLSignature.sign(DOMXMLSignature.java:325) >> >> at >> com.esignforms.open.crypto.XmlDigitalSignature.sign(XmlDigitalSignature.java:208) >> >> If I revert back to Java 8, it works again. >> >> I noted that our XML digital signature code makes no direct >> references to namespaces.? Basic code does set the >> DocumentBuildFactory to be namespace aware: >> >> ? DocumentBuilderFactorydbf= DocumentBuilderFactory./newInstance/(); >> >> dbf.setNamespaceAware(*true*); >> >> When we sign under Java 8, this is the resulting digitally signed >> output for our XML element, which does have a namespace of >> our own: >> >> > html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" >> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> >> >> >> >> >> >> >> >> Date Doc 1 >> >> >> >> >> >> >> >> >> >> > content="bbfe9bed-918d-446b-9518-8ec303bafb83" /> >> >> > content="5163276c-d8aa-436f-8a96-5bc0c9eca931" /> >> >> > content="d15a91a3-87b8-457e-84bc-0b56ac7ebb10" /> >> >> >> >> >> >> > content="61afd6f3-b79e-4d14-844d-3a38541020ea" /> >> >> >> >> >> >> >> >> > content="52248c28-187e-43f0-8de8-98357fa63654" /> >> >> > content="62edfd59-be00-435a-9bd5-583cc84d220a" /> >> >> >> >> >> >> >> >> > content="50-46-115-249.evrt.wa.frontiernet.net >> (50.46.115.249)" /> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
> class="X86f339d5_81e2_4117_95c2_8f747f5a6fe3 pagediv"> >> >>
* * * ? T E S T ? T R A N S A C T I >> O N ? * * *
>> >>
>> >>

> class="labelAreaStacked">> >January 30, 2019

>> >>
>> >>
>> >> >> >> >> >> ]]>82PhK9E99GBG/pq5PSLRIGqpz0QbwwN8wlYQJsR3e4r5g1M8yhD3J0XhxNcMHmJIyyyb7yzo947O >> >> y2T9M/EHQw==
zqVVsv0tdx1Fp/c1rrj5b7aKdVtwtq2u0R0RsUnwCja3aMXGjsfqA68lZawt5wCtZqLWsKllPUom >> >> Z5quVeBVBg==
AKs1UqheswdoyC7xfofmnZoCOF8dmFISw0Cnqfp9n294EgvP5dnZAWWXH+yspvhnNr3qOJmcaP3N >> >> ZYoN6rG5XA==PzDq2Q3GpkgsnMmD//3bp5q+IksCxpR106yL1hx+WdxNvZWeAdT3SFAoHgLZtx4KL814iqLbiL5U >> >> kwwmI2q8DA==ID9zJVDWmIjJzv2TWdq3RjZ4MdF3+gX2LX2du7uRw0A2BJ7u8DAg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973jpfugkT825uN4/JDGlDDATrPNq/PSt/2zg5Clbu10b/5/K5sYdergf8Mf >> >> hlm3QoG4iEt+qMR3eaDLOnjBqKGeSfhuFxEWbyzlQkS6zOnoGQPQQdw983vpSQIDAQABMA4GA1Ud >> >> DwEB/wQEAwIGwDANBgkqhkiG9w0BAQ0FAAOCAgEAaGn/Q+1fjL7N675UYMGuC5EfloDQ3Y+zuYyx >> >> FtMrwO3GuvABTf+oKsQc5n7XDgpQVBWlgIHH+LldDhRPQ1a0MPvMzPDL3Ps1K+hJewNhcec6fqXS >> >> t+lszt+mnuK6gGKTioTbO6Li1E41WtJ1UhK4br1lsoNkM0E4rB5KUyj0ZmTCSlYlchAzMYLr1Ymc >> >> Q5wgAu0lFIpluhd12un9mUWWXouSC+8pI+ZKfPz2lm+PGBDTTp0TsLLWldvLcnEAgbLG4wZvb1za >> >> 3EccZWtCX0b5lGjMCajhADiz76GgYZt1fTus1fhoTe6GsJV9lM11NZTEeTPAUE9VvtNGYOaNUl2e >> >> S9pE1myNfiBgXNNJ3L4J6d6fGPlHV9rNPzjclfAOn4a1c+7ZBIsvW1znaeaAoeNyCcRPUr9rgKBS >> >> L+izvr6w3eYiqjQWozCi2Nw/oTKk1dC32uzD9KRrQ8pAlSDsspic7FJpFqPVuxrvs8z7tXpc6uyB >> >> cmaNZN91xowONrPljlbW2jm5AkebDyTMPfxIRcrTybOr/K3nOYEMkV8G/tRli4SRleGr3cUusHd5 >> >> 47BlUSoncDYywh+4drtCycli2mfph3hjB34qkwbzI8j8iX6PSROH+AGcC0L1MEgRq2Um9+K3iTBA >> >> 9zGxY4cvR4vn4VtWcebg9AVMJCwhV85c7l0P0uU=2019-01-30T12:40:46-08:00document.htmltext/html> "DeploymentId="bbfe9bed-918d-446b-9518-8ec303bafb83"SignerAddress="50-46-115-249.evrt.wa.frontiernet.net >> >> (50.46.115.249)"SignerAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X >> 10_14_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.3 >> Safari/605.1.15"Timestamp="2019-01-30T12:40:46-08:00"Version="19.1.19_p0129_1657"/> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From valerie.peng at oracle.com Thu Feb 7 22:09:02 2019 From: valerie.peng at oracle.com (Valerie Peng) Date: Thu, 7 Feb 2019 14:09:02 -0800 Subject: [13] RFR JDK-8216597 "SIGBUS in Java_sun_security_pkcs11_wrapper_PKCS11_getNativeKeyInfo after JDK-6913047" Message-ID: <02f7f228-66d1-0ed1-0b5b-760e3e84ddfa@oracle.com> 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 From xuelei.fan at oracle.com Fri Feb 8 16:16:57 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Fri, 8 Feb 2019 08:16:57 -0800 Subject: Code Review Request, JDK-8218580, endpoint identification algorithm should be case-insensitive Message-ID: Hi, Please review this update: http://cr.openjdk.java.net/~xuelei/8218580/webrev.00/ Objects.equals is case-sensitive, and should not be used to recognize case-insensitive objects. Trivial update, no new regression test. Thanks, Xuelei From jamil.j.nimeh at oracle.com Fri Feb 8 16:46:11 2019 From: jamil.j.nimeh at oracle.com (Jamil Nimeh) Date: Fri, 8 Feb 2019 08:46:11 -0800 Subject: Code Review Request, JDK-8218580, endpoint identification algorithm should be case-insensitive In-Reply-To: References: Message-ID: <46042528-ceea-7f5b-c40e-cbf8fa073f52@oracle.com> Looks fine to me. --Jamil On 2/8/2019 8:16 AM, Xuelei Fan wrote: > Hi, > > Please review this update: > ?? http://cr.openjdk.java.net/~xuelei/8218580/webrev.00/ > > Objects.equals is case-sensitive, and should not be used to recognize > case-insensitive objects. > > Trivial update, no new regression test. > > Thanks, > Xuelei From sean.mullan at oracle.com Fri Feb 8 19:06:03 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Fri, 8 Feb 2019 14:06:03 -0500 Subject: RFR 8180569: Refactor sun/security/krb5/ shell tests to plain java tests In-Reply-To: <004DCA97-218A-47A3-B1C2-BE0CAF2C5BEF@oracle.com> References: <004DCA97-218A-47A3-B1C2-BE0CAF2C5BEF@oracle.com> Message-ID: Looks good to me. --Sean On 2/3/19 9:44 AM, Weijun Wang wrote: > Please take a review at > > https://cr.openjdk.java.net/~weijun/8180569/webrev.00 > > I've combined ktarg.sh, ktmissing.sh, and ktzero.sh into KtabZero.java. > > rcache_usemd5.sh is renamed to ReplayCacheTestProcWithMD5.java. The test has no content and is only used to launch another test. I don't want to combine them because I want different working directory. > > runNameEquals.sh is left as a shell test. It calls quite some *nix commands and is better to stay unchanged. > > Thanks, > Max > From xuelei.fan at oracle.com Fri Feb 8 20:26:06 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Fri, 8 Feb 2019 12:26:06 -0800 Subject: RFR 8168069 : X509TrustManagerImpl causes ClassLoader leaks with unparseable extensions Message-ID: Hi, Could I get the following update reviewed? http://cr.openjdk.java.net/~xuelei/8168069/webrev.00/ In the lazy initialization holder in SSLContextImpl, an exception is reserved as static in order to check if the holder is initialized properly. If the exception had a strong referent to some object, the object will be out of the cycle of garbage collection. With this update, the original exception is debug logged, and a new exception with the same exception message as the original one. Code cleanup, no new regression test. Thanks & Regards, Xuelei From jay at elastic.co Fri Feb 8 20:43:25 2019 From: jay at elastic.co (Jay Modi) Date: Fri, 8 Feb 2019 13:43:25 -0700 Subject: TLSv1.3 HttpsServer endless loop based on client socket i/o shutdown Message-ID: Hi, I've been doing some testing with Apache HttpClient against the com.sun.net.httpserver.HttpsServer that is included with the JDK and came across some interesting behavior that occurs when using TLSv1.3, but TLSv1.2 works normally. If the client manually calls Socket#shutdownOutput and Socket#shutdownInput before closing the socket, the HttpsServer goes into an endless loop while trying send the close back to the client. Is this expected? I've done my best to create a minimal reproducer without Apache HttpClient[1]. To me this behavior does not seem right and as I mentioned, I did not have these issues when using TLSv1.2. I'm running on macOS with the following JDK: openjdk version "11.0.2" 2019-01-15 OpenJDK Runtime Environment 18.9 (build 11.0.2+9) OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode) Jay [1] https://gist.github.com/jaymode/3a6562beaa7ea789b287372bd10d4d1d -------------- next part -------------- An HTML attachment was scrubbed... URL: From heiko.jakob at gediegos.de Sun Feb 10 01:34:30 2019 From: heiko.jakob at gediegos.de (Heiko Jakob) Date: Sun, 10 Feb 2019 02:34:30 +0100 Subject: ldaps:// ignores alternative DNS names / SNA (Subject Alternative Name) certs if hostname != CN name Message-ID: <2d1a1cfe-bb0d-5f1b-cdb7-c54bfb2d4e44@gediegos.de> Hi, connecting to a secure ldap server with a SNA certificate fails with "javax.naming.CommunicationException: simple bind failed: ldap.foo.bar:636 [Root exception is javax.net.ssl.SSLHandshakeException: No subject alternative DNS name matching ldap.foo.bar found.]" The certificate is valid and i've tested it on https on the same machine which works flawlessly. The problem does not effect the Oracle JDK/JRE, only OpenJDK. I've testen OpenJDK 1.8.0_181, 11.0.1, 11.0.2 and all are affected. With best regards Heiko Jakob How to reproduce: Have a valid certificate for a host named CN "realhost.foo.bar" with x509 SNA extension for DNS.1 "realhost.foo.bar" DNS.2 "ldap.foo.bar". Use the same certificate for https & ldap on the same host. Examine the certificate to have CN="realhost.foo.bar" and x509 SNA extension for ldap.foo.bar $ openssl x509 -in my.crt -text -noout | less Certificate: ... ?????? Validity ??????????? Not Before: Feb? 8 11:28:53 2019 GMT ??????????? Not After : Feb? 7 11:28:53 2024 GMT ??????? Subject: C = DE, ST = BW, L = Stuttgart, O = foo.bar, OU = IT Department, CN = realhost.foo.bar ... ??????????? X509v3 Subject Alternative Name: ??????????????? DNS:realhost.foo.bar, DNS:ldap.foo.bar Run the following small test program to reproduce the problem. package testSSL; import java.net.URL; import java.net.URLConnection; import java.util.Hashtable; import javax.naming.Context; import javax.naming.directory.DirContext; import javax.naming.directory.InitialDirContext; public final class TestSSL { ??? public static void main(String[] args) { ??? ??? String url_l = "ldaps://ldap.foo.bar:636"; ??? ??? String url_h = "https://ldap.foo.bar"; ??? ??? System.out.println("TestSSL"); ??? ??? URL url; ??? ??? try { ??? ??? ??? System.out.println("Test " + url_h); ??? ??? ??? url = new URL(url_h); ??? ??? ??? URLConnection conn = url.openConnection(); ??? ??? ??? conn.connect(); ??? ??? } catch (Exception e) { ??? ??? ??? e.printStackTrace(); ??? ??? ??? System.out.println("Failed " + url_h); ??? ??? ??? System.exit(-1); ??? ??? } ??? ??? System.out.println("https:// OK"); ??? ??? System.out.println("Test " + url_l); ??? ??? Hashtable env = new Hashtable(); ??? ??? env.put(Context.INITIAL_CONTEXT_FACTORY, ??? ??? ??? "com.sun.jndi.ldap.LdapCtxFactory"); ??? ??? env.put(Context.PROVIDER_URL, url_l); ??? ??? env.put(Context.SECURITY_PROTOCOL, "ssl"); ??? ??? env.put(Context.SECURITY_AUTHENTICATION, "simple"); ??? ??? env.put(Context.SECURITY_PRINCIPAL, "cn=admin,dc=foo,dc=bar"); ??? ??? env.put(Context.SECURITY_CREDENTIALS, "mysecret"); ??? ??? try { ??? ??? ??? DirContext ctx = new InitialDirContext(env); ??? ??? } catch (Exception e) { ??? ??? ??? e.printStackTrace(); ??? ??? ??? System.out.println("Failed " + url_l); ??? ??? ??? System.exit(-1); ??? ??? } ??? ??? System.out.println("ldaps:// OK"); ??? } } Test it against various JDKs $ (for j in $(find /opt/java/ -type f -name 'java' 2> /dev/null); do echo $j; $j -version; $j -classpath ./ testSSL.TestSSL; echo""; echo "##############################################";echo ""; sleep 30; done ) 2>&1 | tee -a testSSL.out Reference output from oracle JDK opt/java/jdk1.8.0_73/bin/java java version "1.8.0_73" Java(TM) SE Runtime Environment (build 1.8.0_73-b02) Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode) TestSSL https://ldap.foo.bar https:// OK ldaps://ldap.foo.bar:636 ldaps:// OK ############################################## .... ############################################## /opt/java/jdk-11.0.2/bin/java openjdk version "11.0.2" 2019-01-15 OpenJDK Runtime Environment 18.9 (build 11.0.2+9) OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode) TestSSL https://ldap.foo.bar https:// OK ldaps://ldap.foo.bar:636 javax.naming.CommunicationException: simple bind failed: ldap.foo.bar:636 [Root exception is javax.net.ssl.SSLHandshakeException: No subject alternative DNS name matching ldap.foo.bar found.] ??????? at java.naming/com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:219) ??????? at java.naming/com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2795) ??????? at java.naming/com.sun.jndi.ldap.LdapCtx.(LdapCtx.java:320) ??????? at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:192) ??????? at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:210) ??????? at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:153) ??????? at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:83) ??????? at java.naming/javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:730) ??????? at java.naming/javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305) ??????? at java.naming/javax.naming.InitialContext.init(InitialContext.java:236) ??????? at java.naming/javax.naming.InitialContext.(InitialContext.java:208) ??????? at java.naming/javax.naming.directory.InitialDirContext.(InitialDirContext.java:101) ??????? at testSSL.TestSSL.main(TestSSL.java:57) Caused by: javax.net.ssl.SSLHandshakeException: No subject alternative DNS name matching ldap.foo.bar found. ??????? at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:128) ??????? at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:321) ??????? at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:264) ??????? at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:259) ??????? at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:642) ??????? at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:461) ??????? at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:361) ??????? at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:392) ??????? at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:444) ??????? at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:421) ??????? at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:178) ??????? at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164) ??????? at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1152) ??????? at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063) ??????? at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402) ??????? at java.base/sun.security.ssl.SSLSocketImpl.ensureNegotiated(SSLSocketImpl.java:716) ??????? at java.base/sun.security.ssl.SSLSocketImpl$AppOutputStream.write(SSLSocketImpl.java:970) ??????? at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81) ??????? at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142) ??????? at java.naming/com.sun.jndi.ldap.Connection.writeRequest(Connection.java:398) ??????? at java.naming/com.sun.jndi.ldap.Connection.writeRequest(Connection.java:371) ??????? at java.naming/com.sun.jndi.ldap.LdapClient.ldapBind(LdapClient.java:359) ??????? at java.naming/com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:214) ??????? ... 12 more From pallavi.sonal at oracle.com Mon Feb 11 05:31:46 2019 From: pallavi.sonal at oracle.com (Pallavi Sonal) Date: Sun, 10 Feb 2019 21:31:46 -0800 (PST) Subject: ldaps:// ignores alternative DNS names / SNA (Subject Alternative Name) certs if hostname != CN name) Message-ID: <5226cccc-8740-4018-97fc-6d001c35c77c@default> Hi Heiko, Please refer the release notes for JDK 8u181 at https://www.oracle.com/technetwork/java/javase/8u181-relnotes-4479407.html , there is a change to improve LDAP support and make it more secure. It is not possible now to establish an LDAPS connection to a server which presents a certificate whose CN or SAN does not contain the requested host name. So, either the same host name should be used which is there in the certificate's CN or SAN or the certificate should be updated to have the matching hostname as in its CN or SAN. I have added the snippet from the release notes below for your reference : --------------------------------------------------------------- ? Improve LDAP support Endpoint identification has been enabled on LDAPS connections. To improve the robustness of LDAPS (secure LDAP over TLS) connections, endpoint identification algorithms have been enabled by default. Note that there may be situations where some applications that were previously able to successfully connect to an LDAPS server may no longer be able to do so. Such applications may, if they deem appropriate, disable endpoint identification using a new system property: com.sun.jndi.ldap.object.disableEndpointIdentification. Define this system property (or set it to true) to disable endpoint identification algorithms. --------------------------------------------------------------- Thanks, Pallavi Sonal Date: Sun, 10 Feb 2019 02:34:30 +0100 From: Heiko Jakob To: security-dev at openjdk.java.net Subject: ldaps:// ignores alternative DNS names / SNA (Subject Alternative Name) certs if hostname != CN name Message-ID: <2d1a1cfe-bb0d-5f1b-cdb7-c54bfb2d4e44 at gediegos.de> Content-Type: text/plain; charset=utf-8; format=flowed Hi, connecting to a secure ldap server with a SNA certificate fails with "javax.naming.CommunicationException: simple bind failed: ldap.foo.bar:636 [Root exception is javax.net.ssl.SSLHandshakeException: No subject alternative DNS name matching ldap.foo.bar found.]" The certificate is valid and i've tested it on https on the same machine which works flawlessly. The problem does not effect the Oracle JDK/JRE, only OpenJDK. I've testen OpenJDK 1.8.0_181, 11.0.1, 11.0.2 and all are affected. With best regards Heiko Jakob How to reproduce: Have a valid certificate for a host named CN "realhost.foo.bar" with x509 SNA extension for DNS.1 "realhost.foo.bar" DNS.2 "ldap.foo.bar". Use the same certificate for https & ldap on the same host. Examine the certificate to have CN="realhost.foo.bar" and x509 SNA extension for ldap.foo.bar $ openssl x509 -in my.crt -text -noout | less Certificate: ... ?????? Validity ??????????? Not Before: Feb? 8 11:28:53 2019 GMT ??????????? Not After : Feb? 7 11:28:53 2024 GMT ??????? Subject: C = DE, ST = BW, L = Stuttgart, O = foo.bar, OU = IT Department, CN = realhost.foo.bar ... ??????????? X509v3 Subject Alternative Name: ??????????????? DNS:realhost.foo.bar, DNS:ldap.foo.bar Run the following small test program to reproduce the problem. package testSSL; import java.net.URL; import java.net.URLConnection; import java.util.Hashtable; import javax.naming.Context; import javax.naming.directory.DirContext; import javax.naming.directory.InitialDirContext; public final class TestSSL { ??? public static void main(String[] args) { ??? ??? String url_l = "ldaps://ldap.foo.bar:636"; ??? ??? String url_h = "https://ldap.foo.bar"; ??? ??? System.out.println("TestSSL"); ??? ??? URL url; ??? ??? try { ??? ??? ??? System.out.println("Test " + url_h); ??? ??? ??? url = new URL(url_h); ??? ??? ??? URLConnection conn = url.openConnection(); ??? ??? ??? conn.connect(); ??? ??? } catch (Exception e) { ??? ??? ??? e.printStackTrace(); ??? ??? ??? System.out.println("Failed " + url_h); ??? ??? ??? System.exit(-1); ??? ??? } ??? ??? System.out.println("https:// OK"); ??? ??? System.out.println("Test " + url_l); ??? ??? Hashtable env = new Hashtable(); ??? ??? env.put(Context.INITIAL_CONTEXT_FACTORY, ??? ??? ??? "com.sun.jndi.ldap.LdapCtxFactory"); ??? ??? env.put(Context.PROVIDER_URL, url_l); ??? ??? env.put(Context.SECURITY_PROTOCOL, "ssl"); ??? ??? env.put(Context.SECURITY_AUTHENTICATION, "simple"); ??? ??? env.put(Context.SECURITY_PRINCIPAL, "cn=admin,dc=foo,dc=bar"); ??? ??? env.put(Context.SECURITY_CREDENTIALS, "mysecret"); ??? ??? try { ??? ??? ??? DirContext ctx = new InitialDirContext(env); ??? ??? } catch (Exception e) { ??? ??? ??? e.printStackTrace(); ??? ??? ??? System.out.println("Failed " + url_l); ??? ??? ??? System.exit(-1); ??? ??? } ??? ??? System.out.println("ldaps:// OK"); ??? } } Test it against various JDKs $ (for j in $(find /opt/java/ -type f -name 'java' 2> /dev/null); do echo $j; $j -version; $j -classpath ./ testSSL.TestSSL; echo""; echo "##############################################";echo ""; sleep 30; done ) 2>&1 | tee -a testSSL.out Reference output from oracle JDK opt/java/jdk1.8.0_73/bin/java java version "1.8.0_73" Java(TM) SE Runtime Environment (build 1.8.0_73-b02) Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode) TestSSL https://ldap.foo.bar https:// OK ldaps://ldap.foo.bar:636 ldaps:// OK ############################################## .... ############################################## /opt/java/jdk-11.0.2/bin/java openjdk version "11.0.2" 2019-01-15 OpenJDK Runtime Environment 18.9 (build 11.0.2+9) OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode) TestSSL https://ldap.foo.bar https:// OK ldaps://ldap.foo.bar:636 javax.naming.CommunicationException: simple bind failed: ldap.foo.bar:636 [Root exception is javax.net.ssl.SSLHandshakeException: No subject alternative DNS name matching ldap.foo.bar found.] ??????? at java.naming/com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:219) ??????? at java.naming/com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2795) ??????? at java.naming/com.sun.jndi.ldap.LdapCtx.(LdapCtx.java:320) ??????? at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:192) ??????? at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:210) ??????? at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:153) ??????? at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:83) ??????? at java.naming/javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:730) ??????? at java.naming/javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305) ??????? at java.naming/javax.naming.InitialContext.init(InitialContext.java:236) ??????? at java.naming/javax.naming.InitialContext.(InitialContext.java:208) ??????? at java.naming/javax.naming.directory.InitialDirContext.(InitialDirContext.java:101) ??????? at testSSL.TestSSL.main(TestSSL.java:57) Caused by: javax.net.ssl.SSLHandshakeException: No subject alternative DNS name matching ldap.foo.bar found. ??????? at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:128) ??????? at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:321) ??????? at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:264) ??????? at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:259) ??????? at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:642) ??????? at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:461) ??????? at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:361) ??????? at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:392) ??????? at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:444) ??????? at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:421) ??????? at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:178) ??????? at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164) ??????? at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1152) ??????? at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063) ??????? at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402) ??????? at java.base/sun.security.ssl.SSLSocketImpl.ensureNegotiated(SSLSocketImpl.java:716) ??????? at java.base/sun.security.ssl.SSLSocketImpl$AppOutputStream.write(SSLSocketImpl.java:970) ??????? at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81) ??????? at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142) ??????? at java.naming/com.sun.jndi.ldap.Connection.writeRequest(Connection.java:398) ??????? at java.naming/com.sun.jndi.ldap.Connection.writeRequest(Connection.java:371) ??????? at java.naming/com.sun.jndi.ldap.LdapClient.ldapBind(LdapClient.java:359) ??????? at java.naming/com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:214) ??????? ... 12 more End of security-dev Digest, Vol 140, Issue 11 ********************************************* From daniel.fuchs at oracle.com Mon Feb 11 09:58:36 2019 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Mon, 11 Feb 2019 10:58:36 +0100 Subject: TLSv1.3 HttpsServer endless loop based on client socket i/o shutdown In-Reply-To: References: Message-ID: <78b535ce-0b02-f5e5-b83e-c41377e25523@oracle.com> Hi Jay, It looks like this is JDK-8214418 - which has been fixed in 12.0.1 b03 and 13-ea b04. The issue was with the half closed semantics of the SSL engine in TLS 1.3. best regards, -- daniel On 08/02/2019 21:43, Jay Modi wrote: > Hi, > > I've been doing some testing with Apache HttpClient against the > com.sun.net.httpserver.HttpsServer that is included with the JDK and > came across some interesting behavior that occurs when using TLSv1.3, > but TLSv1.2 works normally. If the client manually calls > Socket#shutdownOutput and Socket#shutdownInput before closing the > socket, the HttpsServer goes into an endless loop while trying send the > close back to the client. Is this expected? I've done my best to create > a minimal reproducer without Apache HttpClient[1]. > > To me this behavior does not seem right and as I mentioned, I did not > have these issues when using TLSv1.2. I'm running on macOS with the > following JDK: > openjdk version "11.0.2" 2019-01-15 > OpenJDK Runtime Environment 18.9 (build 11.0.2+9) > OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode) > > Jay > > [1] https://gist.github.com/jaymode/3a6562beaa7ea789b287372bd10d4d1d From j.p.cranendonk at gmail.com Mon Feb 11 10:43:00 2019 From: j.p.cranendonk at gmail.com (Jeroen Cranendonk) Date: Mon, 11 Feb 2019 11:43:00 +0100 Subject: Status of JDK-8207031 Message-ID: Hi! I'm wondering what the status is on the issue: https://bugs.openjdk.java.net/browse/JDK-8207031 I saw a request for review: https://mail.openjdk.java.net/pipermail/security-dev/2018-July/017581.html But I don't think that's been followed up on? We are looking to switch to Java 11, and this is becoming one of the biggest blockers to us :) Cheers! -------------- next part -------------- An HTML attachment was scrubbed... URL: From sha.jiang at oracle.com Mon Feb 11 10:47:42 2019 From: sha.jiang at oracle.com (sha.jiang at oracle.com) Date: Mon, 11 Feb 2019 18:47:42 +0800 Subject: RFR[13] JDK-8146392: sun/security/tools/keytool/selfissued.sh failed with ar_SA locale Message-ID: <0442ebc3-f6e7-d8cf-d2cf-152b4464beca@oracle.com> Hi, This fix just makes sure that the keytool in test sun/security/tools/keytool/selfissued.sh uses en_US locale, or the test fails with ar_SA. diff -r bc20d0376402 test/jdk/sun/security/tools/keytool/selfissued.sh --- a/test/jdk/sun/security/tools/keytool/selfissued.sh??? Mon Jan 28 23:00:31 2019 +0100 +++ b/test/jdk/sun/security/tools/keytool/selfissued.sh??? Mon Feb 11 14:58:34 2019 +0800 @@ -1,5 +1,5 @@ ?# -# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved. ?# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ?# ?# This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,7 @@ ?esac ?KS=selfsigned.ks -KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storepass changeit -keypass changeit -keystore $KS -keyalg rsa" +KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -J-Duser.language=en -J-Duser.country=US -storepass changeit -keypass changeit -keystore $KS -keyalg rsa" ?rm $KS Best regards, John Jiang From weijun.wang at oracle.com Mon Feb 11 10:57:21 2019 From: weijun.wang at oracle.com (Weijun Wang) Date: Mon, 11 Feb 2019 18:57:21 +0800 Subject: RFR[13] JDK-8146392: sun/security/tools/keytool/selfissued.sh failed with ar_SA locale In-Reply-To: <0442ebc3-f6e7-d8cf-d2cf-152b4464beca@oracle.com> References: <0442ebc3-f6e7-d8cf-d2cf-152b4464beca@oracle.com> Message-ID: <33C162EB-8600-46CF-8969-6B63F5D6A05C@oracle.com> Please close it as will-not-fix because I'm about to modify it into a java test soon. Thanks, Max > On Feb 11, 2019, at 6:47 PM, sha.jiang at oracle.com wrote: > > Hi, > This fix just makes sure that the keytool in test sun/security/tools/keytool/selfissued.sh uses en_US locale, > or the test fails with ar_SA. > > diff -r bc20d0376402 test/jdk/sun/security/tools/keytool/selfissued.sh > --- a/test/jdk/sun/security/tools/keytool/selfissued.sh Mon Jan 28 23:00:31 2019 +0100 > +++ b/test/jdk/sun/security/tools/keytool/selfissued.sh Mon Feb 11 14:58:34 2019 +0800 > @@ -1,5 +1,5 @@ > # > -# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. > +# Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved. > # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > # > # This code is free software; you can redistribute it and/or modify it > @@ -45,7 +45,7 @@ > esac > > KS=selfsigned.ks > -KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storepass changeit -keypass changeit -keystore $KS -keyalg rsa" > +KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -J-Duser.language=en -J-Duser.country=US -storepass changeit -keypass changeit -keystore $KS -keyalg rsa" > > rm $KS > > > Best regards, > John Jiang > From pallavi.sonal at oracle.com Mon Feb 11 12:49:47 2019 From: pallavi.sonal at oracle.com (Pallavi Sonal) Date: Mon, 11 Feb 2019 04:49:47 -0800 (PST) Subject: ldaps:// ignores alternative DNS names / SNA (Subject Alternative Name) certs if hostname != CN name) In-Reply-To: <5226cccc-8740-4018-97fc-6d001c35c77c@default> References: <5226cccc-8740-4018-97fc-6d001c35c77c@default> Message-ID: <77112a81-ef16-450c-bb93-6ba1f26f9abc@default> Just for reference and as conclusion to this thread - had a chat with OP on another mail , this actually turned out to be an environment issue. -----Original Message----- From: Pallavi Sonal Sent: February-11-19 11:02 AM To: Heiko Jakob Cc: security-dev at openjdk.java.net Subject: RE: ldaps:// ignores alternative DNS names / SNA (Subject Alternative Name) certs if hostname != CN name) Hi Heiko, Please refer the release notes for JDK 8u181 at https://www.oracle.com/technetwork/java/javase/8u181-relnotes-4479407.html , there is a change to improve LDAP support and make it more secure. It is not possible now to establish an LDAPS connection to a server which presents a certificate whose CN or SAN does not contain the requested host name. So, either the same host name should be used which is there in the certificate's CN or SAN or the certificate should be updated to have the matching hostname as in its CN or SAN. I have added the snippet from the release notes below for your reference : --------------------------------------------------------------- ? Improve LDAP support Endpoint identification has been enabled on LDAPS connections. To improve the robustness of LDAPS (secure LDAP over TLS) connections, endpoint identification algorithms have been enabled by default. Note that there may be situations where some applications that were previously able to successfully connect to an LDAPS server may no longer be able to do so. Such applications may, if they deem appropriate, disable endpoint identification using a new system property: com.sun.jndi.ldap.object.disableEndpointIdentification. Define this system property (or set it to true) to disable endpoint identification algorithms. --------------------------------------------------------------- Thanks, Pallavi Sonal Date: Sun, 10 Feb 2019 02:34:30 +0100 From: Heiko Jakob To: security-dev at openjdk.java.net Subject: ldaps:// ignores alternative DNS names / SNA (Subject Alternative Name) certs if hostname != CN name Message-ID: <2d1a1cfe-bb0d-5f1b-cdb7-c54bfb2d4e44 at gediegos.de> Content-Type: text/plain; charset=utf-8; format=flowed Hi, connecting to a secure ldap server with a SNA certificate fails with "javax.naming.CommunicationException: simple bind failed: ldap.foo.bar:636 [Root exception is javax.net.ssl.SSLHandshakeException: No subject alternative DNS name matching ldap.foo.bar found.]" The certificate is valid and i've tested it on https on the same machine which works flawlessly. The problem does not effect the Oracle JDK/JRE, only OpenJDK. I've testen OpenJDK 1.8.0_181, 11.0.1, 11.0.2 and all are affected. With best regards Heiko Jakob How to reproduce: Have a valid certificate for a host named CN "realhost.foo.bar" with x509 SNA extension for DNS.1 "realhost.foo.bar" DNS.2 "ldap.foo.bar". Use the same certificate for https & ldap on the same host. Examine the certificate to have CN="realhost.foo.bar" and x509 SNA extension for ldap.foo.bar $ openssl x509 -in my.crt -text -noout | less Certificate: ... ?????? Validity ??????????? Not Before: Feb? 8 11:28:53 2019 GMT ??????????? Not After : Feb? 7 11:28:53 2024 GMT ??????? Subject: C = DE, ST = BW, L = Stuttgart, O = foo.bar, OU = IT Department, CN = realhost.foo.bar ... ??????????? X509v3 Subject Alternative Name: ??????????????? DNS:realhost.foo.bar, DNS:ldap.foo.bar Run the following small test program to reproduce the problem. package testSSL; import java.net.URL; import java.net.URLConnection; import java.util.Hashtable; import javax.naming.Context; import javax.naming.directory.DirContext; import javax.naming.directory.InitialDirContext; public final class TestSSL { ??? public static void main(String[] args) { ??? ??? String url_l = "ldaps://ldap.foo.bar:636"; ??? ??? String url_h = "https://ldap.foo.bar"; ??? ??? System.out.println("TestSSL"); ??? ??? URL url; ??? ??? try { ??? ??? ??? System.out.println("Test " + url_h); ??? ??? ??? url = new URL(url_h); ??? ??? ??? URLConnection conn = url.openConnection(); ??? ??? ??? conn.connect(); ??? ??? } catch (Exception e) { ??? ??? ??? e.printStackTrace(); ??? ??? ??? System.out.println("Failed " + url_h); ??? ??? ??? System.exit(-1); ??? ??? } ??? ??? System.out.println("https:// OK"); ??? ??? System.out.println("Test " + url_l); ??? ??? Hashtable env = new Hashtable(); ??? ??? env.put(Context.INITIAL_CONTEXT_FACTORY, ??? ??? ??? "com.sun.jndi.ldap.LdapCtxFactory"); ??? ??? env.put(Context.PROVIDER_URL, url_l); ??? ??? env.put(Context.SECURITY_PROTOCOL, "ssl"); ??? ??? env.put(Context.SECURITY_AUTHENTICATION, "simple"); ??? ??? env.put(Context.SECURITY_PRINCIPAL, "cn=admin,dc=foo,dc=bar"); ??? ??? env.put(Context.SECURITY_CREDENTIALS, "mysecret"); ??? ??? try { ??? ??? ??? DirContext ctx = new InitialDirContext(env); ??? ??? } catch (Exception e) { ??? ??? ??? e.printStackTrace(); ??? ??? ??? System.out.println("Failed " + url_l); ??? ??? ??? System.exit(-1); ??? ??? } ??? ??? System.out.println("ldaps:// OK"); ??? } } Test it against various JDKs $ (for j in $(find /opt/java/ -type f -name 'java' 2> /dev/null); do echo $j; $j -version; $j -classpath ./ testSSL.TestSSL; echo""; echo "##############################################";echo ""; sleep 30; done ) 2>&1 | tee -a testSSL.out Reference output from oracle JDK opt/java/jdk1.8.0_73/bin/java java version "1.8.0_73" Java(TM) SE Runtime Environment (build 1.8.0_73-b02) Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode) TestSSL https://ldap.foo.bar https:// OK ldaps://ldap.foo.bar:636 ldaps:// OK ############################################## .... ############################################## /opt/java/jdk-11.0.2/bin/java openjdk version "11.0.2" 2019-01-15 OpenJDK Runtime Environment 18.9 (build 11.0.2+9) OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode) TestSSL https://ldap.foo.bar https:// OK ldaps://ldap.foo.bar:636 javax.naming.CommunicationException: simple bind failed: ldap.foo.bar:636 [Root exception is javax.net.ssl.SSLHandshakeException: No subject alternative DNS name matching ldap.foo.bar found.] ??????? at java.naming/com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:219) ??????? at java.naming/com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2795) ??????? at java.naming/com.sun.jndi.ldap.LdapCtx.(LdapCtx.java:320) ??????? at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:192) ??????? at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:210) ??????? at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:153) ??????? at java.naming/com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:83) ??????? at java.naming/javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:730) ??????? at java.naming/javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305) ??????? at java.naming/javax.naming.InitialContext.init(InitialContext.java:236) ??????? at java.naming/javax.naming.InitialContext.(InitialContext.java:208) ??????? at java.naming/javax.naming.directory.InitialDirContext.(InitialDirContext.java:101) ??????? at testSSL.TestSSL.main(TestSSL.java:57) Caused by: javax.net.ssl.SSLHandshakeException: No subject alternative DNS name matching ldap.foo.bar found. ??????? at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:128) ??????? at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:321) ??????? at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:264) ??????? at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:259) ??????? at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:642) ??????? at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:461) ??????? at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:361) ??????? at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:392) ??????? at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:444) ??????? at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:421) ??????? at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:178) ??????? at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164) ??????? at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1152) ??????? at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063) ??????? at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402) ??????? at java.base/sun.security.ssl.SSLSocketImpl.ensureNegotiated(SSLSocketImpl.java:716) ??????? at java.base/sun.security.ssl.SSLSocketImpl$AppOutputStream.write(SSLSocketImpl.java:970) ??????? at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81) ??????? at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142) ??????? at java.naming/com.sun.jndi.ldap.Connection.writeRequest(Connection.java:398) ??????? at java.naming/com.sun.jndi.ldap.Connection.writeRequest(Connection.java:371) ??????? at java.naming/com.sun.jndi.ldap.LdapClient.ldapBind(LdapClient.java:359) ??????? at java.naming/com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:214) ??????? ... 12 more End of security-dev Digest, Vol 140, Issue 11 ********************************************* From Nico.Williams at twosigma.com Mon Feb 11 19:05:16 2019 From: Nico.Williams at twosigma.com (Nico Williams) Date: Mon, 11 Feb 2019 19:05:16 +0000 Subject: ldaps:// ignores alternative DNS names / SNA (Subject Alternative Name) certs if hostname != CN name) In-Reply-To: <5226cccc-8740-4018-97fc-6d001c35c77c@default> References: <5226cccc-8740-4018-97fc-6d001c35c77c@default> Message-ID: <20190211190516.GA4046@twosigma.com> On Sun, Feb 10, 2019 at 09:31:46PM -0800, Pallavi Sonal wrote: > Please refer the release notes for JDK 8u181 at > https://www.oracle.com/technetwork/java/javase/8u181-relnotes-4479407.html , > there is a change to improve LDAP support and make it more secure. It is not > possible now to establish an LDAPS connection to a server which presents a > certificate whose CN or SAN does not contain the requested host name. So, > either the same host name should be used which is there in the certificate's > CN or SAN or the certificate should be updated to have the matching hostname > as in its CN or SAN. I have added the snippet from the release notes below > for your reference : Heiko's post shows that the certificate had the correct hostname as a dNSName SAN. Sounds like a bug to me, and a serious one at that. Nico -- From anthony.scarpino at oracle.com Mon Feb 11 19:30:07 2019 From: anthony.scarpino at oracle.com (Anthony Scarpino) Date: Mon, 11 Feb 2019 11:30:07 -0800 Subject: [13] RFR JDK-8216597 "SIGBUS in Java_sun_security_pkcs11_wrapper_PKCS11_getNativeKeyInfo after JDK-6913047" In-Reply-To: <02f7f228-66d1-0ed1-0b5b-760e3e84ddfa@oracle.com> References: <02f7f228-66d1-0ed1-0b5b-760e3e84ddfa@oracle.com> Message-ID: <81e73bd1-f327-3120-ebf1-68fd0dec3a8d@oracle.com> On 2/7/19 2:09 PM, Valerie Peng wrote: > 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 The change looks fine. Tony From xuelei.fan at oracle.com Mon Feb 11 19:32:29 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Mon, 11 Feb 2019 11:32:29 -0800 Subject: RFR [13] JDK-4919790 : Errors in alert ssl message does not reflect the actual certificate status Message-ID: <3c720033-6206-0a49-86d7-5ee407f995a9@oracle.com> Hi, Could I get the update reviewed? http://cr.openjdk.java.net/~xuelei/4919790/webrev.00/ It had been a while that the SunJSSE provider use certificate_unknown or certificate_revoked (or bad_certificate_status_response for OCSP stapling) as the certificate issues alert. Other certificate alert like certificate_expired are not used. The bug was reported in JDK 6. With the introducing of CertPathValidatorException.BasicReason in JDK 7. Now we can handle the alert more accuracy. Note: please don't rely on the certificate alert type for application development. The alert type may be changed and different per the provider preference. No new regression test as the update is simple and straightforward. Thanks, Xuelei From anthony.scarpino at oracle.com Mon Feb 11 21:45:39 2019 From: anthony.scarpino at oracle.com (Anthony Scarpino) Date: Mon, 11 Feb 2019 13:45:39 -0800 Subject: RFR[13]: Delegated task created by SSLEngine throws java.nio.BufferUnderflowException Message-ID: <91f58fe2-9400-7bdd-73fc-f206f427ea90@oracle.com> Hi, I need a review of this simple change that throws the wrong exception http://cr.openjdk.java.net/~ascarpino/8215790/webrev/ Tony From jamil.j.nimeh at oracle.com Tue Feb 12 00:33:24 2019 From: jamil.j.nimeh at oracle.com (Jamil Nimeh) Date: Mon, 11 Feb 2019 16:33:24 -0800 Subject: RFR[13]: Delegated task created by SSLEngine throws java.nio.BufferUnderflowException In-Reply-To: <91f58fe2-9400-7bdd-73fc-f206f427ea90@oracle.com> References: <91f58fe2-9400-7bdd-73fc-f206f427ea90@oracle.com> Message-ID: <6424c4e7-4148-f299-b64d-83b58b7fc81e@oracle.com> Looks good to me. --Jamil On 2/11/2019 1:45 PM, Anthony Scarpino wrote: > Hi, > > I need a review of this simple change that throws the wrong exception > > http://cr.openjdk.java.net/~ascarpino/8215790/webrev/ > > Tony From sean.mullan at oracle.com Tue Feb 12 18:25:44 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Tue, 12 Feb 2019 13:25:44 -0500 Subject: Java SSLSocketChannel/SSLSelector? In-Reply-To: References: Message-ID: Hi Andi, TLS/JSSE topics are best discussed on the security-dev alias, so I am copying that list for more discussion and -bcc-ing core-libs-dev. --Sean On 2/11/19 3:29 PM, Andi Mullaraj wrote: > Hi java-core community, > > I have been directed to this channel to discuss matters related to Java > performant ssl communications. Maybe this is a topic that has been > discussed in the past, in which case I would appreciate if someone pointed > me to that particular topic. > > Back in 2002 I personally applauded the java.nio.channels (jdk1.4) package, > realizing that there was no way to port this to the secure communications, > due to lack of a comparable implementation for SSL. But I thought it was > going to just be matter of time. A couple of years ago I had to go back > search for it, and was kind of surprised to find the following in > http://docs.oracle.com/javase/7/docs/technotes/guides/security/jsse/JSSERefGuide.html#SSLENG > : > > --- begin quote --- > Newcomers to the API may wonder "Why not just have an SSLSocketChannel > which extends java.nio.channels.SocketChannel?" There are two main reasons: > > 1. There were a lot of very difficult questions about what a > SSLSocketChannel should be, including its class hierarchy and how it should > interoperate with Selectors and other types of SocketChannels. Each > proposal brought up more questions than answers. It was noted that any new > API abstraction extended to work with SSL/TLS would require the same > significant analysis and could result in large and complex APIs. > 2. Any JSSE implementation of a new API would be free to choose the "best" > I/O & compute strategy, but hiding any of these details is inappropriate > for those applications needing full control. Any specific implementation > would be inappropriate for some application segment. > --- end quote --- > > It has been a while since this was stated, and I would really like to > revisit it. I personally believe that the question #1 has a quite natural > answer, while #2 should not really be a concern if we adhere to the spi > model where users can bring their own implementation if needed. I know > because I have also implemented it (but would like to discuss that in a > later stage, if it comes to it). > > The benefit of such implementation would be immense. Imagine many Java > services written with nio and which struggle to move to SSL due to the > great complexity of using SSLEngine (zookeeper service to name one), while > all they would need to do (if SSLSocketChannels were available) is to > instantiate an instance of SSLSocketChannel/SSLSelector when the security > is required and the rest would stay the same (as in case of plain > communication using SocketChannel/Selector). Another important use case is > the advent of IOT, where millions of devices, with relatively low > throughput would want to protect their communication via SSL. > > The ways I have seen the community deal with this are mainly: > > 1. Go through the pain of learning SSLEngine (and hope to get it right) > 2. Build their services around tested libraries (like Jetty, which handle > the SSL offload but don't resurface it in SocketChannel/Selector paradigm, > that also come with their huge set of dependencies, bringing in unavoidable > version collisions) > 3. Use proxies (nginx, ha) to deal with the high number of SSL connections > and divide the load by scaling horizontally in the back end (making for a > harder deployment model) > > We can make this a lot easier! > > Any feedback is greatly appreciated, > Best, > > Andi Mullaraj > From sean.mullan at oracle.com Tue Feb 12 19:54:55 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Tue, 12 Feb 2019 14:54:55 -0500 Subject: Code Review Request, JDK-8217835, Remove the experimental SunJSSE FIPS compliant mode In-Reply-To: <2b0668ee-cf1f-707a-e5ae-42afffaa755a@oracle.com> References: <2b0668ee-cf1f-707a-e5ae-42afffaa755a@oracle.com> Message-ID: <2f2135d9-6297-62ee-0857-162b7bcdfd21@oracle.com> Looks good, pretty straightforward cleanup. --Sean On 2/5/19 1:44 PM, Xuelei Fan wrote: > Hi, > > Could I have the update reviewed? > ?? http://cr.openjdk.java.net/~xuelei/8217835/webrev.00/ > > With this update, the experimental FIPS 140 compliant mode is removed > from the SunJSSE provider. As the SunJSSE provider uses the JDK default > cryptography providers, alternatively applications can configure the > Java Security Property to use FIPS 140 compliant cryptography providers. > > More details,? please refer to CSR: > ?? https://bugs.openjdk.java.net/browse/JDK-8217907 > > Thanks & Regards, > Xuelei From christoph.langer at sap.com Tue Feb 12 21:57:23 2019 From: christoph.langer at sap.com (Langer, Christoph) Date: Tue, 12 Feb 2019 21:57:23 +0000 Subject: RFR 8213031: (zipfs) Add support for POSIX file permissions In-Reply-To: References: <7b513a34196141f595cd5d194fb9d8a2@sap.com> <46af4f9d-60f9-c60d-e6f1-8fb97df3ba2e@oracle.com> <5d28b0715d2041ff892a3c44e024f120@sap.com> <8e9231ff-b7d5-bc2f-2643-713f3c670a1d@oracle.com> Message-ID: <3aeba9a64a434a968fc1d82a44077745@sap.com> Hi Alan, all, here comes the next proposal for POSIX support in jdk.zipfs - which hopefully represents the converged solution, at least in its overall design. http://cr.openjdk.java.net/~clanger/webrevs/8213031.6/ With that patch, the behavior is the following: a) A ZipFileSystem instance by default does NOT support the PosixFileAttributeView. However, it is possible to query for a known attribute named "zip:storedPermissions". Its value can be null to represent no permission information or any set of PosixFileAttribute. b) A ZipFileSystem instance can be created with the property "posix"=true. In that case, PosixFileAttributeView is supported with default values. -> owner: A UserPrincipal with the name of System.getProperty("user.name") if property access is allowed, "" otherwise -> group: A GroupPrincipal with the name "". -> permissions: Set.of(OWNER_READ, OWNER_WRITE, GROUP_READ) The default values can be modified by using the properties "defaultOwner", "defaultGroup" and "defaultPermissions". Implementation wise the ZipFileAttributeView always extends PosixFileAttributeView but behaves different, depending on how it was obtained. Within ZipFileSystem, the Entry inner class is not static any more but always has a reference to the Enclosing ZipFileSystem. That's needed because default owner/group/permission can be set on ZipFileSystem instance level now and the Entry, implementing the FileAttributes needs to know where it belongs to. This seems somewhat logical anyway. The new test "TestPosix" is quite extensive. I had to add 2 permissions to test.policy to allow testing in a restricted environment. Module-info and CSR have been adopted, too. Thanks in advance for reviewing. Best regards Christoph > -----Original Message----- > From: Langer, Christoph > Sent: Montag, 21. Januar 2019 10:17 > To: 'Alan Bateman' > Cc: nio-dev ; OpenJDK Dev list dev at openjdk.java.net>; Java Core Libs ; > Volker Simonis > Subject: RE: RFR 8213031: (zipfs) Add support for POSIX file permissions > > Hi Alan, > > first of all, thank you for your input on this. > > > I think the approach to explore are: > > > > 1. zipfs supports PosixFileAttributeView without subsetting. If > > readAttribute(file, BasicFileAttributes.class) succeeds then > > readAttribute(file, PosixFileAttributes.class) should also succeed, even > > if there aren't permissions encoded in the zip entry's external file > > attributes. It would mean that owner and group return default values, > > and permissions may return a default value. It does mean you can't > > distinguish the default value from "no permissions" but there is > > precedence for that, e.g. mount a FAT32 file system on Linux or Unix > > systems and `stat` a file to have the stat structure populated with > > default uid, gid and mode bits. > > OK, I can see the point that in a PosixFileAttributeView as it is, there's no > place for optionality/null values. However, with this approach the benefits > would be that Files::get/setPosixPermissions would work and that's why I > think we should pursue this. The challenge will be to find reasonable > defaults. > > > 2. zipfs defines a new FileAttributeView that defines read and write > > access to permissions stored in a zip entry's external file attribute. > > As it's a new view then it can define the behavior for the case that the > > zip entry doesn't have permissions. Furthermore it does not need to > > extend BasicFileAttributeView so doesn't need to be concerned with bulk > > access, nor concerned with group/owner. As you know, the attributes API > > allows for both type safe and dynamic access so you have a choice as to > > whether to support both or just dynamic access. With the first then > > jdk.zipfs would export a package with a public interface that defines > > the view. If someone wants type safe access to the permissions attribute > > then you need to import the class. The alternative is to not export any > > packages but just define the view in the module-info. The view its name > > and define the name/type of the permissions attribute, it will also > > define how it behaves when the external attributes aren't populated. In > > usage terms it means reading the permissions will be something like > > Files.readAttribute(file, "zip:permissions") and casting the value to > > Set - not pretty but it avoids depending on a > > JDK-specific API. > > For this approach, there are 2 things I dislike. The first is that I don't think we > should export named packages from module jdk.zipfs that people would > develop Java code against while not being in the Java API. And secondly, this > way would not support using Files::set/getPosixPermissions since the > specification/implementation of that utility method explicitly refers to > PosixFileAttributeView. > > I can imagine something like this: > Zipfs by default implements an own view that offers dynamic, not type safe > access to "zip:permissions" and we'll document this. If a user of zipfs wants > to see full PosixFileAttributeView support with default values, then we > should allow for a creation attribute for the zipfs that can control this. Maybe > we can even allow specifying default values for user, group and permissions > via zipfs attributes. > > I'll work to develop the patch into this direction unless you tell me that this > idea is bogus (if so, then I hope it be soon ??) > > Thanks > Christoph > > From sean.mullan at oracle.com Tue Feb 12 22:14:41 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Tue, 12 Feb 2019 17:14:41 -0500 Subject: XML Digital Signature throws NAMESPACE_ERR exception under OpenJDK 11 that works under Java SE 8, 9 and 10 In-Reply-To: References: Message-ID: The bug is now at https://bugs.openjdk.java.net/browse/JDK-8218629 I have started looking at this issue and have some progress I can report. In JDK 9, we updated the version of the Apache XML Signature implementation in the JDK. Some of the marshalling code was rewritten such that it will throw Exceptions if legacy DOM level 1 methods were used to create XML content which is then passed into XMLObject and similar XMLSignature types that take DOMStructure objects. This is because the DOM level 1 methods do not support namespaces. I am still evaluating what the best fix is. However, you can workaround the issue by always using DOM level 3 methods which are namespace aware. For example, use Document.createElementNS instead of Document.createElement and Element.createAttributeNS instead of Element.createAttribute. Using legacy or non-namespace aware XML parsers or implementations is not recommended and the XML Signature Best Practices document gives some rationale: https://www.w3.org/TR/xmldsig-bestpractices/#signing-xml-without-namespaces That said, this is a regression in behavior so it would be best if we could restore the previous behavior. I have attached a modified version of the test case to the bug report which no longer throws an Exception. Let me know if this is an acceptable workaround. Double-check the namespaces that I used to make sure they are correct. --Sean On 2/7/19 11:23 AM, Open eSignForms wrote: > On 2/7/19 7:49 AM, Sean Mullan wrote: >> 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 From yozons at gmail.com Tue Feb 12 23:28:03 2019 From: yozons at gmail.com (Open eSignForms) Date: Tue, 12 Feb 2019 15:28:03 -0800 Subject: XML Digital Signature throws NAMESPACE_ERR exception under OpenJDK 11 that works under Java SE 8, 9 and 10 In-Reply-To: References: Message-ID: Thanks for the update, Sean.? I'm a bit perplexed because I found the original code works under Java 9 and Java 10, so it seems like the change occurred in Java 11. I don't see the modified version of the test case.? If you attached it, it somehow didn't make it through to me. If it's just a matter of making the code more correct, we'd love to make the changes.? My concern, of course, is that we've already done millions of XML digital signatures, so we need that to continue to verify correctly (and even under Java 11, it seems that the verify code works against previously digitally signed content) even if we now start digitally signing using more update-to-date code. Please send over the modified test case and I'll take a look. Thanks! David On 2/12/19 2:14 PM, Sean Mullan wrote: > The bug is now at https://bugs.openjdk.java.net/browse/JDK-8218629 > > I have started looking at this issue and have some progress I can report. > > In JDK 9, we updated the version of the Apache XML Signature > implementation in the JDK. Some of the marshalling code was rewritten > such that it will throw Exceptions if legacy DOM level 1 methods were > used to create XML content which is then passed into XMLObject and > similar XMLSignature types that take DOMStructure objects. This is > because the DOM level 1 methods do not support namespaces. > > I am still evaluating what the best fix is. However, you can > workaround the issue by always using DOM level 3 methods which are > namespace aware. For example, use Document.createElementNS instead of > Document.createElement and Element.createAttributeNS instead of > Element.createAttribute. > > Using legacy or non-namespace aware XML parsers or implementations is > not recommended and the XML Signature Best Practices document gives > some rationale: > https://www.w3.org/TR/xmldsig-bestpractices/#signing-xml-without-namespaces > That said, this is a regression in behavior so it would be best if we > could restore the previous behavior. > > I have attached a modified version of the test case to the bug report > which no longer throws an Exception. Let me know if this is an > acceptable workaround. Double-check the namespaces that I used to make > sure they are correct. > > --Sean > > > On 2/7/19 11:23 AM, Open eSignForms wrote: > >> On 2/7/19 7:49 AM, Sean Mullan wrote: >>> 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 From weijun.wang at oracle.com Wed Feb 13 03:01:54 2019 From: weijun.wang at oracle.com (Weijun Wang) Date: Wed, 13 Feb 2019 11:01:54 +0800 Subject: RFR 8180573: Refactor sun/security/tools shell tests to plain java tests Message-ID: <2B9C2E12-4BCE-4FFE-84FF-F21CE5FAC56F@oracle.com> Please review the fix at https://cr.openjdk.java.net/~weijun/8180573/webrev.00/ Notes: - Most changes are just .sh -> .java - StorePasswordsByShell.sh combined into StorePasswords.java - In most cases, JarUtils is called to create a jar file. Sometimes the jar command is called because of delicate differences, for example, jar adds directory entries also. - The i18n tests are completely manual described in i18n.html. Old i18n.java is useless, now is also empty. - Copyright year updated to 2019, @bug unchanged. Two files not converted yet: - ./keytool/console.sh This is a manual test calling old versions of JDK. - ./keytool/ListKeychainStore.sh I tried on this one but "security list-keychains -s ..." has no effect on mach5 machines when calling by ProcessTools. No idea why, I've created a separate bug (JDK-8218886) for it. Thanks, Max From weijun.wang at oracle.com Wed Feb 13 03:31:33 2019 From: weijun.wang at oracle.com (Weijun Wang) Date: Wed, 13 Feb 2019 11:31:33 +0800 Subject: RFR 8218888: keytool -genkeypair should not have the -destalias option Message-ID: The -genkeypair command mistakenly lists -destalias in its option table. Here is the simple patch: diff --git a/src/java.base/share/classes/sun/security/tools/keytool/Main.java b/src/java.base/share/classes/sun/security/tools/keytool/Main.java --- a/src/java.base/share/classes/sun/security/tools/keytool/Main.java +++ b/src/java.base/share/classes/sun/security/tools/keytool/Main.java @@ -211,7 +211,7 @@ STORETYPE, PROVIDERNAME, ADDPROVIDER, PROVIDERCLASS, PROVIDERPATH, V, PROTECTED), GENKEYPAIR("Generates.a.key.pair", - ALIAS, KEYALG, KEYSIZE, CURVENAME, SIGALG, DESTALIAS, DNAME, + ALIAS, KEYALG, KEYSIZE, CURVENAME, SIGALG, DNAME, STARTDATE, EXT, VALIDITY, KEYPASS, KEYSTORE, STOREPASS, STORETYPE, PROVIDERNAME, ADDPROVIDER, PROVIDERCLASS, PROVIDERPATH, V, PROTECTED), Thanks Max -------------- next part -------------- An HTML attachment was scrubbed... URL: From xuelei.fan at oracle.com Wed Feb 13 04:00:59 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Tue, 12 Feb 2019 20:00:59 -0800 Subject: Not possible to disable new TLS extensions for TLS 1.2 connections In-Reply-To: References: Message-ID: <3dfb3505-dd0e-3b91-17a0-c6165d7a1069@oracle.com> Hi Amir, It should be rare now the a TLS vendor cannot ignore unknown extensions. > "issuer": "CN=invalid2.invalid, OU="No SNI provided; > please fix your client."", The error message encapsulated in the certificate does not sound right to me. Is it caused by the absence of SNI extension? Did you have a test case that I can reproduce the problem? Thanks & Regards, Xuelei On 1/7/2019 9:27 PM, Amir Khassaia wrote: > 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-0813:40:14.395 AEDT|SSLCipher.java:437|jdk.tls.keyLimits: ? entry = AES/GCM/NoPadding KeyUpdate2^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_md5] > > ? ? }, > > "signature_algorithms_cert (50)": { > > "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_md5] > > ? ? }, > > "extended_master_secret (23)": { > > ? ? ? > > ? ? }, > > "supported_versions (43)": { > > "versions": [TLSv1.2, TLSv1.1] > > ? ? }, > > "renegotiation_info (65,281)": { > > "renegotiated connection": [] > > ? ? } > > ? ] > > } > > ) > > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.455 > AEDT|Alert.java:232|Received alert message ( > > "Alert": { > > "level"? ? ? : "fatal", > > "description": "handshake_failure" > > } > > ) > > javax.net.ssl|ERROR|01|main|2019-01-08 13:40:14.456 > AEDT|TransportContext.java:313|Fatal (HANDSHAKE_FAILURE): Received fatal > alert: handshake_failure ( > > "throwable" : { > > ? javax.net.ssl.SSLHandshakeException: Received fatal alert: > handshake_failure > > ? ? at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:128) > > ? ? at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117) > > ? ? at > java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:308) > > ? ? at > java.base/sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:279) > > ? ? at > java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:181) > > ? ? at > java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164) > > ? ? at > java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1152) > > ? ? at > java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063) > > ? ? at > java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402) > > ? ? at SslSocketClient.main(SslSocketClient.kt:47)} > > > ) > > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.457 > AEDT|SSLSocketImpl.java:1361|close the underlying socket > > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.457 > AEDT|SSLSocketImpl.java:1380|close the SSL connection (initiative) > > Exception in thread "main" javax.net.ssl.SSLHandshakeException: Received > fatal alert: handshake_failure > > ? at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:128) > > ? at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117) > > ? at > java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:308) > > ? at java.base/sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:279) > > ? at > java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:181) > > ? at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164) > > ? at > java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1152) > > ? at > java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063) > > ? at > java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402) > > ? at SslSocketClient.main(SslSocketClient.kt:47) > > > > From sean.mullan at oracle.com Wed Feb 13 13:12:35 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Wed, 13 Feb 2019 08:12:35 -0500 Subject: RFR 8218888: keytool -genkeypair should not have the -destalias option In-Reply-To: References: Message-ID: <99b1882d-542c-cd7c-c4b7-6bb2d35cf9a7@oracle.com> Looks good. --Sean On 2/12/19 10:31 PM, Weijun Wang wrote: > The -genkeypair command mistakenly lists -destalias in its option table. > Here is the simple patch: > > *diff --git > a/src/java.base/share/classes/sun/security/tools/keytool/Main.java > b/src/java.base/share/classes/sun/security/tools/keytool/Main.java* > *--- a/src/java.base/share/classes/sun/security/tools/keytool/Main.java* > *+++ b/src/java.base/share/classes/sun/security/tools/keytool/Main.java* > @@ -211,7 +211,7 @@ > ?? ? ? ? ? ? STORETYPE, PROVIDERNAME, ADDPROVIDER, PROVIDERCLASS, > ?? ? ? ? ? ? PROVIDERPATH, V, PROTECTED), > ?? ? ? ? GENKEYPAIR("Generates.a.key.pair", > -? ? ? ? ? ? ALIAS, KEYALG, KEYSIZE, CURVENAME, SIGALG, DESTALIAS, DNAME, > +? ? ? ? ? ? ALIAS, KEYALG, KEYSIZE, CURVENAME, SIGALG, DNAME, > ?? ? ? ? ? ? STARTDATE, EXT, VALIDITY, KEYPASS, KEYSTORE, > ?? ? ? ? ? ? STOREPASS, STORETYPE, PROVIDERNAME, ADDPROVIDER, > ?? ? ? ? ? ? PROVIDERCLASS, PROVIDERPATH, V, PROTECTED), > > Thanks > Max From sean.mullan at oracle.com Wed Feb 13 14:03:33 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Wed, 13 Feb 2019 09:03:33 -0500 Subject: XML Digital Signature throws NAMESPACE_ERR exception under OpenJDK 11 that works under Java SE 8, 9 and 10 In-Reply-To: References: Message-ID: <8f5d59e0-89be-9146-7e57-5d2cf755043f@oracle.com> On 2/12/19 6:28 PM, Open eSignForms wrote: > Thanks for the update, Sean.? I'm a bit perplexed because I found the > original code works under Java 9 and Java 10, so it seems like the > change occurred in Java 11. Sorry, that was a typo, I meant to say JDK 11. > I don't see the modified version of the test case.? If you attached it, > it somehow didn't make it through to me. > > If it's just a matter of making the code more correct, we'd love to make > the changes.? My concern, of course, is that we've already done millions > of XML digital signatures, so we need that to continue to verify > correctly (and even under Java 11, it seems that the verify code works > against previously digitally signed content) even if we now start > digitally signing using more update-to-date code. The verification of pre-existing signatures should continue to work regardless of how this bug is addressed. > Please send over the modified test case and I'll take a look. It is attached to the bug report in the Attachments section: https://bugs.openjdk.java.net/browse/JDK-8218629 (make sure you download the one I added yesterday). --Sean > > Thanks! > David > > On 2/12/19 2:14 PM, Sean Mullan wrote: >> The bug is now at https://bugs.openjdk.java.net/browse/JDK-8218629 >> >> I have started looking at this issue and have some progress I can report. >> >> In JDK 9, we updated the version of the Apache XML Signature >> implementation in the JDK. Some of the marshalling code was rewritten >> such that it will throw Exceptions if legacy DOM level 1 methods were >> used to create XML content which is then passed into XMLObject and >> similar XMLSignature types that take DOMStructure objects. This is >> because the DOM level 1 methods do not support namespaces. >> >> I am still evaluating what the best fix is. However, you can >> workaround the issue by always using DOM level 3 methods which are >> namespace aware. For example, use Document.createElementNS instead of >> Document.createElement and Element.createAttributeNS instead of >> Element.createAttribute. >> >> Using legacy or non-namespace aware XML parsers or implementations is >> not recommended and the XML Signature Best Practices document gives >> some rationale: >> https://www.w3.org/TR/xmldsig-bestpractices/#signing-xml-without-namespaces >> >> That said, this is a regression in behavior so it would be best if we >> could restore the previous behavior. >> >> I have attached a modified version of the test case to the bug report >> which no longer throws an Exception. Let me know if this is an >> acceptable workaround. Double-check the namespaces that I used to make >> sure they are correct. >> >> --Sean >> >> >> On 2/7/19 11:23 AM, Open eSignForms wrote: >> >>> On 2/7/19 7:49 AM, Sean Mullan wrote: >>>> 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 From dhiller at twitter.com Wed Feb 13 16:21:45 2019 From: dhiller at twitter.com (Dean Hiller) Date: Wed, 13 Feb 2019 09:21:45 -0700 Subject: Java SSLSocketChannel/SSLSelector? In-Reply-To: References: Message-ID: I would highly suggest implementing your own for a much better understanding. I did implement something like what you want and in so doing realized I like their decision. ie. See the heirarchy here https://github.com/deanhiller/webpieces/tree/master/core/core-channelmanager2/src/main/java/org/webpieces/nio/api/channels The TCPChannel could be SSL or not SSL as there are two implementations. If you do want an implementation that does what you want though, this library does exactly that https://github.com/deanhiller/webpieces/tree/master/core/core-channelmanager2 which is used in the webpieces webserver https://github.com/deanhiller/webpieces That nio library is standalone even though it is in the webpieces repo. I mean, every component in webpieces is another stand-alone piece. The downside is the library owns a thread which typical java libraries avoid. ie. it has to have a thread to poll the selector and read from all the sockets to be fed to the thread pools, etc. I think that is the main reason they decided not to have this type of library. They prefer not to be running threads(which I agree, the jdk shouldn't). later, Dean On Tue, Feb 12, 2019 at 7:54 PM Sean Mullan wrote: > Hi Andi, > > TLS/JSSE topics are best discussed on the security-dev alias, so I am > copying that list for more discussion and -bcc-ing core-libs-dev. > > --Sean > > On 2/11/19 3:29 PM, Andi Mullaraj wrote: > > Hi java-core community, > > > > I have been directed to this channel to discuss matters related to Java > > performant ssl communications. Maybe this is a topic that has been > > discussed in the past, in which case I would appreciate if someone > pointed > > me to that particular topic. > > > > Back in 2002 I personally applauded the java.nio.channels (jdk1.4) > package, > > realizing that there was no way to port this to the secure > communications, > > due to lack of a comparable implementation for SSL. But I thought it was > > going to just be matter of time. A couple of years ago I had to go back > > search for it, and was kind of surprised to find the following in > > > http://docs.oracle.com/javase/7/docs/technotes/guides/security/jsse/JSSERefGuide.html#SSLENG > > : > > > > --- begin quote --- > > Newcomers to the API may wonder "Why not just have an SSLSocketChannel > > which extends java.nio.channels.SocketChannel?" There are two main > reasons: > > > > 1. There were a lot of very difficult questions about what a > > SSLSocketChannel should be, including its class hierarchy and how it > should > > interoperate with Selectors and other types of SocketChannels. Each > > proposal brought up more questions than answers. It was noted that any > new > > API abstraction extended to work with SSL/TLS would require the same > > significant analysis and could result in large and complex APIs. > > 2. Any JSSE implementation of a new API would be free to choose the > "best" > > I/O & compute strategy, but hiding any of these details is inappropriate > > for those applications needing full control. Any specific implementation > > would be inappropriate for some application segment. > > --- end quote --- > > > > It has been a while since this was stated, and I would really like to > > revisit it. I personally believe that the question #1 has a quite > natural > > answer, while #2 should not really be a concern if we adhere to the spi > > model where users can bring their own implementation if needed. I know > > because I have also implemented it (but would like to discuss that in a > > later stage, if it comes to it). > > > > The benefit of such implementation would be immense. Imagine many Java > > services written with nio and which struggle to move to SSL due to the > > great complexity of using SSLEngine (zookeeper service to name one), > while > > all they would need to do (if SSLSocketChannels were available) is to > > instantiate an instance of SSLSocketChannel/SSLSelector when the security > > is required and the rest would stay the same (as in case of plain > > communication using SocketChannel/Selector). Another important use case > is > > the advent of IOT, where millions of devices, with relatively low > > throughput would want to protect their communication via SSL. > > > > The ways I have seen the community deal with this are mainly: > > > > 1. Go through the pain of learning SSLEngine (and hope to get it right) > > 2. Build their services around tested libraries (like Jetty, which handle > > the SSL offload but don't resurface it in SocketChannel/Selector > paradigm, > > that also come with their huge set of dependencies, bringing in > unavoidable > > version collisions) > > 3. Use proxies (nginx, ha) to deal with the high number of SSL > connections > > and divide the load by scaling horizontally in the back end (making for a > > harder deployment model) > > > > We can make this a lot easier! > > > > Any feedback is greatly appreciated, > > Best, > > > > Andi Mullaraj > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dhiller at twitter.com Wed Feb 13 16:26:04 2019 From: dhiller at twitter.com (Dean Hiller) Date: Wed, 13 Feb 2019 09:26:04 -0700 Subject: Java SSLSocketChannel/SSLSelector? In-Reply-To: References: Message-ID: I forgot about and forgot to mention there is a special backpressure in the webpieces implementation. Say A connects through socket to B and B has this webpieces channelmanager. Let's say C is the client code of B. If C does not consume the data fast enough from A, channelmanager deregisters the socket to A to PAUSE reading from A until C catches up. Once C catches up, it re-registers the socket un-pausing. This yields a graceful performance degredation AND it turns out an increase in performance due to less 'jittering' ...a term from the audio world. It's a very complex topic and hard to explain the reasons behind it. Anyways, it was quite an interesting experience. On Wed, Feb 13, 2019 at 9:21 AM Dean Hiller wrote: > I would highly suggest implementing your own for a much better > understanding. > > I did implement something like what you want and in so doing realized I > like their decision. ie. See the heirarchy here > > https://github.com/deanhiller/webpieces/tree/master/core/core-channelmanager2/src/main/java/org/webpieces/nio/api/channels > > The TCPChannel could be SSL or not SSL as there are two implementations. > > If you do want an implementation that does what you want though, this > library does exactly that > > https://github.com/deanhiller/webpieces/tree/master/core/core-channelmanager2 > > which is used in the webpieces webserver > https://github.com/deanhiller/webpieces > > That nio library is standalone even though it is in the webpieces repo. I > mean, every component in webpieces is another stand-alone piece. > > The downside is the library owns a thread which typical java libraries > avoid. ie. it has to have a thread to poll the selector and read from all > the sockets to be fed to the thread pools, etc. I think that is the main > reason they decided not to have this type of library. They prefer not to > be running threads(which I agree, the jdk shouldn't). > > later, > Dean > > > > > On Tue, Feb 12, 2019 at 7:54 PM Sean Mullan > wrote: > >> Hi Andi, >> >> TLS/JSSE topics are best discussed on the security-dev alias, so I am >> copying that list for more discussion and -bcc-ing core-libs-dev. >> >> --Sean >> >> On 2/11/19 3:29 PM, Andi Mullaraj wrote: >> > Hi java-core community, >> > >> > I have been directed to this channel to discuss matters related to Java >> > performant ssl communications. Maybe this is a topic that has been >> > discussed in the past, in which case I would appreciate if someone >> pointed >> > me to that particular topic. >> > >> > Back in 2002 I personally applauded the java.nio.channels (jdk1.4) >> package, >> > realizing that there was no way to port this to the secure >> communications, >> > due to lack of a comparable implementation for SSL. But I thought it >> was >> > going to just be matter of time. A couple of years ago I had to go back >> > search for it, and was kind of surprised to find the following in >> > >> http://docs.oracle.com/javase/7/docs/technotes/guides/security/jsse/JSSERefGuide.html#SSLENG >> > : >> > >> > --- begin quote --- >> > Newcomers to the API may wonder "Why not just have an SSLSocketChannel >> > which extends java.nio.channels.SocketChannel?" There are two main >> reasons: >> > >> > 1. There were a lot of very difficult questions about what a >> > SSLSocketChannel should be, including its class hierarchy and how it >> should >> > interoperate with Selectors and other types of SocketChannels. Each >> > proposal brought up more questions than answers. It was noted that any >> new >> > API abstraction extended to work with SSL/TLS would require the same >> > significant analysis and could result in large and complex APIs. >> > 2. Any JSSE implementation of a new API would be free to choose the >> "best" >> > I/O & compute strategy, but hiding any of these details is inappropriate >> > for those applications needing full control. Any specific implementation >> > would be inappropriate for some application segment. >> > --- end quote --- >> > >> > It has been a while since this was stated, and I would really like to >> > revisit it. I personally believe that the question #1 has a quite >> natural >> > answer, while #2 should not really be a concern if we adhere to the spi >> > model where users can bring their own implementation if needed. I know >> > because I have also implemented it (but would like to discuss that in a >> > later stage, if it comes to it). >> > >> > The benefit of such implementation would be immense. Imagine many Java >> > services written with nio and which struggle to move to SSL due to the >> > great complexity of using SSLEngine (zookeeper service to name one), >> while >> > all they would need to do (if SSLSocketChannels were available) is to >> > instantiate an instance of SSLSocketChannel/SSLSelector when the >> security >> > is required and the rest would stay the same (as in case of plain >> > communication using SocketChannel/Selector). Another important use >> case is >> > the advent of IOT, where millions of devices, with relatively low >> > throughput would want to protect their communication via SSL. >> > >> > The ways I have seen the community deal with this are mainly: >> > >> > 1. Go through the pain of learning SSLEngine (and hope to get it right) >> > 2. Build their services around tested libraries (like Jetty, which >> handle >> > the SSL offload but don't resurface it in SocketChannel/Selector >> paradigm, >> > that also come with their huge set of dependencies, bringing in >> unavoidable >> > version collisions) >> > 3. Use proxies (nginx, ha) to deal with the high number of SSL >> connections >> > and divide the load by scaling horizontally in the back end (making for >> a >> > harder deployment model) >> > >> > We can make this a lot easier! >> > >> > Any feedback is greatly appreciated, >> > Best, >> > >> > Andi Mullaraj >> > >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yozons at gmail.com Wed Feb 13 19:20:04 2019 From: yozons at gmail.com (Open eSignForms) Date: Wed, 13 Feb 2019 11:20:04 -0800 Subject: XML Digital Signature throws NAMESPACE_ERR exception under OpenJDK 11 that works under Java SE 8, 9 and 10 In-Reply-To: <8f5d59e0-89be-9146-7e57-5d2cf755043f@oracle.com> References: <8f5d59e0-89be-9146-7e57-5d2cf755043f@oracle.com> Message-ID: <66dd5bf7-b1b4-b3cf-b595-2c457b29a6af@gmail.com> Thanks, Sean.? I was able to find the updated test case source code. A preliminary review seems to show worthwhile changes to our code.? That is, the namespaces and such seem to make sense as you have them. In particular, the use of: domSignContext.putNamespacePrefix(XMLSignature.XMLNS, "dsig"); and adding this namespace to additional elements we added: ??? ??? ??? String xmlns = "http://uri.etsi.org/01903/v1.1.1#"; seem reasonable and an acceptable workaround for us.? I'm not sure if those were oversights from before, but likely were the result of it being based on Oracle/Java example code from Java 6 days... We'll incorporate your namespace changes in our code and test, but this seems like it will work as I was able to confirm that your fixed version seems to run on Java 10 and Java 11. It is interesting that the fixed code, though, generates different output on Java 10 and Java 11.? I'm not positive, but it seems that Java 11 adds ' ' to the end of many lines that aren't present in Java 10's output. Under Java 10, a test run products this result:

Dummy HTML document

]]>Zqmii2rv6C+bFM+CSO3s8sAGOrl67HEnv4t8XUgQd5iguf9m7vcVJn3pJz5inCZfx5V9lTtDaj0u xbZSyWE5kQ==kZM1pJpRXoeDuolU+kyK41BotQoW7ir5lfg/nNSMoC69bUC2OHzWbQ5Kug0gtrLVIuq5HRdzk6zc 2N2jA0WKMQ==AFx1CJi739IWZwJL1Y5KU2B+ZioT3ONMBLwLTdT/NTysV/+KYF7lZMgEHaGtLxvc6haIKKKzZisr r2YDQVgs5w==jhVDd7nvr4s2bu7LRNHb7yj2gQRzAE7fXcsgonq2Qsn4EWNfpqNEVUViIy9jh86tTs5ZiakaGAEs l9YV1hNnEg==izJCFA5lBOjc7zhlc/1Wrsu+/jd0o0aPtemm4hM7aMKJvzkKddhjaHRY9iX4qtMZJtl7L1qj4YGN hxHc2Wjuj6F1ZFD9asPf/kumVliAqTwNvhfyVfm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DAQABMA4GA1UdDwEB/wQEAwIGwDAN BgkqhkiG9w0BAQ0FAAOCAgEAOu3Y4o7P4wel6zcwGIHfwuTuL/IX9qzYnxtPNkEHL8D8v3P4Tovk zDHOou4Ai5yycZninbaoK2WJr80p2HNfISY51fCJZ+Z16xmBlPmunnLI23cTAJGnZlI6WtsZLXQw LX91VkqKlRL73+MZECxO0m5I4hxNu8CeOIcQ7aCLvnkO8AEeCa9zAwmiL2tJ8coJvELvqS9Zaiaz syix8IWETtrZ+vv+85rASl5PSkCb0AX3eipJoqRgGazWraV7NBwDZgPEYXNQq1/jbQoirjJIzNQO KEgH3wViGFVwnW4YJ4dzbtVd6EVaHZGmYb666FpwNPz6OBLgX1sjvDTMTYGYo/VrIN02neYEvBtK GrZ5Gw7l7BOyKe92F3iQ3q90/kOBmGnEn8agkKlynv5IlJR8xOCxG1U9e8GFfmAwFS5hYtf0Gh/u FRqnOepWQKuZ3kBBR+6KttbE58aD2kVuB36et5Dij1nxr+ihL7e4V42KsQQn/VBDrMoU5xW+yZH/ aAEgpbfUm5detK5oFqs5JIILFiyUXQCrvYuNZFx4vDqrsDmmAaaAPBlcybCUXseqh4hThyrOJ0dX 3xaXcwd32t1+/aOa7jgJRTgSklxhhcRCMHI9HWNlLgUWmvZ2O5G70reY4Kyg1NAS56qX48Xbckvy VMfem/JPPYT/veThnefIgQk=2019-02-13T11:02:30-08:00descriptiontext/html
while when run under Java 11 it shows what seems to be the same (clearly, the digest/hashes aren't the same as the 'timestamp' differs because they are actual times) except for lots of ' ' added to the digests and signatures:

Dummy HTML document

]]>LdB/ydGxr3VUoTshQtOvQNmMZmt2OHgLax4tSk9Lqb1c+X1h4Uc/RBVXwfI9QrVnITBz85Fi8Bwr 7wyMjw84cA==FkpexxTwhpCPHHsMrKGnBXE5hkZ/x10ArpzjX6ltYfOilvVAubzc9sNPwo6phw//ot1rSKPU5jTB LRD7p7t50g==LxB0xAsDxKqeyCflaSUgMQOMhoxP4Gl9GfvlpCiL/gd9r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RC7BC0P+agORSbzi/lI5TWGf hGlZ0YCRonW5siucp8XSoqZsI5w7r1IQvnM/QlcSBJn4PrNW/tWQAmLN0n3UoqzjL/Kl6XiW6s1z IF3eHPDzGnP2OgyXwM5MsJwuEanfnRWtxxuH29q4BxFwr+cL7Jo8j+aCGY3YPbJnctndnqTvwmX0 FRXs8vljK7FCZmNU/TuUm+LqCUtSbbej5zdzgPuuAcviAwIDAQABMA4GA1UdDwEB/wQEAwIGwDAN BgkqhkiG9w0BAQ0FAAOCAgEAOu3Y4o7P4wel6zcwGIHfwuTuL/IX9qzYnxtPNkEHL8D8v3P4Tovk zDHOou4Ai5yycZninbaoK2WJr80p2HNfISY51fCJZ+Z16xmBlPmunnLI23cTAJGnZlI6WtsZLXQw LX91VkqKlRL73+MZECxO0m5I4hxNu8CeOIcQ7aCLvnkO8AEeCa9zAwmiL2tJ8coJvELvqS9Zaiaz syix8IWETtrZ+vv+85rASl5PSkCb0AX3eipJoqRgGazWraV7NBwDZgPEYXNQq1/jbQoirjJIzNQO KEgH3wViGFVwnW4YJ4dzbtVd6EVaHZGmYb666FpwNPz6OBLgX1sjvDTMTYGYo/VrIN02neYEvBtK GrZ5Gw7l7BOyKe92F3iQ3q90/kOBmGnEn8agkKlynv5IlJR8xOCxG1U9e8GFfmAwFS5hYtf0Gh/u FRqnOepWQKuZ3kBBR+6KttbE58aD2kVuB36et5Dij1nxr+ihL7e4V42KsQQn/VBDrMoU5xW+yZH/ aAEgpbfUm5detK5oFqs5JIILFiyUXQCrvYuNZFx4vDqrsDmmAaaAPBlcybCUXseqh4hThyrOJ0dX 3xaXcwd32t1+/aOa7jgJRTgSklxhhcRCMHI9HWNlLgUWmvZ2O5G70reY4Kyg1NAS56qX48Xbckvy VMfem/JPPYT/veThnefIgQk=2019-02-13T11:01:22-08:00descriptiontext/html
It's particularly odd because hex 13 isn't a typical character (^S). Any idea what that difference is about for the base64 digests and signatures? David On 2/13/19 6:03 AM, Sean Mullan wrote: > On 2/12/19 6:28 PM, Open eSignForms wrote: >> Thanks for the update, Sean.? I'm a bit perplexed because I found the >> original code works under Java 9 and Java 10, so it seems like the >> change occurred in Java 11. > > Sorry, that was a typo, I meant to say JDK 11. > >> I don't see the modified version of the test case.? If you attached >> it, it somehow didn't make it through to me. >> >> If it's just a matter of making the code more correct, we'd love to >> make the changes.? My concern, of course, is that we've already done >> millions of XML digital signatures, so we need that to continue to >> verify correctly (and even under Java 11, it seems that the verify >> code works against previously digitally signed content) even if we >> now start digitally signing using more update-to-date code. > > The verification of pre-existing signatures should continue to work > regardless of how this bug is addressed. > >> Please send over the modified test case and I'll take a look. > > It is attached to the bug report in the Attachments section: > https://bugs.openjdk.java.net/browse/JDK-8218629 (make sure you > download the one I added yesterday). > > --Sean > >> >> Thanks! >> David >> >> On 2/12/19 2:14 PM, Sean Mullan wrote: >>> The bug is now at https://bugs.openjdk.java.net/browse/JDK-8218629 >>> >>> I have started looking at this issue and have some progress I can >>> report. >>> >>> In JDK 9, we updated the version of the Apache XML Signature >>> implementation in the JDK. Some of the marshalling code was >>> rewritten such that it will throw Exceptions if legacy DOM level 1 >>> methods were used to create XML content which is then passed into >>> XMLObject and similar XMLSignature types that take DOMStructure >>> objects. This is because the DOM level 1 methods do not support >>> namespaces. >>> >>> I am still evaluating what the best fix is. However, you can >>> workaround the issue by always using DOM level 3 methods which are >>> namespace aware. For example, use Document.createElementNS instead >>> of Document.createElement and Element.createAttributeNS instead of >>> Element.createAttribute. >>> >>> Using legacy or non-namespace aware XML parsers or implementations >>> is not recommended and the XML Signature Best Practices document >>> gives some rationale: >>> https://www.w3.org/TR/xmldsig-bestpractices/#signing-xml-without-namespaces >>> >>> That said, this is a regression in behavior so it would be best if >>> we could restore the previous behavior. >>> >>> I have attached a modified version of the test case to the bug >>> report which no longer throws an Exception. Let me know if this is >>> an acceptable workaround. Double-check the namespaces that I used to >>> make sure they are correct. >>> >>> --Sean >>> >>> >>> On 2/7/19 11:23 AM, Open eSignForms wrote: >>> >>>> On 2/7/19 7:49 AM, Sean Mullan wrote: >>>>> 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 From amir.khassaia at gmail.com Wed Feb 13 21:16:36 2019 From: amir.khassaia at gmail.com (Amir Khassaia) Date: Thu, 14 Feb 2019 08:16:36 +1100 Subject: Not possible to disable new TLS extensions for TLS 1.2 connections In-Reply-To: <3dfb3505-dd0e-3b91-17a0-c6165d7a1069@oracle.com> References: <3dfb3505-dd0e-3b91-17a0-c6165d7a1069@oracle.com> Message-ID: Hi Xuelei, There were 2 distinct cases of change of behaviour. - The "CN=invalid2.invalid, OU="No SNI provided" reliably works without SNI in Java 8 but is indeed fixed by having an SNI included which perhaps was needed all along. This one is reported by XMPP/TLS connection from talk.google.com:5222 - The aborted handshake case (client_hello traces that I've provided) this happened with a hardware device which was replicable with an SSL socket handshake program that I referenced in the gist. Unfortunately replication requires a specific device model so it wont be possible to see it for yourself. The workaround there was to either downgrade JRE to < 11 or to switch JRE globally to use TLS 1.0 or TLS 1.1 via the system property. This is where your proposed enhancement will be of great help as it will allow a per connection type decision. On Wed, Feb 13, 2019 at 3:01 PM Xuelei Fan wrote: > Hi Amir, > > It should be rare now the a TLS vendor cannot ignore unknown extensions. > > > "issuer": "CN=invalid2.invalid, OU="No SNI provided; > > please fix your client."", > The error message encapsulated in the certificate does not sound right > to me. Is it caused by the absence of SNI extension? > > Did you have a test case that I can reproduce the problem? > > Thanks & Regards, > Xuelei > > > On 1/7/2019 9:27 PM, Amir Khassaia wrote: > > 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-0813:40:14.395 > AEDT|SSLCipher.java:437|jdk.tls.keyLimits: entry = AES/GCM/NoPadding > KeyUpdate2^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_md5] > > > > }, > > > > "signature_algorithms_cert (50)": { > > > > "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_md5] > > > > }, > > > > "extended_master_secret (23)": { > > > > > > > > }, > > > > "supported_versions (43)": { > > > > "versions": [TLSv1.2, TLSv1.1] > > > > }, > > > > "renegotiation_info (65,281)": { > > > > "renegotiated connection": [] > > > > } > > > > ] > > > > } > > > > ) > > > > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.455 > > AEDT|Alert.java:232|Received alert message ( > > > > "Alert": { > > > > "level" : "fatal", > > > > "description": "handshake_failure" > > > > } > > > > ) > > > > javax.net.ssl|ERROR|01|main|2019-01-08 13:40:14.456 > > AEDT|TransportContext.java:313|Fatal (HANDSHAKE_FAILURE): Received fatal > > alert: handshake_failure ( > > > > "throwable" : { > > > > javax.net.ssl.SSLHandshakeException: Received fatal alert: > > handshake_failure > > > > at > java.base/sun.security.ssl.Alert.createSSLException(Alert.java:128) > > > > at > java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117) > > > > at > > > java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:308) > > > > at > > java.base/sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:279) > > > > at > > > java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:181) > > > > at > > java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164) > > > > at > > java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1152) > > > > at > > > java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063) > > > > at > > > java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402) > > > > at SslSocketClient.main(SslSocketClient.kt:47)} > > > > > > ) > > > > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.457 > > AEDT|SSLSocketImpl.java:1361|close the underlying socket > > > > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.457 > > AEDT|SSLSocketImpl.java:1380|close the SSL connection (initiative) > > > > Exception in thread "main" javax.net.ssl.SSLHandshakeException: Received > > fatal alert: handshake_failure > > > > at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:128) > > > > at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117) > > > > at > > > java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:308) > > > > at > java.base/sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:279) > > > > at > > > java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:181) > > > > at > java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164) > > > > at > > java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1152) > > > > at > > > java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063) > > > > at > > > java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402) > > > > at SslSocketClient.main(SslSocketClient.kt:47) > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yozons at gmail.com Wed Feb 13 21:23:54 2019 From: yozons at gmail.com (Open eSignForms) Date: Wed, 13 Feb 2019 13:23:54 -0800 Subject: XML Digital Signature throws NAMESPACE_ERR exception under OpenJDK 11 that works under Java SE 8, 9 and 10 In-Reply-To: <66dd5bf7-b1b4-b3cf-b595-2c457b29a6af@gmail.com> References: <8f5d59e0-89be-9146-7e57-5d2cf755043f@oracle.com> <66dd5bf7-b1b4-b3cf-b595-2c457b29a6af@gmail.com> Message-ID: <32d2fff5-1be5-1201-225e-15ac60982067@gmail.com> I checked the ETSI XAdES spec (http://uri.etsi.org/01903/v1.1.1/ts_101903v010101p.pdf) and it doesn't show any namespace on their entries for their QualifyingProperties element and all sub-elements under the ETSI example's element . But, their specification does show element should be under the namespace "http://uri.etsi.org/01903/v1.1.1#" as you added in your fixed code. That is, when my snapshot element that's digitally signed using the below, it fails with the NAMESPACE_ERR exception: But if my snapshot is set up with the ETSI namespace URI, it works: So, it seems that the XMLSignature is noting that the belongs to the default namespace in both cases, but of course expects that particular element to belong to the ETSI namespace, not ours. I presume that's correct behavior; I just didn't think that the XMLSignature.sign() knew about and was limited to that specific namespace. If you agree that this is the correct behavior, I think it's not really a bug in Java 11, though it fails backwards compatibility. The only oddity that remains is what I mentioned below with all the " " characters in the digests/signatures that appear in Java 11.? They sure look odd compared to simple line breaks that presumably were emitted before. David On 2/13/19 11:20 AM, Open eSignForms wrote: > Thanks, Sean.? I was able to find the updated test case source code. > > A preliminary review seems to show worthwhile changes to our code.? > That is, the namespaces and such seem to make sense as you have them. > > In particular, the use of: > > domSignContext.putNamespacePrefix(XMLSignature.XMLNS, "dsig"); > > and adding this namespace to additional elements we added: > > ??? ??? ??? String xmlns = "http://uri.etsi.org/01903/v1.1.1#"; > > seem reasonable and an acceptable workaround for us.? I'm not sure if > those were oversights from before, but likely were the result of it > being based on Oracle/Java example code from Java 6 days... > > We'll incorporate your namespace changes in our code and test, but > this seems like it will work as I was able to confirm that your fixed > version seems to run on Java 10 and Java 11. > > It is interesting that the fixed code, though, generates different > output on Java 10 and Java 11.? I'm not positive, but it seems that > Java 11 adds ' ' to the end of many lines that aren't present in > Java 10's output. > > Under Java 10, a test run products this result: > > timestamp="2019-02-13T11:02:30-08:00" type="document"> xmlns="http://www.w3.org/1999/xhtml">

Dummy HTML > document

]]> xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" > Id="OpenESignForms_Seal"> Algorithm="http://www.w3.org/2006/12/xml-c14n11#WithComments"/> Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"/> Id="Payload_Reference_ID" URI=""> Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>Zqmii2rv6C+bFM+CSO3s8sAGOrl67HEnv4t8XUgQd5iguf9m7vcVJn3pJz5inCZfx5V9lTtDaj0u > > xbZSyWE5kQ== URI="#KeyInfo_ID"> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>kZM1pJpRXoeDuolU+kyK41BotQoW7ir5lfg/nNSMoC69bUC2OHzWbQ5Kug0gtrLVIuq5HRdzk6zc > 2N2jA0WKMQ== URI="#QualifyingProperties_ID"> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>AFx1CJi739IWZwJL1Y5KU2B+ZioT3ONMBLwLTdT/NTysV/+KYF7lZMgEHaGtLxvc6haIKKKzZisr > r2YDQVgs5w== URI="#OpenESignForms_Seal_ID"> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>jhVDd7nvr4s2bu7LRNHb7yj2gQRzAE7fXcsgonq2Qsn4EWNfpqNEVUViIy9jh86tTs5ZiakaGAEs > l9YV1hNnEg==izJCFA5lBOjc7zhlc/1Wrsu+/jd0o0aPtemm4hM7aMKJvzkKddhjaHRY9iX4qtMZJtl7L1qj4YGN > > hxHc2Wjuj6F1ZFD9asPf/kumVliAqTwNvhfyVfmpbaZtzQVtOQWhNIC1PivbPfbwT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fnRWtxxuH29q4BxFwr+cL7Jo8j+aCGY3YPbJnctndnqTvwmX0 > > FRXs8vljK7FCZmNU/TuUm+LqCUtSbbej5zdzgPuuAcviAwIDAQABMA4GA1UdDwEB/wQEAwIGwDAN > > BgkqhkiG9w0BAQ0FAAOCAgEAOu3Y4o7P4wel6zcwGIHfwuTuL/IX9qzYnxtPNkEHL8D8v3P4Tovk > > zDHOou4Ai5yycZninbaoK2WJr80p2HNfISY51fCJZ+Z16xmBlPmunnLI23cTAJGnZlI6WtsZLXQw > > LX91VkqKlRL73+MZECxO0m5I4hxNu8CeOIcQ7aCLvnkO8AEeCa9zAwmiL2tJ8coJvELvqS9Zaiaz > > syix8IWETtrZ+vv+85rASl5PSkCb0AX3eipJoqRgGazWraV7NBwDZgPEYXNQq1/jbQoirjJIzNQO > > KEgH3wViGFVwnW4YJ4dzbtVd6EVaHZGmYb666FpwNPz6OBLgX1sjvDTMTYGYo/VrIN02neYEvBtK > > GrZ5Gw7l7BOyKe92F3iQ3q90/kOBmGnEn8agkKlynv5IlJR8xOCxG1U9e8GFfmAwFS5hYtf0Gh/u > > FRqnOepWQKuZ3kBBR+6KttbE58aD2kVuB36et5Dij1nxr+ihL7e4V42KsQQn/VBDrMoU5xW+yZH/ > > aAEgpbfUm5detK5oFqs5JIILFiyUXQCrvYuNZFx4vDqrsDmmAaaAPBlcybCUXseqh4hThyrOJ0dX > > 3xaXcwd32t1+/aOa7jgJRTgSklxhhcRCMHI9HWNlLgUWmvZ2O5G70reY4Kyg1NAS56qX48Xbckvy > > VMfem/JPPYT/veThnefIgQk= xmlns:ns0="http://uri.etsi.org/01903/v1.1.1#" > ns0:Id="QualifyingProperties_ID" > xmlns="http://uri.etsi.org/01903/v1.1.1#">2019-02-13T11:02:30-08:00 ns0:ObjectReference="#Payload_Reference_ID">descriptiontext/html Id="OpenESignForms_Seal_ID" > Target="#OpenESignForms_Seal"> xmlns:ns0="http://open.esignforms.com/XMLSchema/2011" > ns0:DeploymentHostAddress="192.1.1.1" > xmlns:ns1="http://open.esignforms.com/XMLSchema/2011" > ns1:DeploymentHostName="open.esignforms.com" > xmlns:ns2="http://open.esignforms.com/XMLSchema/2011" > ns2:DeploymentId="1.1.1.1" > xmlns:ns3="http://open.esignforms.com/XMLSchema/2011" > ns3:SignerAddress="192.1.1.1" > xmlns:ns4="http://open.esignforms.com/XMLSchema/2011" > ns4:SignerAgent="No-Browser-Test" > xmlns:ns5="http://open.esignforms.com/XMLSchema/2011" > ns5:Timestamp="2019-02-13T11:02:30-08:00" > xmlns:ns6="http://open.esignforms.com/XMLSchema/2011" > ns6:Version="19.1.19"/>
> > while when run under Java 11 it shows what seems to be the same > (clearly, the digest/hashes aren't the same as the 'timestamp' differs > because they are actual times) except for lots of ' ' added to the > digests and signatures: > > timestamp="2019-02-13T11:01:22-08:00" type="document"> xmlns="http://www.w3.org/1999/xhtml">

Dummy HTML > document

]]> xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" > Id="OpenESignForms_Seal"> Algorithm="http://www.w3.org/2006/12/xml-c14n11#WithComments"/> Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"/> Id="Payload_Reference_ID" URI=""> Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>LdB/ydGxr3VUoTshQtOvQNmMZmt2OHgLax4tSk9Lqb1c+X1h4Uc/RBVXwfI9QrVnITBz85Fi8Bwr > > 7wyMjw84cA== URI="#KeyInfo_ID"> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>FkpexxTwhpCPHHsMrKGnBXE5hkZ/x10ArpzjX6ltYfOilvVAubzc9sNPwo6phw//ot1rSKPU5jTB > LRD7p7t50g== URI="#QualifyingProperties_ID"> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>LxB0xAsDxKqeyCflaSUgMQOMhoxP4Gl9GfvlpCiL/gd9rz36qG4roaFRl+4PBC+IxzGiRDOqzQYX > x6gSn5d1IQ== URI="#OpenESignForms_Seal_ID"> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>Pqd+9yaeBMytcG1sTTpuq+Wrd3lZSC18j7lv6VQ6LjUSz9VN7uwVNNn1E79mY8H6XUI2jbd/IozM > oba2KF46ig==IpdHZtzSw8TOnp0gfKMaCp30jJAPP8YCAIg4OBvRobIwHBFrG+O9v7peXRRA5nXi+fm4bdemi5jI > > /N2smS7W6lKMMeTzrYNJEmpD/0c/SVCs0M1peZmiWZD/F6GYP6RkhZfTglk9skKsZIme3W5lHL5e > > vTFno50J32oW0chq/jPzD42snoVQmVKS9wqqybGgRrm1W2RSWfziNo7QjXtJuR5eVuCtqpOLrGrS > > J0aLaaNLucia/6cJyZ13mz7131Lj2Y4oJbrbpzvrDY5xDfFDK+bRRMR3DCvTLgKcZZz5zxcAKYL8 > > lG64U/tsmd/ZVn+d+fJGH03hPdvY/wMW7MTN1k/6S95PiNdx0cLeP0HLCug9zWiC7vUkrVDrsO9i > > qsvSYKcAH8vQlG1arZgGJn88Hg8EGjmmWXs15ulU3Lm8TOTXl/xi6O4stSgMi9dFSsE1ISHAPaxN > > D3Rqg7Bv7p/iEVn0xXq/C9AI3iwrpHbip8K81uJOsaiZgwR5D40XyYLV9FUPIacRclfT5EJKsx6k > > jYiprWMOMjmnlJwj2vI8zG6sYLVJdQywm2isWu5eHSw39Wof0BYfDeOzh0LrifUcnt86no5fUEOI > > OlNbqOO7rjuxtb+gt1iO2dTHfQhG99BCBQhC7AEMp67fIlPjEOECXldDTpzPMZ1K6cPlk22rpvc= Id="KeyInfo_ID">184a40b0-78b6-4070-a7d7-1497078a06e4kPCr+Fy0NInaICpnzDpGLkNQ93kd0NzZfTBfQOb3PUH1Bt4OrBWcvYoch7wUm6k1Il3apsi7s2B9 > > Geqbh7tzF41MwvTWBNCQg3Kw3FKcF0jzKZ7D+na8Ndc52YPmsjU9zjpf+SDfKqb0NIDe3Bo3csWW > > I42CkF3sI9AFknogovrfRM7ITJatA6WRHU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5G70reY4Kyg1NAS56qX48Xbckvy > > VMfem/JPPYT/veThnefIgQk= xmlns:ns0="http://uri.etsi.org/01903/v1.1.1#" > ns0:Id="QualifyingProperties_ID" > xmlns="http://uri.etsi.org/01903/v1.1.1#">2019-02-13T11:01:22-08:00 ns0:ObjectReference="#Payload_Reference_ID">descriptiontext/html Id="OpenESignForms_Seal_ID" > Target="#OpenESignForms_Seal"> xmlns:ns0="http://open.esignforms.com/XMLSchema/2011" > ns0:DeploymentHostAddress="192.1.1.1" > xmlns:ns1="http://open.esignforms.com/XMLSchema/2011" > ns1:DeploymentHostName="open.esignforms.com" > xmlns:ns2="http://open.esignforms.com/XMLSchema/2011" > ns2:DeploymentId="1.1.1.1" > xmlns:ns3="http://open.esignforms.com/XMLSchema/2011" > ns3:SignerAddress="192.1.1.1" > xmlns:ns4="http://open.esignforms.com/XMLSchema/2011" > ns4:SignerAgent="No-Browser-Test" > xmlns:ns5="http://open.esignforms.com/XMLSchema/2011" > ns5:Timestamp="2019-02-13T11:01:22-08:00" > xmlns:ns6="http://open.esignforms.com/XMLSchema/2011" > ns6:Version="19.1.19"/>
> > > It's particularly odd because hex 13 isn't a typical character (^S). > > Any idea what that difference is about for the base64 digests and > signatures? > > David > > > On 2/13/19 6:03 AM, Sean Mullan wrote: >> On 2/12/19 6:28 PM, Open eSignForms wrote: >>> Thanks for the update, Sean.? I'm a bit perplexed because I found >>> the original code works under Java 9 and Java 10, so it seems like >>> the change occurred in Java 11. >> >> Sorry, that was a typo, I meant to say JDK 11. >> >>> I don't see the modified version of the test case.? If you attached >>> it, it somehow didn't make it through to me. >>> >>> If it's just a matter of making the code more correct, we'd love to >>> make the changes.? My concern, of course, is that we've already done >>> millions of XML digital signatures, so we need that to continue to >>> verify correctly (and even under Java 11, it seems that the verify >>> code works against previously digitally signed content) even if we >>> now start digitally signing using more update-to-date code. >> >> The verification of pre-existing signatures should continue to work >> regardless of how this bug is addressed. >> >>> Please send over the modified test case and I'll take a look. >> >> It is attached to the bug report in the Attachments section: >> https://bugs.openjdk.java.net/browse/JDK-8218629 (make sure you >> download the one I added yesterday). >> >> --Sean >> >>> >>> Thanks! >>> David >>> >>> On 2/12/19 2:14 PM, Sean Mullan wrote: >>>> The bug is now at https://bugs.openjdk.java.net/browse/JDK-8218629 >>>> >>>> I have started looking at this issue and have some progress I can >>>> report. >>>> >>>> In JDK 9, we updated the version of the Apache XML Signature >>>> implementation in the JDK. Some of the marshalling code was >>>> rewritten such that it will throw Exceptions if legacy DOM level 1 >>>> methods were used to create XML content which is then passed into >>>> XMLObject and similar XMLSignature types that take DOMStructure >>>> objects. This is because the DOM level 1 methods do not support >>>> namespaces. >>>> >>>> I am still evaluating what the best fix is. However, you can >>>> workaround the issue by always using DOM level 3 methods which are >>>> namespace aware. For example, use Document.createElementNS instead >>>> of Document.createElement and Element.createAttributeNS instead of >>>> Element.createAttribute. >>>> >>>> Using legacy or non-namespace aware XML parsers or implementations >>>> is not recommended and the XML Signature Best Practices document >>>> gives some rationale: >>>> https://www.w3.org/TR/xmldsig-bestpractices/#signing-xml-without-namespaces >>>> >>>> That said, this is a regression in behavior so it would be best if >>>> we could restore the previous behavior. >>>> >>>> I have attached a modified version of the test case to the bug >>>> report which no longer throws an Exception. Let me know if this is >>>> an acceptable workaround. Double-check the namespaces that I used >>>> to make sure they are correct. >>>> >>>> --Sean >>>> >>>> >>>> On 2/7/19 11:23 AM, Open eSignForms wrote: >>>> >>>>> On 2/7/19 7:49 AM, Sean Mullan wrote: >>>>>> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xuelei.fan at oracle.com Wed Feb 13 21:44:31 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Wed, 13 Feb 2019 13:44:31 -0800 Subject: Not possible to disable new TLS extensions for TLS 1.2 connections In-Reply-To: References: <3dfb3505-dd0e-3b91-17a0-c6165d7a1069@oracle.com> Message-ID: <283c595b-5ff5-66d7-46fb-f3a60817a508@oracle.com> Hi Amir, Could you build OpenJDK by yourself? If it is doable, I could send your a patch to disable the extension so that you can confirm if and which extension is the underlying problem. Thanks, Xuelei On 2/13/2019 1:16 PM, Amir Khassaia wrote: > Hi Xuelei, > There were 2 distinct cases of change of behaviour. > > * The "CN=invalid2.invalid, OU="No SNI provided" reliably works > without SNI in Java 8 but is indeed fixed by having an SNI included > which perhaps was needed all along. This one is reported by XMPP/TLS > connection from talk.google.com:5222 > * The aborted handshake case (client_hello traces that I've provided) > this happened with a hardware device which was replicable with an > SSL socket handshake program that I referenced in the gist. > Unfortunately replication requires a specific device model so it > wont be possible to see it for yourself. The workaround there was to > either downgrade JRE to < 11 or to switch JRE globally to use TLS > 1.0 or TLS 1.1 via the system property. This is where your proposed > enhancement will be of great help as it will allow a per connection > type decision. > > > On Wed, Feb 13, 2019 at 3:01 PM Xuelei Fan > wrote: > > Hi Amir, > > It should be rare now the a TLS vendor cannot ignore unknown extensions. > > ?> "issuer": "CN=invalid2.invalid, OU="No SNI provided; > ?> please fix your client."", > The error message encapsulated in the certificate does not sound right > to me.? Is it caused by the absence of SNI extension? > > Did you have a test case that I can reproduce the problem? > > Thanks & Regards, > Xuelei > > > On 1/7/2019 9:27 PM, Amir Khassaia wrote: > > 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-0813:40:14.395 > AEDT|SSLCipher.java:437|jdk.tls.keyLimits: ? entry = > AES/GCM/NoPadding KeyUpdate2^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_md5] > > > >? ? ? }, > > > > "signature_algorithms_cert (50)": { > > > > "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_md5] > > > >? ? ? }, > > > > "extended_master_secret (23)": { > > > >? ? ? ? > > > >? ? ? }, > > > > "supported_versions (43)": { > > > > "versions": [TLSv1.2, TLSv1.1] > > > >? ? ? }, > > > > "renegotiation_info (65,281)": { > > > > "renegotiated connection": [] > > > >? ? ? } > > > >? ? ] > > > > } > > > > ) > > > > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.455 > > AEDT|Alert.java:232|Received alert message ( > > > > "Alert": { > > > > "level"? ? ? : "fatal", > > > > "description": "handshake_failure" > > > > } > > > > ) > > > > javax.net.ssl|ERROR|01|main|2019-01-08 13:40:14.456 > > AEDT|TransportContext.java:313|Fatal (HANDSHAKE_FAILURE): > Received fatal > > alert: handshake_failure ( > > > > "throwable" : { > > > >? ? javax.net.ssl.SSLHandshakeException: Received fatal alert: > > handshake_failure > > > >? ? ? at > java.base/sun.security.ssl.Alert.createSSLException(Alert.java:128) > > > >? ? ? at > java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117) > > > >? ? ? at > > > java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:308) > > > >? ? ? at > > > java.base/sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:279) > > > >? ? ? at > > > java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:181) > > > >? ? ? at > > java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164) > > > >? ? ? at > > > java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1152) > > > >? ? ? at > > > java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063) > > > >? ? ? at > > > java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402) > > > >? ? ? at SslSocketClient.main(SslSocketClient.kt:47)} > > > > > > ) > > > > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.457 > > AEDT|SSLSocketImpl.java:1361|close the underlying socket > > > > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.457 > > AEDT|SSLSocketImpl.java:1380|close the SSL connection (initiative) > > > > Exception in thread "main" javax.net.ssl.SSLHandshakeException: > Received > > fatal alert: handshake_failure > > > >? ? at > java.base/sun.security.ssl.Alert.createSSLException(Alert.java:128) > > > >? ? at > java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117) > > > >? ? at > > > java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:308) > > > >? ? at > java.base/sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:279) > > > >? ? at > > > java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:181) > > > >? ? at > java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164) > > > >? ? at > > > java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1152) > > > >? ? at > > > java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063) > > > >? ? at > > > java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402) > > > >? ? at SslSocketClient.main(SslSocketClient.kt:47) > > > > > > > > > From xuelei.fan at oracle.com Wed Feb 13 21:51:05 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Wed, 13 Feb 2019 13:51:05 -0800 Subject: CSR Review Request, JDK-8218932 Remove the internal package com.sun.net.ssl Message-ID: <6071db41-91d6-6f55-ddeb-658c93a37280@oracle.com> Hi, Could I get the CSR reviewed: https://bugs.openjdk.java.net/browse/JDK-8218932 The internal package com.sun.net.ssl had been deprecated since JDK 1.4, and was not exported in the java.base module since JDK 9. Application cannot use them directly now. It should be safe to remove them in JDK 13. If you are using the internal package for some reason, please let me know the compatibility impact by the end of Feb 20, 2019. Thanks, Xuelei From amir.khassaia at gmail.com Wed Feb 13 21:57:20 2019 From: amir.khassaia at gmail.com (Amir Khassaia) Date: Thu, 14 Feb 2019 08:57:20 +1100 Subject: Not possible to disable new TLS extensions for TLS 1.2 connections In-Reply-To: <283c595b-5ff5-66d7-46fb-f3a60817a508@oracle.com> References: <3dfb3505-dd0e-3b91-17a0-c6165d7a1069@oracle.com> <283c595b-5ff5-66d7-46fb-f3a60817a508@oracle.com> Message-ID: Unfortunately I no longer have the device that replicates the problem :( and other similar ones never showed in the first place. Traditionally I would make TLS handshakes stay identical across JDK versions to ensure compatibility as working with various devices and vendors would show up a multitude of ways a handshake would fail, including ones where handshake succeeds but application data encryption fails later etc. In each of these JDK tuning would be able to make the handshake "compatible" with a given device. In this case it could be made almost identical with the exception of the extensions listed. I can send you wireshark PCAPs if needed from the session with the device but they will really just show the same information as already listed. On Thu, Feb 14, 2019 at 8:44 AM Xuelei Fan wrote: > Hi Amir, > > Could you build OpenJDK by yourself? If it is doable, I could send your > a patch to disable the extension so that you can confirm if and which > extension is the underlying problem. > > Thanks, > Xuelei > > > On 2/13/2019 1:16 PM, Amir Khassaia wrote: > > Hi Xuelei, > > There were 2 distinct cases of change of behaviour. > > > > * The "CN=invalid2.invalid, OU="No SNI provided" reliably works > > without SNI in Java 8 but is indeed fixed by having an SNI included > > which perhaps was needed all along. This one is reported by XMPP/TLS > > connection from talk.google.com:5222 > > * The aborted handshake case (client_hello traces that I've provided) > > this happened with a hardware device which was replicable with an > > SSL socket handshake program that I referenced in the gist. > > Unfortunately replication requires a specific device model so it > > wont be possible to see it for yourself. The workaround there was to > > either downgrade JRE to < 11 or to switch JRE globally to use TLS > > 1.0 or TLS 1.1 via the system property. This is where your proposed > > enhancement will be of great help as it will allow a per connection > > type decision. > > > > > > On Wed, Feb 13, 2019 at 3:01 PM Xuelei Fan > > wrote: > > > > Hi Amir, > > > > It should be rare now the a TLS vendor cannot ignore unknown > extensions. > > > > > "issuer": "CN=invalid2.invalid, OU="No SNI provided; > > > please fix your client."", > > The error message encapsulated in the certificate does not sound > right > > to me. Is it caused by the absence of SNI extension? > > > > Did you have a test case that I can reproduce the problem? > > > > Thanks & Regards, > > Xuelei > > > > > > On 1/7/2019 9:27 PM, Amir Khassaia wrote: > > > 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-0813:40:14.395 > > AEDT|SSLCipher.java:437|jdk.tls.keyLimits: entry = > > AES/GCM/NoPadding KeyUpdate2^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_md5] > > > > > > }, > > > > > > "signature_algorithms_cert (50)": { > > > > > > "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_md5] > > > > > > }, > > > > > > "extended_master_secret (23)": { > > > > > > > > > > > > }, > > > > > > "supported_versions (43)": { > > > > > > "versions": [TLSv1.2, TLSv1.1] > > > > > > }, > > > > > > "renegotiation_info (65,281)": { > > > > > > "renegotiated connection": [] > > > > > > } > > > > > > ] > > > > > > } > > > > > > ) > > > > > > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.455 > > > AEDT|Alert.java:232|Received alert message ( > > > > > > "Alert": { > > > > > > "level" : "fatal", > > > > > > "description": "handshake_failure" > > > > > > } > > > > > > ) > > > > > > javax.net.ssl|ERROR|01|main|2019-01-08 13:40:14.456 > > > AEDT|TransportContext.java:313|Fatal (HANDSHAKE_FAILURE): > > Received fatal > > > alert: handshake_failure ( > > > > > > "throwable" : { > > > > > > javax.net.ssl.SSLHandshakeException: Received fatal alert: > > > handshake_failure > > > > > > at > > java.base/sun.security.ssl.Alert.createSSLException(Alert.java:128) > > > > > > at > > java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117) > > > > > > at > > > > > > java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:308) > > > > > > at > > > > > > java.base/sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:279) > > > > > > at > > > > > > java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:181) > > > > > > at > > > > java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164) > > > > > > at > > > > > > java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1152) > > > > > > at > > > > > > java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063) > > > > > > at > > > > > > java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402) > > > > > > at SslSocketClient.main(SslSocketClient.kt:47)} > > > > > > > > > ) > > > > > > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.457 > > > AEDT|SSLSocketImpl.java:1361|close the underlying socket > > > > > > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.457 > > > AEDT|SSLSocketImpl.java:1380|close the SSL connection (initiative) > > > > > > Exception in thread "main" javax.net.ssl.SSLHandshakeException: > > Received > > > fatal alert: handshake_failure > > > > > > at > > java.base/sun.security.ssl.Alert.createSSLException(Alert.java:128) > > > > > > at > > java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117) > > > > > > at > > > > > > java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:308) > > > > > > at > > > java.base/sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:279) > > > > > > at > > > > > > java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:181) > > > > > > at > > java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164) > > > > > > at > > > > > > java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1152) > > > > > > at > > > > > > java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063) > > > > > > at > > > > > > java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402) > > > > > > at SslSocketClient.main(SslSocketClient.kt:47) > > > > > > > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From openjdk at suche.org Wed Feb 13 22:04:37 2019 From: openjdk at suche.org (=?UTF-8?Q?Thomas_Lu=c3=9fnig?=) Date: Wed, 13 Feb 2019 23:04:37 +0100 Subject: Not possible to disable new TLS extensions for TLS 1.2 connections In-Reply-To: <283c595b-5ff5-66d7-46fb-f3a60817a508@oracle.com> References: <3dfb3505-dd0e-3b91-17a0-c6165d7a1069@oracle.com> <283c595b-5ff5-66d7-46fb-f3a60817a508@oracle.com> Message-ID: <1d76a7a3-103a-c7c0-8834-3b7e953c7291@suche.org> Hi, maybe two points. 1) Older lotus notes server have the problem. 2) The problem can be solved if you disable TLSv1.3 or even TLSv1.2 3) Maybe it would be an good idea to build an set of client hello's with different options. ???? Or even an generator. Than you send if and check the result since the servers with problem ???? only reply with an ssl alert. So you can check it without an ssl engine or jdk build Gru? Thomas Am 13.02.2019 um 22:44:31 schrieb Xuelei Fan: > Hi Amir, > > Could you build OpenJDK by yourself?? If it is doable, I could send > your a patch to disable the extension so that you can confirm if and > which extension is the underlying problem. > > Thanks, > Xuelei > > > On 2/13/2019 1:16 PM, Amir Khassaia wrote: >> Hi Xuelei, >> There were 2 distinct cases of change of behaviour. >> >> ? * The "CN=invalid2.invalid, OU="No SNI provided" reliably works >> ??? without SNI in Java 8 but is indeed fixed by having an SNI included >> ??? which perhaps was needed all along. This one is reported by XMPP/TLS >> ??? connection from talk.google.com:5222 >> ? * The aborted handshake case (client_hello traces that I've provided) >> ??? this happened with a hardware device which was replicable with an >> ??? SSL socket handshake program that I referenced in the gist. >> ??? Unfortunately replication requires a specific device model so it >> ??? wont be possible to see it for yourself. The workaround there was to >> ??? either downgrade JRE to < 11 or to switch JRE globally to use TLS >> ??? 1.0 or TLS 1.1 via the system property. This is where your proposed >> ??? enhancement will be of great help as it will allow a per connection >> ??? type decision. >> >> >> On Wed, Feb 13, 2019 at 3:01 PM Xuelei Fan > > wrote: >> >> ??? Hi Amir, >> >> ??? It should be rare now the a TLS vendor cannot ignore unknown >> extensions. >> >> ???? ?> "issuer": "CN=invalid2.invalid, OU="No SNI provided; >> ???? ?> please fix your client."", >> ??? The error message encapsulated in the certificate does not sound >> right >> ??? to me.? Is it caused by the absence of SNI extension? >> >> ??? Did you have a test case that I can reproduce the problem? >> >> ??? Thanks & Regards, >> ??? Xuelei >> >> >> ??? On 1/7/2019 9:27 PM, Amir Khassaia wrote: >> ???? > 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-0813:40:14.395 >> AEDT|SSLCipher.java:437|jdk.tls.keyLimits: ? entry = >> ??? AES/GCM/NoPadding KeyUpdate2^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_md5] >> ???? > >> ???? >? ? ? }, >> ???? > >> ???? > "signature_algorithms_cert (50)": { >> ???? > >> ???? > "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_md5] >> ???? > >> ???? >? ? ? }, >> ???? > >> ???? > "extended_master_secret (23)": { >> ???? > >> ???? >? ? ? ? >> ???? > >> ???? >? ? ? }, >> ???? > >> ???? > "supported_versions (43)": { >> ???? > >> ???? > "versions": [TLSv1.2, TLSv1.1] >> ???? > >> ???? >? ? ? }, >> ???? > >> ???? > "renegotiation_info (65,281)": { >> ???? > >> ???? > "renegotiated connection": [] >> ???? > >> ???? >? ? ? } >> ???? > >> ???? >? ? ] >> ???? > >> ???? > } >> ???? > >> ???? > ) >> ???? > >> ???? > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.455 >> ???? > AEDT|Alert.java:232|Received alert message ( >> ???? > >> ???? > "Alert": { >> ???? > >> ???? > "level"? ? ? : "fatal", >> ???? > >> ???? > "description": "handshake_failure" >> ???? > >> ???? > } >> ???? > >> ???? > ) >> ???? > >> ???? > javax.net.ssl|ERROR|01|main|2019-01-08 13:40:14.456 >> ???? > AEDT|TransportContext.java:313|Fatal (HANDSHAKE_FAILURE): >> ??? Received fatal >> ???? > alert: handshake_failure ( >> ???? > >> ???? > "throwable" : { >> ???? > >> ???? >? ? javax.net.ssl.SSLHandshakeException: Received fatal alert: >> ???? > handshake_failure >> ???? > >> ???? >? ? ? at >> java.base/sun.security.ssl.Alert.createSSLException(Alert.java:128) >> ???? > >> ???? >? ? ? at >> java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117) >> ???? > >> ???? >? ? ? at >> ???? > >> java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:308) >> ???? > >> ???? >? ? ? at >> ???? > >> java.base/sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:279) >> ???? > >> ???? >? ? ? at >> ???? > >> java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:181) >> ???? > >> ???? >? ? ? at >> ???? > >> java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164) >> ???? > >> ???? >? ? ? at >> ???? > >> java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1152) >> ???? > >> ???? >? ? ? at >> ???? > >> java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063) >> ???? > >> ???? >? ? ? at >> ???? > >> java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402) >> ???? > >> ???? >? ? ? at SslSocketClient.main(SslSocketClient.kt:47)} >> ???? > >> ???? > >> ???? > ) >> ???? > >> ???? > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.457 >> ???? > AEDT|SSLSocketImpl.java:1361|close the underlying socket >> ???? > >> ???? > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.457 >> ???? > AEDT|SSLSocketImpl.java:1380|close the SSL connection >> (initiative) >> ???? > >> ???? > Exception in thread "main" javax.net.ssl.SSLHandshakeException: >> ??? Received >> ???? > fatal alert: handshake_failure >> ???? > >> ???? >? ? at >> java.base/sun.security.ssl.Alert.createSSLException(Alert.java:128) >> ???? > >> ???? >? ? at >> java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117) >> ???? > >> ???? >? ? at >> ???? > >> java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:308) >> ???? > >> ???? >? ? at >> java.base/sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:279) >> ???? > >> ???? >? ? at >> ???? > >> java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:181) >> ???? > >> ???? >? ? at >> java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164) >> ???? > >> ???? >? ? at >> ???? > >> java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1152) >> ???? > >> ???? >? ? at >> ???? > >> java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063) >> ???? > >> ???? >? ? at >> ???? > >> java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402) >> ???? > >> ???? >? ? at SslSocketClient.main(SslSocketClient.kt:47) >> ???? > >> ???? > >> ???? > >> ???? > >> From lance.andersen at oracle.com Wed Feb 13 22:05:09 2019 From: lance.andersen at oracle.com (Lance Andersen) Date: Wed, 13 Feb 2019 17:05:09 -0500 Subject: RFR 8213031: (zipfs) Add support for POSIX file permissions In-Reply-To: <3aeba9a64a434a968fc1d82a44077745@sap.com> References: <7b513a34196141f595cd5d194fb9d8a2@sap.com> <46af4f9d-60f9-c60d-e6f1-8fb97df3ba2e@oracle.com> <5d28b0715d2041ff892a3c44e024f120@sap.com> <8e9231ff-b7d5-bc2f-2643-713f3c670a1d@oracle.com> <3aeba9a64a434a968fc1d82a44077745@sap.com> Message-ID: Hi Christoph, Just starting to take a peek at this and noticed one quick thing in your test: ------------ Paths.get(System.getProperty("test.dir", "."), "testPosix.zip") ?????? You do not need the test.dir property or the permission added to test.policy to access it, just reference the jar and it will be created in user.dir which is also writable. Best Lance > On Feb 12, 2019, at 4:57 PM, Langer, Christoph wrote: > > Hi Alan, all, > > here comes the next proposal for POSIX support in jdk.zipfs - which hopefully represents the converged solution, at least in its overall design. > > http://cr.openjdk.java.net/~clanger/webrevs/8213031.6/ > > With that patch, the behavior is the following: > a) A ZipFileSystem instance by default does NOT support the PosixFileAttributeView. However, it is possible to query for a known attribute named "zip:storedPermissions". Its value can be null to represent no permission information or any set of PosixFileAttribute. > b) A ZipFileSystem instance can be created with the property "posix"=true. In that case, PosixFileAttributeView is supported with default values. > -> owner: A UserPrincipal with the name of System.getProperty("user.name") if property access is allowed, "" otherwise > -> group: A GroupPrincipal with the name "". > -> permissions: Set.of(OWNER_READ, OWNER_WRITE, GROUP_READ) > > The default values can be modified by using the properties "defaultOwner", "defaultGroup" and "defaultPermissions". > > Implementation wise the ZipFileAttributeView always extends PosixFileAttributeView but behaves different, depending on how it was obtained. > > Within ZipFileSystem, the Entry inner class is not static any more but always has a reference to the Enclosing ZipFileSystem. That's needed because default owner/group/permission can be set on ZipFileSystem instance level now and the Entry, implementing the FileAttributes needs to know where it belongs to. This seems somewhat logical anyway. > > The new test "TestPosix" is quite extensive. I had to add 2 permissions to test.policy to allow testing in a restricted environment. > > Module-info and CSR have been adopted, too. > > Thanks in advance for reviewing. > > Best regards > Christoph > >> -----Original Message----- >> From: Langer, Christoph >> Sent: Montag, 21. Januar 2019 10:17 >> To: 'Alan Bateman' >> Cc: nio-dev ; OpenJDK Dev list > dev at openjdk.java.net>; Java Core Libs ; >> Volker Simonis >> Subject: RE: RFR 8213031: (zipfs) Add support for POSIX file permissions >> >> Hi Alan, >> >> first of all, thank you for your input on this. >> >>> I think the approach to explore are: >>> >>> 1. zipfs supports PosixFileAttributeView without subsetting. If >>> readAttribute(file, BasicFileAttributes.class) succeeds then >>> readAttribute(file, PosixFileAttributes.class) should also succeed, even >>> if there aren't permissions encoded in the zip entry's external file >>> attributes. It would mean that owner and group return default values, >>> and permissions may return a default value. It does mean you can't >>> distinguish the default value from "no permissions" but there is >>> precedence for that, e.g. mount a FAT32 file system on Linux or Unix >>> systems and `stat` a file to have the stat structure populated with >>> default uid, gid and mode bits. >> >> OK, I can see the point that in a PosixFileAttributeView as it is, there's no >> place for optionality/null values. However, with this approach the benefits >> would be that Files::get/setPosixPermissions would work and that's why I >> think we should pursue this. The challenge will be to find reasonable >> defaults. >> >>> 2. zipfs defines a new FileAttributeView that defines read and write >>> access to permissions stored in a zip entry's external file attribute. >>> As it's a new view then it can define the behavior for the case that the >>> zip entry doesn't have permissions. Furthermore it does not need to >>> extend BasicFileAttributeView so doesn't need to be concerned with bulk >>> access, nor concerned with group/owner. As you know, the attributes API >>> allows for both type safe and dynamic access so you have a choice as to >>> whether to support both or just dynamic access. With the first then >>> jdk.zipfs would export a package with a public interface that defines >>> the view. If someone wants type safe access to the permissions attribute >>> then you need to import the class. The alternative is to not export any >>> packages but just define the view in the module-info. The view its name >>> and define the name/type of the permissions attribute, it will also >>> define how it behaves when the external attributes aren't populated. In >>> usage terms it means reading the permissions will be something like >>> Files.readAttribute(file, "zip:permissions") and casting the value to >>> Set - not pretty but it avoids depending on a >>> JDK-specific API. >> >> For this approach, there are 2 things I dislike. The first is that I don't think we >> should export named packages from module jdk.zipfs that people would >> develop Java code against while not being in the Java API. And secondly, this >> way would not support using Files::set/getPosixPermissions since the >> specification/implementation of that utility method explicitly refers to >> PosixFileAttributeView. >> >> I can imagine something like this: >> Zipfs by default implements an own view that offers dynamic, not type safe >> access to "zip:permissions" and we'll document this. If a user of zipfs wants >> to see full PosixFileAttributeView support with default values, then we >> should allow for a creation attribute for the zipfs that can control this. Maybe >> we can even allow specifying default values for user, group and permissions >> via zipfs attributes. >> >> I'll work to develop the patch into this direction unless you tell me that this >> idea is bogus (if so, then I hope it be soon ??) >> >> Thanks >> Christoph >> >> > Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: oracle_sig_logo.gif Type: image/gif Size: 658 bytes Desc: not available URL: From amir.khassaia at gmail.com Wed Feb 13 22:08:22 2019 From: amir.khassaia at gmail.com (Amir Khassaia) Date: Thu, 14 Feb 2019 09:08:22 +1100 Subject: Not possible to disable new TLS extensions for TLS 1.2 connections In-Reply-To: <1d76a7a3-103a-c7c0-8834-3b7e953c7291@suche.org> References: <3dfb3505-dd0e-3b91-17a0-c6165d7a1069@oracle.com> <283c595b-5ff5-66d7-46fb-f3a60817a508@oracle.com> <1d76a7a3-103a-c7c0-8834-3b7e953c7291@suche.org> Message-ID: Hi Thomas, Can you confirm its tied to new extensions to TLS 1.2 client hello and whether you diagnosed which one was the problem in Lotus Notes case ? On Thu, Feb 14, 2019 at 9:05 AM Thomas Lu?nig wrote: > Hi, > > maybe two points. > > 1) Older lotus notes server have the problem. > 2) The problem can be solved if you disable TLSv1.3 or even TLSv1.2 > 3) Maybe it would be an good idea to build an set of client hello's with > different options. > Or even an generator. Than you send if and check the result since > the servers with problem > only reply with an ssl alert. So you can check it without an ssl > engine or jdk build > > > Gru? Thomas > > Am 13.02.2019 um 22:44:31 schrieb Xuelei Fan: > > Hi Amir, > > > > Could you build OpenJDK by yourself? If it is doable, I could send > > your a patch to disable the extension so that you can confirm if and > > which extension is the underlying problem. > > > > Thanks, > > Xuelei > > > > > > On 2/13/2019 1:16 PM, Amir Khassaia wrote: > >> Hi Xuelei, > >> There were 2 distinct cases of change of behaviour. > >> > >> * The "CN=invalid2.invalid, OU="No SNI provided" reliably works > >> without SNI in Java 8 but is indeed fixed by having an SNI included > >> which perhaps was needed all along. This one is reported by XMPP/TLS > >> connection from talk.google.com:5222 > >> * The aborted handshake case (client_hello traces that I've provided) > >> this happened with a hardware device which was replicable with an > >> SSL socket handshake program that I referenced in the gist. > >> Unfortunately replication requires a specific device model so it > >> wont be possible to see it for yourself. The workaround there was to > >> either downgrade JRE to < 11 or to switch JRE globally to use TLS > >> 1.0 or TLS 1.1 via the system property. This is where your proposed > >> enhancement will be of great help as it will allow a per connection > >> type decision. > >> > >> > >> On Wed, Feb 13, 2019 at 3:01 PM Xuelei Fan >> > wrote: > >> > >> Hi Amir, > >> > >> It should be rare now the a TLS vendor cannot ignore unknown > >> extensions. > >> > >> > "issuer": "CN=invalid2.invalid, OU="No SNI provided; > >> > please fix your client."", > >> The error message encapsulated in the certificate does not sound > >> right > >> to me. Is it caused by the absence of SNI extension? > >> > >> Did you have a test case that I can reproduce the problem? > >> > >> Thanks & Regards, > >> Xuelei > >> > >> > >> On 1/7/2019 9:27 PM, Amir Khassaia wrote: > >> > 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-0813:40:14.395 > >> AEDT|SSLCipher.java:437|jdk.tls.keyLimits: entry = > >> AES/GCM/NoPadding KeyUpdate2^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_md5] > >> > > >> > }, > >> > > >> > "signature_algorithms_cert (50)": { > >> > > >> > "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_md5] > >> > > >> > }, > >> > > >> > "extended_master_secret (23)": { > >> > > >> > > >> > > >> > }, > >> > > >> > "supported_versions (43)": { > >> > > >> > "versions": [TLSv1.2, TLSv1.1] > >> > > >> > }, > >> > > >> > "renegotiation_info (65,281)": { > >> > > >> > "renegotiated connection": [] > >> > > >> > } > >> > > >> > ] > >> > > >> > } > >> > > >> > ) > >> > > >> > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.455 > >> > AEDT|Alert.java:232|Received alert message ( > >> > > >> > "Alert": { > >> > > >> > "level" : "fatal", > >> > > >> > "description": "handshake_failure" > >> > > >> > } > >> > > >> > ) > >> > > >> > javax.net.ssl|ERROR|01|main|2019-01-08 13:40:14.456 > >> > AEDT|TransportContext.java:313|Fatal (HANDSHAKE_FAILURE): > >> Received fatal > >> > alert: handshake_failure ( > >> > > >> > "throwable" : { > >> > > >> > javax.net.ssl.SSLHandshakeException: Received fatal alert: > >> > handshake_failure > >> > > >> > at > >> java.base/sun.security.ssl.Alert.createSSLException(Alert.java:128) > >> > > >> > at > >> java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117) > >> > > >> > at > >> > > >> > java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:308) > >> > > >> > at > >> > > >> java.base/sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:279) > >> > > >> > at > >> > > >> > java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:181) > >> > > >> > at > >> > > >> java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164) > >> > > >> > at > >> > > >> java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1152) > >> > > >> > at > >> > > >> > java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063) > >> > > >> > at > >> > > >> > java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402) > >> > > >> > at SslSocketClient.main(SslSocketClient.kt:47)} > >> > > >> > > >> > ) > >> > > >> > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.457 > >> > AEDT|SSLSocketImpl.java:1361|close the underlying socket > >> > > >> > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.457 > >> > AEDT|SSLSocketImpl.java:1380|close the SSL connection > >> (initiative) > >> > > >> > Exception in thread "main" javax.net.ssl.SSLHandshakeException: > >> Received > >> > fatal alert: handshake_failure > >> > > >> > at > >> java.base/sun.security.ssl.Alert.createSSLException(Alert.java:128) > >> > > >> > at > >> java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117) > >> > > >> > at > >> > > >> > java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:308) > >> > > >> > at > >> java.base/sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:279) > >> > > >> > at > >> > > >> > java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:181) > >> > > >> > at > >> java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164) > >> > > >> > at > >> > > >> java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1152) > >> > > >> > at > >> > > >> > java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063) > >> > > >> > at > >> > > >> > java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402) > >> > > >> > at SslSocketClient.main(SslSocketClient.kt:47) > >> > > >> > > >> > > >> > > >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From openjdk at suche.org Wed Feb 13 22:22:27 2019 From: openjdk at suche.org (=?UTF-8?Q?Thomas_Lu=c3=9fnig?=) Date: Wed, 13 Feb 2019 23:22:27 +0100 Subject: Not possible to disable new TLS extensions for TLS 1.2 connections In-Reply-To: References: <3dfb3505-dd0e-3b91-17a0-c6165d7a1069@oracle.com> <283c595b-5ff5-66d7-46fb-f3a60817a508@oracle.com> <1d76a7a3-103a-c7c0-8834-3b7e953c7291@suche.org> Message-ID: Hi, i check the old mails. In your case the problem was about the EC-Group extensions. If the server receive an unknown group he break the handshake with an alert. What was interesting is the fact it did not break after client hello but after Client-RSA-Key with alert illgegalParameter. I managed to establish the connection by disable all cipher suites using ec (only for this destination) not an good but an working solution. Maybe you can provide an ssl debug log or pcap so that is is possible to see if the same type of error happen. Gru? Thomas Sequence was: Client-Hello (SSLv3 - TLSv1.2) Server-Hello(SSLv3) Server-Certificates(SSLv3) Client-RSA-Key(TLSv1.2) Server-Alert(SSLv3 , FATAL , IllegalParameter) p.s. for the Problem with exception about unsupported group in jdk10 (fixed in 11) i found an workaround by only offering RSA and no EC suites ?to the server that send 65535 as EC group that was causing the trouble. Am 13.02.2019 um 23:08:22 schrieb Amir Khassaia: > Hi Thomas, > Can you confirm its tied to new extensions to TLS 1.2 client hello and > whether you diagnosed which one was the problem in Lotus Notes case ? > > On Thu, Feb 14, 2019 at 9:05 AM Thomas Lu?nig > wrote: > > Hi, > > maybe two points. > > 1) Older lotus notes server have the problem. > 2) The problem can be solved if you disable TLSv1.3 or even TLSv1.2 > 3) Maybe it would be an good idea to build an set of client > hello's with > different options. > ????? Or even an generator. Than you send if and check the result > since > the servers with problem > ????? only reply with an ssl alert. So you can check it without an > ssl > engine or jdk build > > > Gru? Thomas > > Am 13.02.2019 um 22:44:31 schrieb Xuelei Fan: > > Hi Amir, > > > > Could you build OpenJDK by yourself?? If it is doable, I could send > > your a patch to disable the extension so that you can confirm if > and > > which extension is the underlying problem. > > > > Thanks, > > Xuelei > > > > > > On 2/13/2019 1:16 PM, Amir Khassaia wrote: > >> Hi Xuelei, > >> There were 2 distinct cases of change of behaviour. > >> > >> ? * The "CN=invalid2.invalid, OU="No SNI provided" reliably works > >> ??? without SNI in Java 8 but is indeed fixed by having an SNI > included > >> ??? which perhaps was needed all along. This one is reported by > XMPP/TLS > >> ??? connection from talk.google.com:5222 > > >> ? * The aborted handshake case (client_hello traces that I've > provided) > >> ??? this happened with a hardware device which was replicable > with an > >> ??? SSL socket handshake program that I referenced in the gist. > >> ??? Unfortunately replication requires a specific device model > so it > >> ??? wont be possible to see it for yourself. The workaround > there was to > >> ??? either downgrade JRE to < 11 or to switch JRE globally to > use TLS > >> ??? 1.0 or TLS 1.1 via the system property. This is where your > proposed > >> ??? enhancement will be of great help as it will allow a per > connection > >> ??? type decision. > >> > >> > >> On Wed, Feb 13, 2019 at 3:01 PM Xuelei Fan > > >> >> > wrote: > >> > >> ??? Hi Amir, > >> > >> ??? It should be rare now the a TLS vendor cannot ignore unknown > >> extensions. > >> > >> ???? ?> "issuer": "CN=invalid2.invalid, OU="No SNI provided; > >> ???? ?> please fix your client."", > >> ??? The error message encapsulated in the certificate does not > sound > >> right > >> ??? to me.? Is it caused by the absence of SNI extension? > >> > >> ??? Did you have a test case that I can reproduce the problem? > >> > >> ??? Thanks & Regards, > >> ??? Xuelei > >> > >> > >> ??? On 1/7/2019 9:27 PM, Amir Khassaia wrote: > >> ???? > 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-0813:40:14.395 > >> AEDT|SSLCipher.java:437|jdk.tls.keyLimits: ? entry = > >> ??? AES/GCM/NoPadding KeyUpdate2^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_md5] > >> ???? > > >> ???? >? ? ? }, > >> ???? > > >> ???? > "signature_algorithms_cert (50)": { > >> ???? > > >> ???? > "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_md5] > >> ???? > > >> ???? >? ? ? }, > >> ???? > > >> ???? > "extended_master_secret (23)": { > >> ???? > > >> ???? >? ? ? ? > >> ???? > > >> ???? >? ? ? }, > >> ???? > > >> ???? > "supported_versions (43)": { > >> ???? > > >> ???? > "versions": [TLSv1.2, TLSv1.1] > >> ???? > > >> ???? >? ? ? }, > >> ???? > > >> ???? > "renegotiation_info (65,281)": { > >> ???? > > >> ???? > "renegotiated connection": [] > >> ???? > > >> ???? >? ? ? } > >> ???? > > >> ???? >? ? ] > >> ???? > > >> ???? > } > >> ???? > > >> ???? > ) > >> ???? > > >> ???? > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.455 > >> ???? > AEDT|Alert.java:232|Received alert message ( > >> ???? > > >> ???? > "Alert": { > >> ???? > > >> ???? > "level"? ? ? : "fatal", > >> ???? > > >> ???? > "description": "handshake_failure" > >> ???? > > >> ???? > } > >> ???? > > >> ???? > ) > >> ???? > > >> ???? > javax.net.ssl|ERROR|01|main|2019-01-08 13:40:14.456 > >> ???? > AEDT|TransportContext.java:313|Fatal (HANDSHAKE_FAILURE): > >> ??? Received fatal > >> ???? > alert: handshake_failure ( > >> ???? > > >> ???? > "throwable" : { > >> ???? > > >> ???? >? ? javax.net.ssl.SSLHandshakeException: Received fatal > alert: > >> ???? > handshake_failure > >> ???? > > >> ???? >? ? ? at > >> java.base/sun.security.ssl.Alert.createSSLException(Alert.java:128) > >> ???? > > >> ???? >? ? ? at > >> java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117) > >> ???? > > >> ???? >? ? ? at > >> ???? > > >> > java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:308) > >> ???? > > >> ???? >? ? ? at > >> ???? > > >> > java.base/sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:279) > >> ???? > > >> ???? >? ? ? at > >> ???? > > >> > java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:181) > >> ???? > > >> ???? >? ? ? at > >> ???? > > >> > java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164) > >> ???? > > >> ???? >? ? ? at > >> ???? > > >> > java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1152) > >> ???? > > >> ???? >? ? ? at > >> ???? > > >> > java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063) > >> ???? > > >> ???? >? ? ? at > >> ???? > > >> > java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402) > >> ???? > > >> ???? >? ? ? at SslSocketClient.main(SslSocketClient.kt:47)} > >> ???? > > >> ???? > > >> ???? > ) > >> ???? > > >> ???? > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.457 > >> ???? > AEDT|SSLSocketImpl.java:1361|close the underlying socket > >> ???? > > >> ???? > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.457 > >> ???? > AEDT|SSLSocketImpl.java:1380|close the SSL connection > >> (initiative) > >> ???? > > >> ???? > Exception in thread "main" > javax.net.ssl.SSLHandshakeException: > >> ??? Received > >> ???? > fatal alert: handshake_failure > >> ???? > > >> ???? >? ? at > >> java.base/sun.security.ssl.Alert.createSSLException(Alert.java:128) > >> ???? > > >> ???? >? ? at > >> java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117) > >> ???? > > >> ???? >? ? at > >> ???? > > >> > java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:308) > >> ???? > > >> ???? >? ? at > >> > java.base/sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:279) > >> ???? > > >> ???? >? ? at > >> ???? > > >> > java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:181) > >> ???? > > >> ???? >? ? at > >> > java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164) > >> ???? > > >> ???? >? ? at > >> ???? > > >> > java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1152) > >> ???? > > >> ???? >? ? at > >> ???? > > >> > java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063) > >> ???? > > >> ???? >? ? at > >> ???? > > >> > java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402) > >> ???? > > >> ???? >? ? at SslSocketClient.main(SslSocketClient.kt:47) > >> ???? > > >> ???? > > >> ???? > > >> ???? > > >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From christoph.langer at sap.com Wed Feb 13 22:30:45 2019 From: christoph.langer at sap.com (Langer, Christoph) Date: Wed, 13 Feb 2019 22:30:45 +0000 Subject: RFR 8213031: (zipfs) Add support for POSIX file permissions In-Reply-To: References: <7b513a34196141f595cd5d194fb9d8a2@sap.com> <46af4f9d-60f9-c60d-e6f1-8fb97df3ba2e@oracle.com> <5d28b0715d2041ff892a3c44e024f120@sap.com> <8e9231ff-b7d5-bc2f-2643-713f3c670a1d@oracle.com> <3aeba9a64a434a968fc1d82a44077745@sap.com> Message-ID: <818ca9a7fe2445638dddc2481f95f9f8@sap.com> Hi Lance, thanks for looking. > Just starting to take a peek at this and noticed one quick thing in your test: > ------------ > Paths.get(System.getProperty("test.dir", "."), "testPosix.zip") > ?????? > > You do not need the test.dir property ?or the permission added to test.policy > to access it, ?just reference the jar and it will be created in user.dir which is > also writable. Hm, I thought I didn't want to mess around in "user.dir" as it can be some more global directory where you wouldn't want to leave artefacts... To me "test.dir" feels cleaner. Are there other opinions about that? Thanks Christoph From amir.khassaia at gmail.com Wed Feb 13 22:35:48 2019 From: amir.khassaia at gmail.com (Amir Khassaia) Date: Thu, 14 Feb 2019 09:35:48 +1100 Subject: Not possible to disable new TLS extensions for TLS 1.2 connections In-Reply-To: References: <3dfb3505-dd0e-3b91-17a0-c6165d7a1069@oracle.com> <283c595b-5ff5-66d7-46fb-f3a60817a508@oracle.com> <1d76a7a3-103a-c7c0-8834-3b7e953c7291@suche.org> Message-ID: While this is somewhat similar its still a little different to what I was asking because you can control named groups right now with the system property, eg. jdk.tls.namedGroups (yes its global not ideal) and also at the socket level but at least you dont have to drop TLS level. For the other extensions I mentioned, you cannot control them at all you have to drop TLS level, even a system property is better but of course something per connection eg, SSLParameters is ideal. On Thu, Feb 14, 2019 at 9:22 AM Thomas Lu?nig wrote: > Hi, > > i check the old mails. In your case the problem was about the EC-Group > extensions. If the server receive an unknown group he break the handshake > with an alert. What was interesting is the fact it did not break after > client hello but after Client-RSA-Key with alert illgegalParameter. I > managed to establish the connection by disable all cipher suites using ec > (only for this destination) not an good but an working solution. > Maybe you can provide an ssl debug log or pcap so that is is possible to > see if the same type of error happen. > > Gru? Thomas > > Sequence was: > > Client-Hello (SSLv3 - TLSv1.2) > Server-Hello(SSLv3) > Server-Certificates(SSLv3) > Client-RSA-Key(TLSv1.2) > Server-Alert(SSLv3 , FATAL , IllegalParameter) > > > p.s. for the Problem with exception about unsupported group in jdk10 > (fixed in 11) i found an workaround by only offering RSA and no EC suites > to the server that send 65535 as EC group that was causing the trouble. > Am 13.02.2019 um 23:08:22 schrieb Amir Khassaia: > > Hi Thomas, > Can you confirm its tied to new extensions to TLS 1.2 client hello and > whether you diagnosed which one was the problem in Lotus Notes case ? > > On Thu, Feb 14, 2019 at 9:05 AM Thomas Lu?nig wrote: > >> Hi, >> >> maybe two points. >> >> 1) Older lotus notes server have the problem. >> 2) The problem can be solved if you disable TLSv1.3 or even TLSv1.2 >> 3) Maybe it would be an good idea to build an set of client hello's with >> different options. >> Or even an generator. Than you send if and check the result since >> the servers with problem >> only reply with an ssl alert. So you can check it without an ssl >> engine or jdk build >> >> >> Gru? Thomas >> >> Am 13.02.2019 um 22:44:31 schrieb Xuelei Fan: >> > Hi Amir, >> > >> > Could you build OpenJDK by yourself? If it is doable, I could send >> > your a patch to disable the extension so that you can confirm if and >> > which extension is the underlying problem. >> > >> > Thanks, >> > Xuelei >> > >> > >> > On 2/13/2019 1:16 PM, Amir Khassaia wrote: >> >> Hi Xuelei, >> >> There were 2 distinct cases of change of behaviour. >> >> >> >> * The "CN=invalid2.invalid, OU="No SNI provided" reliably works >> >> without SNI in Java 8 but is indeed fixed by having an SNI included >> >> which perhaps was needed all along. This one is reported by >> XMPP/TLS >> >> connection from talk.google.com:5222 >> >> * The aborted handshake case (client_hello traces that I've provided) >> >> this happened with a hardware device which was replicable with an >> >> SSL socket handshake program that I referenced in the gist. >> >> Unfortunately replication requires a specific device model so it >> >> wont be possible to see it for yourself. The workaround there was >> to >> >> either downgrade JRE to < 11 or to switch JRE globally to use TLS >> >> 1.0 or TLS 1.1 via the system property. This is where your proposed >> >> enhancement will be of great help as it will allow a per connection >> >> type decision. >> >> >> >> >> >> On Wed, Feb 13, 2019 at 3:01 PM Xuelei Fan > >> > wrote: >> >> >> >> Hi Amir, >> >> >> >> It should be rare now the a TLS vendor cannot ignore unknown >> >> extensions. >> >> >> >> > "issuer": "CN=invalid2.invalid, OU="No SNI provided; >> >> > please fix your client."", >> >> The error message encapsulated in the certificate does not sound >> >> right >> >> to me. Is it caused by the absence of SNI extension? >> >> >> >> Did you have a test case that I can reproduce the problem? >> >> >> >> Thanks & Regards, >> >> Xuelei >> >> >> >> >> >> On 1/7/2019 9:27 PM, Amir Khassaia wrote: >> >> > 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-0813:40:14.395 >> >> AEDT|SSLCipher.java:437|jdk.tls.keyLimits: entry = >> >> AES/GCM/NoPadding KeyUpdate2^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_md5] >> >> > >> >> > }, >> >> > >> >> > "signature_algorithms_cert (50)": { >> >> > >> >> > "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_md5] >> >> > >> >> > }, >> >> > >> >> > "extended_master_secret (23)": { >> >> > >> >> > >> >> > >> >> > }, >> >> > >> >> > "supported_versions (43)": { >> >> > >> >> > "versions": [TLSv1.2, TLSv1.1] >> >> > >> >> > }, >> >> > >> >> > "renegotiation_info (65,281)": { >> >> > >> >> > "renegotiated connection": [] >> >> > >> >> > } >> >> > >> >> > ] >> >> > >> >> > } >> >> > >> >> > ) >> >> > >> >> > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.455 >> >> > AEDT|Alert.java:232|Received alert message ( >> >> > >> >> > "Alert": { >> >> > >> >> > "level" : "fatal", >> >> > >> >> > "description": "handshake_failure" >> >> > >> >> > } >> >> > >> >> > ) >> >> > >> >> > javax.net.ssl|ERROR|01|main|2019-01-08 13:40:14.456 >> >> > AEDT|TransportContext.java:313|Fatal (HANDSHAKE_FAILURE): >> >> Received fatal >> >> > alert: handshake_failure ( >> >> > >> >> > "throwable" : { >> >> > >> >> > javax.net.ssl.SSLHandshakeException: Received fatal alert: >> >> > handshake_failure >> >> > >> >> > at >> >> java.base/sun.security.ssl.Alert.createSSLException(Alert.java:128) >> >> > >> >> > at >> >> java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117) >> >> > >> >> > at >> >> > >> >> >> java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:308) >> >> > >> >> > at >> >> > >> >> java.base/sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:279) >> >> > >> >> > at >> >> > >> >> >> java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:181) >> >> > >> >> > at >> >> > >> >> java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164) >> >> > >> >> > at >> >> > >> >> >> java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1152) >> >> > >> >> > at >> >> > >> >> >> java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063) >> >> > >> >> > at >> >> > >> >> >> java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402) >> >> > >> >> > at SslSocketClient.main(SslSocketClient.kt:47)} >> >> > >> >> > >> >> > ) >> >> > >> >> > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.457 >> >> > AEDT|SSLSocketImpl.java:1361|close the underlying socket >> >> > >> >> > javax.net.ssl|DEBUG|01|main|2019-01-08 13:40:14.457 >> >> > AEDT|SSLSocketImpl.java:1380|close the SSL connection >> >> (initiative) >> >> > >> >> > Exception in thread "main" javax.net.ssl.SSLHandshakeException: >> >> Received >> >> > fatal alert: handshake_failure >> >> > >> >> > at >> >> java.base/sun.security.ssl.Alert.createSSLException(Alert.java:128) >> >> > >> >> > at >> >> java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117) >> >> > >> >> > at >> >> > >> >> >> java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:308) >> >> > >> >> > at >> >> java.base/sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:279) >> >> > >> >> > at >> >> > >> >> >> java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:181) >> >> > >> >> > at >> >> java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164) >> >> > >> >> > at >> >> > >> >> >> java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1152) >> >> > >> >> > at >> >> > >> >> >> java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1063) >> >> > >> >> > at >> >> > >> >> >> java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402) >> >> > >> >> > at SslSocketClient.main(SslSocketClient.kt:47) >> >> > >> >> > >> >> > >> >> > >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lance.andersen at oracle.com Wed Feb 13 22:53:15 2019 From: lance.andersen at oracle.com (Lance Andersen) Date: Wed, 13 Feb 2019 17:53:15 -0500 Subject: RFR 8213031: (zipfs) Add support for POSIX file permissions In-Reply-To: <818ca9a7fe2445638dddc2481f95f9f8@sap.com> References: <7b513a34196141f595cd5d194fb9d8a2@sap.com> <46af4f9d-60f9-c60d-e6f1-8fb97df3ba2e@oracle.com> <5d28b0715d2041ff892a3c44e024f120@sap.com> <8e9231ff-b7d5-bc2f-2643-713f3c670a1d@oracle.com> <3aeba9a64a434a968fc1d82a44077745@sap.com> <818ca9a7fe2445638dddc2481f95f9f8@sap.com> Message-ID: <3854DFE0-C244-4920-9554-65F6401438BF@oracle.com> Hi Christoph > On Feb 13, 2019, at 5:30 PM, Langer, Christoph wrote: > > Hi Lance, > > thanks for looking. > >> Just starting to take a peek at this and noticed one quick thing in your test: >> ------------ >> Paths.get(System.getProperty("test.dir", "."), "testPosix.zip") >> ?????? >> >> You do not need the test.dir property or the permission added to test.policy >> to access it, just reference the jar and it will be created in user.dir which is >> also writable. > > Hm, I thought I didn't want to mess around in "user.dir" as it can be some more global directory where you wouldn't want to leave artefacts... To me "test.dir" feels cleaner. Are there other opinions about that? user.dir points to the scratch directory that test uses, so it is where you want to create the tests. Workspaces can sometimes be read only: For example: ?????? @Test public void test000() throws IOException { System.out.println("test.dir = " + System.getProperty("test.dir", ".")); System.out.println("user.dir = " + System.getProperty("user.dir", ".")); System.out.println( Paths.get(System.getProperty("test.dir", "."), "basic.jar").toAbsolutePath() ); } ----------------- Results in: -------------------- test.dir = . user.dir = /Users/ljanders/Documents/hg-workspaces/openjdk-jdk/jdk-zip-api/build/macosx-x64/JTwork/scratch /Users/ljanders/Documents/hg-workspaces/openjdk-jdk/jdk-zip-api/build/macosx-x64/JTwork/scratch/./basic.jar Please see http://openjdk.java.net/jtreg/tag-spec.html for the system properties. I do not see test.dir there. ????????? I would just do: ????????? Path foo = Path.of("test.zip"); System.out.println("test.zip path=" + foo.toAbsolutePath()); -------------------------- which results in the output: test.zip path=/Users/ljanders/Documents/hg-workspaces/openjdk-jdk/jdk-zip-api/build/macosx-x64/JTwork/scratch/test.zip Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From yozons at gmail.com Wed Feb 13 23:06:04 2019 From: yozons at gmail.com (Open eSignForms) Date: Wed, 13 Feb 2019 15:06:04 -0800 Subject: XML Digital Signature throws NAMESPACE_ERR exception under OpenJDK 11 that works under Java SE 8, 9 and 10 In-Reply-To: <32d2fff5-1be5-1201-225e-15ac60982067@gmail.com> References: <8f5d59e0-89be-9146-7e57-5d2cf755043f@oracle.com> <66dd5bf7-b1b4-b3cf-b595-2c457b29a6af@gmail.com> <32d2fff5-1be5-1201-225e-15ac60982067@gmail.com> Message-ID: <648d666c-60a4-bc09-ecd9-f993255040e2@gmail.com> Well, I have found that my verify routines are failing.? I added the following lines to the main() test method of your fixed code after the signature is done to attempt to validate the generated signed XML: ??? ??? ??? try { ??? ??? ??? ??? System.err.println("Verifying signedXml..."); ??? ??? ??? ??? xmldsig.verify(signedXml, signatureKey); ??? ??? ??? ??? System.err.println("Verified signedXml..."); ??? ??? ??? } catch(Exception ve) { System.err.println("XmlDigitalSignature.main() signature verification exception: " + ve.getMessage()); ??? ??? ??? } This basically submits the created 'signedXml' returned just above with the same keys.? I also had to update the method "verify(String signedXml, SignatureKey signatureKey)" where it sets the ID attribute to include the namespace added in the fixed code: ??? ??? ??? qualifyingPropertiesElement.setIdAttribute*NS("http://uri.etsi.org/01903/v1.1.1#"*,"Id", true); // mark our id as the "Id" attribute This then fails showing 2 out of 4 references validated, the others failing: XmlDigitalSignature.verify(SignatureKey) SERIOUS-ERROR Failed core validation; SignatureValue validated: true ?-> Reference[0] validated: true ?-> Reference[1] validated: true ?-> Reference[2] validated: false ?-> Reference[3] validated: false XmlDigitalSignature.verify(SignatureKey) SERIOUS-ERROR exception: Invalid signature. SignatureValue validated; XML data payload validated; OpenESignForms Seal validated; Unexpected Reference[2] INVALID; Unexpected Reference[3] INVALID In my test code I was able to show the references subscripts 0-3 being: ?-> Reference[0] before validate(): *r.getId(): Payload_Reference_ID*; r.getURI(): ?-> Reference[0] validated: true ?-> Reference[1] before validate(): r.getId(): null; *r.getURI(): #KeyInfo_ID* ?-> Reference[1] validated: true ?-> Reference[2] before validate(): r.getId(): null; *r.getURI(): #QualifyingProperties_ID* ?-> Reference[2] validated: false ?-> Reference[3] before validate(): r.getId(): null; *r.getURI(): #OpenESignForms_Seal_ID* ?-> Reference[3] validated: false So, the namespace changes made allow the digital signature to be applied, but now I'm stuck on how to verify these last two references.? It seems that references related to Payload_Reference_ID and #KeyInfo_ID validate, but #QualifyingProperties_ID and #OpenESignForms_Seal_ID are failing. I'm not sure how those references work with respect to the namespace changes you suggested. In fact, the fixed code no longer validates the digital signature under Java 8 once the namespaces were added.? Any ideas? Thanks, David On 2/13/19 1:23 PM, Open eSignForms wrote: > > I checked the ETSI XAdES spec > (http://uri.etsi.org/01903/v1.1.1/ts_101903v010101p.pdf) and it > doesn't show any namespace on their entries for their > QualifyingProperties element and all sub-elements under the ETSI > example's element . > > But, their specification does show element > should be under the namespace "http://uri.etsi.org/01903/v1.1.1#" as > you added in your fixed code. > > That is, when my snapshot element that's digitally signed using the > below, it fails with the NAMESPACE_ERR exception: > > timestamp="2019-02-13T11:02:30-08:00" type="document"> > > But if my snapshot is set up with the ETSI namespace URI, it works: > > timestamp="2019-02-13T11:02:30-08:00" type="document"> > > So, it seems that the XMLSignature is noting that the > belongs to the default namespace in both cases, > but of course expects that particular element to belong to the ETSI > namespace, not ours. > > I presume that's correct behavior; I just didn't think that the > XMLSignature.sign() knew about and was limited to that specific namespace. > > If you agree that this is the correct behavior, I think it's not > really a bug in Java 11, though it fails backwards compatibility. > > The only oddity that remains is what I mentioned below with all the > " " characters in the digests/signatures that appear in Java 11.? > They sure look odd compared to simple line breaks that presumably were > emitted before. > > David > > > > On 2/13/19 11:20 AM, Open eSignForms wrote: >> Thanks, Sean.? I was able to find the updated test case source code. >> >> A preliminary review seems to show worthwhile changes to our code.? >> That is, the namespaces and such seem to make sense as you have them. >> >> In particular, the use of: >> >> domSignContext.putNamespacePrefix(XMLSignature.XMLNS, "dsig"); >> >> and adding this namespace to additional elements we added: >> >> ??? ??? ??? String xmlns = "http://uri.etsi.org/01903/v1.1.1#"; >> >> seem reasonable and an acceptable workaround for us.? I'm not sure if >> those were oversights from before, but likely were the result of it >> being based on Oracle/Java example code from Java 6 days... >> >> We'll incorporate your namespace changes in our code and test, but >> this seems like it will work as I was able to confirm that your fixed >> version seems to run on Java 10 and Java 11. >> >> It is interesting that the fixed code, though, generates different >> output on Java 10 and Java 11.? I'm not positive, but it seems that >> Java 11 adds ' ' to the end of many lines that aren't present in >> Java 10's output. >> >> Under Java 10, a test run products this result: >> >> > timestamp="2019-02-13T11:02:30-08:00" type="document">> xmlns="http://www.w3.org/1999/xhtml">

Dummy HTML >> document

]]>> xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" >> Id="OpenESignForms_Seal">> Algorithm="http://www.w3.org/2006/12/xml-c14n11#WithComments"/>> Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"/>> Id="Payload_Reference_ID" URI="">> Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>Zqmii2rv6C+bFM+CSO3s8sAGOrl67HEnv4t8XUgQd5iguf9m7vcVJn3pJz5inCZfx5V9lTtDaj0u >> >> xbZSyWE5kQ==> URI="#KeyInfo_ID">> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>kZM1pJpRXoeDuolU+kyK41BotQoW7ir5lfg/nNSMoC69bUC2OHzWbQ5Kug0gtrLVIuq5HRdzk6zc >> 2N2jA0WKMQ==> URI="#QualifyingProperties_ID">> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>AFx1CJi739IWZwJL1Y5KU2B+ZioT3ONMBLwLTdT/NTysV/+KYF7lZMgEHaGtLxvc6haIKKKzZisr >> r2YDQVgs5w==> URI="#OpenESignForms_Seal_ID">> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>jhVDd7nvr4s2bu7LRNHb7yj2gQRzAE7fXcsgonq2Qsn4EWNfpqNEVUViIy9jh86tTs5ZiakaGAEs >> l9YV1hNnEg==izJCFA5lBOjc7zhlc/1Wrsu+/jd0o0aPtemm4hM7aMKJvzkKddhjaHRY9iX4qtMZJtl7L1qj4YGN >> >> hxHc2Wjuj6F1ZFD9asPf/kumVliAqTwNvhfyVfmpbaZtzQVtOQWhNIC1PivbPfbwTKr1yztLbo0K >> >> B8TJWWiqHBjgEjlhw8X84buXVsCIUaAkOJG73Q0x9hMDVPf5y5R56xknLwjwzQPdveMI3zKvKvq5 >> >> vj1UPKVqlCjrjPa1HR0g4wEOjL51HCK/EWVbB4LLRAL59KB6ERW01CaRX1crGzQw6wz5eFVWK/0o >>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K7FCZmNU/TuUm+LqCUtSbbej5zdzgPuuAcviAwIDAQABMA4GA1UdDwEB/wQEAwIGwDAN >> >> BgkqhkiG9w0BAQ0FAAOCAgEAOu3Y4o7P4wel6zcwGIHfwuTuL/IX9qzYnxtPNkEHL8D8v3P4Tovk >> >> zDHOou4Ai5yycZninbaoK2WJr80p2HNfISY51fCJZ+Z16xmBlPmunnLI23cTAJGnZlI6WtsZLXQw >> >> LX91VkqKlRL73+MZECxO0m5I4hxNu8CeOIcQ7aCLvnkO8AEeCa9zAwmiL2tJ8coJvELvqS9Zaiaz >> >> syix8IWETtrZ+vv+85rASl5PSkCb0AX3eipJoqRgGazWraV7NBwDZgPEYXNQq1/jbQoirjJIzNQO >> >> KEgH3wViGFVwnW4YJ4dzbtVd6EVaHZGmYb666FpwNPz6OBLgX1sjvDTMTYGYo/VrIN02neYEvBtK >> >> GrZ5Gw7l7BOyKe92F3iQ3q90/kOBmGnEn8agkKlynv5IlJR8xOCxG1U9e8GFfmAwFS5hYtf0Gh/u >> >> FRqnOepWQKuZ3kBBR+6KttbE58aD2kVuB36et5Dij1nxr+ihL7e4V42KsQQn/VBDrMoU5xW+yZH/ >> >> aAEgpbfUm5detK5oFqs5JIILFiyUXQCrvYuNZFx4vDqrsDmmAaaAPBlcybCUXseqh4hThyrOJ0dX >> >> 3xaXcwd32t1+/aOa7jgJRTgSklxhhcRCMHI9HWNlLgUWmvZ2O5G70reY4Kyg1NAS56qX48Xbckvy >> >> VMfem/JPPYT/veThnefIgQk=> xmlns:ns0="http://uri.etsi.org/01903/v1.1.1#" >> ns0:Id="QualifyingProperties_ID" >> xmlns="http://uri.etsi.org/01903/v1.1.1#">2019-02-13T11:02:30-08:00> ns0:ObjectReference="#Payload_Reference_ID">descriptiontext/html> Id="OpenESignForms_Seal_ID" >> Target="#OpenESignForms_Seal">> xmlns:ns0="http://open.esignforms.com/XMLSchema/2011" >> ns0:DeploymentHostAddress="192.1.1.1" >> xmlns:ns1="http://open.esignforms.com/XMLSchema/2011" >> ns1:DeploymentHostName="open.esignforms.com" >> xmlns:ns2="http://open.esignforms.com/XMLSchema/2011" >> ns2:DeploymentId="1.1.1.1" >> xmlns:ns3="http://open.esignforms.com/XMLSchema/2011" >> ns3:SignerAddress="192.1.1.1" >> xmlns:ns4="http://open.esignforms.com/XMLSchema/2011" >> ns4:SignerAgent="No-Browser-Test" >> xmlns:ns5="http://open.esignforms.com/XMLSchema/2011" >> ns5:Timestamp="2019-02-13T11:02:30-08:00" >> xmlns:ns6="http://open.esignforms.com/XMLSchema/2011" >> ns6:Version="19.1.19"/>
>> >> while when run under Java 11 it shows what seems to be the same >> (clearly, the digest/hashes aren't the same as the 'timestamp' >> differs because they are actual times) except for lots of ' ' >> added to the digests and signatures: >> >> > timestamp="2019-02-13T11:01:22-08:00" type="document">> xmlns="http://www.w3.org/1999/xhtml">

Dummy HTML >> document

]]>> xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" >> Id="OpenESignForms_Seal">> Algorithm="http://www.w3.org/2006/12/xml-c14n11#WithComments"/>> Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"/>> Id="Payload_Reference_ID" URI="">> Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>LdB/ydGxr3VUoTshQtOvQNmMZmt2OHgLax4tSk9Lqb1c+X1h4Uc/RBVXwfI9QrVnITBz85Fi8Bwr >> >> 7wyMjw84cA==> URI="#KeyInfo_ID">> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>FkpexxTwhpCPHHsMrKGnBXE5hkZ/x10ArpzjX6ltYfOilvVAubzc9sNPwo6phw//ot1rSKPU5jTB >> LRD7p7t50g==> URI="#QualifyingProperties_ID">> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>LxB0xAsDxKqeyCflaSUgMQOMhoxP4Gl9GfvlpCiL/gd9rz36qG4roaFRl+4PBC+IxzGiRDOqzQYX >> x6gSn5d1IQ==> URI="#OpenESignForms_Seal_ID">> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>Pqd+9yaeBMytcG1sTTpuq+Wrd3lZSC18j7lv6VQ6LjUSz9VN7uwVNNn1E79mY8H6XUI2jbd/IozM >> oba2KF46ig==IpdHZtzSw8TOnp0gfKMaCp30jJAPP8YCAIg4OBvRobIwHBFrG+O9v7peXRRA5nXi+fm4bdemi5jI >> >> /N2smS7W6lKMMeTzrYNJEmpD/0c/SVCs0M1peZmiWZD/F6GYP6RkhZfTglk9skKsZIme3W5lHL5e >> >> vTFno50J32oW0chq/jPzD42snoVQmVKS9wqqybGgRrm1W2RSWfziNo7QjXtJuR5eVuCtqpOLrGrS >> >> J0aLaaNLucia/6cJyZ13mz7131Lj2Y4oJbrbpzvrDY5xDfFDK+bRRMR3DCvTLgKcZZz5zxcAKYL8 >> >> lG64U/tsmd/ZVn+d+fJGH03hPdvY/wMW7MTN1k/6S95PiNdx0cLeP0HLCug9zWiC7vUkrVDrsO9i >> >> qsvSYKcAH8vQlG1arZgGJn88Hg8EGjmmWXs15ulU3Lm8TOTXl/xi6O4stSgMi9dFSsE1ISHAPaxN >> >> D3Rqg7Bv7p/iEVn0xXq/C9AI3iwrpHbip8K81uJOsaiZgwR5D40XyYLV9FUPIacRclfT5EJKsx6k >> >> jYiprWMOMjmnlJwj2vI8zG6sYLVJdQywm2isWu5eHSw39Wof0BYfDeOzh0LrifUcnt86no5fUEOI >> >> OlNbqOO7rjuxtb+gt1iO2dTHfQhG99BCBQhC7AEMp67fIlPjEOECXldDTpzPMZ1K6cPlk22rpvc=> Id="KeyInfo_ID">184a40b0-78b6-4070-a7d7-1497078a06e4kPCr+Fy0NInaICpnzDpGLkNQ93kd0NzZfTBfQOb3PUH1Bt4OrBWcvYoch7wUm6k1Il3apsi7s2B9 >> >> Geqbh7tzF41MwvTWBNCQg3Kw3FKcF0jzKZ7D+na8Ndc52YPmsjU9zjpf+SDfKqb0NIDe3Bo3csWW >> >> I42CkF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/ >> >> aAEgpbfUm5detK5oFqs5JIILFiyUXQCrvYuNZFx4vDqrsDmmAaaAPBlcybCUXseqh4hThyrOJ0dX >> >> 3xaXcwd32t1+/aOa7jgJRTgSklxhhcRCMHI9HWNlLgUWmvZ2O5G70reY4Kyg1NAS56qX48Xbckvy >> >> VMfem/JPPYT/veThnefIgQk=> xmlns:ns0="http://uri.etsi.org/01903/v1.1.1#" >> ns0:Id="QualifyingProperties_ID" >> xmlns="http://uri.etsi.org/01903/v1.1.1#">2019-02-13T11:01:22-08:00> ns0:ObjectReference="#Payload_Reference_ID">descriptiontext/html> Id="OpenESignForms_Seal_ID" >> Target="#OpenESignForms_Seal">> xmlns:ns0="http://open.esignforms.com/XMLSchema/2011" >> ns0:DeploymentHostAddress="192.1.1.1" >> xmlns:ns1="http://open.esignforms.com/XMLSchema/2011" >> ns1:DeploymentHostName="open.esignforms.com" >> xmlns:ns2="http://open.esignforms.com/XMLSchema/2011" >> ns2:DeploymentId="1.1.1.1" >> xmlns:ns3="http://open.esignforms.com/XMLSchema/2011" >> ns3:SignerAddress="192.1.1.1" >> xmlns:ns4="http://open.esignforms.com/XMLSchema/2011" >> ns4:SignerAgent="No-Browser-Test" >> xmlns:ns5="http://open.esignforms.com/XMLSchema/2011" >> ns5:Timestamp="2019-02-13T11:01:22-08:00" >> xmlns:ns6="http://open.esignforms.com/XMLSchema/2011" >> ns6:Version="19.1.19"/>
>> >> >> It's particularly odd because hex 13 isn't a typical character (^S). >> >> Any idea what that difference is about for the base64 digests and >> signatures? >> >> David >> >> >> On 2/13/19 6:03 AM, Sean Mullan wrote: >>> On 2/12/19 6:28 PM, Open eSignForms wrote: >>>> Thanks for the update, Sean.? I'm a bit perplexed because I found >>>> the original code works under Java 9 and Java 10, so it seems like >>>> the change occurred in Java 11. >>> >>> Sorry, that was a typo, I meant to say JDK 11. >>> >>>> I don't see the modified version of the test case.? If you attached >>>> it, it somehow didn't make it through to me. >>>> >>>> If it's just a matter of making the code more correct, we'd love to >>>> make the changes.? My concern, of course, is that we've already >>>> done millions of XML digital signatures, so we need that to >>>> continue to verify correctly (and even under Java 11, it seems that >>>> the verify code works against previously digitally signed content) >>>> even if we now start digitally signing using more update-to-date code. >>> >>> The verification of pre-existing signatures should continue to work >>> regardless of how this bug is addressed. >>> >>>> Please send over the modified test case and I'll take a look. >>> >>> It is attached to the bug report in the Attachments section: >>> https://bugs.openjdk.java.net/browse/JDK-8218629 (make sure you >>> download the one I added yesterday). >>> >>> --Sean >>> >>>> >>>> Thanks! >>>> David >>>> >>>> On 2/12/19 2:14 PM, Sean Mullan wrote: >>>>> The bug is now at https://bugs.openjdk.java.net/browse/JDK-8218629 >>>>> >>>>> I have started looking at this issue and have some progress I can >>>>> report. >>>>> >>>>> In JDK 9, we updated the version of the Apache XML Signature >>>>> implementation in the JDK. Some of the marshalling code was >>>>> rewritten such that it will throw Exceptions if legacy DOM level 1 >>>>> methods were used to create XML content which is then passed into >>>>> XMLObject and similar XMLSignature types that take DOMStructure >>>>> objects. This is because the DOM level 1 methods do not support >>>>> namespaces. >>>>> >>>>> I am still evaluating what the best fix is. However, you can >>>>> workaround the issue by always using DOM level 3 methods which are >>>>> namespace aware. For example, use Document.createElementNS instead >>>>> of Document.createElement and Element.createAttributeNS instead of >>>>> Element.createAttribute. >>>>> >>>>> Using legacy or non-namespace aware XML parsers or implementations >>>>> is not recommended and the XML Signature Best Practices document >>>>> gives some rationale: >>>>> https://www.w3.org/TR/xmldsig-bestpractices/#signing-xml-without-namespaces >>>>> >>>>> That said, this is a regression in behavior so it would be best if >>>>> we could restore the previous behavior. >>>>> >>>>> I have attached a modified version of the test case to the bug >>>>> report which no longer throws an Exception. Let me know if this is >>>>> an acceptable workaround. Double-check the namespaces that I used >>>>> to make sure they are correct. >>>>> >>>>> --Sean >>>>> >>>>> >>>>> On 2/7/19 11:23 AM, Open eSignForms wrote: >>>>> >>>>>> On 2/7/19 7:49 AM, Sean Mullan wrote: >>>>>>> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From amir.khassaia at gmail.com Wed Feb 13 23:58:09 2019 From: amir.khassaia at gmail.com (Amir Khassaia) Date: Thu, 14 Feb 2019 10:58:09 +1100 Subject: javax.net.debug output lost client hello extensions in JDK 11.0.2 Message-ID: Hi, I'd like to report a bug that may confuse others as they diagnose TLS handshakes. The extension logging seems to be affected in JDK 11.0.2, these come up as empty in client hello (see below) from Oracle JDK 11.0.2 ========================== javax.net.ssl|DEBUG|01|main|2019-02-14 10:51:48.620 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-02-14 10:51:50.357 AEDT|ServerNameExtension.java:255|Unable to indicate server name javax.net.ssl|DEBUG|01|main|2019-02-14 10:51:50.357 AEDT|SSLExtensions.java:256|Ignore, context unavailable extension: server_name javax.net.ssl|DEBUG|01|main|2019-02-14 10:51:50.358 AEDT|SSLExtensions.java:256|Ignore, context unavailable extension: status_request javax.net.ssl|DEBUG|01|main|2019-02-14 10:51:50.361 AEDT|SupportedGroupsExtension.java:841|Ignore inactive or disabled named group: secp160k1 javax.net.ssl|WARNING|01|main|2019-02-14 10:51:50.486 AEDT|SignatureScheme.java:282|Signature algorithm, ed25519, is not supported by the underlying providers javax.net.ssl|WARNING|01|main|2019-02-14 10:51:50.486 AEDT|SignatureScheme.java:282|Signature algorithm, ed448, is not supported by the underlying providers javax.net.ssl|INFO|01|main|2019-02-14 10:51:50.513 AEDT|AlpnExtension.java:161|No available application protocols javax.net.ssl|DEBUG|01|main|2019-02-14 10:51:50.514 AEDT|SSLExtensions.java:256|Ignore, context unavailable extension: application_layer_protocol_negotiation javax.net.ssl|DEBUG|01|main|2019-02-14 10:51:50.514 AEDT|SSLExtensions.java:256|Ignore, context unavailable extension: status_request_v2 javax.net.ssl|DEBUG|01|main|2019-02-14 10:51:50.516 AEDT|ClientHello.java:651|Produced ClientHello handshake message ( "ClientHello": { "client version" : "TLSv1.2", "random" : "3E 3B 04 98 F4 65 C7 CF 2B B2 30 EA AE CE 7D C5 51 45 C4 A9 CB D6 F2 39 3F 52 46 77 BE 28 EC 06", "session id" : "", "cipher suites" : "[TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256(0xC02B), TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256(0xC02F), TLS_RSA_WITH_AES_128_GCM_SHA256(0x009C), TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256(0xC02D), TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256(0xC031), TLS_DHE_RSA_WITH_AES_128_GCM_SHA256(0x009E), TLS_DHE_DSS_WITH_AES_128_GCM_SHA256(0x00A2), 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_ECDSA_WITH_AES_128_CBC_SHA256(0xC025), TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256(0xC029), TLS_DHE_RSA_WITH_AES_128_CBC_SHA256(0x0067), TLS_DHE_DSS_WITH_AES_128_CBC_SHA256(0x0040), TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA(0xC009), TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA(0xC013), TLS_RSA_WITH_AES_128_CBC_SHA(0x002F), TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA(0xC004), TLS_ECDH_RSA_WITH_AES_128_CBC_SHA(0xC00E), TLS_DHE_RSA_WITH_AES_128_CBC_SHA(0x0033), TLS_DHE_DSS_WITH_AES_128_CBC_SHA(0x0032)]", "compression methods" : "00", "extensions" : [ ] } ) Notice empty extensions, these are actually there on the wire (checked with wireshark). This previously appeared to work, just checked with OpenJDK 11.0.1 and I get them: javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:54.261 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-02-14 10:54:56.491 AEDT|ServerNameExtension.java:255|Unable to indicate server name javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:56.492 AEDT|SSLExtensions.java:235|Ignore, context unavailable extension: server_name javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:56.492 AEDT|SSLExtensions.java:235|Ignore, context unavailable extension: status_request javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:56.494 AEDT|SupportedGroupsExtension.java:841|Ignore inactive or disabled named group: secp160k1 javax.net.ssl|WARNING|01|main|2019-02-14 10:54:56.546 AEDT|SignatureScheme.java:282|Signature algorithm, ed25519, is not supported by the underlying providers javax.net.ssl|WARNING|01|main|2019-02-14 10:54:56.546 AEDT|SignatureScheme.java:282|Signature algorithm, ed448, is not supported by the underlying providers javax.net.ssl|INFO|01|main|2019-02-14 10:54:56.575 AEDT|AlpnExtension.java:161|No available application protocols javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:56.576 AEDT|SSLExtensions.java:235|Ignore, context unavailable extension: application_layer_protocol_negotiation javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:56.576 AEDT|SSLExtensions.java:235|Ignore, context unavailable extension: status_request_v2 javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:56.577 AEDT|SSLExtensions.java:235|Ignore, context unavailable extension: renegotiation_info javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:56.582 AEDT|ClientHello.java:651|Produced ClientHello handshake message ( "ClientHello": { "client version" : "TLSv1.2", "random" : "4E 23 00 5E 22 D3 0D 78 D0 97 B5 E1 16 FB E3 92 B5 90 B0 8E 30 89 BC 72 BA F1 B7 94 71 E7 E8 80", "session id" : "", "cipher suites" : "[TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256(0xC02B), TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256(0xC02F), TLS_RSA_WITH_AES_128_GCM_SHA256(0x009C), TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256(0xC02D), TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256(0xC031), TLS_DHE_RSA_WITH_AES_128_GCM_SHA256(0x009E), TLS_DHE_DSS_WITH_AES_128_GCM_SHA256(0x00A2), 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_ECDSA_WITH_AES_128_CBC_SHA256(0xC025), TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256(0xC029), TLS_DHE_RSA_WITH_AES_128_CBC_SHA256(0x0067), TLS_DHE_DSS_WITH_AES_128_CBC_SHA256(0x0040), TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA(0xC009), TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA(0xC013), TLS_RSA_WITH_AES_128_CBC_SHA(0x002F), TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA(0xC004), TLS_ECDH_RSA_WITH_AES_128_CBC_SHA(0xC00E), TLS_DHE_RSA_WITH_AES_128_CBC_SHA(0x0033), TLS_DHE_DSS_WITH_AES_128_CBC_SHA(0x0032), TLS_EMPTY_RENEGOTIATION_INFO_SCSV(0x00FF)]", "compression methods" : "00", "extensions" : [ "supported_groups (10)": { "versions": [secp256r1, secp384r1, secp521r1] }, "ec_point_formats (11)": { "formats": [uncompressed] }, "signature_algorithms (13)": { "signature schemes": [ecdsa_secp256r1_sha256, ecdsa_secp384r1_sha384, ecdsa_secp512r1_sha512, rsa_pkcs1_sha256, rsa_pkcs1_sha384, rsa_pkcs1_sha512, dsa_sha256, ecdsa_sha1, rsa_pkcs1_sha1, dsa_sha1] }, "signature_algorithms_cert (50)": { "signature schemes": [ecdsa_secp256r1_sha256, ecdsa_secp384r1_sha384, ecdsa_secp512r1_sha512, rsa_pkcs1_sha256, rsa_pkcs1_sha384, rsa_pkcs1_sha512, dsa_sha256, ecdsa_sha1, rsa_pkcs1_sha1, dsa_sha1] }, "extended_master_secret (23)": { }, "supported_versions (43)": { "versions": [TLSv1.2, TLSv1.1, TLSv1] } ] } ) Regards, Amir -------------- next part -------------- An HTML attachment was scrubbed... URL: From xuelei.fan at oracle.com Thu Feb 14 03:25:59 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Wed, 13 Feb 2019 19:25:59 -0800 Subject: javax.net.debug output lost client hello extensions in JDK 11.0.2 In-Reply-To: References: Message-ID: <50a86743-cfba-ddaa-7773-f9cc1cbd3b4f@oracle.com> This bug will be addressed in JDK 11.0.3 and 12. See also: https://bugs.openjdk.java.net/browse/JDK-8210974 Thanks, Xuelei On 2/13/2019 3:58 PM, Amir Khassaia wrote: > > Hi, I'd like to report a bug that may confuse others as they diagnose > TLS handshakes. > > The extension logging seems to be affected in JDK 11.0.2, these come up > as empty in client hello (see below) from Oracle JDK 11.0.2 > ========================== > javax.net.ssl|DEBUG|01|main|2019-02-14 10:51:48.620 > 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-02-14 10:51:50.357 > AEDT|ServerNameExtension.java:255|Unable to indicate server name > javax.net.ssl|DEBUG|01|main|2019-02-14 10:51:50.357 > AEDT|SSLExtensions.java:256|Ignore, context unavailable extension: > server_name > javax.net.ssl|DEBUG|01|main|2019-02-14 10:51:50.358 > AEDT|SSLExtensions.java:256|Ignore, context unavailable extension: > status_request > javax.net.ssl|DEBUG|01|main|2019-02-14 10:51:50.361 > AEDT|SupportedGroupsExtension.java:841|Ignore inactive or disabled named > group: secp160k1 > javax.net.ssl|WARNING|01|main|2019-02-14 10:51:50.486 > AEDT|SignatureScheme.java:282|Signature algorithm, ed25519, is not > supported by the underlying providers > javax.net.ssl|WARNING|01|main|2019-02-14 10:51:50.486 > AEDT|SignatureScheme.java:282|Signature algorithm, ed448, is not > supported by the underlying providers > javax.net.ssl|INFO|01|main|2019-02-14 10:51:50.513 > AEDT|AlpnExtension.java:161|No available application protocols > javax.net.ssl|DEBUG|01|main|2019-02-14 10:51:50.514 > AEDT|SSLExtensions.java:256|Ignore, context unavailable extension: > application_layer_protocol_negotiation > javax.net.ssl|DEBUG|01|main|2019-02-14 10:51:50.514 > AEDT|SSLExtensions.java:256|Ignore, context unavailable extension: > status_request_v2 > javax.net.ssl|DEBUG|01|main|2019-02-14 10:51:50.516 > AEDT|ClientHello.java:651|Produced ClientHello handshake message ( > "ClientHello": { > ? "client version"? ? ? : "TLSv1.2", > ? "random"? ? ? ? ? ? ? : "3E 3B 04 98 F4 65 C7 CF 2B B2 30 EA AE CE 7D > C5 51 45 C4 A9 CB D6 F2 39 3F 52 46 77 BE 28 EC 06", > ? "session id"? ? ? ? ? : "", > ? "cipher suites"? ? ? ?: > "[TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256(0xC02B), > TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256(0xC02F), > TLS_RSA_WITH_AES_128_GCM_SHA256(0x009C), > TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256(0xC02D), > TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256(0xC031), > TLS_DHE_RSA_WITH_AES_128_GCM_SHA256(0x009E), > TLS_DHE_DSS_WITH_AES_128_GCM_SHA256(0x00A2), > 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_ECDSA_WITH_AES_128_CBC_SHA256(0xC025), > TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256(0xC029), > TLS_DHE_RSA_WITH_AES_128_CBC_SHA256(0x0067), > TLS_DHE_DSS_WITH_AES_128_CBC_SHA256(0x0040), > TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA(0xC009), > TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA(0xC013), > TLS_RSA_WITH_AES_128_CBC_SHA(0x002F), > TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA(0xC004), > TLS_ECDH_RSA_WITH_AES_128_CBC_SHA(0xC00E), > TLS_DHE_RSA_WITH_AES_128_CBC_SHA(0x0033), > TLS_DHE_DSS_WITH_AES_128_CBC_SHA(0x0032)]", > ? "compression methods" : "00", > ? "extensions"? ? ? ? ? : [ > ? ] > } > ) > > Notice empty extensions, these are actually there on the wire (checked > with wireshark). > > This previously appeared to work, just checked with OpenJDK 11.0.1 and I > get them: > > javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:54.261 > 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-02-14 10:54:56.491 > AEDT|ServerNameExtension.java:255|Unable to indicate server name > javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:56.492 > AEDT|SSLExtensions.java:235|Ignore, context unavailable extension: > server_name > javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:56.492 > AEDT|SSLExtensions.java:235|Ignore, context unavailable extension: > status_request > javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:56.494 > AEDT|SupportedGroupsExtension.java:841|Ignore inactive or disabled named > group: secp160k1 > javax.net.ssl|WARNING|01|main|2019-02-14 10:54:56.546 > AEDT|SignatureScheme.java:282|Signature algorithm, ed25519, is not > supported by the underlying providers > javax.net.ssl|WARNING|01|main|2019-02-14 10:54:56.546 > AEDT|SignatureScheme.java:282|Signature algorithm, ed448, is not > supported by the underlying providers > javax.net.ssl|INFO|01|main|2019-02-14 10:54:56.575 > AEDT|AlpnExtension.java:161|No available application protocols > javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:56.576 > AEDT|SSLExtensions.java:235|Ignore, context unavailable extension: > application_layer_protocol_negotiation > javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:56.576 > AEDT|SSLExtensions.java:235|Ignore, context unavailable extension: > status_request_v2 > javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:56.577 > AEDT|SSLExtensions.java:235|Ignore, context unavailable extension: > renegotiation_info > javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:56.582 > AEDT|ClientHello.java:651|Produced ClientHello handshake message ( > "ClientHello": { > ? "client version"? ? ? : "TLSv1.2", > ? "random"? ? ? ? ? ? ? : "4E 23 00 5E 22 D3 0D 78 D0 97 B5 E1 16 FB E3 > 92 B5 90 B0 8E 30 89 BC 72 BA F1 B7 94 71 E7 E8 80", > ? "session id"? ? ? ? ? : "", > ? "cipher suites"? ? ? ?: > "[TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256(0xC02B), > TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256(0xC02F), > TLS_RSA_WITH_AES_128_GCM_SHA256(0x009C), > TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256(0xC02D), > TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256(0xC031), > TLS_DHE_RSA_WITH_AES_128_GCM_SHA256(0x009E), > TLS_DHE_DSS_WITH_AES_128_GCM_SHA256(0x00A2), > 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_ECDSA_WITH_AES_128_CBC_SHA256(0xC025), > TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256(0xC029), > TLS_DHE_RSA_WITH_AES_128_CBC_SHA256(0x0067), > TLS_DHE_DSS_WITH_AES_128_CBC_SHA256(0x0040), > TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA(0xC009), > TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA(0xC013), > TLS_RSA_WITH_AES_128_CBC_SHA(0x002F), > TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA(0xC004), > TLS_ECDH_RSA_WITH_AES_128_CBC_SHA(0xC00E), > TLS_DHE_RSA_WITH_AES_128_CBC_SHA(0x0033), > TLS_DHE_DSS_WITH_AES_128_CBC_SHA(0x0032), > TLS_EMPTY_RENEGOTIATION_INFO_SCSV(0x00FF)]", > ? "compression methods" : "00", > ? "extensions"? ? ? ? ? : [ > ? ? "supported_groups (10)": { > ? ? ? "versions": [secp256r1, secp384r1, secp521r1] > ? ? }, > ? ? "ec_point_formats (11)": { > ? ? ? "formats": [uncompressed] > ? ? }, > ? ? "signature_algorithms (13)": { > ? ? ? "signature schemes": [ecdsa_secp256r1_sha256, > ecdsa_secp384r1_sha384, ecdsa_secp512r1_sha512, rsa_pkcs1_sha256, > rsa_pkcs1_sha384, rsa_pkcs1_sha512, dsa_sha256, ecdsa_sha1, > rsa_pkcs1_sha1, dsa_sha1] > ? ? }, > ? ? "signature_algorithms_cert (50)": { > ? ? ? "signature schemes": [ecdsa_secp256r1_sha256, > ecdsa_secp384r1_sha384, ecdsa_secp512r1_sha512, rsa_pkcs1_sha256, > rsa_pkcs1_sha384, rsa_pkcs1_sha512, dsa_sha256, ecdsa_sha1, > rsa_pkcs1_sha1, dsa_sha1] > ? ? }, > ? ? "extended_master_secret (23)": { > ? ? ? > ? ? }, > ? ? "supported_versions (43)": { > ? ? ? "versions": [TLSv1.2, TLSv1.1, TLSv1] > ? ? } > ? ] > } > ) > > Regards, > Amir > > > From amir.khassaia at gmail.com Thu Feb 14 04:29:56 2019 From: amir.khassaia at gmail.com (Amir Khassaia) Date: Thu, 14 Feb 2019 15:29:56 +1100 Subject: javax.net.debug output lost client hello extensions in JDK 11.0.2 In-Reply-To: <50a86743-cfba-ddaa-7773-f9cc1cbd3b4f@oracle.com> References: <50a86743-cfba-ddaa-7773-f9cc1cbd3b4f@oracle.com> Message-ID: Thanks Xuelei, I clearly missed the report somehow On Thu, Feb 14, 2019 at 2:26 PM Xuelei Fan wrote: > This bug will be addressed in JDK 11.0.3 and 12. See also: > https://bugs.openjdk.java.net/browse/JDK-8210974 > > Thanks, > Xuelei > > On 2/13/2019 3:58 PM, Amir Khassaia wrote: > > > > Hi, I'd like to report a bug that may confuse others as they diagnose > > TLS handshakes. > > > > The extension logging seems to be affected in JDK 11.0.2, these come up > > as empty in client hello (see below) from Oracle JDK 11.0.2 > > ========================== > > javax.net.ssl|DEBUG|01|main|2019-02-14 10:51:48.620 > > 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-02-14 10:51:50.357 > > AEDT|ServerNameExtension.java:255|Unable to indicate server name > > javax.net.ssl|DEBUG|01|main|2019-02-14 10:51:50.357 > > AEDT|SSLExtensions.java:256|Ignore, context unavailable extension: > > server_name > > javax.net.ssl|DEBUG|01|main|2019-02-14 10:51:50.358 > > AEDT|SSLExtensions.java:256|Ignore, context unavailable extension: > > status_request > > javax.net.ssl|DEBUG|01|main|2019-02-14 10:51:50.361 > > AEDT|SupportedGroupsExtension.java:841|Ignore inactive or disabled named > > group: secp160k1 > > javax.net.ssl|WARNING|01|main|2019-02-14 10:51:50.486 > > AEDT|SignatureScheme.java:282|Signature algorithm, ed25519, is not > > supported by the underlying providers > > javax.net.ssl|WARNING|01|main|2019-02-14 10:51:50.486 > > AEDT|SignatureScheme.java:282|Signature algorithm, ed448, is not > > supported by the underlying providers > > javax.net.ssl|INFO|01|main|2019-02-14 10:51:50.513 > > AEDT|AlpnExtension.java:161|No available application protocols > > javax.net.ssl|DEBUG|01|main|2019-02-14 10:51:50.514 > > AEDT|SSLExtensions.java:256|Ignore, context unavailable extension: > > application_layer_protocol_negotiation > > javax.net.ssl|DEBUG|01|main|2019-02-14 10:51:50.514 > > AEDT|SSLExtensions.java:256|Ignore, context unavailable extension: > > status_request_v2 > > javax.net.ssl|DEBUG|01|main|2019-02-14 10:51:50.516 > > AEDT|ClientHello.java:651|Produced ClientHello handshake message ( > > "ClientHello": { > > "client version" : "TLSv1.2", > > "random" : "3E 3B 04 98 F4 65 C7 CF 2B B2 30 EA AE CE 7D > > C5 51 45 C4 A9 CB D6 F2 39 3F 52 46 77 BE 28 EC 06", > > "session id" : "", > > "cipher suites" : > > "[TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256(0xC02B), > > TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256(0xC02F), > > TLS_RSA_WITH_AES_128_GCM_SHA256(0x009C), > > TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256(0xC02D), > > TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256(0xC031), > > TLS_DHE_RSA_WITH_AES_128_GCM_SHA256(0x009E), > > TLS_DHE_DSS_WITH_AES_128_GCM_SHA256(0x00A2), > > 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_ECDSA_WITH_AES_128_CBC_SHA256(0xC025), > > TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256(0xC029), > > TLS_DHE_RSA_WITH_AES_128_CBC_SHA256(0x0067), > > TLS_DHE_DSS_WITH_AES_128_CBC_SHA256(0x0040), > > TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA(0xC009), > > TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA(0xC013), > > TLS_RSA_WITH_AES_128_CBC_SHA(0x002F), > > TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA(0xC004), > > TLS_ECDH_RSA_WITH_AES_128_CBC_SHA(0xC00E), > > TLS_DHE_RSA_WITH_AES_128_CBC_SHA(0x0033), > > TLS_DHE_DSS_WITH_AES_128_CBC_SHA(0x0032)]", > > "compression methods" : "00", > > "extensions" : [ > > ] > > } > > ) > > > > Notice empty extensions, these are actually there on the wire (checked > > with wireshark). > > > > This previously appeared to work, just checked with OpenJDK 11.0.1 and I > > get them: > > > > javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:54.261 > > 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-02-14 10:54:56.491 > > AEDT|ServerNameExtension.java:255|Unable to indicate server name > > javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:56.492 > > AEDT|SSLExtensions.java:235|Ignore, context unavailable extension: > > server_name > > javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:56.492 > > AEDT|SSLExtensions.java:235|Ignore, context unavailable extension: > > status_request > > javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:56.494 > > AEDT|SupportedGroupsExtension.java:841|Ignore inactive or disabled named > > group: secp160k1 > > javax.net.ssl|WARNING|01|main|2019-02-14 10:54:56.546 > > AEDT|SignatureScheme.java:282|Signature algorithm, ed25519, is not > > supported by the underlying providers > > javax.net.ssl|WARNING|01|main|2019-02-14 10:54:56.546 > > AEDT|SignatureScheme.java:282|Signature algorithm, ed448, is not > > supported by the underlying providers > > javax.net.ssl|INFO|01|main|2019-02-14 10:54:56.575 > > AEDT|AlpnExtension.java:161|No available application protocols > > javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:56.576 > > AEDT|SSLExtensions.java:235|Ignore, context unavailable extension: > > application_layer_protocol_negotiation > > javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:56.576 > > AEDT|SSLExtensions.java:235|Ignore, context unavailable extension: > > status_request_v2 > > javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:56.577 > > AEDT|SSLExtensions.java:235|Ignore, context unavailable extension: > > renegotiation_info > > javax.net.ssl|DEBUG|01|main|2019-02-14 10:54:56.582 > > AEDT|ClientHello.java:651|Produced ClientHello handshake message ( > > "ClientHello": { > > "client version" : "TLSv1.2", > > "random" : "4E 23 00 5E 22 D3 0D 78 D0 97 B5 E1 16 FB E3 > > 92 B5 90 B0 8E 30 89 BC 72 BA F1 B7 94 71 E7 E8 80", > > "session id" : "", > > "cipher suites" : > > "[TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256(0xC02B), > > TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256(0xC02F), > > TLS_RSA_WITH_AES_128_GCM_SHA256(0x009C), > > TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256(0xC02D), > > TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256(0xC031), > > TLS_DHE_RSA_WITH_AES_128_GCM_SHA256(0x009E), > > TLS_DHE_DSS_WITH_AES_128_GCM_SHA256(0x00A2), > > 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_ECDSA_WITH_AES_128_CBC_SHA256(0xC025), > > TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256(0xC029), > > TLS_DHE_RSA_WITH_AES_128_CBC_SHA256(0x0067), > > TLS_DHE_DSS_WITH_AES_128_CBC_SHA256(0x0040), > > TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA(0xC009), > > TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA(0xC013), > > TLS_RSA_WITH_AES_128_CBC_SHA(0x002F), > > TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA(0xC004), > > TLS_ECDH_RSA_WITH_AES_128_CBC_SHA(0xC00E), > > TLS_DHE_RSA_WITH_AES_128_CBC_SHA(0x0033), > > TLS_DHE_DSS_WITH_AES_128_CBC_SHA(0x0032), > > TLS_EMPTY_RENEGOTIATION_INFO_SCSV(0x00FF)]", > > "compression methods" : "00", > > "extensions" : [ > > "supported_groups (10)": { > > "versions": [secp256r1, secp384r1, secp521r1] > > }, > > "ec_point_formats (11)": { > > "formats": [uncompressed] > > }, > > "signature_algorithms (13)": { > > "signature schemes": [ecdsa_secp256r1_sha256, > > ecdsa_secp384r1_sha384, ecdsa_secp512r1_sha512, rsa_pkcs1_sha256, > > rsa_pkcs1_sha384, rsa_pkcs1_sha512, dsa_sha256, ecdsa_sha1, > > rsa_pkcs1_sha1, dsa_sha1] > > }, > > "signature_algorithms_cert (50)": { > > "signature schemes": [ecdsa_secp256r1_sha256, > > ecdsa_secp384r1_sha384, ecdsa_secp512r1_sha512, rsa_pkcs1_sha256, > > rsa_pkcs1_sha384, rsa_pkcs1_sha512, dsa_sha256, ecdsa_sha1, > > rsa_pkcs1_sha1, dsa_sha1] > > }, > > "extended_master_secret (23)": { > > > > }, > > "supported_versions (43)": { > > "versions": [TLSv1.2, TLSv1.1, TLSv1] > > } > > ] > > } > > ) > > > > Regards, > > Amir > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From christoph.langer at sap.com Thu Feb 14 07:54:16 2019 From: christoph.langer at sap.com (Langer, Christoph) Date: Thu, 14 Feb 2019 07:54:16 +0000 Subject: RFR 8213031: (zipfs) Add support for POSIX file permissions In-Reply-To: <3854DFE0-C244-4920-9554-65F6401438BF@oracle.com> References: <7b513a34196141f595cd5d194fb9d8a2@sap.com> <46af4f9d-60f9-c60d-e6f1-8fb97df3ba2e@oracle.com> <5d28b0715d2041ff892a3c44e024f120@sap.com> <8e9231ff-b7d5-bc2f-2643-713f3c670a1d@oracle.com> <3aeba9a64a434a968fc1d82a44077745@sap.com> <818ca9a7fe2445638dddc2481f95f9f8@sap.com> <3854DFE0-C244-4920-9554-65F6401438BF@oracle.com> Message-ID: Hi Lance, thanks for the detailed explanation, sounds great. I?ll work that in in my next edition ?? Best regards Christoph From: Lance Andersen Sent: Mittwoch, 13. Februar 2019 23:53 To: Langer, Christoph Cc: Alan Bateman ; nio-dev ; Java Core Libs ; OpenJDK Dev list ; Volker Simonis Subject: Re: RFR 8213031: (zipfs) Add support for POSIX file permissions Hi Christoph On Feb 13, 2019, at 5:30 PM, Langer, Christoph > wrote: Hi Lance, thanks for looking. Just starting to take a peek at this and noticed one quick thing in your test: ------------ Paths.get(System.getProperty("test.dir", "."), "testPosix.zip") ?????? You do not need the test.dir property or the permission added to test.policy to access it, just reference the jar and it will be created in user.dir which is also writable. Hm, I thought I didn't want to mess around in "user.dir" as it can be some more global directory where you wouldn't want to leave artefacts... To me "test.dir" feels cleaner. Are there other opinions about that? user.dir points to the scratch directory that test uses, so it is where you want to create the tests. Workspaces can sometimes be read only: For example: ?????? @Test public void test000() throws IOException { System.out.println("test.dir = " + System.getProperty("test.dir", ".")); System.out.println("user.dir = " + System.getProperty("user.dir", ".")); System.out.println( Paths.get(System.getProperty("test.dir", "."), "basic.jar").toAbsolutePath() ); } ----------------- Results in: -------------------- test.dir = . user.dir = /Users/ljanders/Documents/hg-workspaces/openjdk-jdk/jdk-zip-api/build/macosx-x64/JTwork/scratch /Users/ljanders/Documents/hg-workspaces/openjdk-jdk/jdk-zip-api/build/macosx-x64/JTwork/scratch/./basic.jar Please see http://openjdk.java.net/jtreg/tag-spec.html for the system properties. I do not see test.dir there. ????????? I would just do: ????????? Path foo = Path.of("test.zip"); System.out.println("test.zip path=" + foo.toAbsolutePath()); -------------------------- which results in the output: test.zip path=/Users/ljanders/Documents/hg-workspaces/openjdk-jdk/jdk-zip-api/build/macosx-x64/JTwork/scratch/test.zip Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037 Oracle Java Engineering 1 Network Drive Burlington, MA 01803 Lance.Andersen at oracle.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean.mullan at oracle.com Thu Feb 14 18:24:09 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Thu, 14 Feb 2019 13:24:09 -0500 Subject: RFR [13] JDK-4919790 : Errors in alert ssl message does not reflect the actual certificate status In-Reply-To: <3c720033-6206-0a49-86d7-5ee407f995a9@oracle.com> References: <3c720033-6206-0a49-86d7-5ee407f995a9@oracle.com> Message-ID: <3f17ece6-f40d-6f0c-ef23-9c3590ac01d8@oracle.com> On 2/11/19 2:32 PM, Xuelei Fan wrote: > Hi, > > Could I get the update reviewed? > ?? http://cr.openjdk.java.net/~xuelei/4919790/webrev.00/ 721 alert = Alert.UNSUPPORTED_CERTIFCATE; Can we fix this typo while we are cleaning this up? s/CERTIFCATE/CERTIFICATE/ Also, I was a bit curious about these lines (not part of your fix): 711 if (reason == BasicReason.REVOKED) { 712 alert = chc.staplingActive ? 713 Alert.BAD_CERT_STATUS_RESPONSE : 714 Alert.CERTIFICATE_REVOKED; If a certificate is revoked, why would you set the alert status to BAD_CERT_STATUS_RESPONSE if stapling is enabled? Also, bug needs a noreg label. --Sean > It had been a while that the SunJSSE provider use certificate_unknown or > certificate_revoked (or bad_certificate_status_response for OCSP > stapling) as the certificate issues alert.? Other certificate alert like > certificate_expired are not used. > > The bug was reported in JDK 6.? With the introducing of > CertPathValidatorException.BasicReason in JDK 7. Now we can handle the > alert more accuracy. > > Note: please don't rely on the certificate alert type for application > development.? The alert type may be changed and different per the > provider preference. > > No new regression test as the update is simple and straightforward. > > Thanks, > Xuelei From sean.mullan at oracle.com Thu Feb 14 19:08:35 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Thu, 14 Feb 2019 14:08:35 -0500 Subject: XML Digital Signature throws NAMESPACE_ERR exception under OpenJDK 11 that works under Java SE 8, 9 and 10 In-Reply-To: <66dd5bf7-b1b4-b3cf-b595-2c457b29a6af@gmail.com> References: <8f5d59e0-89be-9146-7e57-5d2cf755043f@oracle.com> <66dd5bf7-b1b4-b3cf-b595-2c457b29a6af@gmail.com> Message-ID: <74045499-137b-87c4-ab59-8edb4801aa4b@oracle.com> On 2/13/19 2:20 PM, Open eSignForms wrote: > Thanks, Sean.? I was able to find the updated test case source code. > > A preliminary review seems to show worthwhile changes to our code.? That > is, the namespaces and such seem to make sense as you have them. > > In particular, the use of: > > domSignContext.putNamespacePrefix(XMLSignature.XMLNS, "dsig"); > > and adding this namespace to additional elements we added: > > ??? ??? ??? String xmlns = "http://uri.etsi.org/01903/v1.1.1#"; > > seem reasonable and an acceptable workaround for us.? I'm not sure if > those were oversights from before, but likely were the result of it > being based on Oracle/Java example code from Java 6 days... > > We'll incorporate your namespace changes in our code and test, but this > seems like it will work as I was able to confirm that your fixed version > seems to run on Java 10 and Java 11. > > It is interesting that the fixed code, though, generates different > output on Java 10 and Java 11.? I'm not positive, but it seems that Java > 11 adds ' ' to the end of many lines that aren't present in Java > 10's output. This is the ASCII code for a carriage return, encoded in XML. I don't know why that behavior is different in JDK 11. This would be a question for the XML developers. I have copied Joe Wang, to see if he might know. --Sean > > Under Java 10, a test run products this result: > > timestamp="2019-02-13T11:02:30-08:00" type="document"> xmlns="http://www.w3.org/1999/xhtml">

Dummy HTML > document

]]> xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" > Id="OpenESignForms_Seal"> Algorithm="http://www.w3.org/2006/12/xml-c14n11#WithComments"/> Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"/> Id="Payload_Reference_ID" URI=""> Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>Zqmii2rv6C+bFM+CSO3s8sAGOrl67HEnv4t8XUgQd5iguf9m7vcVJn3pJz5inCZfx5V9lTtDaj0u > > xbZSyWE5kQ== URI="#KeyInfo_ID"> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>kZM1pJpRXoeDuolU+kyK41BotQoW7ir5lfg/nNSMoC69bUC2OHzWbQ5Kug0gtrLVIuq5HRdzk6zc > > 2N2jA0WKMQ== URI="#QualifyingProperties_ID"> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>AFx1CJi739IWZwJL1Y5KU2B+ZioT3ONMBLwLTdT/NTysV/+KYF7lZMgEHaGtLxvc6haIKKKzZisr > > r2YDQVgs5w== URI="#OpenESignForms_Seal_ID"> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>jhVDd7nvr4s2bu7LRNHb7yj2gQRzAE7fXcsgonq2Qsn4EWNfpqNEVUViIy9jh86tTs5ZiakaGAEs > > l9YV1hNnEg==izJCFA5lBOjc7zhlc/1Wrsu+/jd0o0aPtemm4hM7aMKJvzkKddhjaHRY9iX4qtMZJtl7L1qj4YGN > > hxHc2Wjuj6F1ZFD9asPf/kumVliAqTwNvhfyVfmpbaZtzQVtOQWhNIC1PivbPfbwTKr1yztLbo0K > > B8TJWWiqHBjgEjlhw8X84buXVsCIUaAkOJG73Q0x9hMDVPf5y5R56xknLwjwzQPdveMI3zKvKvq5 > > vj1UPKVqlCjrjPa1HR0g4wEOjL51HCK/EWVbB4LLRAL59KB6ERW01CaRX1crGzQw6wz5eFVWK/0o > > NcIdn4wc7rWPdYfT362iqqJMzIyUQGHmk7FVD/1Nky2wlEvYaRk7PrpbXo8ISSPB+RQM+EWQbYCP > > RVT5oq6d4dnu0cUuj/wG8Ng7FIfSY3C8Ds9cw7CTKi/Dbmw3oE8yaJHNqfjEMAW2tmqQmuC4ZRXG > > 7DfqeNdgiHwoQLdLzD/vj/00SWmcM67NWQNwblbPJ5MhVeFmh/fIbd7bkIyANbw1FAYIj1b+Hf8b > > cZzC+lNecKxzkcY9/VZ3ny4kBBQmxwBLlojBa2ll8B9m+sYN0enRGwy9GG2eBY2Gb53KqAALQAUU > > kjXjJYxrQh64Y2RTAgp01Nbfj7QbvuKW93YDR6cpjNTM7EfJfQM/cz+VHHngFCRr/N0/WmM4j0A= Id="KeyInfo_ID">c42c747f-0f03-46a3-8ae8-81fc95464c8fkPCr+Fy0NInaICpnzDpGLkNQ93kd0NzZfTBfQOb3PUH1Bt4OrBW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5xW+yZH/ > > aAEgpbfUm5detK5oFqs5JIILFiyUXQCrvYuNZFx4vDqrsDmmAaaAPBlcybCUXseqh4hThyrOJ0dX > > 3xaXcwd32t1+/aOa7jgJRTgSklxhhcRCMHI9HWNlLgUWmvZ2O5G70reY4Kyg1NAS56qX48Xbckvy > > VMfem/JPPYT/veThnefIgQk= xmlns:ns0="http://uri.etsi.org/01903/v1.1.1#" > ns0:Id="QualifyingProperties_ID" > xmlns="http://uri.etsi.org/01903/v1.1.1#">2019-02-13T11:02:30-08:00 ns0:ObjectReference="#Payload_Reference_ID">descriptiontext/html Id="OpenESignForms_Seal_ID" > Target="#OpenESignForms_Seal"> xmlns:ns0="http://open.esignforms.com/XMLSchema/2011" > ns0:DeploymentHostAddress="192.1.1.1" > xmlns:ns1="http://open.esignforms.com/XMLSchema/2011" > ns1:DeploymentHostName="open.esignforms.com" > xmlns:ns2="http://open.esignforms.com/XMLSchema/2011" > ns2:DeploymentId="1.1.1.1" > xmlns:ns3="http://open.esignforms.com/XMLSchema/2011" > ns3:SignerAddress="192.1.1.1" > xmlns:ns4="http://open.esignforms.com/XMLSchema/2011" > ns4:SignerAgent="No-Browser-Test" > xmlns:ns5="http://open.esignforms.com/XMLSchema/2011" > ns5:Timestamp="2019-02-13T11:02:30-08:00" > xmlns:ns6="http://open.esignforms.com/XMLSchema/2011" > ns6:Version="19.1.19"/>
> > > while when run under Java 11 it shows what seems to be the same > (clearly, the digest/hashes aren't the same as the 'timestamp' differs > because they are actual times) except for lots of ' ' added to the > digests and signatures: > > timestamp="2019-02-13T11:01:22-08:00" type="document"> xmlns="http://www.w3.org/1999/xhtml">

Dummy HTML > document

]]> xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" > Id="OpenESignForms_Seal"> Algorithm="http://www.w3.org/2006/12/xml-c14n11#WithComments"/> Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"/> Id="Payload_Reference_ID" URI=""> Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>LdB/ydGxr3VUoTshQtOvQNmMZmt2OHgLax4tSk9Lqb1c+X1h4Uc/RBVXwfI9QrVnITBz85Fi8Bwr > > 7wyMjw84cA== URI="#KeyInfo_ID"> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>FkpexxTwhpCPHHsMrKGnBXE5hkZ/x10ArpzjX6ltYfOilvVAubzc9sNPwo6phw//ot1rSKPU5jTB > > LRD7p7t50g== URI="#QualifyingProperties_ID"> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>LxB0xAsDxKqeyCflaSUgMQOMhoxP4Gl9GfvlpCiL/gd9rz36qG4roaFRl+4PBC+IxzGiRDOqzQYX > > x6gSn5d1IQ== URI="#OpenESignForms_Seal_ID"> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>Pqd+9yaeBMytcG1sTTpuq+Wrd3lZSC18j7lv6VQ6LjUSz9VN7uwVNNn1E79mY8H6XUI2jbd/IozM > > oba2KF46ig==IpdHZtzSw8TOnp0gfKMaCp30jJAPP8YCAIg4OBvRobIwHBFrG+O9v7peXRRA5nXi+fm4bdemi5jI > > /N2smS7W6lKMMeTzrYNJEmpD/0c/SVCs0M1peZmiWZD/F6GYP6RkhZfTglk9skKsZIme3W5lHL5e > > vTFno50J32oW0chq/jPzD42snoVQmVKS9wqqybGgRrm1W2RSWfziNo7QjXtJuR5eVuCtqpOLrGrS > > J0aLaaNLucia/6cJyZ13mz7131Lj2Y4oJbrbpzvrDY5xDfFDK+bRRMR3DCvTLgKcZZz5zxcAKYL8 > > lG64U/tsmd/ZVn+d+fJGH03hPdvY/wMW7MTN1k/6S95PiNdx0cLeP0HLCug9zWiC7vUkrVDrsO9i > > qsvSYKcAH8vQlG1arZgGJn88Hg8EGjmmWXs15ulU3Lm8TOTXl/xi6O4stSgMi9dFSsE1ISHAPaxN > > D3Rqg7Bv7p/iEVn0xXq/C9AI3iwrpHbip8K81uJOsaiZgwR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AX3eipJoqRgGazWraV7NBwDZgPEYXNQq1/jbQoirjJIzNQO > > KEgH3wViGFVwnW4YJ4dzbtVd6EVaHZGmYb666FpwNPz6OBLgX1sjvDTMTYGYo/VrIN02neYEvBtK > > GrZ5Gw7l7BOyKe92F3iQ3q90/kOBmGnEn8agkKlynv5IlJR8xOCxG1U9e8GFfmAwFS5hYtf0Gh/u > > FRqnOepWQKuZ3kBBR+6KttbE58aD2kVuB36et5Dij1nxr+ihL7e4V42KsQQn/VBDrMoU5xW+yZH/ > > aAEgpbfUm5detK5oFqs5JIILFiyUXQCrvYuNZFx4vDqrsDmmAaaAPBlcybCUXseqh4hThyrOJ0dX > > 3xaXcwd32t1+/aOa7jgJRTgSklxhhcRCMHI9HWNlLgUWmvZ2O5G70reY4Kyg1NAS56qX48Xbckvy > > VMfem/JPPYT/veThnefIgQk= xmlns:ns0="http://uri.etsi.org/01903/v1.1.1#" > ns0:Id="QualifyingProperties_ID" > xmlns="http://uri.etsi.org/01903/v1.1.1#">2019-02-13T11:01:22-08:00 ns0:ObjectReference="#Payload_Reference_ID">descriptiontext/html Id="OpenESignForms_Seal_ID" > Target="#OpenESignForms_Seal"> xmlns:ns0="http://open.esignforms.com/XMLSchema/2011" > ns0:DeploymentHostAddress="192.1.1.1" > xmlns:ns1="http://open.esignforms.com/XMLSchema/2011" > ns1:DeploymentHostName="open.esignforms.com" > xmlns:ns2="http://open.esignforms.com/XMLSchema/2011" > ns2:DeploymentId="1.1.1.1" > xmlns:ns3="http://open.esignforms.com/XMLSchema/2011" > ns3:SignerAddress="192.1.1.1" > xmlns:ns4="http://open.esignforms.com/XMLSchema/2011" > ns4:SignerAgent="No-Browser-Test" > xmlns:ns5="http://open.esignforms.com/XMLSchema/2011" > ns5:Timestamp="2019-02-13T11:01:22-08:00" > xmlns:ns6="http://open.esignforms.com/XMLSchema/2011" > ns6:Version="19.1.19"/>
> > > > It's particularly odd because hex 13 isn't a typical character (^S). > > Any idea what that difference is about for the base64 digests and > signatures? > > David > > > On 2/13/19 6:03 AM, Sean Mullan wrote: >> On 2/12/19 6:28 PM, Open eSignForms wrote: >>> Thanks for the update, Sean.? I'm a bit perplexed because I found the >>> original code works under Java 9 and Java 10, so it seems like the >>> change occurred in Java 11. >> >> Sorry, that was a typo, I meant to say JDK 11. >> >>> I don't see the modified version of the test case.? If you attached >>> it, it somehow didn't make it through to me. >>> >>> If it's just a matter of making the code more correct, we'd love to >>> make the changes.? My concern, of course, is that we've already done >>> millions of XML digital signatures, so we need that to continue to >>> verify correctly (and even under Java 11, it seems that the verify >>> code works against previously digitally signed content) even if we >>> now start digitally signing using more update-to-date code. >> >> The verification of pre-existing signatures should continue to work >> regardless of how this bug is addressed. >> >>> Please send over the modified test case and I'll take a look. >> >> It is attached to the bug report in the Attachments section: >> https://bugs.openjdk.java.net/browse/JDK-8218629 (make sure you >> download the one I added yesterday). >> >> --Sean >> >>> >>> Thanks! >>> David >>> >>> On 2/12/19 2:14 PM, Sean Mullan wrote: >>>> The bug is now at https://bugs.openjdk.java.net/browse/JDK-8218629 >>>> >>>> I have started looking at this issue and have some progress I can >>>> report. >>>> >>>> In JDK 9, we updated the version of the Apache XML Signature >>>> implementation in the JDK. Some of the marshalling code was >>>> rewritten such that it will throw Exceptions if legacy DOM level 1 >>>> methods were used to create XML content which is then passed into >>>> XMLObject and similar XMLSignature types that take DOMStructure >>>> objects. This is because the DOM level 1 methods do not support >>>> namespaces. >>>> >>>> I am still evaluating what the best fix is. However, you can >>>> workaround the issue by always using DOM level 3 methods which are >>>> namespace aware. For example, use Document.createElementNS instead >>>> of Document.createElement and Element.createAttributeNS instead of >>>> Element.createAttribute. >>>> >>>> Using legacy or non-namespace aware XML parsers or implementations >>>> is not recommended and the XML Signature Best Practices document >>>> gives some rationale: >>>> https://www.w3.org/TR/xmldsig-bestpractices/#signing-xml-without-namespaces >>>> >>>> That said, this is a regression in behavior so it would be best if >>>> we could restore the previous behavior. >>>> >>>> I have attached a modified version of the test case to the bug >>>> report which no longer throws an Exception. Let me know if this is >>>> an acceptable workaround. Double-check the namespaces that I used to >>>> make sure they are correct. >>>> >>>> --Sean >>>> >>>> >>>> On 2/7/19 11:23 AM, Open eSignForms wrote: >>>> >>>>> On 2/7/19 7:49 AM, Sean Mullan wrote: >>>>>> 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 From jamil.j.nimeh at oracle.com Thu Feb 14 19:17:29 2019 From: jamil.j.nimeh at oracle.com (Jamil Nimeh) Date: Thu, 14 Feb 2019 11:17:29 -0800 Subject: RFR [13] JDK-4919790 : Errors in alert ssl message does not reflect the actual certificate status In-Reply-To: <3f17ece6-f40d-6f0c-ef23-9c3590ac01d8@oracle.com> References: <3c720033-6206-0a49-86d7-5ee407f995a9@oracle.com> <3f17ece6-f40d-6f0c-ef23-9c3590ac01d8@oracle.com> Message-ID: <8f5bab05-5376-0d8b-a3e5-6a8d75aab2da@oracle.com> On 2/14/2019 10:24 AM, Sean Mullan wrote: > On 2/11/19 2:32 PM, Xuelei Fan wrote: >> Hi, >> >> Could I get the update reviewed? >> ??? http://cr.openjdk.java.net/~xuelei/4919790/webrev.00/ > > 721???????????????????? alert = Alert.UNSUPPORTED_CERTIFCATE; > > Can we fix this typo while we are cleaning this up? > s/CERTIFCATE/CERTIFICATE/ > > Also, I was a bit curious about these lines (not part of your fix): > > ?711???????????????? if (reason == BasicReason.REVOKED) { > ?712???????????????????? alert = chc.staplingActive ? > ?713???????????????????????????? Alert.BAD_CERT_STATUS_RESPONSE : > ?714???????????????????????????? Alert.CERTIFICATE_REVOKED; > > If a certificate is revoked, why would you set the alert status to > BAD_CERT_STATUS_RESPONSE if stapling is enabled? I think that was something I did back when we did OCSP stapling in JDK 9.? IIRC, RFC 6066 says that clients receiving stapled responses must check them and alert with bad_certificate_status_response "if the response is not satisfactory" (their words, not mine).? Back then I interpreted "unsatisfactory" to mean both structurally wrong or revoked.? Perhaps that was too broad an interpretation. It's probably worth seeing how a couple other clients handle this case.? I know I had tested with them back in pre-JDK9 days, but I don't recall the results.? I might have some old packet captures lying about still also, I just need to dig them up. > > Also, bug needs a noreg label. > > --Sean > >> It had been a while that the SunJSSE provider use certificate_unknown >> or certificate_revoked (or bad_certificate_status_response for OCSP >> stapling) as the certificate issues alert.? Other certificate alert >> like certificate_expired are not used. >> >> The bug was reported in JDK 6.? With the introducing of >> CertPathValidatorException.BasicReason in JDK 7. Now we can handle >> the alert more accuracy. >> >> Note: please don't rely on the certificate alert type for application >> development.? The alert type may be changed and different per the >> provider preference. >> >> No new regression test as the update is simple and straightforward. >> >> Thanks, >> Xuelei From jamil.j.nimeh at oracle.com Thu Feb 14 19:20:40 2019 From: jamil.j.nimeh at oracle.com (Jamil Nimeh) Date: Thu, 14 Feb 2019 11:20:40 -0800 Subject: RFR [13] JDK-4919790 : Errors in alert ssl message does not reflect the actual certificate status In-Reply-To: <8f5bab05-5376-0d8b-a3e5-6a8d75aab2da@oracle.com> References: <3c720033-6206-0a49-86d7-5ee407f995a9@oracle.com> <3f17ece6-f40d-6f0c-ef23-9c3590ac01d8@oracle.com> <8f5bab05-5376-0d8b-a3e5-6a8d75aab2da@oracle.com> Message-ID: <4d51eef9-c4ba-bdec-20ea-02d14a4c62fa@oracle.com> Whoops, forgot to look at RFC 6961.? Over there, both revoked and structural failures are both supposed to yield bad_certificate_status_response alerts.? I think what we have is conformant with the spec. --Jamil On 2/14/2019 11:17 AM, Jamil Nimeh wrote: > > > On 2/14/2019 10:24 AM, Sean Mullan wrote: >> On 2/11/19 2:32 PM, Xuelei Fan wrote: >>> Hi, >>> >>> Could I get the update reviewed? >>> ??? http://cr.openjdk.java.net/~xuelei/4919790/webrev.00/ >> >> 721???????????????????? alert = Alert.UNSUPPORTED_CERTIFCATE; >> >> Can we fix this typo while we are cleaning this up? >> s/CERTIFCATE/CERTIFICATE/ >> >> Also, I was a bit curious about these lines (not part of your fix): >> >> ?711???????????????? if (reason == BasicReason.REVOKED) { >> ?712???????????????????? alert = chc.staplingActive ? >> ?713???????????????????????????? Alert.BAD_CERT_STATUS_RESPONSE : >> ?714???????????????????????????? Alert.CERTIFICATE_REVOKED; >> >> If a certificate is revoked, why would you set the alert status to >> BAD_CERT_STATUS_RESPONSE if stapling is enabled? > I think that was something I did back when we did OCSP stapling in JDK > 9.? IIRC, RFC 6066 says that clients receiving stapled responses must > check them and alert with bad_certificate_status_response "if the > response is not satisfactory" (their words, not mine).? Back then I > interpreted "unsatisfactory" to mean both structurally wrong or > revoked. Perhaps that was too broad an interpretation. > > It's probably worth seeing how a couple other clients handle this > case.? I know I had tested with them back in pre-JDK9 days, but I > don't recall the results.? I might have some old packet captures lying > about still also, I just need to dig them up. >> >> Also, bug needs a noreg label. >> >> --Sean >> >>> It had been a while that the SunJSSE provider use >>> certificate_unknown or certificate_revoked (or >>> bad_certificate_status_response for OCSP stapling) as the >>> certificate issues alert.? Other certificate alert like >>> certificate_expired are not used. >>> >>> The bug was reported in JDK 6.? With the introducing of >>> CertPathValidatorException.BasicReason in JDK 7. Now we can handle >>> the alert more accuracy. >>> >>> Note: please don't rely on the certificate alert type for >>> application development.? The alert type may be changed and >>> different per the provider preference. >>> >>> No new regression test as the update is simple and straightforward. >>> >>> Thanks, >>> Xuelei > From sean.mullan at oracle.com Thu Feb 14 19:29:52 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Thu, 14 Feb 2019 14:29:52 -0500 Subject: XML Digital Signature throws NAMESPACE_ERR exception under OpenJDK 11 that works under Java SE 8, 9 and 10 In-Reply-To: <648d666c-60a4-bc09-ecd9-f993255040e2@gmail.com> References: <8f5d59e0-89be-9146-7e57-5d2cf755043f@oracle.com> <66dd5bf7-b1b4-b3cf-b595-2c457b29a6af@gmail.com> <32d2fff5-1be5-1201-225e-15ac60982067@gmail.com> <648d666c-60a4-bc09-ecd9-f993255040e2@gmail.com> Message-ID: I will need more time to look into this. In the meantime, another workaround is to just specify null as the namespace to the createElementNS and setAttributeNS methods. I tried this out on your example and it works fine on JDK 11. This should generate signatures just like you were creating before. They won't have the correct ETSI namespace and may instead inherit the XML Signature namespace, but if you haven't seen problems with that, then it might be ok. It's typically more of an issue if you are moving signed content from one document to another and an ancestor namespace can be inherited and break or invalidate the signature, although exclusive C14N is designed to protect against that. --Sean On 2/13/19 6:06 PM, Open eSignForms wrote: > Well, I have found that my verify routines are failing.? I added the > following lines to the main() test method of your fixed code after the > signature is done to attempt to validate the generated signed XML: > > ??? ??? ??? try { > ??? ??? ??? ??? System.err.println("Verifying signedXml..."); > ??? ??? ??? ??? xmldsig.verify(signedXml, signatureKey); > ??? ??? ??? ??? System.err.println("Verified signedXml..."); > ??? ??? ??? } catch(Exception ve) { > System.err.println("XmlDigitalSignature.main() signature verification > exception: " + ve.getMessage()); > ??? ??? ??? } > > This basically submits the created 'signedXml' returned just above with > the same keys.? I also had to update the method "verify(String > signedXml, SignatureKey signatureKey)" where it sets the ID attribute to > include the namespace added in the fixed code: > > > qualifyingPropertiesElement.setIdAttribute*NS("http://uri.etsi.org/01903/v1.1.1#"*,"Id", > true); // mark our id as the "Id" attribute > > This then fails showing 2 out of 4 references validated, the others failing: > > XmlDigitalSignature.verify(SignatureKey) SERIOUS-ERROR Failed core > validation; SignatureValue validated: true > ?-> Reference[0] validated: true > ?-> Reference[1] validated: true > ?-> Reference[2] validated: false > ?-> Reference[3] validated: false > XmlDigitalSignature.verify(SignatureKey) SERIOUS-ERROR exception: > Invalid signature. SignatureValue validated; XML data payload validated; > OpenESignForms Seal validated; Unexpected Reference[2] INVALID; > Unexpected Reference[3] INVALID > > In my test code I was able to show the references subscripts 0-3 being: > > ?-> Reference[0] before validate(): *r.getId(): Payload_Reference_ID*; > r.getURI(): > ?-> Reference[0] validated: true > > ?-> Reference[1] before validate(): r.getId(): null; *r.getURI(): > #KeyInfo_ID* > ?-> Reference[1] validated: true > > ?-> Reference[2] before validate(): r.getId(): null; *r.getURI(): > #QualifyingProperties_ID* > ?-> Reference[2] validated: false > > ?-> Reference[3] before validate(): r.getId(): null; *r.getURI(): > #OpenESignForms_Seal_ID* > ?-> Reference[3] validated: false > > So, the namespace changes made allow the digital signature to be > applied, but now I'm stuck on how to verify these last two references. > It seems that references related to Payload_Reference_ID and #KeyInfo_ID > validate, but #QualifyingProperties_ID and #OpenESignForms_Seal_ID are > failing. > > I'm not sure how those references work with respect to the namespace > changes you suggested. > > In fact, the fixed code no longer validates the digital signature under > Java 8 once the namespaces were added.? Any ideas? > > Thanks, David > > > On 2/13/19 1:23 PM, Open eSignForms wrote: >> >> I checked the ETSI XAdES spec >> (http://uri.etsi.org/01903/v1.1.1/ts_101903v010101p.pdf) and it >> doesn't show any namespace on their entries for their >> QualifyingProperties element and all sub-elements under the ETSI >> example's element . >> >> But, their specification does show element >> should be under the namespace "http://uri.etsi.org/01903/v1.1.1#" as >> you added in your fixed code. >> >> That is, when my snapshot element that's digitally signed using the >> below, it fails with the NAMESPACE_ERR exception: >> >> > timestamp="2019-02-13T11:02:30-08:00" type="document"> >> >> But if my snapshot is set up with the ETSI namespace URI, it works: >> >> > timestamp="2019-02-13T11:02:30-08:00" type="document"> >> >> So, it seems that the XMLSignature is noting that the >> belongs to the default namespace in both cases, >> but of course expects that particular element to belong to the ETSI >> namespace, not ours. >> >> I presume that's correct behavior; I just didn't think that the >> XMLSignature.sign() knew about and was limited to that specific namespace. >> >> If you agree that this is the correct behavior, I think it's not >> really a bug in Java 11, though it fails backwards compatibility. >> >> The only oddity that remains is what I mentioned below with all the >> " " characters in the digests/signatures that appear in Java 11. >> They sure look odd compared to simple line breaks that presumably were >> emitted before. >> >> David >> >> >> >> On 2/13/19 11:20 AM, Open eSignForms wrote: >>> Thanks, Sean.? I was able to find the updated test case source code. >>> >>> A preliminary review seems to show worthwhile changes to our code. >>> That is, the namespaces and such seem to make sense as you have them. >>> >>> In particular, the use of: >>> >>> domSignContext.putNamespacePrefix(XMLSignature.XMLNS, "dsig"); >>> >>> and adding this namespace to additional elements we added: >>> >>> ??? ??? ??? String xmlns = "http://uri.etsi.org/01903/v1.1.1#"; >>> >>> seem reasonable and an acceptable workaround for us.? I'm not sure if >>> those were oversights from before, but likely were the result of it >>> being based on Oracle/Java example code from Java 6 days... >>> >>> We'll incorporate your namespace changes in our code and test, but >>> this seems like it will work as I was able to confirm that your fixed >>> version seems to run on Java 10 and Java 11. >>> >>> It is interesting that the fixed code, though, generates different >>> output on Java 10 and Java 11.? I'm not positive, but it seems that >>> Java 11 adds ' ' to the end of many lines that aren't present in >>> Java 10's output. >>> >>> Under Java 10, a test run products this result: >>> >>> >> timestamp="2019-02-13T11:02:30-08:00" type="document">>> xmlns="http://www.w3.org/1999/xhtml">

Dummy HTML >>> document

]]>>> xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" >>> Id="OpenESignForms_Seal">>> Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"/>>> Id="Payload_Reference_ID" URI="">>> Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>>> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>Zqmii2rv6C+bFM+CSO3s8sAGOrl67HEnv4t8XUgQd5iguf9m7vcVJn3pJz5inCZfx5V9lTtDaj0u >>> >>> xbZSyWE5kQ==>> URI="#KeyInfo_ID">>> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>kZM1pJpRXoeDuolU+kyK41BotQoW7ir5lfg/nNSMoC69bUC2OHzWbQ5Kug0gtrLVIuq5HRdzk6zc >>> 2N2jA0WKMQ==>> URI="#QualifyingProperties_ID">>> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>AFx1CJi739IWZwJL1Y5KU2B+ZioT3ONMBLwLTdT/NTysV/+KYF7lZMgEHaGtLxvc6haIKKKzZisr >>> r2YDQVgs5w==>> URI="#OpenESignForms_Seal_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/kOBmGnEn8agkKlynv5IlJR8xOCxG1U9e8GFfmAwFS5hYtf0Gh/u >>> >>> FRqnOepWQKuZ3kBBR+6KttbE58aD2kVuB36et5Dij1nxr+ihL7e4V42KsQQn/VBDrMoU5xW+yZH/ >>> >>> aAEgpbfUm5detK5oFqs5JIILFiyUXQCrvYuNZFx4vDqrsDmmAaaAPBlcybCUXseqh4hThyrOJ0dX >>> >>> 3xaXcwd32t1+/aOa7jgJRTgSklxhhcRCMHI9HWNlLgUWmvZ2O5G70reY4Kyg1NAS56qX48Xbckvy >>> >>> VMfem/JPPYT/veThnefIgQk=>> xmlns:ns0="http://uri.etsi.org/01903/v1.1.1#" >>> ns0:Id="QualifyingProperties_ID" >>> xmlns="http://uri.etsi.org/01903/v1.1.1#">2019-02-13T11:02:30-08:00>> ns0:ObjectReference="#Payload_Reference_ID">descriptiontext/html>> Id="OpenESignForms_Seal_ID" >>> Target="#OpenESignForms_Seal">>> xmlns:ns0="http://open.esignforms.com/XMLSchema/2011" >>> ns0:DeploymentHostAddress="192.1.1.1" >>> xmlns:ns1="http://open.esignforms.com/XMLSchema/2011" >>> ns1:DeploymentHostName="open.esignforms.com" >>> xmlns:ns2="http://open.esignforms.com/XMLSchema/2011" >>> ns2:DeploymentId="1.1.1.1" >>> xmlns:ns3="http://open.esignforms.com/XMLSchema/2011" >>> ns3:SignerAddress="192.1.1.1" >>> xmlns:ns4="http://open.esignforms.com/XMLSchema/2011" >>> ns4:SignerAgent="No-Browser-Test" >>> xmlns:ns5="http://open.esignforms.com/XMLSchema/2011" >>> ns5:Timestamp="2019-02-13T11:02:30-08:00" >>> xmlns:ns6="http://open.esignforms.com/XMLSchema/2011" >>> ns6:Version="19.1.19"/>
>>> >>> while when run under Java 11 it shows what seems to be the same >>> (clearly, the digest/hashes aren't the same as the 'timestamp' >>> differs because they are actual times) except for lots of ' ' >>> added to the digests and signatures: >>> >>> >> timestamp="2019-02-13T11:01:22-08:00" type="document">>> xmlns="http://www.w3.org/1999/xhtml">

Dummy HTML >>> document

]]>>> xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" >>> Id="OpenESignForms_Seal">>> Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"/>>> Id="Payload_Reference_ID" URI="">>> Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>>> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>LdB/ydGxr3VUoTshQtOvQNmMZmt2OHgLax4tSk9Lqb1c+X1h4Uc/RBVXwfI9QrVnITBz85Fi8Bwr >>> >>> 7wyMjw84cA==>> URI="#KeyInfo_ID">>> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>FkpexxTwhpCPHHsMrKGnBXE5hkZ/x10ArpzjX6ltYfOilvVAubzc9sNPwo6phw//ot1rSKPU5jTB >>> LRD7p7t50g==>> URI="#QualifyingProperties_ID">>> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>LxB0xAsDxKqeyCflaSUgMQOMhoxP4Gl9GfvlpCiL/gd9rz36qG4roaFRl+4PBC+IxzGiRDOqzQYX >>> x6gSn5d1IQ==>> URI="#OpenESignForms_Seal_ID">>> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>Pqd+9yaeBMytcG1sTTpuq+Wrd3lZSC18j7lv6VQ6LjUSz9VN7uwVNNn1E79mY8H6XUI2jbd/IozM >>> oba2KF46ig==IpdHZtzSw8TOnp0gfKMaCp30jJAPP8YCAIg4OBvRobIwHBFrG+O9v7peXRRA5nXi+fm4bdemi5jI >>> >>> /N2smS7W6lKMMeTzrYNJEmpD/0c/SVCs0M1peZmiWZD/F6GYP6RkhZfTglk9skKsZIme3W5lHL5e >>> >>> vTFno50J32oW0chq/jPzD42snoVQmVKS9wqqybGgRrm1W2RSWfziNo7QjXtJuR5eVuCtqpOLrGrS >>> >>> J0aLaaNLucia/6cJyZ13mz7131Lj2Y4oJbrbpzvrDY5xDfFDK+bRRMR3DCvTLgKcZZz5zxcAKYL8 >>> >>> lG64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GnP2OgyXwM5MsJwuEanfnRWtxxuH29q4BxFwr+cL7Jo8j+aCGY3YPbJnctndnqTvwmX0 >>> >>> FRXs8vljK7FCZmNU/TuUm+LqCUtSbbej5zdzgPuuAcviAwIDAQABMA4GA1UdDwEB/wQEAwIGwDAN >>> >>> BgkqhkiG9w0BAQ0FAAOCAgEAOu3Y4o7P4wel6zcwGIHfwuTuL/IX9qzYnxtPNkEHL8D8v3P4Tovk >>> >>> zDHOou4Ai5yycZninbaoK2WJr80p2HNfISY51fCJZ+Z16xmBlPmunnLI23cTAJGnZlI6WtsZLXQw >>> >>> LX91VkqKlRL73+MZECxO0m5I4hxNu8CeOIcQ7aCLvnkO8AEeCa9zAwmiL2tJ8coJvELvqS9Zaiaz >>> >>> syix8IWETtrZ+vv+85rASl5PSkCb0AX3eipJoqRgGazWraV7NBwDZgPEYXNQq1/jbQoirjJIzNQO >>> >>> KEgH3wViGFVwnW4YJ4dzbtVd6EVaHZGmYb666FpwNPz6OBLgX1sjvDTMTYGYo/VrIN02neYEvBtK >>> >>> GrZ5Gw7l7BOyKe92F3iQ3q90/kOBmGnEn8agkKlynv5IlJR8xOCxG1U9e8GFfmAwFS5hYtf0Gh/u >>> >>> FRqnOepWQKuZ3kBBR+6KttbE58aD2kVuB36et5Dij1nxr+ihL7e4V42KsQQn/VBDrMoU5xW+yZH/ >>> >>> aAEgpbfUm5detK5oFqs5JIILFiyUXQCrvYuNZFx4vDqrsDmmAaaAPBlcybCUXseqh4hThyrOJ0dX >>> >>> 3xaXcwd32t1+/aOa7jgJRTgSklxhhcRCMHI9HWNlLgUWmvZ2O5G70reY4Kyg1NAS56qX48Xbckvy >>> >>> VMfem/JPPYT/veThnefIgQk=>> xmlns:ns0="http://uri.etsi.org/01903/v1.1.1#" >>> ns0:Id="QualifyingProperties_ID" >>> xmlns="http://uri.etsi.org/01903/v1.1.1#">2019-02-13T11:01:22-08:00>> ns0:ObjectReference="#Payload_Reference_ID">descriptiontext/html>> Id="OpenESignForms_Seal_ID" >>> Target="#OpenESignForms_Seal">>> xmlns:ns0="http://open.esignforms.com/XMLSchema/2011" >>> ns0:DeploymentHostAddress="192.1.1.1" >>> xmlns:ns1="http://open.esignforms.com/XMLSchema/2011" >>> ns1:DeploymentHostName="open.esignforms.com" >>> xmlns:ns2="http://open.esignforms.com/XMLSchema/2011" >>> ns2:DeploymentId="1.1.1.1" >>> xmlns:ns3="http://open.esignforms.com/XMLSchema/2011" >>> ns3:SignerAddress="192.1.1.1" >>> xmlns:ns4="http://open.esignforms.com/XMLSchema/2011" >>> ns4:SignerAgent="No-Browser-Test" >>> xmlns:ns5="http://open.esignforms.com/XMLSchema/2011" >>> ns5:Timestamp="2019-02-13T11:01:22-08:00" >>> xmlns:ns6="http://open.esignforms.com/XMLSchema/2011" >>> ns6:Version="19.1.19"/>
>>> >>> >>> It's particularly odd because hex 13 isn't a typical character (^S). >>> >>> Any idea what that difference is about for the base64 digests and >>> signatures? >>> >>> David >>> >>> >>> On 2/13/19 6:03 AM, Sean Mullan wrote: >>>> On 2/12/19 6:28 PM, Open eSignForms wrote: >>>>> Thanks for the update, Sean.? I'm a bit perplexed because I found >>>>> the original code works under Java 9 and Java 10, so it seems like >>>>> the change occurred in Java 11. >>>> >>>> Sorry, that was a typo, I meant to say JDK 11. >>>> >>>>> I don't see the modified version of the test case.? If you attached >>>>> it, it somehow didn't make it through to me. >>>>> >>>>> If it's just a matter of making the code more correct, we'd love to >>>>> make the changes.? My concern, of course, is that we've already >>>>> done millions of XML digital signatures, so we need that to >>>>> continue to verify correctly (and even under Java 11, it seems that >>>>> the verify code works against previously digitally signed content) >>>>> even if we now start digitally signing using more update-to-date code. >>>> >>>> The verification of pre-existing signatures should continue to work >>>> regardless of how this bug is addressed. >>>> >>>>> Please send over the modified test case and I'll take a look. >>>> >>>> It is attached to the bug report in the Attachments section: >>>> https://bugs.openjdk.java.net/browse/JDK-8218629 (make sure you >>>> download the one I added yesterday). >>>> >>>> --Sean >>>> >>>>> >>>>> Thanks! >>>>> David >>>>> >>>>> On 2/12/19 2:14 PM, Sean Mullan wrote: >>>>>> The bug is now at https://bugs.openjdk.java.net/browse/JDK-8218629 >>>>>> >>>>>> I have started looking at this issue and have some progress I can >>>>>> report. >>>>>> >>>>>> In JDK 9, we updated the version of the Apache XML Signature >>>>>> implementation in the JDK. Some of the marshalling code was >>>>>> rewritten such that it will throw Exceptions if legacy DOM level 1 >>>>>> methods were used to create XML content which is then passed into >>>>>> XMLObject and similar XMLSignature types that take DOMStructure >>>>>> objects. This is because the DOM level 1 methods do not support >>>>>> namespaces. >>>>>> >>>>>> I am still evaluating what the best fix is. However, you can >>>>>> workaround the issue by always using DOM level 3 methods which are >>>>>> namespace aware. For example, use Document.createElementNS instead >>>>>> of Document.createElement and Element.createAttributeNS instead of >>>>>> Element.createAttribute. >>>>>> >>>>>> Using legacy or non-namespace aware XML parsers or implementations >>>>>> is not recommended and the XML Signature Best Practices document >>>>>> gives some rationale: >>>>>> https://www.w3.org/TR/xmldsig-bestpractices/#signing-xml-without-namespaces >>>>>> >>>>>> That said, this is a regression in behavior so it would be best if >>>>>> we could restore the previous behavior. >>>>>> >>>>>> I have attached a modified version of the test case to the bug >>>>>> report which no longer throws an Exception. Let me know if this is >>>>>> an acceptable workaround. Double-check the namespaces that I used >>>>>> to make sure they are correct. >>>>>> >>>>>> --Sean >>>>>> >>>>>> >>>>>> On 2/7/19 11:23 AM, Open eSignForms wrote: >>>>>> >>>>>>> On 2/7/19 7:49 AM, Sean Mullan wrote: >>>>>>>> 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 From xuelei.fan at oracle.com Thu Feb 14 19:38:34 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Thu, 14 Feb 2019 11:38:34 -0800 Subject: RFR [13] JDK-4919790 : Errors in alert ssl message does not reflect the actual certificate status In-Reply-To: <3f17ece6-f40d-6f0c-ef23-9c3590ac01d8@oracle.com> References: <3c720033-6206-0a49-86d7-5ee407f995a9@oracle.com> <3f17ece6-f40d-6f0c-ef23-9c3590ac01d8@oracle.com> Message-ID: <973bb5b9-8cbd-281f-3606-88a2c8cd270d@oracle.com> On 2/14/2019 10:24 AM, Sean Mullan wrote: > On 2/11/19 2:32 PM, Xuelei Fan wrote: >> Hi, >> >> Could I get the update reviewed? >> ??? http://cr.openjdk.java.net/~xuelei/4919790/webrev.00/ > > 721???????????????????? alert = Alert.UNSUPPORTED_CERTIFCATE; > > Can we fix this typo while we are cleaning this up? > s/CERTIFCATE/CERTIFICATE/ > Good catch! Here is the updated webrev: http://cr.openjdk.java.net/~xuelei/4919790/webrev.01/ > Also, I was a bit curious about these lines (not part of your fix): > > ?711???????????????? if (reason == BasicReason.REVOKED) { > ?712???????????????????? alert = chc.staplingActive ? > ?713???????????????????????????? Alert.BAD_CERT_STATUS_RESPONSE : > ?714???????????????????????????? Alert.CERTIFICATE_REVOKED; > > If a certificate is revoked, why would you set the alert status to > BAD_CERT_STATUS_RESPONSE if stapling is enabled? > See Jamil's reply. The spec is a little bit wired to me although. Note that the new added items are not controlled by OCSP stapling, so we can use the original reason. > Also, bug needs a noreg label. > Added. Thanks, Xuelei > --Sean > >> It had been a while that the SunJSSE provider use certificate_unknown >> or certificate_revoked (or bad_certificate_status_response for OCSP >> stapling) as the certificate issues alert.? Other certificate alert >> like certificate_expired are not used. >> >> The bug was reported in JDK 6.? With the introducing of >> CertPathValidatorException.BasicReason in JDK 7. Now we can handle the >> alert more accuracy. >> >> Note: please don't rely on the certificate alert type for application >> development.? The alert type may be changed and different per the >> provider preference. >> >> No new regression test as the update is simple and straightforward. >> >> Thanks, >> Xuelei From sean.mullan at oracle.com Thu Feb 14 19:49:38 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Thu, 14 Feb 2019 14:49:38 -0500 Subject: RFR [13] JDK-4919790 : Errors in alert ssl message does not reflect the actual certificate status In-Reply-To: <4d51eef9-c4ba-bdec-20ea-02d14a4c62fa@oracle.com> References: <3c720033-6206-0a49-86d7-5ee407f995a9@oracle.com> <3f17ece6-f40d-6f0c-ef23-9c3590ac01d8@oracle.com> <8f5bab05-5376-0d8b-a3e5-6a8d75aab2da@oracle.com> <4d51eef9-c4ba-bdec-20ea-02d14a4c62fa@oracle.com> Message-ID: On 2/14/19 2:20 PM, Jamil Nimeh wrote: > Whoops, forgot to look at RFC 6961.? Over there, both revoked and > structural failures are both supposed to yield > bad_certificate_status_response alerts.? I think what we have is > conformant with the spec. Ok, thanks for checking, let's leave the code as is. --Sean From sean.mullan at oracle.com Thu Feb 14 19:51:00 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Thu, 14 Feb 2019 14:51:00 -0500 Subject: RFR [13] JDK-4919790 : Errors in alert ssl message does not reflect the actual certificate status In-Reply-To: <973bb5b9-8cbd-281f-3606-88a2c8cd270d@oracle.com> References: <3c720033-6206-0a49-86d7-5ee407f995a9@oracle.com> <3f17ece6-f40d-6f0c-ef23-9c3590ac01d8@oracle.com> <973bb5b9-8cbd-281f-3606-88a2c8cd270d@oracle.com> Message-ID: <0db4154e-be7f-379f-82e1-00334e87d405@oracle.com> On 2/14/19 2:38 PM, Xuelei Fan wrote: > Good catch!? Here is the updated webrev: > http://cr.openjdk.java.net/~xuelei/4919790/webrev.01/ Looks good. --Sean From mandy.chung at oracle.com Thu Feb 14 20:40:20 2019 From: mandy.chung at oracle.com (Mandy Chung) Date: Thu, 14 Feb 2019 12:40:20 -0800 Subject: CSR Review Request, JDK-8218932 Remove the internal package com.sun.net.ssl In-Reply-To: <6071db41-91d6-6f55-ddeb-658c93a37280@oracle.com> References: <6071db41-91d6-6f55-ddeb-658c93a37280@oracle.com> Message-ID: On 2/13/19 1:51 PM, Xuelei Fan wrote: > Hi, > > Could I get the CSR reviewed: > ?? https://bugs.openjdk.java.net/browse/JDK-8218932 > > The internal package com.sun.net.ssl had been deprecated since JDK 1.4, > and was not exported in the java.base module since JDK 9.? Application > cannot use them directly now.? It should be safe to remove them in JDK 13. > > If you are using the internal package for some reason, please let me > know the compatibility impact by the end of Feb 20, 2019. For those who are not aware of the jdeps tool: jdeps -jdkinternals will flag static references to JDK internal APIs and output some suggestion if a replacement API is known like this: JDK Internal API Suggested Replacement ---------------- --------------------- com.sun.net.ssl.HostnameVerifier Use javax.net.ssl @since 1.4 com.sun.net.ssl.internal.ssl.Provider Use java.security.Security.getProvider(provider-name) @since 1.3 Run jdeps on your libraries to find out any use of JDK internal APIs. Mandy From yozons at gmail.com Thu Feb 14 20:53:57 2019 From: yozons at gmail.com (Open eSignForms) Date: Thu, 14 Feb 2019 12:53:57 -0800 Subject: XML Digital Signature throws NAMESPACE_ERR exception under OpenJDK 11 that works under Java SE 8, 9 and 10 In-Reply-To: References: <8f5d59e0-89be-9146-7e57-5d2cf755043f@oracle.com> <66dd5bf7-b1b4-b3cf-b595-2c457b29a6af@gmail.com> <32d2fff5-1be5-1201-225e-15ac60982067@gmail.com> <648d666c-60a4-bc09-ecd9-f993255040e2@gmail.com> Message-ID: Thanks.? I sent over the latest code that I was testing on yesterday. I changed our code to use null instead of "http://uri.etsi.org/01903/v1.4.1#" -- as well as removed the "xades:" prefixes (with or without prefixes never resolved anything for me, though the prefix made the XML look better than all the generated prefixes).? It still signs fine, but the verify fails, and it only fails in reference #3 which is the ETSI/XAdES element. XmlDigitalSignature.verify(SignatureKey) SERIOUS-ERROR Failed core validation; SignatureValue validated: true ?-> Reference[0] before validate(): r.getId(): Payload_Reference_ID; r.getURI(): ?-> Reference[0] validated: true ?-> Reference[1] before validate(): r.getId(): null; r.getURI(): #KeyInfo_ID ?-> Reference[1] validated: true *?-> Reference[2] before validate(): r.getId(): null; r.getURI(): #QualifyingProperties_ID** **?-> Reference[2] validated: false** *?-> Reference[3] before validate(): r.getId(): null; r.getURI(): #OpenESignForms_Seal_ID ?-> Reference[3] validated: true It's not clear why that section can generate the signature fine, but can't validate it. Before removing the namespace spec on that element, it appeared fine in the signed XML, but fails verification: ??? ??????? ??????????? ??????????????? 2019-02-14T10:46:44-08:00 ??????????????? ??????????????? ??????????????????? description text/html ??????????????????? ??????????????? ??????????? ??????????? ??????? ??? With the namespace removed, it also looks normal and fine to me, but still fails verification: ??? ??????? ??????????? ??????????????? 2019-02-14T11:33:27-08:00 ??????????????? ??????????????? ??????????????????? description ??????????????????????? text/html ??????????????????? ??????????????? ??????????? ??????? ??? On 2/14/19 11:29 AM, Sean Mullan wrote: > I will need more time to look into this. In the meantime, another > workaround is to just specify null as the namespace to the > createElementNS and setAttributeNS methods. I tried this out on your > example and it works fine on JDK 11. This should generate signatures > just like you were creating before. They won't have the correct ETSI > namespace and may instead inherit the XML Signature namespace, but if > you haven't seen problems with that, then it might be ok. It's > typically more of an issue if you are moving signed content from one > document to another and an ancestor namespace can be inherited and > break or invalidate the signature, although exclusive C14N is designed > to protect against that. > > > --Sean > > On 2/13/19 6:06 PM, Open eSignForms wrote: >> Well, I have found that my verify routines are failing.? I added the >> following lines to the main() test method of your fixed code after >> the signature is done to attempt to validate the generated signed XML: >> >> ???? ??? ??? try { >> ???? ??? ??? ??? System.err.println("Verifying signedXml..."); >> ???? ??? ??? ??? xmldsig.verify(signedXml, signatureKey); >> ???? ??? ??? ??? System.err.println("Verified signedXml..."); >> ???? ??? ??? } catch(Exception ve) { >> System.err.println("XmlDigitalSignature.main() signature verification >> exception: " + ve.getMessage()); >> ???? ??? ??? } >> >> This basically submits the created 'signedXml' returned just above >> with the same keys.? I also had to update the method "verify(String >> signedXml, SignatureKey signatureKey)" where it sets the ID attribute >> to include the namespace added in the fixed code: >> >> qualifyingPropertiesElement.setIdAttribute*NS("http://uri.etsi.org/01903/v1.1.1#"*,"Id", >> true); // mark our id as the "Id" attribute >> >> This then fails showing 2 out of 4 references validated, the others >> failing: >> >> XmlDigitalSignature.verify(SignatureKey) SERIOUS-ERROR Failed core >> validation; SignatureValue validated: true >> ??-> Reference[0] validated: true >> ??-> Reference[1] validated: true >> ??-> Reference[2] validated: false >> ??-> Reference[3] validated: false >> XmlDigitalSignature.verify(SignatureKey) SERIOUS-ERROR exception: >> Invalid signature. SignatureValue validated; XML data payload >> validated; OpenESignForms Seal validated; Unexpected Reference[2] >> INVALID; Unexpected Reference[3] INVALID >> >> In my test code I was able to show the references subscripts 0-3 being: >> >> ??-> Reference[0] before validate(): *r.getId(): >> Payload_Reference_ID*; r.getURI(): >> ??-> Reference[0] validated: true >> >> ??-> Reference[1] before validate(): r.getId(): null; *r.getURI(): >> #KeyInfo_ID* >> ??-> Reference[1] validated: true >> >> ??-> Reference[2] before validate(): r.getId(): null; *r.getURI(): >> #QualifyingProperties_ID* >> ??-> Reference[2] validated: false >> >> ??-> Reference[3] before validate(): r.getId(): null; *r.getURI(): >> #OpenESignForms_Seal_ID* >> ??-> Reference[3] validated: false >> >> So, the namespace changes made allow the digital signature to be >> applied, but now I'm stuck on how to verify these last two >> references.? It seems that references related to Payload_Reference_ID >> and #KeyInfo_ID validate, but #QualifyingProperties_ID and >> #OpenESignForms_Seal_ID are failing. >> >> I'm not sure how those references work with respect to the namespace >> changes you suggested. >> >> In fact, the fixed code no longer validates the digital signature >> under Java 8 once the namespaces were added.? Any ideas? >> >> Thanks, David >> >> >> On 2/13/19 1:23 PM, Open eSignForms wrote: >>> >>> I checked the ETSI XAdES spec >>> (http://uri.etsi.org/01903/v1.1.1/ts_101903v010101p.pdf) and it >>> doesn't show any namespace on their entries for their >>> QualifyingProperties element and all sub-elements under the ETSI >>> example's element . >>> >>> But, their specification does show element >>> should be under the namespace "http://uri.etsi.org/01903/v1.1.1#" as >>> you added in your fixed code. >>> >>> That is, when my snapshot element that's digitally signed using the >>> below, it fails with the NAMESPACE_ERR exception: >>> >>> >> timestamp="2019-02-13T11:02:30-08:00" type="document"> >>> >>> But if my snapshot is set up with the ETSI namespace URI, it works: >>> >>> >> timestamp="2019-02-13T11:02:30-08:00" type="document"> >>> >>> So, it seems that the XMLSignature is noting that the >>> belongs to the default namespace in both >>> cases, but of course expects that particular element to belong to >>> the ETSI namespace, not ours. >>> >>> I presume that's correct behavior; I just didn't think that the >>> XMLSignature.sign() knew about and was limited to that specific >>> namespace. >>> >>> If you agree that this is the correct behavior, I think it's not >>> really a bug in Java 11, though it fails backwards compatibility. >>> >>> The only oddity that remains is what I mentioned below with all the >>> " " characters in the digests/signatures that appear in Java >>> 11.? They sure look odd compared to simple line breaks that >>> presumably were emitted before. >>> >>> David >>> >>> >>> >>> On 2/13/19 11:20 AM, Open eSignForms wrote: >>>> Thanks, Sean.? I was able to find the updated test case source code. >>>> >>>> A preliminary review seems to show worthwhile changes to our code.? >>>> That is, the namespaces and such seem to make sense as you have them. >>>> >>>> In particular, the use of: >>>> >>>> domSignContext.putNamespacePrefix(XMLSignature.XMLNS, "dsig"); >>>> >>>> and adding this namespace to additional elements we added: >>>> >>>> ??? ??? ??? String xmlns = "http://uri.etsi.org/01903/v1.1.1#"; >>>> >>>> seem reasonable and an acceptable workaround for us.? I'm not sure >>>> if those were oversights from before, but likely were the result of >>>> it being based on Oracle/Java example code from Java 6 days... >>>> >>>> We'll incorporate your namespace changes in our code and test, but >>>> this seems like it will work as I was able to confirm that your >>>> fixed version seems to run on Java 10 and Java 11. >>>> >>>> It is interesting that the fixed code, though, generates different >>>> output on Java 10 and Java 11.? I'm not positive, but it seems that >>>> Java 11 adds ' ' to the end of many lines that aren't present >>>> in Java 10's output. >>>> >>>> Under Java 10, a test run products this result: >>>> >>>> >>> timestamp="2019-02-13T11:02:30-08:00" >>>> type="document">>>> xmlns="http://www.w3.org/1999/xhtml">

Dummy >>>> HTML document

]]>>>> xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" >>>> Id="OpenESignForms_Seal">>>> Algorithm="http://www.w3.org/2006/12/xml-c14n11#WithComments"/>>>> Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"/>>>> Id="Payload_Reference_ID" URI="">>>> Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>>>> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>Zqmii2rv6C+bFM+CSO3s8sAGOrl67HEnv4t8XUgQd5iguf9m7vcVJn3pJz5inCZfx5V9lTtDaj0u >>>> >>>> xbZSyWE5kQ==>>> URI="#KeyInfo_ID">>>> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>kZM1pJpRXoeDuolU+kyK41BotQoW7ir5lfg/nNSMoC69bUC2OHzWbQ5Kug0gtrLVIuq5HRdzk6zc >>>> 2N2jA0WKMQ==>>> URI="#QualifyingProperties_ID">>>> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>AFx1CJi739IWZwJL1Y5KU2B+ZioT3ONMBLwLTdT/NTysV/+KYF7lZMgEHaGtLxvc6haIKKKzZisr >>>> r2YDQVgs5w==>>> URI="#OpenESignForms_Seal_ID">>>> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>jhVDd7nvr4s2bu7LRNHb7yj2gQRzAE7fXcsgonq2Qsn4EWNfpqNEVUViIy9jh86tTs5ZiakaGAEs >>>> l9YV1hNnEg==izJCFA5lBOjc7zhlc/1Wrsu+/jd0o0aPtemm4hM7aMKJvzkKddhjaHRY9iX4qtMZJtl7L1qj4YGN >>>> >>>> hxHc2Wjuj6F1ZFD9asPf/kumVliAqTwNvhfyVfmpbaZtzQVtOQWhNIC1PivbPfbwTKr1yztLbo0K >>>> >>>> B8TJWWiqHBjgEjlhw8X84buXVsCIUaAkOJG73Q0x9hMDVPf5y5R56xknLwjwzQPdveMI3zKvKvq5 >>>> >>>> vj1UPKVqlCjrjPa1HR0g4wEOjL51HCK/EWVbB4LLRAL59KB6ERW01CaRX1crGzQw6wz5eFVWK/0o >>>> >>>> NcIdn4wc7rWPdYfT362iqqJMzIyUQGHmk7FVD/1Nky2wlEvYaRk7PrpbXo8ISSPB+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lcSBJn4PrNW/tWQAmLN0n3UoqzjL/Kl6XiW6s1z >>>> >>>> IF3eHPDzGnP2OgyXwM5MsJwuEanfnRWtxxuH29q4BxFwr+cL7Jo8j+aCGY3YPbJnctndnqTvwmX0 >>>> >>>> FRXs8vljK7FCZmNU/TuUm+LqCUtSbbej5zdzgPuuAcviAwIDAQABMA4GA1UdDwEB/wQEAwIGwDAN >>>> >>>> BgkqhkiG9w0BAQ0FAAOCAgEAOu3Y4o7P4wel6zcwGIHfwuTuL/IX9qzYnxtPNkEHL8D8v3P4Tovk >>>> >>>> zDHOou4Ai5yycZninbaoK2WJr80p2HNfISY51fCJZ+Z16xmBlPmunnLI23cTAJGnZlI6WtsZLXQw >>>> >>>> LX91VkqKlRL73+MZECxO0m5I4hxNu8CeOIcQ7aCLvnkO8AEeCa9zAwmiL2tJ8coJvELvqS9Zaiaz >>>> >>>> syix8IWETtrZ+vv+85rASl5PSkCb0AX3eipJoqRgGazWraV7NBwDZgPEYXNQq1/jbQoirjJIzNQO >>>> >>>> KEgH3wViGFVwnW4YJ4dzbtVd6EVaHZGmYb666FpwNPz6OBLgX1sjvDTMTYGYo/VrIN02neYEvBtK >>>> >>>> GrZ5Gw7l7BOyKe92F3iQ3q90/kOBmGnEn8agkKlynv5IlJR8xOCxG1U9e8GFfmAwFS5hYtf0Gh/u >>>> >>>> FRqnOepWQKuZ3kBBR+6KttbE58aD2kVuB36et5Dij1nxr+ihL7e4V42KsQQn/VBDrMoU5xW+yZH/ >>>> >>>> aAEgpbfUm5detK5oFqs5JIILFiyUXQCrvYuNZFx4vDqrsDmmAaaAPBlcybCUXseqh4hThyrOJ0dX >>>> >>>> 3xaXcwd32t1+/aOa7jgJRTgSklxhhcRCMHI9HWNlLgUWmvZ2O5G70reY4Kyg1NAS56qX48Xbckvy >>>> >>>> VMfem/JPPYT/veThnefIgQk=>>> xmlns:ns0="http://uri.etsi.org/01903/v1.1.1#" >>>> ns0:Id="QualifyingProperties_ID" >>>> xmlns="http://uri.etsi.org/01903/v1.1.1#">2019-02-13T11:02:30-08:00>>> ns0:ObjectReference="#Payload_Reference_ID">descriptiontext/html>>> Id="OpenESignForms_Seal_ID" >>>> Target="#OpenESignForms_Seal">>>> xmlns:ns0="http://open.esignforms.com/XMLSchema/2011" >>>> ns0:DeploymentHostAddress="192.1.1.1" >>>> xmlns:ns1="http://open.esignforms.com/XMLSchema/2011" >>>> ns1:DeploymentHostName="open.esignforms.com" >>>> xmlns:ns2="http://open.esignforms.com/XMLSchema/2011" >>>> ns2:DeploymentId="1.1.1.1" >>>> xmlns:ns3="http://open.esignforms.com/XMLSchema/2011" >>>> ns3:SignerAddress="192.1.1.1" >>>> xmlns:ns4="http://open.esignforms.com/XMLSchema/2011" >>>> ns4:SignerAgent="No-Browser-Test" >>>> xmlns:ns5="http://open.esignforms.com/XMLSchema/2011" >>>> ns5:Timestamp="2019-02-13T11:02:30-08:00" >>>> xmlns:ns6="http://open.esignforms.com/XMLSchema/2011" >>>> ns6:Version="19.1.19"/>
>>>> >>>> while when run under Java 11 it shows what seems to be the same >>>> (clearly, the digest/hashes aren't the same as the 'timestamp' >>>> differs because they are actual times) except for lots of ' ' >>>> added to the digests and signatures: >>>> >>>> >>> timestamp="2019-02-13T11:01:22-08:00" >>>> type="document">>>> xmlns="http://www.w3.org/1999/xhtml">

Dummy >>>> HTML document

]]>>>> xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" >>>> Id="OpenESignForms_Seal">>>> Algorithm="http://www.w3.org/2006/12/xml-c14n11#WithComments"/>>>> Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"/>>>> Id="Payload_Reference_ID" URI="">>>> Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>>>> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>LdB/ydGxr3VUoTshQtOvQNmMZmt2OHgLax4tSk9Lqb1c+X1h4Uc/RBVXwfI9QrVnITBz85Fi8Bwr >>>> >>>> 7wyMjw84cA==>>> URI="#KeyInfo_ID">>>> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>FkpexxTwhpCPHHsMrKGnBXE5hkZ/x10ArpzjX6ltYfOilvVAubzc9sNPwo6phw//ot1rSKPU5jTB >>>> LRD7p7t50g==>>> URI="#QualifyingProperties_ID">>>> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>LxB0xAsDxKqeyCflaSUgMQOMhoxP4Gl9GfvlpCiL/gd9rz36qG4roaFRl+4PBC+IxzGiRDOqzQYX >>>> x6gSn5d1IQ==>>> URI="#OpenESignForms_Seal_ID">>>> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>Pqd+9yaeBMytcG1sTTpuq+Wrd3lZSC18j7lv6VQ6LjUSz9VN7uwVNNn1E79mY8H6XUI2jbd/IozM >>>> oba2KF46ig==IpdHZtzSw8TOnp0gfKMaCp30jJAPP8YCAIg4OBvRobIwHBFrG+O9v7peXRRA5nXi+fm4bdemi5jI >>>> >>>> /N2smS7W6lKMMeTzrYNJEmpD/0c/SVCs0M1peZmiWZD/F6GYP6RkhZfTglk9skKsZIme3W5lHL5e >>>> >>>> vTFno50J32oW0chq/jPzD42snoVQmVKS9wqqybGgRrm1W2RSWfziNo7QjXtJuR5eVuCtqpOLrGrS >>>> >>>> J0aLaaNLucia/6cJyZ13mz7131Lj2Y4oJbrbpzvrDY5xDfFDK+bRRMR3DCvTLgKcZZz5zxcAKYL8 >>>> >>>> lG64U/tsmd/ZVn+d+fJGH03hPdvY/wMW7MTN1k/6S95PiNdx0cLeP0HLCug9zWiC7vUkrVDrsO9i >>>> >>>> qsvSYKcAH8vQlG1arZgGJn88Hg8EGjmmWXs15ulU3Lm8TOTXl/xi6O4stSgMi9dFSsE1ISHAPaxN >>>> >>>> D3Rqg7Bv7p/iEVn0xXq/C9AI3iwrpHbip8K81uJOsaiZgwR5D40XyYLV9FUPIacRclfT5EJKsx6k >>>> >>>> jYiprWMOMjmnlJwj2vI8zG6sYLVJdQywm2isWu5eHSw39W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o7P4wel6zcwGIHfwuTuL/IX9qzYnxtPNkEHL8D8v3P4Tovk >>>> >>>> zDHOou4Ai5yycZninbaoK2WJr80p2HNfISY51fCJZ+Z16xmBlPmunnLI23cTAJGnZlI6WtsZLXQw >>>> >>>> LX91VkqKlRL73+MZECxO0m5I4hxNu8CeOIcQ7aCLvnkO8AEeCa9zAwmiL2tJ8coJvELvqS9Zaiaz >>>> >>>> syix8IWETtrZ+vv+85rASl5PSkCb0AX3eipJoqRgGazWraV7NBwDZgPEYXNQq1/jbQoirjJIzNQO >>>> >>>> KEgH3wViGFVwnW4YJ4dzbtVd6EVaHZGmYb666FpwNPz6OBLgX1sjvDTMTYGYo/VrIN02neYEvBtK >>>> >>>> GrZ5Gw7l7BOyKe92F3iQ3q90/kOBmGnEn8agkKlynv5IlJR8xOCxG1U9e8GFfmAwFS5hYtf0Gh/u >>>> >>>> FRqnOepWQKuZ3kBBR+6KttbE58aD2kVuB36et5Dij1nxr+ihL7e4V42KsQQn/VBDrMoU5xW+yZH/ >>>> >>>> aAEgpbfUm5detK5oFqs5JIILFiyUXQCrvYuNZFx4vDqrsDmmAaaAPBlcybCUXseqh4hThyrOJ0dX >>>> >>>> 3xaXcwd32t1+/aOa7jgJRTgSklxhhcRCMHI9HWNlLgUWmvZ2O5G70reY4Kyg1NAS56qX48Xbckvy >>>> >>>> VMfem/JPPYT/veThnefIgQk=>>> xmlns:ns0="http://uri.etsi.org/01903/v1.1.1#" >>>> ns0:Id="QualifyingProperties_ID" >>>> xmlns="http://uri.etsi.org/01903/v1.1.1#">2019-02-13T11:01:22-08:00>>> ns0:ObjectReference="#Payload_Reference_ID">descriptiontext/html>>> Id="OpenESignForms_Seal_ID" >>>> Target="#OpenESignForms_Seal">>>> xmlns:ns0="http://open.esignforms.com/XMLSchema/2011" >>>> ns0:DeploymentHostAddress="192.1.1.1" >>>> xmlns:ns1="http://open.esignforms.com/XMLSchema/2011" >>>> ns1:DeploymentHostName="open.esignforms.com" >>>> xmlns:ns2="http://open.esignforms.com/XMLSchema/2011" >>>> ns2:DeploymentId="1.1.1.1" >>>> xmlns:ns3="http://open.esignforms.com/XMLSchema/2011" >>>> ns3:SignerAddress="192.1.1.1" >>>> xmlns:ns4="http://open.esignforms.com/XMLSchema/2011" >>>> ns4:SignerAgent="No-Browser-Test" >>>> xmlns:ns5="http://open.esignforms.com/XMLSchema/2011" >>>> ns5:Timestamp="2019-02-13T11:01:22-08:00" >>>> xmlns:ns6="http://open.esignforms.com/XMLSchema/2011" >>>> ns6:Version="19.1.19"/>
>>>> >>>> >>>> It's particularly odd because hex 13 isn't a typical character (^S). >>>> >>>> Any idea what that difference is about for the base64 digests and >>>> signatures? >>>> >>>> David >>>> >>>> >>>> On 2/13/19 6:03 AM, Sean Mullan wrote: >>>>> On 2/12/19 6:28 PM, Open eSignForms wrote: >>>>>> Thanks for the update, Sean.? I'm a bit perplexed because I found >>>>>> the original code works under Java 9 and Java 10, so it seems >>>>>> like the change occurred in Java 11. >>>>> >>>>> Sorry, that was a typo, I meant to say JDK 11. >>>>> >>>>>> I don't see the modified version of the test case.? If you >>>>>> attached it, it somehow didn't make it through to me. >>>>>> >>>>>> If it's just a matter of making the code more correct, we'd love >>>>>> to make the changes.? My concern, of course, is that we've >>>>>> already done millions of XML digital signatures, so we need that >>>>>> to continue to verify correctly (and even under Java 11, it seems >>>>>> that the verify code works against previously digitally signed >>>>>> content) even if we now start digitally signing using more >>>>>> update-to-date code. >>>>> >>>>> The verification of pre-existing signatures should continue to >>>>> work regardless of how this bug is addressed. >>>>> >>>>>> Please send over the modified test case and I'll take a look. >>>>> >>>>> It is attached to the bug report in the Attachments section: >>>>> https://bugs.openjdk.java.net/browse/JDK-8218629 (make sure you >>>>> download the one I added yesterday). >>>>> >>>>> --Sean >>>>> >>>>>> >>>>>> Thanks! >>>>>> David >>>>>> >>>>>> On 2/12/19 2:14 PM, Sean Mullan wrote: >>>>>>> The bug is now at https://bugs.openjdk.java.net/browse/JDK-8218629 >>>>>>> >>>>>>> I have started looking at this issue and have some progress I >>>>>>> can report. >>>>>>> >>>>>>> In JDK 9, we updated the version of the Apache XML Signature >>>>>>> implementation in the JDK. Some of the marshalling code was >>>>>>> rewritten such that it will throw Exceptions if legacy DOM level >>>>>>> 1 methods were used to create XML content which is then passed >>>>>>> into XMLObject and similar XMLSignature types that take >>>>>>> DOMStructure objects. This is because the DOM level 1 methods do >>>>>>> not support namespaces. >>>>>>> >>>>>>> I am still evaluating what the best fix is. However, you can >>>>>>> workaround the issue by always using DOM level 3 methods which >>>>>>> are namespace aware. For example, use Document.createElementNS >>>>>>> instead of Document.createElement and Element.createAttributeNS >>>>>>> instead of Element.createAttribute. >>>>>>> >>>>>>> Using legacy or non-namespace aware XML parsers or >>>>>>> implementations is not recommended and the XML Signature Best >>>>>>> Practices document gives some rationale: >>>>>>> https://www.w3.org/TR/xmldsig-bestpractices/#signing-xml-without-namespaces >>>>>>> >>>>>>> That said, this is a regression in behavior so it would be best >>>>>>> if we could restore the previous behavior. >>>>>>> >>>>>>> I have attached a modified version of the test case to the bug >>>>>>> report which no longer throws an Exception. Let me know if this >>>>>>> is an acceptable workaround. Double-check the namespaces that I >>>>>>> used to make sure they are correct. >>>>>>> >>>>>>> --Sean >>>>>>> >>>>>>> >>>>>>> On 2/7/19 11:23 AM, Open eSignForms wrote: >>>>>>> >>>>>>>> On 2/7/19 7:49 AM, Sean Mullan wrote: >>>>>>>>> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From huizhe.wang at oracle.com Thu Feb 14 22:54:53 2019 From: huizhe.wang at oracle.com (Joe Wang) Date: Thu, 14 Feb 2019 14:54:53 -0800 Subject: XML Digital Signature throws NAMESPACE_ERR exception under OpenJDK 11 that works under Java SE 8, 9 and 10 In-Reply-To: <74045499-137b-87c4-ab59-8edb4801aa4b@oracle.com> References: <8f5d59e0-89be-9146-7e57-5d2cf755043f@oracle.com> <66dd5bf7-b1b4-b3cf-b595-2c457b29a6af@gmail.com> <74045499-137b-87c4-ab59-8edb4801aa4b@oracle.com> Message-ID: <5C65F1BD.5060002@oracle.com> On 2/14/19, 11:08 AM, Sean Mullan wrote: > On 2/13/19 2:20 PM, Open eSignForms wrote: >> Thanks, Sean. I was able to find the updated test case source code. >> >> A preliminary review seems to show worthwhile changes to our code. >> That is, the namespaces and such seem to make sense as you have them. >> >> In particular, the use of: >> >> domSignContext.putNamespacePrefix(XMLSignature.XMLNS, "dsig"); >> >> and adding this namespace to additional elements we added: >> >> String xmlns = "http://uri.etsi.org/01903/v1.1.1#"; >> >> seem reasonable and an acceptable workaround for us. I'm not sure if >> those were oversights from before, but likely were the result of it >> being based on Oracle/Java example code from Java 6 days... >> >> We'll incorporate your namespace changes in our code and test, but >> this seems like it will work as I was able to confirm that your fixed >> version seems to run on Java 10 and Java 11. >> >> It is interesting that the fixed code, though, generates different >> output on Java 10 and Java 11. I'm not positive, but it seems that >> Java 11 adds ' ' to the end of many lines that aren't present in >> Java 10's output. > > This is the ASCII code for a carriage return, encoded in XML. I don't > know why that behavior is different in JDK 11. This would be a > question for the XML developers. I have copied Joe Wang, to see if he > might know. Hi Sean, There hasn't been functional change to that area between JDK 10 and 11 that I'm aware of. If you believe there's a behavior change, or you could isolate the issue down to the java.xml/xml processor, please file a bug. I'll be happy to investigate. Thanks, Joe > > --Sean > >> >> Under Java 10, a test run products this result: >> >> > timestamp="2019-02-13T11:02:30-08:00" type="document">> xmlns="http://www.w3.org/1999/xhtml">

Dummy HTML >> document

]]>> xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" >> Id="OpenESignForms_Seal">> Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"/>> Id="Payload_Reference_ID" URI="">> Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>Zqmii2rv6C+bFM+CSO3s8sAGOrl67HEnv4t8XUgQd5iguf9m7vcVJn3pJz5inCZfx5V9lTtDaj0u >> >> xbZSyWE5kQ==> URI="#KeyInfo_ID">> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>kZM1pJpRXoeDuolU+kyK41BotQoW7ir5lfg/nNSMoC69bUC2OHzWbQ5Kug0gtrLVIuq5HRdzk6zc >> >> 2N2jA0WKMQ==> URI="#QualifyingProperties_ID">> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>AFx1CJi739IWZwJL1Y5KU2B+ZioT3ONMBLwLTdT/NTysV/+KYF7lZMgEHaGtLxvc6haIKKKzZisr >> >> r2YDQVgs5w==> URI="#OpenESignForms_Seal_ID">> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>jhVDd7nvr4s2bu7LRNHb7yj2gQRzAE7fXcsgonq2Qsn4EWNfpqNEVUViIy9jh86tTs5ZiakaGAEs >> >> l9YV1hNnEg==izJCFA5lBOjc7zhlc/1Wrsu+/jd0o0aPtemm4hM7aMKJvzkKddhjaHRY9iX4qtMZJtl7L1qj4YGN >> >> hxHc2Wjuj6F1ZFD9asPf/kumVliAqTwNvhfyVfmpbaZtzQVtOQWhNIC1PivbPfbwTKr1yztLbo0K >> >> B8TJWWiqHBjgEjlhw8X84buXVsCIUaAkOJG73Q0x9hMDVPf5y5R56xknLwjwzQPdveMI3zKvKvq5 >> >> vj1UPKVqlCjrjPa1HR0g4wEOjL51HCK/EWVbB4LLRAL59KB6ERW01CaRX1crGzQw6wz5eFVWK/0o >> >> NcIdn4wc7rWPdYfT362iqqJMzIyUQGHmk7FVD/1Nky2wlEvYaRk7PrpbXo8ISSPB+RQM+EWQbYCP >> >> RVT5oq6d4dnu0cUuj/wG8Ng7FIfSY3C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HfwuTuL/IX9qzYnxtPNkEHL8D8v3P4Tovk >> >> zDHOou4Ai5yycZninbaoK2WJr80p2HNfISY51fCJZ+Z16xmBlPmunnLI23cTAJGnZlI6WtsZLXQw >> >> LX91VkqKlRL73+MZECxO0m5I4hxNu8CeOIcQ7aCLvnkO8AEeCa9zAwmiL2tJ8coJvELvqS9Zaiaz >> >> syix8IWETtrZ+vv+85rASl5PSkCb0AX3eipJoqRgGazWraV7NBwDZgPEYXNQq1/jbQoirjJIzNQO >> >> KEgH3wViGFVwnW4YJ4dzbtVd6EVaHZGmYb666FpwNPz6OBLgX1sjvDTMTYGYo/VrIN02neYEvBtK >> >> GrZ5Gw7l7BOyKe92F3iQ3q90/kOBmGnEn8agkKlynv5IlJR8xOCxG1U9e8GFfmAwFS5hYtf0Gh/u >> >> FRqnOepWQKuZ3kBBR+6KttbE58aD2kVuB36et5Dij1nxr+ihL7e4V42KsQQn/VBDrMoU5xW+yZH/ >> >> aAEgpbfUm5detK5oFqs5JIILFiyUXQCrvYuNZFx4vDqrsDmmAaaAPBlcybCUXseqh4hThyrOJ0dX >> >> 3xaXcwd32t1+/aOa7jgJRTgSklxhhcRCMHI9HWNlLgUWmvZ2O5G70reY4Kyg1NAS56qX48Xbckvy >> >> VMfem/JPPYT/veThnefIgQk=> xmlns:ns0="http://uri.etsi.org/01903/v1.1.1#" >> ns0:Id="QualifyingProperties_ID" >> xmlns="http://uri.etsi.org/01903/v1.1.1#">2019-02-13T11:02:30-08:00> ns0:ObjectReference="#Payload_Reference_ID">descriptiontext/html> Id="OpenESignForms_Seal_ID" >> Target="#OpenESignForms_Seal">> xmlns:ns0="http://open.esignforms.com/XMLSchema/2011" >> ns0:DeploymentHostAddress="192.1.1.1" >> xmlns:ns1="http://open.esignforms.com/XMLSchema/2011" >> ns1:DeploymentHostName="open.esignforms.com" >> xmlns:ns2="http://open.esignforms.com/XMLSchema/2011" >> ns2:DeploymentId="1.1.1.1" >> xmlns:ns3="http://open.esignforms.com/XMLSchema/2011" >> ns3:SignerAddress="192.1.1.1" >> xmlns:ns4="http://open.esignforms.com/XMLSchema/2011" >> ns4:SignerAgent="No-Browser-Test" >> xmlns:ns5="http://open.esignforms.com/XMLSchema/2011" >> ns5:Timestamp="2019-02-13T11:02:30-08:00" >> xmlns:ns6="http://open.esignforms.com/XMLSchema/2011" >> ns6:Version="19.1.19"/>
>> >> >> while when run under Java 11 it shows what seems to be the same >> (clearly, the digest/hashes aren't the same as the 'timestamp' >> differs because they are actual times) except for lots of ' ' >> added to the digests and signatures: >> >> > timestamp="2019-02-13T11:01:22-08:00" type="document">> xmlns="http://www.w3.org/1999/xhtml">

Dummy HTML >> document

]]>> xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" >> Id="OpenESignForms_Seal">> Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"/>> Id="Payload_Reference_ID" URI="">> Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>LdB/ydGxr3VUoTshQtOvQNmMZmt2OHgLax4tSk9Lqb1c+X1h4Uc/RBVXwfI9QrVnITBz85Fi8Bwr >> >> 7wyMjw84cA==> URI="#KeyInfo_ID">> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>FkpexxTwhpCPHHsMrKGnBXE5hkZ/x10ArpzjX6ltYfOilvVAubzc9sNPwo6phw//ot1rSKPU5jTB >> >> LRD7p7t50g==> URI="#QualifyingProperties_ID">> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>LxB0xAsDxKqeyCflaSUgMQOMhoxP4Gl9GfvlpCiL/gd9rz36qG4roaFRl+4PBC+IxzGiRDOqzQYX >> >> x6gSn5d1IQ==> URI="#OpenESignForms_Seal_ID">> Algorithm="http://www.w3.org/2001/04/xmlenc#sha512"/>Pqd+9yaeBMytcG1sTTpuq+Wrd3lZSC18j7lv6VQ6LjUSz9VN7uwVNNn1E79mY8H6XUI2jbd/IozM >> >> oba2KF46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1NAS56qX48Xbckvy >> >> VMfem/JPPYT/veThnefIgQk=> xmlns:ns0="http://uri.etsi.org/01903/v1.1.1#" >> ns0:Id="QualifyingProperties_ID" >> xmlns="http://uri.etsi.org/01903/v1.1.1#">2019-02-13T11:01:22-08:00> ns0:ObjectReference="#Payload_Reference_ID">descriptiontext/html> Id="OpenESignForms_Seal_ID" >> Target="#OpenESignForms_Seal">> xmlns:ns0="http://open.esignforms.com/XMLSchema/2011" >> ns0:DeploymentHostAddress="192.1.1.1" >> xmlns:ns1="http://open.esignforms.com/XMLSchema/2011" >> ns1:DeploymentHostName="open.esignforms.com" >> xmlns:ns2="http://open.esignforms.com/XMLSchema/2011" >> ns2:DeploymentId="1.1.1.1" >> xmlns:ns3="http://open.esignforms.com/XMLSchema/2011" >> ns3:SignerAddress="192.1.1.1" >> xmlns:ns4="http://open.esignforms.com/XMLSchema/2011" >> ns4:SignerAgent="No-Browser-Test" >> xmlns:ns5="http://open.esignforms.com/XMLSchema/2011" >> ns5:Timestamp="2019-02-13T11:01:22-08:00" >> xmlns:ns6="http://open.esignforms.com/XMLSchema/2011" >> ns6:Version="19.1.19"/>
>> >> >> >> It's particularly odd because hex 13 isn't a typical character (^S). >> >> Any idea what that difference is about for the base64 digests and >> signatures? >> >> David >> >> >> On 2/13/19 6:03 AM, Sean Mullan wrote: >>> On 2/12/19 6:28 PM, Open eSignForms wrote: >>>> Thanks for the update, Sean. I'm a bit perplexed because I found >>>> the original code works under Java 9 and Java 10, so it seems like >>>> the change occurred in Java 11. >>> >>> Sorry, that was a typo, I meant to say JDK 11. >>> >>>> I don't see the modified version of the test case. If you attached >>>> it, it somehow didn't make it through to me. >>>> >>>> If it's just a matter of making the code more correct, we'd love to >>>> make the changes. My concern, of course, is that we've already >>>> done millions of XML digital signatures, so we need that to >>>> continue to verify correctly (and even under Java 11, it seems that >>>> the verify code works against previously digitally signed content) >>>> even if we now start digitally signing using more update-to-date code. >>> >>> The verification of pre-existing signatures should continue to work >>> regardless of how this bug is addressed. >>> >>>> Please send over the modified test case and I'll take a look. >>> >>> It is attached to the bug report in the Attachments section: >>> https://bugs.openjdk.java.net/browse/JDK-8218629 (make sure you >>> download the one I added yesterday). >>> >>> --Sean >>> >>>> >>>> Thanks! >>>> David >>>> >>>> On 2/12/19 2:14 PM, Sean Mullan wrote: >>>>> The bug is now at https://bugs.openjdk.java.net/browse/JDK-8218629 >>>>> >>>>> I have started looking at this issue and have some progress I can >>>>> report. >>>>> >>>>> In JDK 9, we updated the version of the Apache XML Signature >>>>> implementation in the JDK. Some of the marshalling code was >>>>> rewritten such that it will throw Exceptions if legacy DOM level 1 >>>>> methods were used to create XML content which is then passed into >>>>> XMLObject and similar XMLSignature types that take DOMStructure >>>>> objects. This is because the DOM level 1 methods do not support >>>>> namespaces. >>>>> >>>>> I am still evaluating what the best fix is. However, you can >>>>> workaround the issue by always using DOM level 3 methods which are >>>>> namespace aware. For example, use Document.createElementNS instead >>>>> of Document.createElement and Element.createAttributeNS instead of >>>>> Element.createAttribute. >>>>> >>>>> Using legacy or non-namespace aware XML parsers or implementations >>>>> is not recommended and the XML Signature Best Practices document >>>>> gives some rationale: >>>>> https://www.w3.org/TR/xmldsig-bestpractices/#signing-xml-without-namespaces >>>>> >>>>> That said, this is a regression in behavior so it would be best if >>>>> we could restore the previous behavior. >>>>> >>>>> I have attached a modified version of the test case to the bug >>>>> report which no longer throws an Exception. Let me know if this is >>>>> an acceptable workaround. Double-check the namespaces that I used >>>>> to make sure they are correct. >>>>> >>>>> --Sean >>>>> >>>>> >>>>> On 2/7/19 11:23 AM, Open eSignForms wrote: >>>>> >>>>>> On 2/7/19 7:49 AM, Sean Mullan wrote: >>>>>>> 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 From andimullaraj at gmail.com Fri Feb 15 08:33:57 2019 From: andimullaraj at gmail.com (Andi Mullaraj) Date: Fri, 15 Feb 2019 00:33:57 -0800 Subject: Java SSLSocketChannel/SSLSelector? In-Reply-To: References: Message-ID: Hi Dean, Thanks for sharing your experience. I took a look at your links and the model and implementation seems quite distant from the classic Selector/SelectableChannel though. You seem to allocate a thread per each Selector (which I agree is too much of a cost to pay), then fire actively [listener.selectorFired()] from that thread towards a SelectorListener ... We can come back to implementation details later, but first I would like to ask: any reason we cannot have an SSLSelector which extends the java.nio.channels.Selector, an SSLSocketChannel extending a java.nio.channels.SocketChannel, and so on? I believe we can, and in this doc https://github.com/rouplex/rouplex-niossl/blob/master/README.md I have provided the set of base classes that do just that. Since this is a dev group I am sharing a code snippet from the doc: As an example, an existing application which is using SocketChannel with a Selector for their communications, would be turned into a secure one, by simply replacing: Selector selector = Selector.open(); SocketChannel socketChannel = SocketChannel.open(); socketChannel.register(selector, SelectionKey.OP_READ); while(true) { selector.select(); for (SocketChannel sc : selector.selectedKeys() { sc.read(...) } } with: Selector selector = SSLSelector.open(); // notice the SSL SocketChannel socketChannel = SSLSocketChannel.open(); // notice the SSL socketChannel.register(selector, SelectionKey.OP_READ); while(true) { selector.select(); for (SocketChannel sc : selector.selectedKeys() { sc.read(...) } } How much cooler and easier than that can it get redressing your existing service using (performant) plain communications with (performant) secure ones? Or create a new (and secure) one using the exact knowledge you already have and never having to think SSLEngine again? As I have already mentioned I have worked on such implementation but would like to first discuss with the group the merits and possible problems/shortcomings of adopting the inheritance model from the plain counterparts. Thanks in advance, --Andi On Wed, Feb 13, 2019 at 8:22 AM Dean Hiller wrote: > I would highly suggest implementing your own for a much better > understanding. > > I did implement something like what you want and in so doing realized I > like their decision. ie. See the heirarchy here > > https://github.com/deanhiller/webpieces/tree/master/core/core-channelmanager2/src/main/java/org/webpieces/nio/api/channels > > The TCPChannel could be SSL or not SSL as there are two implementations. > > If you do want an implementation that does what you want though, this > library does exactly that > > https://github.com/deanhiller/webpieces/tree/master/core/core-channelmanager2 > > which is used in the webpieces webserver > https://github.com/deanhiller/webpieces > > That nio library is standalone even though it is in the webpieces repo. I > mean, every component in webpieces is another stand-alone piece. > > The downside is the library owns a thread which typical java libraries > avoid. ie. it has to have a thread to poll the selector and read from all > the sockets to be fed to the thread pools, etc. I think that is the main > reason they decided not to have this type of library. They prefer not to > be running threads(which I agree, the jdk shouldn't). > > later, > Dean > > > > > On Tue, Feb 12, 2019 at 7:54 PM Sean Mullan > wrote: > >> Hi Andi, >> >> TLS/JSSE topics are best discussed on the security-dev alias, so I am >> copying that list for more discussion and -bcc-ing core-libs-dev. >> >> --Sean >> >> On 2/11/19 3:29 PM, Andi Mullaraj wrote: >> > Hi java-core community, >> > >> > I have been directed to this channel to discuss matters related to Java >> > performant ssl communications. Maybe this is a topic that has been >> > discussed in the past, in which case I would appreciate if someone >> pointed >> > me to that particular topic. >> > >> > Back in 2002 I personally applauded the java.nio.channels (jdk1.4) >> package, >> > realizing that there was no way to port this to the secure >> communications, >> > due to lack of a comparable implementation for SSL. But I thought it >> was >> > going to just be matter of time. A couple of years ago I had to go back >> > search for it, and was kind of surprised to find the following in >> > >> http://docs.oracle.com/javase/7/docs/technotes/guides/security/jsse/JSSERefGuide.html#SSLENG >> > : >> > >> > --- begin quote --- >> > Newcomers to the API may wonder "Why not just have an SSLSocketChannel >> > which extends java.nio.channels.SocketChannel?" There are two main >> reasons: >> > >> > 1. There were a lot of very difficult questions about what a >> > SSLSocketChannel should be, including its class hierarchy and how it >> should >> > interoperate with Selectors and other types of SocketChannels. Each >> > proposal brought up more questions than answers. It was noted that any >> new >> > API abstraction extended to work with SSL/TLS would require the same >> > significant analysis and could result in large and complex APIs. >> > 2. Any JSSE implementation of a new API would be free to choose the >> "best" >> > I/O & compute strategy, but hiding any of these details is inappropriate >> > for those applications needing full control. Any specific implementation >> > would be inappropriate for some application segment. >> > --- end quote --- >> > >> > It has been a while since this was stated, and I would really like to >> > revisit it. I personally believe that the question #1 has a quite >> natural >> > answer, while #2 should not really be a concern if we adhere to the spi >> > model where users can bring their own implementation if needed. I know >> > because I have also implemented it (but would like to discuss that in a >> > later stage, if it comes to it). >> > >> > The benefit of such implementation would be immense. Imagine many Java >> > services written with nio and which struggle to move to SSL due to the >> > great complexity of using SSLEngine (zookeeper service to name one), >> while >> > all they would need to do (if SSLSocketChannels were available) is to >> > instantiate an instance of SSLSocketChannel/SSLSelector when the >> security >> > is required and the rest would stay the same (as in case of plain >> > communication using SocketChannel/Selector). Another important use >> case is >> > the advent of IOT, where millions of devices, with relatively low >> > throughput would want to protect their communication via SSL. >> > >> > The ways I have seen the community deal with this are mainly: >> > >> > 1. Go through the pain of learning SSLEngine (and hope to get it right) >> > 2. Build their services around tested libraries (like Jetty, which >> handle >> > the SSL offload but don't resurface it in SocketChannel/Selector >> paradigm, >> > that also come with their huge set of dependencies, bringing in >> unavoidable >> > version collisions) >> > 3. Use proxies (nginx, ha) to deal with the high number of SSL >> connections >> > and divide the load by scaling horizontally in the back end (making for >> a >> > harder deployment model) >> > >> > We can make this a lot easier! >> > >> > Any feedback is greatly appreciated, >> > Best, >> > >> > Andi Mullaraj >> > >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From philipp.kunz at paratix.ch Fri Feb 15 09:34:45 2019 From: philipp.kunz at paratix.ch (Philipp Kunz) Date: Fri, 15 Feb 2019 10:34:45 +0100 Subject: RFR 8180573: Refactor sun/security/tools shell tests to plain java tests In-Reply-To: <2B9C2E12-4BCE-4FFE-84FF-F21CE5FAC56F@oracle.com> References: <2B9C2E12-4BCE-4FFE-84FF-F21CE5FAC56F@oracle.com> Message-ID: <1550223285.2497.12.camel@paratix.ch> Hi Max, I don't know if it is important enough, certainly not a serious issue. In your patch, for example in?DiffEnd.java and a few other tests, Strings are encoded to byte streams with String.getBytes() which uses the default platform character set to encode the strings. Manifests, however, always use UTF-8 as the character set to encode. In my opinion, getBytes(java.nio.charset.StandardCharsets.UTF_8) would be appropriate to specify the encoding in a platform-independent way. Now the manifests used in the tests use so few different characters that this might not even make a real difference because the first around 100 characters or so of most character sets are the same in most encodings. I suspect that the encoding might also have been platform-dependent in at least some of the previous shell tests and therefore this aspect might as well be addressed separately and is not strictly necessary to just properly convert shell tests to java. Regards, Philipp On Wed, 2019-02-13 at 11:01 +0800, Weijun Wang wrote: > Please review the fix at > > https://cr.openjdk.java.net/~weijun/8180573/webrev.00/ > > Notes: > > - Most changes are just .sh -> .java > > - StorePasswordsByShell.sh combined into StorePasswords.java > > - In most cases, JarUtils is called to create a jar file. Sometimes the jar command is called because of delicate differences, for example, jar adds directory entries also. > > - The i18n tests are completely manual described in i18n.html. Old i18n.java is useless, now is also empty. > > - Copyright year updated to 2019, @bug unchanged. > > Two files not converted yet: > > - ./keytool/console.sh > > This is a manual test calling old versions of JDK. > > - ./keytool/ListKeychainStore.sh > > I tried on this one but "security list-keychains -s ..." has no effect on mach5 machines when calling by ProcessTools. No idea why, I've created a separate bug (JDK-8218886) for it. > > Thanks, > Max > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.lloyd at redhat.com Fri Feb 15 12:56:00 2019 From: david.lloyd at redhat.com (David Lloyd) Date: Fri, 15 Feb 2019 06:56:00 -0600 Subject: Java SSLSocketChannel/SSLSelector? In-Reply-To: References: Message-ID: Then your selector can only be used for SSL things. What if someone decides to take the exact same approach to solve some other higher-OSI-layer protocol decoding? Now you have to choose which kind of protocol you want your selector to support. Note that with a plain selector and plain sockets, you *need* a thread to support the event loop anyway, I mean it has to run somewhere. And with SSL, you also need an extra thread or thread pool to handle SSL authentication tasks, no matter whether you make a subclass of Selector. On Fri, Feb 15, 2019 at 2:35 AM Andi Mullaraj wrote: > > Hi Dean, > > Thanks for sharing your experience. I took a look at your links and the model and implementation seems quite distant from the classic Selector/SelectableChannel though. You seem to allocate a thread per each Selector (which I agree is too much of a cost to pay), then fire actively [listener.selectorFired()] from that thread towards a SelectorListener ... > > We can come back to implementation details later, but first I would like to ask: any reason we cannot have an SSLSelector which extends the java.nio.channels.Selector, an SSLSocketChannel extending a java.nio.channels.SocketChannel, and so on? I believe we can, and in this doc https://github.com/rouplex/rouplex-niossl/blob/master/README.md I have provided the set of base classes that do just that. Since this is a dev group I am sharing a code snippet from the doc: > > As an example, an existing application which is using SocketChannel with a Selector for their communications, would be turned into a secure one, by simply replacing: > > Selector selector = Selector.open(); > SocketChannel socketChannel = SocketChannel.open(); > socketChannel.register(selector, SelectionKey.OP_READ); > > while(true) { > selector.select(); > for (SocketChannel sc : selector.selectedKeys() { > sc.read(...) > } > } > > with: > > Selector selector = SSLSelector.open(); // notice the SSL > SocketChannel socketChannel = SSLSocketChannel.open(); // notice the SSL > socketChannel.register(selector, SelectionKey.OP_READ); > > while(true) { > selector.select(); > for (SocketChannel sc : selector.selectedKeys() { > sc.read(...) > } > } > > How much cooler and easier than that can it get redressing your existing service using (performant) plain communications with (performant) secure ones? Or create a new (and secure) one using the exact knowledge you already have and never having to think SSLEngine again? > > As I have already mentioned I have worked on such implementation but would like to first discuss with the group the merits and possible problems/shortcomings of adopting the inheritance model from the plain counterparts. > > Thanks in advance, > --Andi > > > On Wed, Feb 13, 2019 at 8:22 AM Dean Hiller wrote: >> >> I would highly suggest implementing your own for a much better understanding. >> >> I did implement something like what you want and in so doing realized I like their decision. ie. See the heirarchy here >> https://github.com/deanhiller/webpieces/tree/master/core/core-channelmanager2/src/main/java/org/webpieces/nio/api/channels >> >> The TCPChannel could be SSL or not SSL as there are two implementations. >> >> If you do want an implementation that does what you want though, this library does exactly that >> https://github.com/deanhiller/webpieces/tree/master/core/core-channelmanager2 >> >> which is used in the webpieces webserver >> https://github.com/deanhiller/webpieces >> >> That nio library is standalone even though it is in the webpieces repo. I mean, every component in webpieces is another stand-alone piece. >> >> The downside is the library owns a thread which typical java libraries avoid. ie. it has to have a thread to poll the selector and read from all the sockets to be fed to the thread pools, etc. I think that is the main reason they decided not to have this type of library. They prefer not to be running threads(which I agree, the jdk shouldn't). >> >> later, >> Dean >> >> >> >> >> On Tue, Feb 12, 2019 at 7:54 PM Sean Mullan wrote: >>> >>> Hi Andi, >>> >>> TLS/JSSE topics are best discussed on the security-dev alias, so I am >>> copying that list for more discussion and -bcc-ing core-libs-dev. >>> >>> --Sean >>> >>> On 2/11/19 3:29 PM, Andi Mullaraj wrote: >>> > Hi java-core community, >>> > >>> > I have been directed to this channel to discuss matters related to Java >>> > performant ssl communications. Maybe this is a topic that has been >>> > discussed in the past, in which case I would appreciate if someone pointed >>> > me to that particular topic. >>> > >>> > Back in 2002 I personally applauded the java.nio.channels (jdk1.4) package, >>> > realizing that there was no way to port this to the secure communications, >>> > due to lack of a comparable implementation for SSL. But I thought it was >>> > going to just be matter of time. A couple of years ago I had to go back >>> > search for it, and was kind of surprised to find the following in >>> > http://docs.oracle.com/javase/7/docs/technotes/guides/security/jsse/JSSERefGuide.html#SSLENG >>> > : >>> > >>> > --- begin quote --- >>> > Newcomers to the API may wonder "Why not just have an SSLSocketChannel >>> > which extends java.nio.channels.SocketChannel?" There are two main reasons: >>> > >>> > 1. There were a lot of very difficult questions about what a >>> > SSLSocketChannel should be, including its class hierarchy and how it should >>> > interoperate with Selectors and other types of SocketChannels. Each >>> > proposal brought up more questions than answers. It was noted that any new >>> > API abstraction extended to work with SSL/TLS would require the same >>> > significant analysis and could result in large and complex APIs. >>> > 2. Any JSSE implementation of a new API would be free to choose the "best" >>> > I/O & compute strategy, but hiding any of these details is inappropriate >>> > for those applications needing full control. Any specific implementation >>> > would be inappropriate for some application segment. >>> > --- end quote --- >>> > >>> > It has been a while since this was stated, and I would really like to >>> > revisit it. I personally believe that the question #1 has a quite natural >>> > answer, while #2 should not really be a concern if we adhere to the spi >>> > model where users can bring their own implementation if needed. I know >>> > because I have also implemented it (but would like to discuss that in a >>> > later stage, if it comes to it). >>> > >>> > The benefit of such implementation would be immense. Imagine many Java >>> > services written with nio and which struggle to move to SSL due to the >>> > great complexity of using SSLEngine (zookeeper service to name one), while >>> > all they would need to do (if SSLSocketChannels were available) is to >>> > instantiate an instance of SSLSocketChannel/SSLSelector when the security >>> > is required and the rest would stay the same (as in case of plain >>> > communication using SocketChannel/Selector). Another important use case is >>> > the advent of IOT, where millions of devices, with relatively low >>> > throughput would want to protect their communication via SSL. >>> > >>> > The ways I have seen the community deal with this are mainly: >>> > >>> > 1. Go through the pain of learning SSLEngine (and hope to get it right) >>> > 2. Build their services around tested libraries (like Jetty, which handle >>> > the SSL offload but don't resurface it in SocketChannel/Selector paradigm, >>> > that also come with their huge set of dependencies, bringing in unavoidable >>> > version collisions) >>> > 3. Use proxies (nginx, ha) to deal with the high number of SSL connections >>> > and divide the load by scaling horizontally in the back end (making for a >>> > harder deployment model) >>> > >>> > We can make this a lot easier! >>> > >>> > Any feedback is greatly appreciated, >>> > Best, >>> > >>> > Andi Mullaraj >>> > -- - DML From weijun.wang at oracle.com Fri Feb 15 13:31:49 2019 From: weijun.wang at oracle.com (Weijun Wang) Date: Fri, 15 Feb 2019 21:31:49 +0800 Subject: RFR 8180573: Refactor sun/security/tools shell tests to plain java tests In-Reply-To: <1550223285.2497.12.camel@paratix.ch> References: <2B9C2E12-4BCE-4FFE-84FF-F21CE5FAC56F@oracle.com> <1550223285.2497.12.camel@paratix.ch> Message-ID: <0BF4117D-E0D6-4A2F-B959-D59466E093CB@oracle.com> Hi Philipp, In most cases, it's just about creating a non-empty file; in some case, the content is relevant. For the former, I will change it to something like "new byte[10]"; for the latter, I'll use getBytes(UTF_8). Thanks, Max > On Feb 15, 2019, at 5:34 PM, Philipp Kunz wrote: > > Hi Max, > > I don't know if it is important enough, certainly not a serious issue. > In your patch, for example in DiffEnd.java and a few other tests, Strings are encoded to byte streams with String.getBytes() which uses the default platform character set to encode the strings. > Manifests, however, always use UTF-8 as the character set to encode. In my opinion, getBytes(java.nio.charset.StandardCharsets.UTF_8) would be appropriate to specify the encoding in a platform-independent way. > Now the manifests used in the tests use so few different characters that this might not even make a real difference because the first around 100 characters or so of most character sets are the same in most encodings. > I suspect that the encoding might also have been platform-dependent in at least some of the previous shell tests and therefore this aspect might as well be addressed separately and is not strictly necessary to just properly convert shell tests to java. > > Regards, > Philipp > > > On Wed, 2019-02-13 at 11:01 +0800, Weijun Wang wrote: >> Please review the fix at >> >> >> https://cr.openjdk.java.net/~weijun/8180573/webrev.00/ >> >> >> Notes: >> >> - Most changes are just .sh -> .java >> >> - StorePasswordsByShell.sh combined into StorePasswords.java >> >> - In most cases, JarUtils is called to create a jar file. Sometimes the jar command is called because of delicate differences, for example, jar adds directory entries also. >> >> - The i18n tests are completely manual described in i18n.html. Old i18n.java is useless, now is also empty. >> >> - Copyright year updated to 2019, @bug unchanged. >> >> Two files not converted yet: >> >> - ./keytool/console.sh >> >> This is a manual test calling old versions of JDK. >> >> - ./keytool/ListKeychainStore.sh >> >> I tried on this one but "security list-keychains -s ..." has no effect on mach5 machines when calling by ProcessTools. No idea why, I've created a separate bug (JDK-8218886) for it. >> >> Thanks, >> Max >> >> From valerie.peng at oracle.com Fri Feb 15 20:04:40 2019 From: valerie.peng at oracle.com (Valerie Peng) Date: Fri, 15 Feb 2019 12:04:40 -0800 Subject: [13] RFR JDK-8218780 "Update MUSCLE PCSC-Lite header files" Message-ID: <902a2671-051a-9d29-f49f-5b29b3fe173d@oracle.com> Hi Sean (Coffey), Can you please help reviewing this fix? It's about updating the PC/SC lite header files under the MUSCLE directory inside smartcardio module. The header files are from https://pcsclite.apdu.fr/ and minor adjustments are made to pcsc_md.h and pcsc.c to match the header update and replace the old types, i.e. LPTSTR/LPCTSTR, with new ones to avoid compilation fails on MacOs. Bug: https://bugs.openjdk.java.net/browse/JDK-8218780 Webrev: http://cr.openjdk.java.net/~valeriep/8218780/webrev.00/ Mach5 run is clean. Thanks, Valerie From yozons at gmail.com Fri Feb 15 20:11:57 2019 From: yozons at gmail.com (Open eSignForms) Date: Fri, 15 Feb 2019 12:11:57 -0800 Subject: XML Digital Signature throws NAMESPACE_ERR exception under OpenJDK 11 that works under Java SE 8, 9 and 10 In-Reply-To: References: <8f5d59e0-89be-9146-7e57-5d2cf755043f@oracle.com> <66dd5bf7-b1b4-b3cf-b595-2c457b29a6af@gmail.com> <32d2fff5-1be5-1201-225e-15ac60982067@gmail.com> <648d666c-60a4-bc09-ecd9-f993255040e2@gmail.com> <5360b44b-9f06-4107-fd9d-165f0b356952@gmail.com> <166893ef-5c96-ba36-3a94-114dd2caeccf@gmail.com> Message-ID: <8a01a47e-0984-b732-7cac-ec76e35b11ab@gmail.com> XML namespaces are pretty confusing.? From what little I gather, unprefixed attributes don't belong to any namespace, not even the default one. I think I can see the bug in the debugging output. On Java 8 and 10 and 11, I'd guess that the marshaling/canonicalization has issues when combining differently namespaced objects. In my working code (also works on Java 11), when my ETSI/XADES QualifyingProperties element is created specifying my namespace (the default namespace for the XML document that I'm signing), it works fine.? If I change my document's default namespace to be the XADES one, it also works.? But I cannot make them work when both are in use.? The reason seems to be as follows. 1) The signedXML generated looks great and sensible, with the xades namespace as expected. ??? ??????? ??????????? ??????????????? 2019-02-15T11:30:44-08:00 ??????????????? ??????????????? ??????????????????? description text/html ??????????????????? ??????????????? ??????????? ??????? ??? 2) But using the debugging options, it shows this element during SIGNING (presuming canonicalization) that makes /*no sense*/. It's added both the default namespace, the 'dsig' namespace, but doesn't include the xades namespace.? Wwhat does the 'xades' prefix even refer to in this XML for the signing digest? ??? ??????? ??????????? 2019-02-15T11:30:44-08:00 ??????????? ??????????? ??????????????? description text/html ??????????????? ??????????? ??????? ??? 3) And again, the debugger shows this element during VERIFICATION (presuming canonicalization) that is excessive, but at least makes some sense (though there are no default elements nor 'dsig' elements).? It's added all three namespaces: our default namespace, the 'dsig' namespace AND the 'xades' namespace. ?? ??????? ??????????? 2019-02-15T11:30:44-08:00 ??????????? ??????????? ??????????????? description text/html ??????????????? ??????????? ??????? ??? On 2/14/19 9:32 PM, Open eSignForms wrote: >> >> Yes, indeed that's the issue.? But I don't know why/how all those >> xmlns attributes are added, since I don't directly add them. >> >> I found the only way I can make it work under Java 8, 10 and 11 is to >> use my common namespace (XML_NAMESPACE_2011 = >> "http://open.esignforms.com/XMLSchema/2011") for all the XADES >> elements with the null namespace on all their attributes.? Even if I >> put that same namespace on the attributes, it then fails. >> >> When I do that, the signed XML generates clean looking XML like this: >> >> ??? >> ??????? > Target="#OpenESignForms_Seal"> >> >> 2019-02-14T17:37:39-08:00 >> ??????????? >> ??????????? >> ??????????????? > ObjectReference="#Payload_Reference_ID"> >> description >> ??????????????????? text/html >> ??????????????? >> ??????????? >> ??????????? >> ??????? >> ??? >> ??? >> ??????? >> ??????????? > Target="#OpenESignForms_Seal"*> >> ??????????????? > DeploymentHostAddress="192.1.1.1" >> DeploymentHostName="open.esignforms.com" DeploymentId="1.1.1.1" >> SignerAddress="192.1.1.1" SignerAgent="No-Browser-Test" >> Timestamp="2019-02-14T17:37:39-08:00" Version="19.1.19"/> >> ??????????? >> ??????? >> ??? >> >> But even above, as you can see, the second ds:Object shows >> ds:SignatureProperty, yet the Id and Target attributes do not include >> a 'ds:' prefix, which it's my understanding to mean that they default >> to our XML payload's default namespace. >> > I don't think that's correct, I think attributes w/o a prefix by > default belong to the namespace of the element in which they are > defined, which in this case is SignatureProperties and the dsig namespace. > > Regarding below, I would forget about JDK 11 for the time being and > focus on generating a signature with proper XMLNS definitions on JDK > 10. If you have any problems verifying with that on JDK 10 or prior, > let me know. The reason is that we will likely be restoring JDK 11 > (and later) to the same state it was in for JDK 10. There were some > changes to the marshalling code in JDK 11 which is causing these and > other problems which will likely be backed out. > > --Sean > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean.mullan at oracle.com Fri Feb 15 21:21:51 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Fri, 15 Feb 2019 16:21:51 -0500 Subject: XML Digital Signature throws NAMESPACE_ERR exception under OpenJDK 11 that works under Java SE 8, 9 and 10 In-Reply-To: <8a01a47e-0984-b732-7cac-ec76e35b11ab@gmail.com> References: <8f5d59e0-89be-9146-7e57-5d2cf755043f@oracle.com> <66dd5bf7-b1b4-b3cf-b595-2c457b29a6af@gmail.com> <32d2fff5-1be5-1201-225e-15ac60982067@gmail.com> <648d666c-60a4-bc09-ecd9-f993255040e2@gmail.com> <5360b44b-9f06-4107-fd9d-165f0b356952@gmail.com> <166893ef-5c96-ba36-3a94-114dd2caeccf@gmail.com> <8a01a47e-0984-b732-7cac-ec76e35b11ab@gmail.com> Message-ID: I know what the problem is. You also need to add the actual namespace attribute to your element, for example: qualifyingPropertiesElement.setAttributeNS( ??????? "http://www.w3.org/2000/xmlns/", "xmlns", "http://uri.etsi.org/01903/v1.1.1#"); You only need to do that on the top-most parent element in that namespace. When I made that change to your code, everything generated and verified for me correctly (on JDK 10 anyway, JDK 11 may still have some issues). --Sean On 2/15/19 3:11 PM, Open eSignForms wrote: > > XML namespaces are pretty confusing.? From what little I gather, > unprefixed attributes don't belong to any namespace, not even the > default one. > > I think I can see the bug in the debugging output. > > On Java 8 and 10 and 11, I'd guess that the > marshaling/canonicalization has issues when combining differently > namespaced objects. > > In my working code (also works on Java 11), when my ETSI/XADES > QualifyingProperties element is created specifying my namespace (the > default namespace for the XML document that I'm signing), it works > fine.? If I change my document's default namespace to be the XADES > one, it also works.? But I cannot make them work when both are in > use.? The reason seems to be as follows. > > 1) The signedXML generated looks great and sensible, with the xades > namespace as expected. > > ??? > ??????? Target="#OpenESignForms_Seal" > *xmlns:xades="http://uri.etsi.org/01903/v1.4.1#"*> > ??????????? > ??????????????? > 2019-02-15T11:30:44-08:00 > ??????????????? > ??????????????? > ??????????????????? ObjectReference="#Payload_Reference_ID"> > description > text/html > ??????????????????? > ??????????????? > ??????????? > ??????? > ??? > > 2) But using the debugging options, it shows this element during > SIGNING (presuming canonicalization) that makes /*no sense*/.? It's > added both the default namespace, the 'dsig' namespace, but doesn't > include the xades namespace. Wwhat does the 'xades' prefix even refer > to in this XML for the signing digest? > > ??? *xmlns="http://open.esignforms.com/XMLSchema/2011" > xmlns:ds="http://www.w3.org/2000/09/xmldsig#"* > Id="QualifyingProperties_ID" Target="#OpenESignForms_Seal"> > ??????? > ??????????? > 2019-02-15T11:30:44-08:00 > ??????????? > ??????????? > ??????????????? ObjectReference="#Payload_Reference_ID"> > description > text/html > ??????????????? > ??????????? > ??????? > ??? > > 3) And again, the debugger shows this element during VERIFICATION > (presuming canonicalization) that is excessive, but at least makes > some sense (though there are no default elements nor 'dsig' > elements).? It's added all three namespaces: our default namespace, > the 'dsig' namespace AND the 'xades' namespace. > > ?? *xmlns="http://open.esignforms.com/XMLSchema/2011" > xmlns:ds="http://www.w3.org/2000/09/xmldsig#" > xmlns:xades="http://uri.etsi.org/01903/v1.4.1#"* > Id="QualifyingProperties_ID" Target="#OpenESignForms_Seal"> > ??????? > ??????????? > 2019-02-15T11:30:44-08:00 > ??????????? > ??????????? > ??????????????? ObjectReference="#Payload_Reference_ID"> > description > text/html > ??????????????? > ??????????? > ??????? > ??? > So the libraries are oddly creating two distinct canonicalized XML for > digesting, with the signing phase seeming to miss the important > 'xades' namespace declaration entirely.? This is no doubt why this is > the only Reference that fails verification as the two.? I'm guessing > that the verification digest is correct when using multiple namespaced > objects/references, but the signing digest is not since it doesn't > include the 'xades' namespace declaration. > > This seems to hold true for Java 8, 10 and 11.? That is, by specifying > null namespaces on atrributes, the code fails the same under under > Java 11, and the debugging output shows the same odd namespaces > above.? If I use a single namespace, then it signs fine under Java 8, > 10 and 11. > > David > > > On 2/15/19 11:12 AM, Sean Mullan wrote: >> On 2/14/19 9:32 PM, Open eSignForms wrote: >>> >>> Yes, indeed that's the issue.? But I don't know why/how all those >>> xmlns attributes are added, since I don't directly add them. >>> >>> I found the only way I can make it work under Java 8, 10 and 11 is >>> to use my common namespace (XML_NAMESPACE_2011 = >>> "http://open.esignforms.com/XMLSchema/2011") for all the XADES >>> elements with the null namespace on all their attributes.? Even if I >>> put that same namespace on the attributes, it then fails. >>> >>> When I do that, the signed XML generates clean looking XML like this: >>> >>> ??? >>> ??????? >> Target="#OpenESignForms_Seal"> >>> >>> 2019-02-14T17:37:39-08:00 >>> ??????????? >>> ??????????? >>> ??????????????? >> ObjectReference="#Payload_Reference_ID"> >>> description >>> text/html >>> ??????????????? >>> ??????????? >>> ??????????? >>> ??????? >>> ??? >>> ??? >>> ??????? >>> ??????????? >> Target="#OpenESignForms_Seal"*> >>> ??????????????? >> DeploymentHostAddress="192.1.1.1" >>> DeploymentHostName="open.esignforms.com" DeploymentId="1.1.1.1" >>> SignerAddress="192.1.1.1" SignerAgent="No-Browser-Test" >>> Timestamp="2019-02-14T17:37:39-08:00" Version="19.1.19"/> >>> ??????????? >>> ??????? >>> ??? >>> >>> But even above, as you can see, the second ds:Object shows >>> ds:SignatureProperty, yet the Id and Target attributes do not >>> include a 'ds:' prefix, which it's my understanding to mean that >>> they default to our XML payload's default namespace. >>> >> I don't think that's correct, I think attributes w/o a prefix by >> default belong to the namespace of the element in which they are >> defined, which in this case is SignatureProperties and the dsig >> namespace. >> >> Regarding below, I would forget about JDK 11 for the time being and >> focus on generating a signature with proper XMLNS definitions on JDK >> 10. If you have any problems verifying with that on JDK 10 or prior, >> let me know. The reason is that we will likely be restoring JDK 11 >> (and later) to the same state it was in for JDK 10. There were some >> changes to the marshalling code in JDK 11 which is causing these and >> other problems which will likely be backed out. >> >> --Sean >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean.mullan at oracle.com Fri Feb 15 21:27:04 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Fri, 15 Feb 2019 16:27:04 -0500 Subject: XML Digital Signature throws NAMESPACE_ERR exception under OpenJDK 11 that works under Java SE 8, 9 and 10 In-Reply-To: <5C65F1BD.5060002@oracle.com> References: <8f5d59e0-89be-9146-7e57-5d2cf755043f@oracle.com> <66dd5bf7-b1b4-b3cf-b595-2c457b29a6af@gmail.com> <74045499-137b-87c4-ab59-8edb4801aa4b@oracle.com> <5C65F1BD.5060002@oracle.com> Message-ID: On 2/14/19 5:54 PM, Joe Wang wrote: >> his is the ASCII code for a carriage return, encoded in XML. I don't >> know why that behavior is different in JDK 11. This would be a >> question for the XML developers. I have copied Joe Wang, to see if he >> might know. > > Hi Sean, > > There hasn't been functional change to that area between JDK 10 and 11 > that I'm aware of. If you believe there's a behavior change, or you > could isolate the issue down to the java.xml/xml processor, please file > a bug.? I'll be happy to investigate. Never mind, I determined that this was a change in the way XML signature data was being base64 encoded. It seems like an innocuous change though and doesn't appear to break anything. --Sean From Nico.Williams at twosigma.com Fri Feb 15 21:45:02 2019 From: Nico.Williams at twosigma.com (Nico Williams) Date: Fri, 15 Feb 2019 21:45:02 +0000 Subject: RFR 6722928: Support SSPI as a native GSS-API provider In-Reply-To: References: <7875DFBB-B208-4556-AC49-6E8584EFDBB9@oracle.com> <20181204203436.GA22527@twosigma.com> <20181206184824.GB22527@twosigma.com> <32999A4A-F6AA-4D6C-A664-F55160744F59@oracle.com> <20181212004054.GG22527@twosigma.com> <20190117190436.GD27060@twosigma.com> Message-ID: <20190215214502.GB4046@twosigma.com> On Tue, Jan 22, 2019 at 10:52:59AM +0800, Weijun Wang wrote: > Webrev updated again at > > https://cr.openjdk.java.net/~weijun/6722928/webrev.04/ > This time I updated gssapi.h to make use of gss_const_xyz_t types. The types > in NativeFunc.h and sspi.cpp are updated as well. (I wish there is an > automatic tool to check the consistence). Thanks. It's not quite right though. See below. > Several Windows API calls (QueryContextAttributes, MakeSignature, > VerifySignature, EncryptMessage, DecryptMessage) need an explicit cast (from > const *p to *p) because they don't announce the pointer to be const, but I > think it's safe. Thanks for the warning. I'll double-check, but it seems likely to be safe, yes. - sspi.cpp:61 61 #define SEC_SUCCESS(status) (*minor_status = status, (status) >= SEC_E_OK) ^^^^^^^^^^^^^^^^^^^^^^ Please add parenthesis around the whole assignment expression. - sspi.cpp:129 129 static long 130 secondsUntil(int inputIsUTC, TimeStamp *time) There's no need to return a signed number, and you assign it to OM_uint32 variables anyways, and we don't care if some credential expired in the past. So just make this return an unsigned integral type, preferably just OM_uint32. So just rewrite as: static OM_uint32 secondsUntil(int inputIsUTC, TimeStamp *time) { // time is local time ULARGE_INTEGER uiLocal; FILETIME now; GetSystemTimeAsFileTime(&now); if (!inputIsUTC) { FILETIME nowLocal; if (FileTimeToLocalFileTime(&now, &nowLocal) == 0) { return -1; } now = nowLocal; } uiLocal.HighPart = now.dwHighDateTime; uiLocal.LowPart = now.dwLowDateTime; long diff = (long)((time->QuadPart - uiLocal.QuadPart) / 10000000); if (diff < 0) return 0; if (sizeof(long) > sizeof(OM_uint32) && diff > (long)~(OM_uint32)0) return GSS_C_INDEFINITE; return diff; } - sspi.cpp:NewContext() Please fully-initialize all fields of the allocated context structure before returning it. Or else use new gss_ctx_id_struct() syntax, or specify a constructor. - sspi.cpp:169 -->165 out->phCred = NULL; 166 out->cbMaxMessage = pkgInfo->cbMaxToken; 167 PP("pkgInfo->cbMaxToken: %ld", pkgInfo->cbMaxToken); 168 FreeContextBuffer(pkgInfo); -->169 out->phCred = NULL; Dup code. - sspi.cpp:flagSspi2Gss() and flagGss2Sspi() I realize that this would be a change to the Java bindings, so this is just a note, but, we should add support for GSS_C_DELEG_POLICY_FLAG. - sspi.cpp:getTGTEndTime() Please immediately write to the `endTime' output parameter upon entry. - sspi.cpp:getTGTEndTime() You leak the logonHandle. You have to close it with LsaDeregisterLogonProcess() before returning after LsaConnectUntrusted() returns successfully. - sspi.cpp:getTGTEndTime() Maybe just make this return OM_uint32 and simplify the one call site, making it return 86400 seconds (1 day) or whatever for the error case, else the secondsUntil() the time indicated by the LSA in response to the KerbRetrieveTicketMessage request. - sspi.cpp:316,355 It is rather concerning that get_full_name() can return its input or a modified copy of its input. At the call sites there's no check to see if the returned value is allocated, and it's hard to analyze if you're ultimately leaking or double-freeing. This isn't performance-critical code, so just always allocate a copy. - sspi.cpp:315 314 // input has realm, no need to add one 315 if (wcschr(input, '@')) { This is not going to work with UPNs. You should probably implement proper RFC1864 name format support, including backslash-quoting. - sspi.cpp:315 315 if (wcschr(input, '@')) { ^ I don't know if it is necessary that this be L'@' or if the compiler will do the right thing because the `wc' argument of `wcschr()' is a `wchar_t'. Elsewhere you do use wide character literals, so I assume even if type promotion works correctly for char->WCHAR (does it?) you might want to be consistent. - sspi.cpp:328 328 // Solution #2: Or just use an empty string (and hope referral works). 329 // This does not work now because ServicePermission check is based on 330 // the exported name. Unless we update ServicePermission check to 331 // be friendly with referral we need a realm. 332 //realm = L""; Yes, ServicePermission is a bit of a disaster. I hope after we integrate our contribution we can clean it up somewhat. - sspi.cpp:337 337 realm = _wgetenv(L"USERDNSDOMAIN"); This is actually probably the best thing to do. Referrals should get chased from there. Or we could get the realm from the user's principal name and use that. - sspi.cpp:344 There's no wide string version of strdup()?? Ugh. wchar_t/WCHAR is cancer. I worry that adding any more wchar_t-using code makes worse the legacy cleanup as Windows starts to prefer UTF-8. But whatever. - sspi.cpp:351 351 wcscpy_s(fullname + oldlen + 1, wcslen(realm) + 1, realm); It would be safer to use wcscat_s(). - sspi.cpp:362 362 #define CHECK_OUTPUT(x) if (!x) return GSS_S_CALL_INACCESSIBLE_WRITE; I would much prefer the more standard and safer do { ... } while (0) construction: 362 #define CHECK_OUTPUT(x) \ do { if (!x) return GSS_S_CALL_INACCESSIBLE_WRITE; } while (0) I would do this for all your macros. I'm also not sure it's worth having these macros. - sspi.cpp:398-405 I don't believe there's an exported name token format for SPNEGO MNs. In principle any MNs produced by SPNEGO should be for the negotiated mechanism. What you should do here instead is check that the exported name token is for Kerberos, and if not return an error immediately. And your gss_export_name() correctly always puts the Kerberos mechanism OID in exported name tokens. - sspi.cpp:412 412 len = MultiByteToWideChar(CP_ACP, 0, input, len, value, len+1); ^^^^^^ Please use CP_UTF8 when en-widening the string in an exported Kerberos name token. - sspi.cpp:465 465 // Initialized as different 466 *name_equal = 0; No need to comment the obvious :) - sspi.cpp:gss_compare_name() Just a note: your `struct gss_name_struct' doesn't keep track of import name type, so you can't check that here. That's OK. It's not worth trying to keep track of it -- I'm just pointing this out. - sspi.cpp:527 527 int len = (int)wcslen(fullname); You don't need that cast. But you should check first that `wcslen()' did not return a value larger than `INT_MAX'. You only even need an `int len' because `WideCharToMultiByte()' returns `int'... I'd write this like: 527 int len; size_t namelen = wcslen(fullname); if (namelen > 255) goto err; // 04 01 00 ** 06 ** OID len:int32 name // ... // - sspi.cpp:545 545 len = WideCharToMultiByte(CP_ACP, 0, fullname, len, ^^^^^^ s/CP_ACP/CP_UTF8/ It's clear that the intent of RFC2743 was to have name strings be in some standard encoding, not the locale's, though RFC2743 says "Latin-1", which isn't precise enough, and useless anyways. Otherwise, if we needed to use the codepage being used by the application we'd have to first determine what that is. The application here is Java, which will be using UTF-8 anyways, no? so just do that. Definitely not ANSI. - sspi.cpp:532,574 You can't assume the length of a multi-byte string will be the same number of `char' as the number of `wchar_t' in the wide-char version of the string. Determinining the correct length is a bit tricky, though since we should be converting to UTF-8 (see above), you can assume that 4x is enough, use 4*len for the buffer allocation, then take the correct length from WideCharToMultiByte(). - sspi.cpp:630-644 This should be done after successfully acquiring a credential. Before that, if actual_mechs != NULL then set *actual_mechs = GSS_C_NO_OID_SET. - sspi.cpp:gss_acquire_cred() It would be good to set *minor_status in more cases. - sspi.cpp:607 606 TimeStamp ts; 607 ts.QuadPart = 0; Huh? TimeStamp is a typedef of SECURITY_INTEGER, and SECURITY_INTEGER is a struct of the same shape and size as FILETIME, and has no QuadPart field. What am I missing? - sspi.cpp:651 651 ts.QuadPart = 0; You've already initialized this at 607. - sspi.cpp:704-711 As mentioned above, you could move this all into a utility function. And there's no need to support anything other than unsigned expiration times. GSS only uses OM_uint32 for those. If a credential is expired you'll get GSS_S_NO_CRED, not a negative expiration time. (You might get GSS_S_COMPLETE and a zero lifetime_rec, but that would be a race condition.) - sspi.cpp:767 I would prefer that all output parameters be initialized early (to zero, GSS_C_NO_NAME, etc.) before any work is done that might cause failure. - sspi.cpp:813 I would prefer that *minor_status is always set to something, even zero. Meaningful minor status values would be nice, but that can come later. - sspi.cpp:871 s/CP_ACP/CP_UTF8/ - sspi.cpp:870-872 Check errors here: 870 gss_display_name(&minor, target_name, &tn, NULL); Wrong buffer length here: 871 int len = MultiByteToWideChar(CP_ACP, 0, (LPCCH)tn.value, (int)tn.length, 872 outName, (int)tn.length); ^^^^^^^^^^^^^^ Replace that with with `sizeof(outName) - 1' please (the `- 1' is important). 873 if (len == 0) { 874 return GSS_S_FAILURE; 875 } - sspi.cpp:897-898 897 } else { 898 if (!pc->phCred) { ... 932 } 933 } You can de-indent all of of 899-931 by re-writing as: 897 } else if (!pc->phCred) { ... 931 } - sspi.cpp:844 844 if (input_token->length == 0) { Technically-speaking input_token can be NULL here. Maybe the Java JNI bindings for GSS always pass in a token? But I'd still change this to `input_token == NULL || input_token->length == 0'. Similarly at 889. And 936. ... - sspi.cpp:596 596 const gss_OID_set desired_mech, Nit: since it's an OID set, the name for this argument is `desired_mechs'. - sspi.cpp:841 841 BOOLEAN isSPNEGO = isSameOID(mech_type, &SPNEGO_OID); Watch out! mech_type can be GSS_C_NO_OID (NULL)! isSameOid() will dereference that. If the Java JNI bindings for GSS just happen to always pass in a mech_type, that's OK, but I think you should not assume this and be safe. - sspi.cpp:954 Should you check if there's an output token before doing this: 954 ss = CompleteAuthToken(&pc->hCtxt, &outBuffDesc); ? - sspi.cpp:874 and others delete `output_token->value' and set it to NULL (and the length to 0) before returning errors after 865. - sspi.cpp:878,962-963 The local variable `pfDone' is set but not used. Drop it. (The compiler should have warned about this, no?) - sspi.cpp:964-966 Change this: 964 outFlag = flagSspi2Gss(outFlag); 965 966 *ret_flags = (OM_uint32)outFlag; to: 964 *ret_flags = flagSspi2Gss(outFlag); You don't use outFlag again. Setting it to a different kind of set of flags seems like a trap for someone to fall into in the future. - sspi.cpp:948 948 if (!SEC_SUCCESS(ss)) { 949 return GSS_S_FAILURE; 950 } 951 952 if ((SEC_I_COMPLETE_NEEDED == ss) 953 || (SEC_I_COMPLETE_AND_CONTINUE == ss)) { I can't find documentation on SEC_SUCCES(). I don't know if it treats SEC_I_COMPLETE_NEEDED as an error or not... I gues it must not. Can you confirm? - sspi.cpp:967-970 Does QueryContextAttributes() initialize its output parameter if it fails: 967 // Ignore the result of the next call. Might fail before context established. 968 QueryContextAttributes( 969 &pc->hCtxt, SECPKG_ATTR_SIZES, &pc->SecPkgContextSizes); ? If not then you'll print garbage at 970: 970 PP("cbMaxToken: %ld. cbMaxSignature: %ld. cbBlockSize: %ld. cbSecurityTrailer: %ld", 971 pc->SecPkgContextSizes.cbMaxToken, 972 pc->SecPkgContextSizes.cbMaxSignature, 973 pc->SecPkgContextSizes.cbBlockSize, 974 pc->SecPkgContextSizes.cbSecurityTrailer); Though if you properly initialize the context, then these should all be zeroes. Similarly at 979 and 980. - sspi.cpp:979-983 Move 980: 979 ss = QueryContextAttributes(&pc->hCtxt, SECPKG_ATTR_NATIVE_NAMES, &pc->nnames); --->980 PP("Names. %ls %ls", pc->nnames.sClientName, pc->nnames.sServerName); 981 if (!SEC_SUCCESS(ss)) { 982 return GSS_S_FAILURE; 983 } to after the SEC_SUCCESS(): 979 ss = QueryContextAttributes(&pc->hCtxt, SECPKG_ATTR_NATIVE_NAMES, &pc->nnames); 980 if (!SEC_SUCCESS(ss)) { 981 return GSS_S_FAILURE; 982 } 983 PP("Names. %ls %ls", pc->nnames.sClientName, pc->nnames.sServerName); - sspi.cpp:1067 Since you don't initialize output parameters early in this function, you might goto err and delete garbage: 1067 err: 1068 if (n1 != NULL) { 1069 if (n1->name != NULL) { 1070 delete[] n1->name; 1071 } 1072 delete n1; 1073 n1 = NULL; 1074 } 1075 if (n2 != NULL) { 1076 if (n2->name != NULL) { Just initialize all output parameters early. - sspi.cpp:1002 It should be simple now to implement this... 1002 PP(">>>> Calling UNIMPLEMENTED gss_accept_sec_context..."); 1003 return GSS_S_FAILURE; - gssapi.h:gss_acquire_cred() @@ -387,13 +399,13 @@ /* Function Prototypes */ GSS_DLLIMP OM_uint32 gss_acquire_cred( OM_uint32 *, /* minor_status */ - gss_name_t, /* desired_name */ + gss_const_name_t, /* desired_name */ OM_uint32, /* time_req */ - gss_OID_set, /* desired_mechs */ ---->+ const gss_OID_set, /* desired_mechs */ gss_cred_usage_t, /* cred_usage */ gss_cred_id_t *, /* output_cred_handle */ gss_OID_set *, /* actual_mechs */ OM_uint32 * /* time_rec */ ); That needs to be `gss_const_OID_set', not `const gss_OID_set'. There's a number of these. Just search for "const gss_" -- any time you see that in a function prototype, it's wrong. - gssapi.h:gss_init_sec_context() @@ -403,100 +415,100 @@ gss_cred_id_t * /* cred_handle */ ); GSS_DLLIMP OM_uint32 gss_init_sec_context( OM_uint32 *, /* minor_status */ - gss_cred_id_t, /* claimant_cred_handle */ + gss_const_cred_id_t, /* claimant_cred_handle */ gss_ctx_id_t *, /* context_handle */ - gss_name_t, /* target_name */ - gss_OID, /* mech_type (used to be const) */ + gss_const_name_t, /* target_name */ ---->+ const gss_OID, /* mech_type (used to be const) */ OM_uint32, /* req_flags */ OM_uint32, /* time_req */ - gss_channel_bindings_t, /* input_chan_bindings */ - gss_buffer_t, /* input_token */ ---->+ const gss_channel_bindings_t, /* input_chan_bindings */ ---->+ const gss_buffer_t, /* input_token */ gss_OID *, /* actual_mech_type */ gss_buffer_t, /* output_token */ OM_uint32 *, /* ret_flags */ OM_uint32 * /* time_rec */ ); These too need to be the correct gss_const_* types. I won't list all of these... - NativeFunc.h Same issues here. E.g., @@ -55,42 +55,42 @@ (OM_uint32 *minor_status, gss_name_t *name); typedef OM_uint32 (*IMPORT_NAME_FN_PTR) (OM_uint32 *minor_status, - gss_buffer_t input_name_buffer, - gss_OID input_name_type, ---->+ const gss_buffer_t input_name_buffer, ---->+ const gss_OID input_name_type, gss_name_t *output_name); Though you got many right too: typedef OM_uint32 (*COMPARE_NAME_FN_PTR) (OM_uint32 *minor_status, - gss_name_t name1, - gss_name_t name2, + gss_const_name_t name1, + gss_const_name_t name2, int *name_equal); Done. This looks much better. Just a bit more work! Nico -- From sean.mullan at oracle.com Fri Feb 15 22:16:39 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Fri, 15 Feb 2019 17:16:39 -0500 Subject: RFR: 8159525: Add @FunctionalInterface annotation to PrivilegedAction and PrivilegedExceptionAction Message-ID: <33b56653-0465-2dd1-6aab-7a1aaf988508@oracle.com> This probably should have been done a while ago, but these interfaces are both good examples of functional interfaces, so adding the annotation is still justified (and simple). CSR: https://bugs.openjdk.java.net/browse/JDK-8219145 (Diffs are also in the CSR). Thanks, Sean From yozons at gmail.com Fri Feb 15 22:33:51 2019 From: yozons at gmail.com (Open eSignForms) Date: Fri, 15 Feb 2019 14:33:51 -0800 Subject: XML Digital Signature throws NAMESPACE_ERR exception under OpenJDK 11 that works under Java SE 8, 9 and 10 In-Reply-To: References: <8f5d59e0-89be-9146-7e57-5d2cf755043f@oracle.com> <66dd5bf7-b1b4-b3cf-b595-2c457b29a6af@gmail.com> <32d2fff5-1be5-1201-225e-15ac60982067@gmail.com> <648d666c-60a4-bc09-ecd9-f993255040e2@gmail.com> <5360b44b-9f06-4107-fd9d-165f0b356952@gmail.com> <166893ef-5c96-ba36-3a94-114dd2caeccf@gmail.com> <8a01a47e-0984-b732-7cac-ec76e35b11ab@gmail.com> Message-ID: That seems to work, though I used this code instead: qualifyingPropertiesElement.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xades", "http://uri.etsi.org/01903/v1.4.1#"); That's because my xades elements all carry that prefix.? It does seem to work.? It's a bit odd to have to code it since the signed XML generates it in the expected way, as does the signature validation code.? In the end, as long as it works, I'm happy again! Thanks for all your help.? After I try to push this back into our actual code, I'll report back since I need to make sure that this works not only on newly signed data using Java 11, but also continues to work on previously signed content.? I think it will from prior testing. Thanks, David On 2/15/19 1:21 PM, Sean Mullan wrote: > I know what the problem is. > > You also need to add the actual namespace attribute to your element, > for example: > > qualifyingPropertiesElement.setAttributeNS( > "http://www.w3.org/2000/xmlns/", "xmlns", > "http://uri.etsi.org/01903/v1.1.1#"); > > You only need to do that on the top-most parent element in that namespace. > > When I made that change to your code, everything generated and > verified for me correctly (on JDK 10 anyway, JDK 11 may still have > some issues). > > --Sean > > On 2/15/19 3:11 PM, Open eSignForms wrote: >> >> XML namespaces are pretty confusing.? From what little I gather, >> unprefixed attributes don't belong to any namespace, not even the >> default one. >> >> I think I can see the bug in the debugging output. >> >> On Java 8 and 10 and 11, I'd guess that the >> marshaling/canonicalization has issues when combining differently >> namespaced objects. >> >> In my working code (also works on Java 11), when my ETSI/XADES >> QualifyingProperties element is created specifying my namespace (the >> default namespace for the XML document that I'm signing), it works >> fine.? If I change my document's default namespace to be the XADES >> one, it also works.? But I cannot make them work when both are in >> use.? The reason seems to be as follows. >> >> 1) The signedXML generated looks great and sensible, with the xades >> namespace as expected. >> >> ??? >> ??????? > Target="#OpenESignForms_Seal" >> *xmlns:xades="http://uri.etsi.org/01903/v1.4.1#"*> >> ??????????? >> ??????????????? >> 2019-02-15T11:30:44-08:00 >> ??????????????? >> ??????????????? >> ??????????????????? > ObjectReference="#Payload_Reference_ID"> >> description >> text/html >> ??????????????????? >> ??????????????? >> ??????????? >> ??????? >> ??? >> >> 2) But using the debugging options, it shows this element during >> SIGNING (presuming canonicalization) that makes /*no sense*/.? It's >> added both the default namespace, the 'dsig' namespace, but doesn't >> include the xades namespace. Wwhat does the 'xades' prefix even refer >> to in this XML for the signing digest? >> >> ??? > *xmlns="http://open.esignforms.com/XMLSchema/2011" >> xmlns:ds="http://www.w3.org/2000/09/xmldsig#"* >> Id="QualifyingProperties_ID" Target="#OpenESignForms_Seal"> >> ??????? >> ??????????? >> 2019-02-15T11:30:44-08:00 >> ??????????? >> ??????????? >> ??????????????? > ObjectReference="#Payload_Reference_ID"> >> description >> text/html >> ??????????????? >> ??????????? >> ??????? >> ??? >> >> 3) And again, the debugger shows this element during VERIFICATION >> (presuming canonicalization) that is excessive, but at least makes >> some sense (though there are no default elements nor 'dsig' >> elements).? It's added all three namespaces: our default namespace, >> the 'dsig' namespace AND the 'xades' namespace. >> >> ?? > *xmlns="http://open.esignforms.com/XMLSchema/2011" >> xmlns:ds="http://www.w3.org/2000/09/xmldsig#" >> xmlns:xades="http://uri.etsi.org/01903/v1.4.1#"* >> Id="QualifyingProperties_ID" Target="#OpenESignForms_Seal"> >> ??????? >> ??????????? >> 2019-02-15T11:30:44-08:00 >> ??????????? >> ??????????? >> ??????????????? > ObjectReference="#Payload_Reference_ID"> >> description >> text/html >> ??????????????? >> ??????????? >> ??????? >> ??? > >> So the libraries are oddly creating two distinct canonicalized XML >> for digesting, with the signing phase seeming to miss the important >> 'xades' namespace declaration entirely.? This is no doubt why this is >> the only Reference that fails verification as the two.? I'm guessing >> that the verification digest is correct when using multiple >> namespaced objects/references, but the signing digest is not since it >> doesn't include the 'xades' namespace declaration. >> >> This seems to hold true for Java 8, 10 and 11.? That is, by >> specifying null namespaces on atrributes, the code fails the same >> under under Java 11, and the debugging output shows the same odd >> namespaces above.? If I use a single namespace, then it signs fine >> under Java 8, 10 and 11. >> >> David >> >> >> On 2/15/19 11:12 AM, Sean Mullan wrote: >>> On 2/14/19 9:32 PM, Open eSignForms wrote: >>>> >>>> Yes, indeed that's the issue.? But I don't know why/how all those >>>> xmlns attributes are added, since I don't directly add them. >>>> >>>> I found the only way I can make it work under Java 8, 10 and 11 is >>>> to use my common namespace (XML_NAMESPACE_2011 = >>>> "http://open.esignforms.com/XMLSchema/2011") for all the XADES >>>> elements with the null namespace on all their attributes.? Even if >>>> I put that same namespace on the attributes, it then fails. >>>> >>>> When I do that, the signed XML generates clean looking XML like this: >>>> >>>> ??? >>>> ??????? >>> Target="#OpenESignForms_Seal"> >>>> >>>> 2019-02-14T17:37:39-08:00 >>>> ??????????? >>>> ??????????? >>>> ??????????????? >>> ObjectReference="#Payload_Reference_ID"> >>>> description >>>> text/html >>>> ??????????????? >>>> ??????????? >>>> ??????????? >>>> ??????? >>>> ??? >>>> ??? >>>> ??????? >>>> ??????????? >>> Target="#OpenESignForms_Seal"*> >>>> ??????????????? >>> DeploymentHostAddress="192.1.1.1" >>>> DeploymentHostName="open.esignforms.com" DeploymentId="1.1.1.1" >>>> SignerAddress="192.1.1.1" SignerAgent="No-Browser-Test" >>>> Timestamp="2019-02-14T17:37:39-08:00" Version="19.1.19"/> >>>> ??????????? >>>> ??????? >>>> ??? >>>> >>>> But even above, as you can see, the second ds:Object shows >>>> ds:SignatureProperty, yet the Id and Target attributes do not >>>> include a 'ds:' prefix, which it's my understanding to mean that >>>> they default to our XML payload's default namespace. >>>> >>> I don't think that's correct, I think attributes w/o a prefix by >>> default belong to the namespace of the element in which they are >>> defined, which in this case is SignatureProperties and the dsig >>> namespace. >>> >>> Regarding below, I would forget about JDK 11 for the time being and >>> focus on generating a signature with proper XMLNS definitions on JDK >>> 10. If you have any problems verifying with that on JDK 10 or prior, >>> let me know. The reason is that we will likely be restoring JDK 11 >>> (and later) to the same state it was in for JDK 10. There were some >>> changes to the marshalling code in JDK 11 which is causing these and >>> other problems which will likely be backed out. >>> >>> --Sean >>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From andimullaraj at gmail.com Sat Feb 16 22:18:19 2019 From: andimullaraj at gmail.com (Andi Mullaraj) Date: Sat, 16 Feb 2019 14:18:19 -0800 Subject: Java SSLSocketChannel/SSLSelector? In-Reply-To: References: Message-ID: Hi David, Thanks for following up. Addressing your questions and statements 1. Then your selector can only be used for SSL things. The SSLSelector I am proposing may select on (plain) SocketChannels/ServerSocketChannels, (secure) SSLSocketChannels/SSLServerSocketChannels, and any mixture of them. 2. What if someone decides to take the exact same approach to solve some other higher-OSI-layer protocol decoding? Now you have to choose which kind of protocol you want your selector to support. They create their own selector. I have hard time imagining one selector implementation being able to support various protocols at once. In the current discussion (and if one day this or a similar implementation makes it into jdk), the selector provider will know how to create (plain) SocketChannels as well as (secure) SSLSocketChannels. 3. Note that with a plain selector and plain sockets, you *need* a thread to support the event loop anyway, I mean it has to run somewhere. I don't have enough knowledge here, but I am thinking it will depend on the OS ... if the OS provides similar hooks, then I'd say no other threads are needed -- the thread selecting would be entering a wait() until some notifier wakes it up ... not vital to the SSL part though. 4. And with SSL, you also need an extra thread or thread pool to handle SSL authentication tasks, no matter whether you make a subclass of Selector. True. Resisting the temptation to get into implementation details, I would say it is the SSLSocketChannel that needs the thread pool (since the calls to select() should not deal with any crypto etc). In that case the user can bring its own thread pool (or executor), or use a default one shared by all channels of that selector provider, depending on their needs. Best, --Andi On Fri, Feb 15, 2019 at 4:56 AM David Lloyd wrote: > Then your selector can only be used for SSL things. What if someone > decides to take the exact same approach to solve some other > higher-OSI-layer protocol decoding? Now you have to choose which kind > of protocol you want your selector to support. Note that with a plain > selector and plain sockets, you *need* a thread to support the event > loop anyway, I mean it has to run somewhere. And with SSL, you also > need an extra thread or thread pool to handle SSL authentication > tasks, no matter whether you make a subclass of Selector. > > On Fri, Feb 15, 2019 at 2:35 AM Andi Mullaraj > wrote: > > > > Hi Dean, > > > > Thanks for sharing your experience. I took a look at your links and the > model and implementation seems quite distant from the classic > Selector/SelectableChannel though. You seem to allocate a thread per each > Selector (which I agree is too much of a cost to pay), then fire actively > [listener.selectorFired()] from that thread towards a SelectorListener ... > > > > We can come back to implementation details later, but first I would like > to ask: any reason we cannot have an SSLSelector which extends the > java.nio.channels.Selector, an SSLSocketChannel extending a > java.nio.channels.SocketChannel, and so on? I believe we can, and in this > doc https://github.com/rouplex/rouplex-niossl/blob/master/README.md I > have provided the set of base classes that do just that. Since this is a > dev group I am sharing a code snippet from the doc: > > > > As an example, an existing application which is using SocketChannel with > a Selector for their communications, would be turned into a secure one, by > simply replacing: > > > > Selector selector = Selector.open(); > > SocketChannel socketChannel = SocketChannel.open(); > > socketChannel.register(selector, SelectionKey.OP_READ); > > > > while(true) { > > selector.select(); > > for (SocketChannel sc : selector.selectedKeys() { > > sc.read(...) > > } > > } > > > > with: > > > > Selector selector = SSLSelector.open(); // notice the SSL > > SocketChannel socketChannel = SSLSocketChannel.open(); // notice the SSL > > socketChannel.register(selector, SelectionKey.OP_READ); > > > > while(true) { > > selector.select(); > > for (SocketChannel sc : selector.selectedKeys() { > > sc.read(...) > > } > > } > > > > How much cooler and easier than that can it get redressing your existing > service using (performant) plain communications with (performant) secure > ones? Or create a new (and secure) one using the exact knowledge you > already have and never having to think SSLEngine again? > > > > As I have already mentioned I have worked on such implementation but > would like to first discuss with the group the merits and possible > problems/shortcomings of adopting the inheritance model from the plain > counterparts. > > > > Thanks in advance, > > --Andi > > > > > > On Wed, Feb 13, 2019 at 8:22 AM Dean Hiller wrote: > >> > >> I would highly suggest implementing your own for a much better > understanding. > >> > >> I did implement something like what you want and in so doing realized I > like their decision. ie. See the heirarchy here > >> > https://github.com/deanhiller/webpieces/tree/master/core/core-channelmanager2/src/main/java/org/webpieces/nio/api/channels > >> > >> The TCPChannel could be SSL or not SSL as there are two implementations. > >> > >> If you do want an implementation that does what you want though, this > library does exactly that > >> > https://github.com/deanhiller/webpieces/tree/master/core/core-channelmanager2 > >> > >> which is used in the webpieces webserver > >> https://github.com/deanhiller/webpieces > >> > >> That nio library is standalone even though it is in the webpieces > repo. I mean, every component in webpieces is another stand-alone piece. > >> > >> The downside is the library owns a thread which typical java libraries > avoid. ie. it has to have a thread to poll the selector and read from all > the sockets to be fed to the thread pools, etc. I think that is the main > reason they decided not to have this type of library. They prefer not to > be running threads(which I agree, the jdk shouldn't). > >> > >> later, > >> Dean > >> > >> > >> > >> > >> On Tue, Feb 12, 2019 at 7:54 PM Sean Mullan > wrote: > >>> > >>> Hi Andi, > >>> > >>> TLS/JSSE topics are best discussed on the security-dev alias, so I am > >>> copying that list for more discussion and -bcc-ing core-libs-dev. > >>> > >>> --Sean > >>> > >>> On 2/11/19 3:29 PM, Andi Mullaraj wrote: > >>> > Hi java-core community, > >>> > > >>> > I have been directed to this channel to discuss matters related to > Java > >>> > performant ssl communications. Maybe this is a topic that has been > >>> > discussed in the past, in which case I would appreciate if someone > pointed > >>> > me to that particular topic. > >>> > > >>> > Back in 2002 I personally applauded the java.nio.channels (jdk1.4) > package, > >>> > realizing that there was no way to port this to the secure > communications, > >>> > due to lack of a comparable implementation for SSL. But I thought > it was > >>> > going to just be matter of time. A couple of years ago I had to go > back > >>> > search for it, and was kind of surprised to find the following in > >>> > > http://docs.oracle.com/javase/7/docs/technotes/guides/security/jsse/JSSERefGuide.html#SSLENG > >>> > : > >>> > > >>> > --- begin quote --- > >>> > Newcomers to the API may wonder "Why not just have an > SSLSocketChannel > >>> > which extends java.nio.channels.SocketChannel?" There are two main > reasons: > >>> > > >>> > 1. There were a lot of very difficult questions about what a > >>> > SSLSocketChannel should be, including its class hierarchy and how it > should > >>> > interoperate with Selectors and other types of SocketChannels. Each > >>> > proposal brought up more questions than answers. It was noted that > any new > >>> > API abstraction extended to work with SSL/TLS would require the same > >>> > significant analysis and could result in large and complex APIs. > >>> > 2. Any JSSE implementation of a new API would be free to choose the > "best" > >>> > I/O & compute strategy, but hiding any of these details is > inappropriate > >>> > for those applications needing full control. Any specific > implementation > >>> > would be inappropriate for some application segment. > >>> > --- end quote --- > >>> > > >>> > It has been a while since this was stated, and I would really like to > >>> > revisit it. I personally believe that the question #1 has a quite > natural > >>> > answer, while #2 should not really be a concern if we adhere to the > spi > >>> > model where users can bring their own implementation if needed. I > know > >>> > because I have also implemented it (but would like to discuss that > in a > >>> > later stage, if it comes to it). > >>> > > >>> > The benefit of such implementation would be immense. Imagine many > Java > >>> > services written with nio and which struggle to move to SSL due to > the > >>> > great complexity of using SSLEngine (zookeeper service to name one), > while > >>> > all they would need to do (if SSLSocketChannels were available) is to > >>> > instantiate an instance of SSLSocketChannel/SSLSelector when the > security > >>> > is required and the rest would stay the same (as in case of plain > >>> > communication using SocketChannel/Selector). Another important use > case is > >>> > the advent of IOT, where millions of devices, with relatively low > >>> > throughput would want to protect their communication via SSL. > >>> > > >>> > The ways I have seen the community deal with this are mainly: > >>> > > >>> > 1. Go through the pain of learning SSLEngine (and hope to get it > right) > >>> > 2. Build their services around tested libraries (like Jetty, which > handle > >>> > the SSL offload but don't resurface it in SocketChannel/Selector > paradigm, > >>> > that also come with their huge set of dependencies, bringing in > unavoidable > >>> > version collisions) > >>> > 3. Use proxies (nginx, ha) to deal with the high number of SSL > connections > >>> > and divide the load by scaling horizontally in the back end (making > for a > >>> > harder deployment model) > >>> > > >>> > We can make this a lot easier! > >>> > > >>> > Any feedback is greatly appreciated, > >>> > Best, > >>> > > >>> > Andi Mullaraj > >>> > > > > > -- > - DML > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yozons at gmail.com Sun Feb 17 17:31:40 2019 From: yozons at gmail.com (Open eSignForms) Date: Sun, 17 Feb 2019 09:31:40 -0800 Subject: XML Digital Signature throws NAMESPACE_ERR exception under OpenJDK 11 that works under Java SE 8, 9 and 10 In-Reply-To: References: <8f5d59e0-89be-9146-7e57-5d2cf755043f@oracle.com> <66dd5bf7-b1b4-b3cf-b595-2c457b29a6af@gmail.com> <32d2fff5-1be5-1201-225e-15ac60982067@gmail.com> <648d666c-60a4-bc09-ecd9-f993255040e2@gmail.com> <5360b44b-9f06-4107-fd9d-165f0b356952@gmail.com> <166893ef-5c96-ba36-3a94-114dd2caeccf@gmail.com> <8a01a47e-0984-b732-7cac-ec76e35b11ab@gmail.com> Message-ID: <26568382-4eeb-78bd-ff45-c39dca0830aa@gmail.com> It seems that were are able to now make this work under Java 8, 10 and 11 with the recommended changes.? Of course, I'm sure the bug report still is in place so that prior code not using namespaces will continue to work under 11. For validation, we did note that we have to use special code to handle the prior version that didn't make use of distinct namespaces because of the need to set the "Id" attribute as the 'id' attribute for the Element and to even find the QualifyingProperties element as it's under the XaDES namespace now.? We decided to handle this by using a new default namespace for our XML documents that we sign (which makes sense since the underlying structure has changed), so on verification, we can query the namespace on the root/document element to process as before, or to use the new logic currently required under OpenJDK 11. Thank you, Sean, so much for all your hard work in finding a resolution. David On 2/15/19 2:33 PM, Open eSignForms wrote: > > That seems to work, though I used this code instead: > > qualifyingPropertiesElement.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xades", > "http://uri.etsi.org/01903/v1.4.1#"); > > That's because my xades elements all carry that prefix.? It does seem > to work.? It's a bit odd to have to code it since the signed XML > generates it in the expected way, as does the signature validation > code.? In the end, as long as it works, I'm happy again! > > Thanks for all your help.? After I try to push this back into our > actual code, I'll report back since I need to make sure that this > works not only on newly signed data using Java 11, but also continues > to work on previously signed content.? I think it will from prior testing. > > Thanks, > David > > On 2/15/19 1:21 PM, Sean Mullan wrote: >> I know what the problem is. >> >> You also need to add the actual namespace attribute to your element, >> for example: >> >> qualifyingPropertiesElement.setAttributeNS( >> "http://www.w3.org/2000/xmlns/", "xmlns", >> "http://uri.etsi.org/01903/v1.1.1#"); >> >> You only need to do that on the top-most parent element in that >> namespace. >> >> When I made that change to your code, everything generated and >> verified for me correctly (on JDK 10 anyway, JDK 11 may still have >> some issues). >> >> --Sean >> >> On 2/15/19 3:11 PM, Open eSignForms wrote: >>> >>> XML namespaces are pretty confusing.? From what little I gather, >>> unprefixed attributes don't belong to any namespace, not even the >>> default one. >>> >>> I think I can see the bug in the debugging output. >>> >>> On Java 8 and 10 and 11, I'd guess that the >>> marshaling/canonicalization has issues when combining differently >>> namespaced objects. >>> >>> In my working code (also works on Java 11), when my ETSI/XADES >>> QualifyingProperties element is created specifying my namespace (the >>> default namespace for the XML document that I'm signing), it works >>> fine.? If I change my document's default namespace to be the XADES >>> one, it also works.? But I cannot make them work when both are in >>> use. The reason seems to be as follows. >>> >>> 1) The signedXML generated looks great and sensible, with the xades >>> namespace as expected. >>> >>> ??? >>> ??????? >> Target="#OpenESignForms_Seal" >>> *xmlns:xades="http://uri.etsi.org/01903/v1.4.1#"*> >>> ??????????? >>> ??????????????? >>> 2019-02-15T11:30:44-08:00 >>> ??????????????? >>> ??????????????? >>> ??????????????????? >> ObjectReference="#Payload_Reference_ID"> >>> description >>> text/html >>> ??????????????????? >>> ??????????????? >>> ??????????? >>> ??????? >>> ??? >>> >>> 2) But using the debugging options, it shows this element during >>> SIGNING (presuming canonicalization) that makes /*no sense*/.? It's >>> added both the default namespace, the 'dsig' namespace, but doesn't >>> include the xades namespace.? Wwhat does the 'xades' prefix even >>> refer to in this XML for the signing digest? >>> >>> ??? >> *xmlns="http://open.esignforms.com/XMLSchema/2011" >>> xmlns:ds="http://www.w3.org/2000/09/xmldsig#"* >>> Id="QualifyingProperties_ID" Target="#OpenESignForms_Seal"> >>> ??????? >>> ??????????? >>> 2019-02-15T11:30:44-08:00 >>> ??????????? >>> ??????????? >>> ??????????????? >> ObjectReference="#Payload_Reference_ID"> >>> description >>> text/html >>> ??????????????? >>> ??????????? >>> ??????? >>> ??? >>> >>> 3) And again, the debugger shows this element during VERIFICATION >>> (presuming canonicalization) that is excessive, but at least makes >>> some sense (though there are no default elements nor 'dsig' >>> elements).? It's added all three namespaces: our default namespace, >>> the 'dsig' namespace AND the 'xades' namespace. >>> >>> ?? >> *xmlns="http://open.esignforms.com/XMLSchema/2011" >>> xmlns:ds="http://www.w3.org/2000/09/xmldsig#" >>> xmlns:xades="http://uri.etsi.org/01903/v1.4.1#"* >>> Id="QualifyingProperties_ID" Target="#OpenESignForms_Seal"> >>> ??????? >>> ??????????? >>> 2019-02-15T11:30:44-08:00 >>> ??????????? >>> ??????????? >>> ??????????????? >> ObjectReference="#Payload_Reference_ID"> >>> description >>> text/html >>> ??????????????? >>> ??????????? >>> ??????? >>> ??? >> >>> So the libraries are oddly creating two distinct canonicalized XML >>> for digesting, with the signing phase seeming to miss the important >>> 'xades' namespace declaration entirely.? This is no doubt why this >>> is the only Reference that fails verification as the two.? I'm >>> guessing that the verification digest is correct when using multiple >>> namespaced objects/references, but the signing digest is not since >>> it doesn't include the 'xades' namespace declaration. >>> >>> This seems to hold true for Java 8, 10 and 11.? That is, by >>> specifying null namespaces on atrributes, the code fails the same >>> under under Java 11, and the debugging output shows the same odd >>> namespaces above.? If I use a single namespace, then it signs fine >>> under Java 8, 10 and 11. >>> >>> David >>> >>> >>> On 2/15/19 11:12 AM, Sean Mullan wrote: >>>> On 2/14/19 9:32 PM, Open eSignForms wrote: >>>>> >>>>> Yes, indeed that's the issue.? But I don't know why/how all those >>>>> xmlns attributes are added, since I don't directly add them. >>>>> >>>>> I found the only way I can make it work under Java 8, 10 and 11 is >>>>> to use my common namespace (XML_NAMESPACE_2011 = >>>>> "http://open.esignforms.com/XMLSchema/2011") for all the XADES >>>>> elements with the null namespace on all their attributes.? Even if >>>>> I put that same namespace on the attributes, it then fails. >>>>> >>>>> When I do that, the signed XML generates clean looking XML like this: >>>>> >>>>> ??? >>>>> ??????? >>>> Target="#OpenESignForms_Seal"> >>>>> >>>>> 2019-02-14T17:37:39-08:00 >>>>> ??????????? >>>>> ??????????? >>>>> ??????????????? >>>> ObjectReference="#Payload_Reference_ID"> >>>>> description >>>>> text/html >>>>> ??????????????? >>>>> ??????????? >>>>> ??????????? >>>>> ??????? >>>>> ??? >>>>> ??? >>>>> ??????? >>>>> ??????????? >>>> Target="#OpenESignForms_Seal"*> >>>>> >>>> DeploymentHostAddress="192.1.1.1" >>>>> DeploymentHostName="open.esignforms.com" DeploymentId="1.1.1.1" >>>>> SignerAddress="192.1.1.1" SignerAgent="No-Browser-Test" >>>>> Timestamp="2019-02-14T17:37:39-08:00" Version="19.1.19"/> >>>>> ??????????? >>>>> ??????? >>>>> ??? >>>>> >>>>> But even above, as you can see, the second ds:Object shows >>>>> ds:SignatureProperty, yet the Id and Target attributes do not >>>>> include a 'ds:' prefix, which it's my understanding to mean that >>>>> they default to our XML payload's default namespace. >>>>> >>>> I don't think that's correct, I think attributes w/o a prefix by >>>> default belong to the namespace of the element in which they are >>>> defined, which in this case is SignatureProperties and the dsig >>>> namespace. >>>> >>>> Regarding below, I would forget about JDK 11 for the time being and >>>> focus on generating a signature with proper XMLNS definitions on >>>> JDK 10. If you have any problems verifying with that on JDK 10 or >>>> prior, let me know. The reason is that we will likely be restoring >>>> JDK 11 (and later) to the same state it was in for JDK 10. There >>>> were some changes to the marshalling code in JDK 11 which is >>>> causing these and other problems which will likely be backed out. >>>> >>>> --Sean >>>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.lloyd at redhat.com Mon Feb 18 13:47:05 2019 From: david.lloyd at redhat.com (David Lloyd) Date: Mon, 18 Feb 2019 07:47:05 -0600 Subject: Java SSLSocketChannel/SSLSelector? In-Reply-To: References: Message-ID: On Sat, Feb 16, 2019 at 4:19 PM Andi Mullaraj wrote: > 2. What if someone decides to take the exact same approach to solve some other higher-OSI-layer protocol decoding? Now you have to choose which kind of protocol you want your selector to support. > > They create their own selector. I have hard time imagining one selector implementation being able to support various protocols at once. That is the case today. I can use one selector event loop today to support TCP (including SSL) as well as UDP, even SCTP. The point of selectors is to combine many things into one event loop. > 3. Note that with a plain selector and plain sockets, you *need* a thread to support the event loop anyway, I mean it has to run somewhere. > > I don't have enough knowledge here, but I am thinking it will depend on the OS ... if the OS provides similar hooks, then I'd say no other threads are needed -- the thread selecting would be entering a wait() until some notifier wakes it up ... not vital to the SSL part though. It is definitely not OS-dependent; something in the end has to call selector.select(), and that thing is indeed a thread. I understand the urge to make SSL with Selectors easier, because right now it is very painful. But this approach is unlikely to succeed, at least in the JDK. -- - DML From andimullaraj at gmail.com Mon Feb 18 23:35:43 2019 From: andimullaraj at gmail.com (Andi Mullaraj) Date: Mon, 18 Feb 2019 15:35:43 -0800 Subject: Java SSLSocketChannel/SSLSelector? In-Reply-To: References: Message-ID: Thanks David, > That is the case today. I can use one selector event loop today to > support TCP (including SSL) as well as UDP, even SCTP. The point of > selectors is to combine many things into one event loop. Is this (to use one Selector class only for all protocols) a requirement in JDK? I haven't seen it, but even if it were (such requirement): 1. I mentioned that the SSLSelector that I am proposing would be able to select on whatever the default Selector is able to, plus the SSL socket channels. 2. It would also be able to perform everything without the need for any extra threads. 3. It would not be anymore an obstacle to additions (such as SCTP) than the current one (plain sockets) is (if it were to make it to JDK, obviously) > It is definitely not OS-dependent; something in the end has to call > selector.select(), and that thing is indeed a thread. I am beginning to think we might be on different pages here. Someone from outside the selector calls selector.select(), and all selector's functionality is handled within the context of the calling thread. So where is the need for the extra thread here? More specifically, in the SSLSelector case, a call to its select, ends up usually to a call to its inner selector.select(), always in the context of the calling thread ... so same thing again. Why do you think another thread is necessary here (within the selector itself)? > I understand the urge to make SSL with Selectors easier, because right > now it is very painful. Total agreement. I have one full year of development notes to show how painful it is. I am talking about a fully functional, completely compatible Selector, (down to the lock obtention order -- sometimes 6 to 8 locks to be always kept in order) to vouch for that. > But this approach is unlikely to succeed, at least in the JDK. Would you mind clarifying which part doesn't fit the bill? Let's understand well what is proposed first: A JDK enhancement of Selector/SocketChannel/ServerSocketChannel able to provide the same exact functionality across all existing channels (UDP/TCP) as well as SSL. It can be implemented in pure Java, with no extra threads for selection, with minimal cpu and memory impact (only for SSL channels) over the current implementation. If I were the JDK steward, I wouldn't know what to ask for more. Am not, and thats the reason I am putting all this under SSLSelector/SSLSocketChannel implementation, instances of which provide the same proposed functionality. Thanks, --Andi On Mon, Feb 18, 2019 at 5:47 AM David Lloyd wrote: > On Sat, Feb 16, 2019 at 4:19 PM Andi Mullaraj > wrote: > > 2. What if someone decides to take the exact same approach to solve some > other higher-OSI-layer protocol decoding? Now you have to choose which kind > of protocol you want your selector to support. > > > > They create their own selector. I have hard time imagining one selector > implementation being able to support various protocols at once. > > That is the case today. I can use one selector event loop today to > support TCP (including SSL) as well as UDP, even SCTP. The point of > selectors is to combine many things into one event loop. > > > 3. Note that with a plain selector and plain sockets, you *need* a > thread to support the event loop anyway, I mean it has to run somewhere. > > > > I don't have enough knowledge here, but I am thinking it will depend on > the OS ... if the OS provides similar hooks, then I'd say no other threads > are needed -- the thread selecting would be entering a wait() until some > notifier wakes it up ... not vital to the SSL part though. > > It is definitely not OS-dependent; something in the end has to call > selector.select(), and that thing is indeed a thread. > > I understand the urge to make SSL with Selectors easier, because right > now it is very painful. But this approach is unlikely to succeed, at > least in the JDK. > > > > -- > - DML > -------------- next part -------------- An HTML attachment was scrubbed... URL: From xuelei.fan at oracle.com Wed Feb 20 05:38:40 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Tue, 19 Feb 2019 21:38:40 -0800 Subject: RFR [13] JDK-8219389: Delegated task created by SSLEngine throws BufferUnderflowException Message-ID: <55104090-2235-8f79-47ba-b4ab3ce54ca3@oracle.com> Hi Tony or Jamil, Would you please review the following update: http://cr.openjdk.java.net/~xuelei/8219389/webrev.00/ BufferUnderflowException might be thrown if the record format does not confirm to the formal protocol syntax. The original bug was reported for the ClientHello handshake message, and was fixed in JDK-8215790. I made an enhancement so that more handshake messages buffer operating RuntimeException could be handled properly. Thanks, Xuelei From anthony.scarpino at oracle.com Wed Feb 20 06:06:14 2019 From: anthony.scarpino at oracle.com (Anthony Scarpino) Date: Tue, 19 Feb 2019 22:06:14 -0800 Subject: RFR [13] JDK-8219389: Delegated task created by SSLEngine throws BufferUnderflowException In-Reply-To: <55104090-2235-8f79-47ba-b4ab3ce54ca3@oracle.com> References: <55104090-2235-8f79-47ba-b4ab3ce54ca3@oracle.com> Message-ID: On 2/19/19 9:38 PM, Xuelei Fan wrote: > Hi Tony or Jamil, > > Would you please review the following update: > ?? http://cr.openjdk.java.net/~xuelei/8219389/webrev.00/ > > BufferUnderflowException might be thrown if the record format does not > confirm to the formal protocol syntax. The original bug was reported for > the ClientHello handshake message, and was fixed in JDK-8215790.? I made > an enhancement so that more handshake messages buffer operating > RuntimeException could be handled properly. > > Thanks, > Xuelei I'm not saying your approach is incorrect, but I have to wonder if this is too generic. Are you trying to catch situations other than RandomCookie throwing an exception? RandomCookie is only in ClientHello and ServerHello, so PostHandshakeContext doesn't look necessary. If we need a generic catch all consumed extensions, why not just have it catch "Exception" and run fatal. This could eliminate many of the current fatal calls in the code and centralize the SSLException messages in these two files. Assuming I understand the idea around this change correctly. Tony From Xuelei.Fan at Oracle.Com Wed Feb 20 06:32:50 2019 From: Xuelei.Fan at Oracle.Com (Xuelei Fan) Date: Tue, 19 Feb 2019 22:32:50 -0800 Subject: RFR [13] JDK-8219389: Delegated task created by SSLEngine throws BufferUnderflowException In-Reply-To: References: <55104090-2235-8f79-47ba-b4ab3ce54ca3@oracle.com> Message-ID: > On Feb 19, 2019, at 10:06 PM, Anthony Scarpino wrote: > >> On 2/19/19 9:38 PM, Xuelei Fan wrote: >> Hi Tony or Jamil, >> Would you please review the following update: >> http://cr.openjdk.java.net/~xuelei/8219389/webrev.00/ >> BufferUnderflowException might be thrown if the record format does not confirm to the formal protocol syntax. The original bug was reported for the ClientHello handshake message, and was fixed in JDK-8215790. I made an enhancement so that more handshake messages buffer operating RuntimeException could be handled properly. >> Thanks, >> Xuelei > > I'm not saying your approach is incorrect, but I have to wonder if this is too generic. Are you trying to catch situations other than RandomCookie throwing an exception? Yes, it is for cases other than RandomCookie. Every call to ByteBuffer.get() could throw BUFE unless the length get checked. The impl code did not always check the buffer length before calling the get() method. The issues happens only when the record format does not comply to the protocol syntax. For example, the record length is 5, but the content only have 1 byte. We can fix these issues with two approaches: checking the buffer length before call get() and put(); or catch the exception in a general way. > RandomCookie is only in ClientHello and ServerHello, so PostHandshakeContext doesn't look necessary. > > If we need a generic catch all consumed extensions, why not just have it catch "Exception" and run fatal. I did not get the point. It is not the purpose to catch all consumed exceptions, some of which could have been handled. > This could eliminate many of the current fatal calls in the code and centralize the SSLException messages in these two files. Assuming I understand the idea around this change correctly. > We can go with checking the buffer length before each call to get(), which means we need to update a lot of code, and make no missing and mistakes. Using a centralized way is more robust as if we missed somewhere in the handshake message operations like the ClientHello case. I?m not sure I get the point about the elimination of fatal calls. I think it is still needed to check the buffer length as soon as possible instead of depending on the two lazy centralized catch, which is used just in case the checking is missed somehow. Thanks, Xuelei > Tony From philipp.kunz at paratix.ch Wed Feb 20 12:41:14 2019 From: philipp.kunz at paratix.ch (Philipp Kunz) Date: Wed, 20 Feb 2019 13:41:14 +0100 Subject: Jarsigner Fails To Verify Signed By Alias If Alias Given In Wrong Case Message-ID: <1550666474.2433.13.camel@paratix.ch> Hi, When signing a jarfile the specified alias is converted by JavaKeyStore (storetype JKS) to lower case. When verifying the jarfile with the same alias, it is currently not converted by JKS to lower case and jarsigner reports that the jar is not signed by the alias even after having just signed it with that same alias if not all characters are in lower case. I found no statement in the documentation that an alias would support only lower case or which characters could be used. It could, however, be worth noting in the documentation of JavaKeyStore or the keytool that the alias can be changed by the keystore in certain circumstances. In my opinion, it feels like a bug that aliases are treated differently when signing and verifying with respect to their upper and lower case. Find a patch attached. Some explanations, just in case not too obvious anyway: - The jarsigner never changed the upper and lower cases of aliases itself and neither does with the patch. That is now delegated to the keystore implementation not only for signing but in addition also for verifying. The fix is therefore not JSK-specific. - I assume it is correct that the if (store != null) check and the try catch KeyStoreException can both be moved outside the for loop over the certificates because before as well as now with the patch the result was alway 0 if store was null and KeyStoreException can happen only when loading the keystore, which is certainly true for JKS. - storeHash is used only by printCert and inKeyStoreForOneSigner and contains the aliases as values enclosed in parentheses "(" and ")" which is how it is printed by printCert. It would have probably been easier to add the parentheses only later in printCert but then I tried to change as little as possible. - Two pairs of "result |= " statements were duplicate. Therefore there are the two methods in the test which show that both actually failed with "ckaliases.contains" being the offending piece of code. In the patch I refactored to recombine them. - I really wonder how "result |= SIGNED_BY_ALIAS;" should be set for any certificate c and not only the one an alias in ckaliases points at but I guess that is another story if one at all and might have come from filling storeHash with all certificates and not only the ones in ckaliases or so. - At first glance it might look like a mistake that "alias" is not used inside the loop over ckaliases but instead of comparing "alias" in lower case to ckaliases with unspecified case, the certificate c is now compared to the one gotten from the keystore handling the alias case in its own way. Would someone sponsor this fix or can/should it be improved? Regards, Philipp -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: JavaKeyStoreAliasCaseInsensitive.patch Type: text/x-patch Size: 8881 bytes Desc: not available URL: From anthony.scarpino at oracle.com Wed Feb 20 17:54:24 2019 From: anthony.scarpino at oracle.com (Anthony Scarpino) Date: Wed, 20 Feb 2019 09:54:24 -0800 Subject: RFR [13] JDK-8219389: Delegated task created by SSLEngine throws BufferUnderflowException In-Reply-To: References: <55104090-2235-8f79-47ba-b4ab3ce54ca3@oracle.com> Message-ID: I understand. The change looks fine. Tony On 2/19/19 10:32 PM, Xuelei Fan wrote: > > >> On Feb 19, 2019, at 10:06 PM, Anthony Scarpino wrote: >> >>> On 2/19/19 9:38 PM, Xuelei Fan wrote: >>> Hi Tony or Jamil, >>> Would you please review the following update: >>> http://cr.openjdk.java.net/~xuelei/8219389/webrev.00/ >>> BufferUnderflowException might be thrown if the record format does not confirm to the formal protocol syntax. The original bug was reported for the ClientHello handshake message, and was fixed in JDK-8215790. I made an enhancement so that more handshake messages buffer operating RuntimeException could be handled properly. >>> Thanks, >>> Xuelei >> >> I'm not saying your approach is incorrect, but I have to wonder if this is too generic. Are you trying to catch situations other than RandomCookie throwing an exception? > Yes, it is for cases other than RandomCookie. Every call to ByteBuffer.get() could throw BUFE unless the length get checked. The impl code did not always check the buffer length before calling the get() method. > > The issues happens only when the record format does not comply to the protocol syntax. For example, the record length is 5, but the content only have 1 byte. > > We can fix these issues with two approaches: checking the buffer length before call get() and put(); or catch the exception in a general way. > >> RandomCookie is only in ClientHello and ServerHello, so PostHandshakeContext doesn't look necessary. >> >> If we need a generic catch all consumed extensions, why not just have it catch "Exception" and run fatal. > I did not get the point. It is not the purpose to catch all consumed exceptions, some of which could have been handled. > >> This could eliminate many of the current fatal calls in the code and centralize the SSLException messages in these two files. Assuming I understand the idea around this change correctly. >> > We can go with checking the buffer length before each call to get(), which means we need to update a lot of code, and make no missing and mistakes. Using a centralized way is more robust as if we missed somewhere in the handshake message operations like the ClientHello case. > > I?m not sure I get the point about the elimination of fatal calls. I think it is still needed to check the buffer length as soon as possible instead of depending on the two lazy centralized catch, which is used just in case the checking is missed somehow. > > Thanks, > Xuelei > >> Tony > From xuelei.fan at oracle.com Wed Feb 20 18:41:54 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Wed, 20 Feb 2019 10:41:54 -0800 Subject: RFR 8168069 : X509TrustManagerImpl causes ClassLoader leaks with unparseable extensions In-Reply-To: References: Message-ID: <3ea044fd-d06b-a99e-3024-0dc1d7b92910@oracle.com> ping ... On 2/8/2019 12:26 PM, Xuelei Fan wrote: > Hi, > > Could I get the following update reviewed? > ?? http://cr.openjdk.java.net/~xuelei/8168069/webrev.00/ > > In the lazy initialization holder in SSLContextImpl, an exception is > reserved as static in order to check if the holder is initialized > properly.? If the exception had a strong referent to some object, the > object will be out of the cycle of garbage collection. > > With this update, the original exception is debug logged, and a new > exception with the same exception message as the original one. > > Code cleanup, no new regression test. > > Thanks & Regards, > Xuelei From sean.mullan at oracle.com Wed Feb 20 18:52:21 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Wed, 20 Feb 2019 13:52:21 -0500 Subject: RFR 8168069 : X509TrustManagerImpl causes ClassLoader leaks with unparseable extensions In-Reply-To: <3ea044fd-d06b-a99e-3024-0dc1d7b92910@oracle.com> References: <3ea044fd-d06b-a99e-3024-0dc1d7b92910@oracle.com> Message-ID: <300b9a74-fbb6-364b-636c-1c8878934fa8@oracle.com> On 2/20/19 1:41 PM, Xuelei Fan wrote: > ping ... I took a quick look, but not enough time to understand the full context. The exception in the UnparseableExtension can be useful to get a stack trace later of why it could not be parsed. Did you think of any other way you can fix this? --Sean > > On 2/8/2019 12:26 PM, Xuelei Fan wrote: >> Hi, >> >> Could I get the following update reviewed? >> ??? http://cr.openjdk.java.net/~xuelei/8168069/webrev.00/ >> >> In the lazy initialization holder in SSLContextImpl, an exception is >> reserved as static in order to check if the holder is initialized >> properly.? If the exception had a strong referent to some object, the >> object will be out of the cycle of garbage collection. >> >> With this update, the original exception is debug logged, and a new >> exception with the same exception message as the original one. >> >> Code cleanup, no new regression test. >> >> Thanks & Regards, >> Xuelei From xuelei.fan at oracle.com Wed Feb 20 19:28:58 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Wed, 20 Feb 2019 11:28:58 -0800 Subject: RFR 8168069 : X509TrustManagerImpl causes ClassLoader leaks with unparseable extensions In-Reply-To: <300b9a74-fbb6-364b-636c-1c8878934fa8@oracle.com> References: <3ea044fd-d06b-a99e-3024-0dc1d7b92910@oracle.com> <300b9a74-fbb6-364b-636c-1c8878934fa8@oracle.com> Message-ID: <7da5b272-88a1-6aec-880c-af17b22e03ca@oracle.com> On 2/20/2019 10:52 AM, Sean Mullan wrote: > On 2/20/19 1:41 PM, Xuelei Fan wrote: >> ping ... > > I took a quick look, but not enough time to understand the full context. > The exception in the UnparseableExtension can be useful to get a stack > trace later of why it could not be parsed. Did you think of any other > way you can fix this? > In the UnparseableExtension implementation, the private 'why' variable can be used to dump the stack trace later. But as it is used to get it exception message only, I updated to store the exception message only. The update does not impact the fix. It is a kind of DiD fix in case it is used in a static field in other places. We can leave it unchanged if you like. Thanks, Xuelei > --Sean > >> >> On 2/8/2019 12:26 PM, Xuelei Fan wrote: >>> Hi, >>> >>> Could I get the following update reviewed? >>> ??? http://cr.openjdk.java.net/~xuelei/8168069/webrev.00/ >>> >>> In the lazy initialization holder in SSLContextImpl, an exception is >>> reserved as static in order to check if the holder is initialized >>> properly.? If the exception had a strong referent to some object, the >>> object will be out of the cycle of garbage collection. >>> >>> With this update, the original exception is debug logged, and a new >>> exception with the same exception message as the original one. >>> >>> Code cleanup, no new regression test. >>> >>> Thanks & Regards, >>> Xuelei From xuelei.fan at oracle.com Wed Feb 20 19:38:00 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Wed, 20 Feb 2019 11:38:00 -0800 Subject: CSR Review Request, JDK-8160247 Mark deprecated javax.security.cert APIs with forRemoval=true Message-ID: Hi, Could I get the CSR reviewed: https://bugs.openjdk.java.net/browse/JDK-8219472 The javax.security.cert APIs were deprecated in 1.9 but have had the following warning (since 1.4.2) in the description of each class: Note: The classes in the package javax.security.cert exist for compatibility with earlier versions of the Java Secure Sockets Extension (JSSE). New applications should instead use the standard Java SE certificate classes located in java.security.cert. Since these earlier versions of JSSE are no longer maintained or supported, they should be removed in a future release. This proposal will add forRemoval=true to the deprecated javax.security.cert APIs. Thanks, Xuelei From sean.mullan at oracle.com Wed Feb 20 20:21:50 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Wed, 20 Feb 2019 15:21:50 -0500 Subject: CSR Review Request, JDK-8218932 Remove the internal package com.sun.net.ssl In-Reply-To: <6071db41-91d6-6f55-ddeb-658c93a37280@oracle.com> References: <6071db41-91d6-6f55-ddeb-658c93a37280@oracle.com> Message-ID: In the Problem section: "This internal package is not exported in the java.base module, and applications cannot use them directly any more." That's not quite true. It is not exported but strong encapsulation is not yet enabled by default at runtime so by default the APIs are still accessible. At compile time, they are not, but you can still use the --add-exports option to override that. I would explain this a bit more. Is the compatibility risk really minimal? I think there are some projects still using it, but they have had plenty of advance warning to switch. Maybe it should be low with some additional explanation. Why are you adding "sun.security.ssl.SunJSSE" as a new provider name? I didn't understand why that was related to this issue or useful. --Sean On 2/13/19 4:51 PM, Xuelei Fan wrote: > Hi, > > Could I get the CSR reviewed: > ?? https://bugs.openjdk.java.net/browse/JDK-8218932 > > The internal package com.sun.net.ssl had been deprecated since JDK 1.4, > and was not exported in the java.base module since JDK 9.? Application > cannot use them directly now.? It should be safe to remove them in JDK 13. > > If you are using the internal package for some reason, please let me > know the compatibility impact by the end of Feb 20, 2019. > > Thanks, > Xuelei From sean.mullan at oracle.com Wed Feb 20 20:45:16 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Wed, 20 Feb 2019 15:45:16 -0500 Subject: RFR 8168069 : X509TrustManagerImpl causes ClassLoader leaks with unparseable extensions In-Reply-To: <7da5b272-88a1-6aec-880c-af17b22e03ca@oracle.com> References: <3ea044fd-d06b-a99e-3024-0dc1d7b92910@oracle.com> <300b9a74-fbb6-364b-636c-1c8878934fa8@oracle.com> <7da5b272-88a1-6aec-880c-af17b22e03ca@oracle.com> Message-ID: <26fa997c-4e15-8294-7cca-3b811d2fcdd4@oracle.com> On 2/20/19 2:28 PM, Xuelei Fan wrote: > On 2/20/2019 10:52 AM, Sean Mullan wrote: >> On 2/20/19 1:41 PM, Xuelei Fan wrote: >>> ping ... >> >> I took a quick look, but not enough time to understand the full >> context. The exception in the UnparseableExtension can be useful to >> get a stack trace later of why it could not be parsed. Did you think >> of any other way you can fix this? >> > In the UnparseableExtension implementation, the private 'why' variable > can be used to dump the stack trace later.? But as it is used to get it > exception message only, I updated to store the exception message only. > The update does not impact the fix.? It is a kind of DiD fix in case it > is used in a static field in other places.? We can leave it unchanged if > you like. Actually I took another closer look at the code and I am ok with your change since you can always get the stack trace if you reparse the cert and enable debugging. --Sean > Thanks, > Xuelei > >> --Sean >> >>> >>> On 2/8/2019 12:26 PM, Xuelei Fan wrote: >>>> Hi, >>>> >>>> Could I get the following update reviewed? >>>> ??? http://cr.openjdk.java.net/~xuelei/8168069/webrev.00/ >>>> >>>> In the lazy initialization holder in SSLContextImpl, an exception is >>>> reserved as static in order to check if the holder is initialized >>>> properly.? If the exception had a strong referent to some object, >>>> the object will be out of the cycle of garbage collection. >>>> >>>> With this update, the original exception is debug logged, and a new >>>> exception with the same exception message as the original one. >>>> >>>> Code cleanup, no new regression test. >>>> >>>> Thanks & Regards, >>>> Xuelei From xuelei.fan at oracle.com Thu Feb 21 03:07:48 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Wed, 20 Feb 2019 19:07:48 -0800 Subject: CSR Review Request, JDK-8218932 Remove the internal package com.sun.net.ssl In-Reply-To: References: <6071db41-91d6-6f55-ddeb-658c93a37280@oracle.com> Message-ID: On 2/20/2019 12:21 PM, Sean Mullan wrote: > In the Problem section: > > "This internal package is not exported in the java.base module, and > applications cannot use them directly any more." > > That's not quite true. It is not exported but strong encapsulation is > not yet enabled by default at runtime so by default the APIs are still > accessible. At compile time, they are not, but you can still use the > --add-exports option to override that. I would explain this a bit more. > Hm, I missed this point. I will use the 1st part of the sentence only: "This internal package is not exported in the java.base module." > Is the compatibility risk really minimal? I think there are some > projects still using it, but they have had plenty of advance warning to > switch. Maybe it should be low with some additional explanation. > It's low if the package still can be used by applications since JDK 9. > Why are you adding "sun.security.ssl.SunJSSE" as a new provider name? I > didn't understand why that was related to this issue or useful. > I was hesitated to add a new provider name as well. It should be fine to use "SunJSSE" without a namespace. I updated the CSR accordingly. Thanks, Xuelei > > --Sean > > > On 2/13/19 4:51 PM, Xuelei Fan wrote: >> Hi, >> >> Could I get the CSR reviewed: >> ??? https://bugs.openjdk.java.net/browse/JDK-8218932 >> >> The internal package com.sun.net.ssl had been deprecated since JDK >> 1.4, and was not exported in the java.base module since JDK 9. >> Application cannot use them directly now.? It should be safe to remove >> them in JDK 13. >> >> If you are using the internal package for some reason, please let me >> know the compatibility impact by the end of Feb 20, 2019. >> >> Thanks, >> Xuelei From sean.mullan at oracle.com Thu Feb 21 20:23:48 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Thu, 21 Feb 2019 15:23:48 -0500 Subject: CSR Review Request, JDK-8218932 Remove the internal package com.sun.net.ssl In-Reply-To: References: <6071db41-91d6-6f55-ddeb-658c93a37280@oracle.com> Message-ID: <8fbb03da-70bf-470d-8c17-7b1dbe9322b3@oracle.com> On 2/20/19 10:07 PM, Xuelei Fan wrote: > On 2/20/2019 12:21 PM, Sean Mullan wrote: >> In the Problem section: >> >> "This internal package is not exported in the java.base module, and >> applications cannot use them directly any more." >> >> That's not quite true. It is not exported but strong encapsulation is >> not yet enabled by default at runtime so by default the APIs are still >> accessible. At compile time, they are not, but you can still use the >> --add-exports option to override that. I would explain this a bit more. >> > Hm, I missed this point.? I will use the 1st part of the sentence only: > "This internal package is not exported in the java.base module." > >> Is the compatibility risk really minimal? I think there are some >> projects still using it, but they have had plenty of advance warning >> to switch. Maybe it should be low with some additional explanation. >> > It's low if the package still can be used by applications since JDK 9. > >> Why are you adding "sun.security.ssl.SunJSSE" as a new provider name? >> I didn't understand why that was related to this issue or useful. >> > I was hesitated to add a new provider name as well.? It should be fine > to use "SunJSSE" without a namespace. > > I updated the CSR accordingly. Thanks, I added my name as Reviewer. I think the Compatibility Kind should be "Binary" since removing these APIs (even though they are internal) will cause existing applications using them to not link at runtime. --Sean > > Thanks, > Xuelei > >> >> --Sean >> >> >> On 2/13/19 4:51 PM, Xuelei Fan wrote: >>> Hi, >>> >>> Could I get the CSR reviewed: >>> ??? https://bugs.openjdk.java.net/browse/JDK-8218932 >>> >>> The internal package com.sun.net.ssl had been deprecated since JDK >>> 1.4, and was not exported in the java.base module since JDK 9. >>> Application cannot use them directly now.? It should be safe to >>> remove them in JDK 13. >>> >>> If you are using the internal package for some reason, please let me >>> know the compatibility impact by the end of Feb 20, 2019. >>> >>> Thanks, >>> Xuelei From xuelei.fan at oracle.com Thu Feb 21 21:45:43 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Thu, 21 Feb 2019 13:45:43 -0800 Subject: CSR Review Request, JDK-8163326, The default enabled cipher suites should prefer forward secrecy Message-ID: <9d95ca80-e62a-e0b1-4a62-fba5d6f20f2b@oracle.com> Hi, Could I get the CSR reviewed? https://bugs.openjdk.java.net/browse/JDK-8219545 It is proposed to increase the priority of forward secrecy cipher suites, and decrease the priority of RSA key exchange based cipher suites for the default enabled cipher suites in the SunJSSE provider. Thanks, Xuelei From xuelei.fan at oracle.com Fri Feb 22 03:45:20 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Thu, 21 Feb 2019 19:45:20 -0800 Subject: RFR [13] JDK-8215430: Remove the internal package com.sun.net.ssl Message-ID: <898ee087-a589-de30-c842-770c606c49de@oracle.com> Hi, Could I get the following update reviewed: http://cr.openjdk.java.net/~xuelei/8215430/webrev.00/ The internal package com.sun.net.ssl had been deprecated since JDK 1.4, and was not exported in the java.base module since JDK 9. It should be safe to remove them in JDK 13. For more details, please refer to CSR: https://bugs.openjdk.java.net/browse/JDK-8218932 Thanks, Xuelei From m.retzlaff at knuddels.de Fri Feb 22 16:30:27 2019 From: m.retzlaff at knuddels.de (MRetz) Date: Fri, 22 Feb 2019 09:30:27 -0700 (MST) Subject: Java 11 - SSL handshake for ECDH cipher suites trigger Invalid ECDH ServerKeyExchange with non-default security provider In-Reply-To: <1c78066a-2415-ebb1-a9bc-f573a861988b@gmail.com> References: <31ab966b-1f35-7cdd-3541-4b81e2d0bf01@gmail.com> <78b2ea15-82e1-57cd-49dc-d042323852b6@gmail.com> <75aa940a-33c9-1d13-ec84-1843631adb74@oracle.com> <1c78066a-2415-ebb1-a9bc-f573a861988b@gmail.com> Message-ID: <1550853027515-0.post@n7.nabble.com> We are switching currently to openjdk and this is a problem, we now experience and did not have before. This is our main blocker for doing the switch. It prevents us to use the android playstore API. Is there a fix available meanwhile? Can we do anything to help you investigating this? -- Sent from: http://openjdk.5641.n7.nabble.com/OpenJDK-Security-Development-f69724.html From xuelei.fan at oracle.com Fri Feb 22 16:40:24 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Fri, 22 Feb 2019 08:40:24 -0800 Subject: Java 11 - SSL handshake for ECDH cipher suites trigger Invalid ECDH ServerKeyExchange with non-default security provider In-Reply-To: <1550853027515-0.post@n7.nabble.com> References: <31ab966b-1f35-7cdd-3541-4b81e2d0bf01@gmail.com> <78b2ea15-82e1-57cd-49dc-d042323852b6@gmail.com> <75aa940a-33c9-1d13-ec84-1843631adb74@oracle.com> <1c78066a-2415-ebb1-a9bc-f573a861988b@gmail.com> <1550853027515-0.post@n7.nabble.com> Message-ID: Hi, What's the underlying crypto provider? Please read the discussion on about Sept 20, 2018 in this thread. Would you please help to verify if the parameters used in the crypto provider is set after the init method? Thanks, Xuelei On 2/22/2019 8:30 AM, MRetz wrote: > We are switching currently to openjdk and this is a problem, we now > experience and did not have before. This is our main blocker for doing the > switch. It prevents us to use the android playstore API. > > Is there a fix available meanwhile? Can we do anything to help you > investigating this? > > > > > > -- > Sent from: http://openjdk.5641.n7.nabble.com/OpenJDK-Security-Development-f69724.html > From valerie.peng at oracle.com Fri Feb 22 21:14:16 2019 From: valerie.peng at oracle.com (Valerie Peng) Date: Fri, 22 Feb 2019 13:14:16 -0800 Subject: [13] RFR JDK-8183107: PKCS11 regression regarding checkKeySize Message-ID: <0197236a-1efb-606d-b1d4-504a23362084@oracle.com> Anyone can help reviewing this fix? According to the bug report, some vendors return 0 for both min/max key size range when queried which leads to unexpected errors when SunPKCS11 provider validates key sizes. So, I modified the code to work around this. No new regression test as this is vendor specific and not an issue for the current PKCS11 libraries used in regression testing. Bug: https://bugs.openjdk.java.net/browse/JDK-8183107 Webrev: http://cr.openjdk.java.net/~valeriep/8183107/webrev.00/ Mach5 run is clean. Thanks, Valerie From j.p.cranendonk at gmail.com Mon Feb 25 07:09:28 2019 From: j.p.cranendonk at gmail.com (Jeroen Cranendonk) Date: Mon, 25 Feb 2019 08:09:28 +0100 Subject: Status of JDK-8207031 In-Reply-To: References: Message-ID: <79e8be80-7b23-26c4-ec50-d3663e0c6d15@gmail.com> Sorry to bump my own mail, but is there anyone who could possibly have a look at this? :) I've got a feeling everyone is hoping someone else will :) Cheers! On 11/02/2019 11:43, Jeroen Cranendonk wrote: > Hi! > > I'm wondering what the status is on the issue: > https://bugs.openjdk.java.net/browse/JDK-8207031 > > I saw a request for review: > https://mail.openjdk.java.net/pipermail/security-dev/2018-July/017581.html > > But I don't think that's been followed up on? > > We are looking to switch to Java 11, and this is becoming one of the > biggest blockers to us :) > > Cheers! > > --000000000000ea0d4005819bf889--) From sha.jiang at oracle.com Mon Feb 25 12:01:28 2019 From: sha.jiang at oracle.com (sha.jiang at oracle.com) Date: Mon, 25 Feb 2019 20:01:28 +0800 Subject: RFR[13] JDK-8215524: Finished message validation failure should be decrypt_error alert Message-ID: <2d4d975d-0095-b15c-69fe-9f54f4bd39e2@oracle.com> Hi, When Finished message is validated failed, illegal_parameter is raised currently. But per RFC 8446 section 6.2, this error should alert decrypt_error. And according to the same section, if the length of verify_data in Finished is incorrect, it should alert decode_error rather than illegal_parameter. This fix is verified by fuzzing testing, but it's hard to add a new regression test. Webrev: http://cr.openjdk.java.net/~jjiang/8215524/webrev.00/ Issue: https://bugs.openjdk.java.net/browse/JDK-8215524 Best regards, John Jiang From xuelei.fan at oracle.com Mon Feb 25 15:01:55 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Mon, 25 Feb 2019 07:01:55 -0800 Subject: RFR[13] JDK-8215524: Finished message validation failure should be decrypt_error alert In-Reply-To: <2d4d975d-0095-b15c-69fe-9f54f4bd39e2@oracle.com> References: <2d4d975d-0095-b15c-69fe-9f54f4bd39e2@oracle.com> Message-ID: Looks fine to me. Thanks, Xuelei On 2/25/2019 4:01 AM, sha.jiang at oracle.com wrote: > Hi, > When Finished message is validated failed, illegal_parameter is raised > currently. But per RFC 8446 section 6.2, this error should alert > decrypt_error. > And according to the same section, if the length of verify_data in > Finished is incorrect, it should alert decode_error rather than > illegal_parameter. > > This fix is verified by fuzzing testing, but it's hard to add a new > regression test. > > Webrev: http://cr.openjdk.java.net/~jjiang/8215524/webrev.00/ > Issue: https://bugs.openjdk.java.net/browse/JDK-8215524 > > Best regards, > John Jiang > From xuelei.fan at oracle.com Mon Feb 25 17:36:13 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Mon, 25 Feb 2019 09:36:13 -0800 Subject: CSR Review Request JDK-816826, Use server cipher suites preference by default Message-ID: <2ba7b0d4-dff9-f5ef-683d-8fdae4f6cf9a@oracle.com> Hi, Could I have the following CSR reviewed? https://bugs.openjdk.java.net/browse/JDK-8219657 It is proposing to use server cipher suite preference by default for TLS connections in JDK. In the current implementation, the server honors the client cipher suite preference by default. It is easier to maintain if using the server cipher suite preference, and then the server can have more control over the security parameters of TLS connections. I think the compatibility impact should be minimal. If there is a known risk for you, please let me know by the end of March 4, 2019. Thanks, Xuelei From xuelei.fan at oracle.com Mon Feb 25 18:07:01 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Mon, 25 Feb 2019 10:07:01 -0800 Subject: RFR [13] JDK-8219658: Deadlock in sun.security.ssl.SSLSocketImpl Message-ID: Hi, Please review the following update: http://cr.openjdk.java.net/~xuelei/8219658/webrev.00/ There could be a deadlock if different threads are used for socket closing and reading. The update is similar to the bug reported proposed fix, and has been verified. No new regression test. Thanks, Xuelei From sean.mullan at oracle.com Mon Feb 25 20:46:18 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Mon, 25 Feb 2019 15:46:18 -0500 Subject: RFR [13] 8217878: ENVELOPING XML signature no longer works in JDK 11 Message-ID: In JDK 11, we included an updated version of Apache Santuario (which the JDK XML Signature implementation is based on) [1]. This contained a newer XML marshalling implementation, which has caused a couple of serious regressions (this one and JDK-8218629 [2]). After unsuccessfully trying to patch the current implementation, we decided to back it out and restore the previous code, which had been very stable for many years. The newer implementation is different in subtle ways and doesn't really offer any advantages other than a bit of reduction in lines of code. The Apache Santuario Project also has backed out the implementation. webrev: http://cr.openjdk.java.net/~mullan/webrevs/8217878/webrev.00/ bug: https://bugs.openjdk.java.net/browse/JDK-8217878 New test cases have also been added for the regressions. Note that this also fixes JDK-8218629 [2]. Since technically they are different issues, I will probably include both bug-ids in this changeset. --Sean [1] https://bugs.openjdk.java.net/browse/JDK-8177334 [2] https://bugs.openjdk.java.net/browse/JDK-8218629 From sean.coffey at oracle.com Mon Feb 25 20:49:16 2019 From: sean.coffey at oracle.com (=?UTF-8?Q?Se=c3=a1n_Coffey?=) Date: Mon, 25 Feb 2019 20:49:16 +0000 Subject: [13] RFR JDK-8218780 "Update MUSCLE PCSC-Lite header files" In-Reply-To: <902a2671-051a-9d29-f49f-5b29b3fe173d@oracle.com> References: <902a2671-051a-9d29-f49f-5b29b3fe173d@oracle.com> Message-ID: <45537743-251c-0ec7-df04-4d2e8196a654@oracle.com> Looks fine to me Valerie. regards, Sean. On 15/02/2019 20:04, Valerie Peng wrote: > Hi Sean (Coffey), > > Can you please help reviewing this fix? It's about updating the PC/SC > lite header files under the MUSCLE directory inside smartcardio > module. The header files are from https://pcsclite.apdu.fr/ and minor > adjustments are made to pcsc_md.h and pcsc.c to match the header > update and replace the old types, i.e. LPTSTR/LPCTSTR, with new ones > to avoid compilation fails on MacOs. > > Bug: https://bugs.openjdk.java.net/browse/JDK-8218780 > > Webrev: http://cr.openjdk.java.net/~valeriep/8218780/webrev.00/ > > Mach5 run is clean. > > Thanks, > Valerie From sean.mullan at oracle.com Mon Feb 25 21:23:19 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Mon, 25 Feb 2019 16:23:19 -0500 Subject: CSR Review Request, JDK-8160247 Mark deprecated javax.security.cert APIs with forRemoval=true In-Reply-To: References: Message-ID: The diffs seem out of date. The @Deprecated annotations already have @since="9". There are a few JSSE APIs that reference these deprecated APIs that should also be marked forRemoval and included in the CSR: HandshakeCompletedEvent.getPeerCertificateChain() SSLSession.getPeerCertificateChain() (I think those are the only ones, but please double-check for others). --Sean On 2/20/19 2:38 PM, Xuelei Fan wrote: > Hi, > > Could I get the CSR reviewed: > ??? https://bugs.openjdk.java.net/browse/JDK-8219472 > > The javax.security.cert APIs were deprecated in 1.9 but have had the > following warning (since 1.4.2) in the description of each class: > > ??? Note: The classes in the package javax.security.cert exist for > ??? compatibility with earlier versions of the Java Secure Sockets > ??? Extension (JSSE). New applications should instead use the standard > ??? Java SE certificate classes located in java.security.cert. > > Since these earlier versions of JSSE are no longer maintained or > supported, they should be removed in a future release. > > This proposal will add forRemoval=true to the deprecated > javax.security.cert APIs. > > Thanks, > Xuelei From sean.mullan at oracle.com Mon Feb 25 21:55:02 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Mon, 25 Feb 2019 16:55:02 -0500 Subject: RFR [13] JDK-8215430: Remove the internal package com.sun.net.ssl In-Reply-To: <898ee087-a589-de30-c842-770c606c49de@oracle.com> References: <898ee087-a589-de30-c842-770c606c49de@oracle.com> Message-ID: (I'd suggest cross-posting to net-dev since some classes in the networking area are also changed). - AbstractDelegateHttpsURLConnection It might be less risky to leave the methods as public just in case some code out there is using them (even though they are not supposed to). The rest of this looks ok, pretty straightforward. --Sean On 2/21/19 10:45 PM, Xuelei Fan wrote: > Hi, > > Could I get the following update reviewed: > ?? http://cr.openjdk.java.net/~xuelei/8215430/webrev.00/ > > The internal package com.sun.net.ssl had been deprecated since JDK 1.4, > and was not exported in the java.base module since JDK 9. It should be > safe to remove them in JDK 13. > > For more details, please refer to CSR: > ??? https://bugs.openjdk.java.net/browse/JDK-8218932 > > Thanks, > Xuelei From dhiller at twitter.com Tue Feb 19 16:17:49 2019 From: dhiller at twitter.com (Dean Hiller) Date: Tue, 19 Feb 2019 09:17:49 -0700 Subject: Java SSLSocketChannel/SSLSelector? In-Reply-To: References: Message-ID: > > I am beginning to think we might be on different pages here. Someone from > outside the selector calls selector.select(), and all selector's > functionality is handled within the context of the calling thread. So where > is the need for the extra thread here? More specifically, in the > SSLSelector case, a call to its select, ends up usually to a call to its > inner selector.select(), always in the context of the calling thread ... so > same thing again. Why do you think another thread is necessary here (within > the selector itself)? > That implies multiple threads using 1 selector. That can be very dangerous and prone to bugs. Even with SSL, I would shy away from making something like that unless putting it behind some library/abstraction like netty, webpieces channelmanager or something. In fact, the performance of 1 thread that runs the selector who dishes the work to a threadpool immediately (N sockets to X threads) has been amazing!!! *It was even better than multiple threads on a selector we found.* This was because that caused lots of contention with locks(slowing it down). The contention depended on the application as some apps had more contention than others. I would highly advise just sticking 1 thread on the selector dishing out to a thread pool which removed all contention to streamline the whole process for speed. THEN, if you do have a threadpool and an simple implementation that runs the data serially per socket in the threadpool(this is quite easy to do), you can do the decryption in the threadpool as well. webpieces impl does this as well. just my 2 cents, later, Dean -------------- next part -------------- An HTML attachment was scrubbed... URL: From xuelei.fan at oracle.com Tue Feb 26 03:35:21 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Mon, 25 Feb 2019 19:35:21 -0800 Subject: CSR Review Request, JDK-8160247 Mark deprecated javax.security.cert APIs with forRemoval=true In-Reply-To: References: Message-ID: <5e8ec64d-b834-612d-7bbc-bf935e142d75@oracle.com> All comments make sense to me. I have updated the CSR accordingly. Thanks, Xuelei On 2/25/2019 1:23 PM, Sean Mullan wrote: > The diffs seem out of date. The @Deprecated annotations already have > @since="9". > > There are a few JSSE APIs that reference these deprecated APIs that > should also be marked forRemoval and included in the CSR: > > HandshakeCompletedEvent.getPeerCertificateChain() > SSLSession.getPeerCertificateChain() > > (I think those are the only ones, but please double-check for others). > > --Sean > > On 2/20/19 2:38 PM, Xuelei Fan wrote: >> Hi, >> >> Could I get the CSR reviewed: >> ???? https://bugs.openjdk.java.net/browse/JDK-8219472 >> >> The javax.security.cert APIs were deprecated in 1.9 but have had the >> following warning (since 1.4.2) in the description of each class: >> >> ???? Note: The classes in the package javax.security.cert exist for >> ???? compatibility with earlier versions of the Java Secure Sockets >> ???? Extension (JSSE). New applications should instead use the standard >> ???? Java SE certificate classes located in java.security.cert. >> >> Since these earlier versions of JSSE are no longer maintained or >> supported, they should be removed in a future release. >> >> This proposal will add forRemoval=true to the deprecated >> javax.security.cert APIs. >> >> Thanks, >> Xuelei From xuelei.fan at oracle.com Tue Feb 26 03:53:05 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Mon, 25 Feb 2019 19:53:05 -0800 Subject: RFR [13] JDK-8215430: Remove the internal package com.sun.net.ssl In-Reply-To: References: <898ee087-a589-de30-c842-770c606c49de@oracle.com> Message-ID: <80f63579-2d29-2600-9d92-da1410244fa4@oracle.com> It makes sense to me to leave the AbstractDelegateHttpsURLConnection methods as public. We may need to re-org the code later, but it is out of the scope of this update. Here is the new webrev (only AbstractDelegateHttpsURLConnection updated): http://cr.openjdk.java.net/~xuelei/8215430/webrev.01/ Thanks, Xuelei On 2/25/2019 1:55 PM, Sean Mullan wrote: > (I'd suggest cross-posting to net-dev since some classes in the > networking area are also changed). > > - AbstractDelegateHttpsURLConnection > > It might be less risky to leave the methods as public just in case some > code out there is using them (even though they are not supposed to). > > The rest of this looks ok, pretty straightforward. > > --Sean > > On 2/21/19 10:45 PM, Xuelei Fan wrote: >> Hi, >> >> Could I get the following update reviewed: >> ??? http://cr.openjdk.java.net/~xuelei/8215430/webrev.00/ >> >> The internal package com.sun.net.ssl had been deprecated since JDK >> 1.4, and was not exported in the java.base module since JDK 9. It >> should be safe to remove them in JDK 13. >> >> For more details, please refer to CSR: >> ???? https://bugs.openjdk.java.net/browse/JDK-8218932 >> >> Thanks, >> Xuelei From sean.mullan at oracle.com Tue Feb 26 15:33:22 2019 From: sean.mullan at oracle.com (Sean Mullan) Date: Tue, 26 Feb 2019 10:33:22 -0500 Subject: RFR [13] JDK-8215430: Remove the internal package com.sun.net.ssl In-Reply-To: <80f63579-2d29-2600-9d92-da1410244fa4@oracle.com> References: <898ee087-a589-de30-c842-770c606c49de@oracle.com> <80f63579-2d29-2600-9d92-da1410244fa4@oracle.com> Message-ID: Ok, looks good. --Sean On 2/25/19 10:53 PM, Xuelei Fan wrote: > > > It makes sense to me to leave the AbstractDelegateHttpsURLConnection > methods as public.? We may need to re-org the code later, but it is out > of the scope of this update. > > Here is the new webrev (only AbstractDelegateHttpsURLConnection updated): > ??? http://cr.openjdk.java.net/~xuelei/8215430/webrev.01/ > > Thanks, > Xuelei > > > On 2/25/2019 1:55 PM, Sean Mullan wrote: >> (I'd suggest cross-posting to net-dev since some classes in the >> networking area are also changed). >> >> - AbstractDelegateHttpsURLConnection >> >> It might be less risky to leave the methods as public just in case >> some code out there is using them (even though they are not supposed to). >> >> The rest of this looks ok, pretty straightforward. >> >> --Sean >> >> On 2/21/19 10:45 PM, Xuelei Fan wrote: >>> Hi, >>> >>> Could I get the following update reviewed: >>> ??? http://cr.openjdk.java.net/~xuelei/8215430/webrev.00/ >>> >>> The internal package com.sun.net.ssl had been deprecated since JDK >>> 1.4, and was not exported in the java.base module since JDK 9. It >>> should be safe to remove them in JDK 13. >>> >>> For more details, please refer to CSR: >>> ???? https://bugs.openjdk.java.net/browse/JDK-8218932 >>> >>> Thanks, >>> Xuelei From chris.hegarty at oracle.com Tue Feb 26 15:33:23 2019 From: chris.hegarty at oracle.com (Chris Hegarty) Date: Tue, 26 Feb 2019 15:33:23 +0000 Subject: RFR [13] JDK-8215430: Remove the internal package com.sun.net.ssl In-Reply-To: <80f63579-2d29-2600-9d92-da1410244fa4@oracle.com> References: <898ee087-a589-de30-c842-770c606c49de@oracle.com> <80f63579-2d29-2600-9d92-da1410244fa4@oracle.com> Message-ID: > On 26 Feb 2019, at 03:53, Xuelei Fan wrote: > > > > It makes sense to me to leave the AbstractDelegateHttpsURLConnection methods as public. We may need to re-org the code later, but it is out of the scope of this update. > > Here is the new webrev (only AbstractDelegateHttpsURLConnection updated): > http://cr.openjdk.java.net/~xuelei/8215430/webrev.01/ I think that this is probably ok ( since the package is not exported ), but it seems a little distasteful to not have the API move through the terminal deprecation route before being removed. -Chris. From jamil.j.nimeh at oracle.com Tue Feb 26 16:57:50 2019 From: jamil.j.nimeh at oracle.com (Jamil Nimeh) Date: Tue, 26 Feb 2019 08:57:50 -0800 Subject: [13] RFR JDK-8183107: PKCS11 regression regarding checkKeySize In-Reply-To: <0197236a-1efb-606d-b1d4-504a23362084@oracle.com> References: <0197236a-1efb-606d-b1d4-504a23362084@oracle.com> Message-ID: Hi Valerie, looks good, I only had one comment and it's more of a nit than anything else. * P11KeyPairGenerator.java o 122-124: I think those lines could be safely moved under the algorithm.equals("RSA") clause up at line 113 and get rid of the extra check at line 121. --Jamil On 2/22/19 1:14 PM, Valerie Peng wrote: > > Anyone can help reviewing this fix? According to the bug report, some > vendors return 0 for both min/max key size range when queried which > leads to unexpected errors when SunPKCS11 provider validates key > sizes. So, I modified the code to work around this. No new regression > test as this is vendor specific and not an issue for the current > PKCS11 libraries used in regression testing. > > Bug: https://bugs.openjdk.java.net/browse/JDK-8183107 > > Webrev: http://cr.openjdk.java.net/~valeriep/8183107/webrev.00/ > > Mach5 run is clean. > > Thanks, > Valerie -------------- next part -------------- An HTML attachment was scrubbed... URL: From valerie.peng at oracle.com Tue Feb 26 22:19:13 2019 From: valerie.peng at oracle.com (Valerie Peng) Date: Tue, 26 Feb 2019 14:19:13 -0800 Subject: Status of JDK-8207031 In-Reply-To: <79e8be80-7b23-26c4-ec50-d3663e0c6d15@gmail.com> References: <79e8be80-7b23-26c4-ec50-d3663e0c6d15@gmail.com> Message-ID: <6f3681ab-dd14-53a9-e53c-4a381ad1bff8@oracle.com> I recall that there was some debate with the fix internally. So, maybe more polishing is needed. Just my guess. If it's really critical to you, maybe you should add a comment to the bug record. Currently, it's just a P4 bug which may not get much cycles depending on the RE's cycles as well as the complexity of the fix. Valerie On 2/24/2019 11:09 PM, Jeroen Cranendonk wrote: > Sorry to bump my own mail, but is there anyone who could possibly have > a look at this? :) > > I've got a feeling everyone is hoping someone else will :) > > Cheers! > > > On 11/02/2019 11:43, Jeroen Cranendonk wrote: >> Hi! >> >> I'm wondering what the status is on the issue: >> https://bugs.openjdk.java.net/browse/JDK-8207031 >> >> I saw a request for review: >> https://mail.openjdk.java.net/pipermail/security-dev/2018-July/017581.html >> >> But I don't think that's been followed up on? >> >> We are looking to switch to Java 11, and this is becoming one of the >> biggest blockers to us :) >> >> Cheers! >> >> --000000000000ea0d4005819bf889--) From philipp.kunz at paratix.ch Wed Feb 27 07:25:32 2019 From: philipp.kunz at paratix.ch (Philipp Kunz) Date: Wed, 27 Feb 2019 08:25:32 +0100 Subject: How about a ToolProvider for jarsigner (and maybe keytool)? Message-ID: <1551252332.2433.32.camel@paratix.ch> Hi, Quite a few command line tools are available through java.util.spi.ToolProvider. But not so jarsigner and keytool. If that finds some common interest, I'd be glad to contribute a patch or two. Advantages of having jarsigner and/or keytool available as a tool (though that could certainly be achieved in another way as well) would be - Explicit Stdin, Stdout, and Stderr as parameters (possible already now by forking a separate process?with the overhead of running the tools in their own vm) - Easy prevention of all possible calls to System.exit upon unfavourable command line paramters (at least with jarsigner, and only when working with?sun.security.tools.jarsigner.Main and not with jdk.security.jarsigner.JarSigner) - Easier to detect whether a jarsigner or keytool tool is available on the class or module path or not. - Those who are more familiar with the command line options can use them also programmatically. An example seems to be?JLinkSigningTest.java, [1]. Even though only a test and in that context not actually severe but still not such a bad example. I figure the following should not happen in real code: - The tests catches an Exception which is never thrown (especially not for the reason in the message, "jarsigner not found", I'd expect at best a NoClassDefFoundError but which would not be caught there). - Jarsigner (sun.security.tools.jarsigner.Main) will call System.exit instead of throwing an exception (8 occurrences of System.exit in [2]) for certain command line args - If command line arguments would be specified such that jarsigner would prompt for input, it would be most probably stuck indefinitely. I tried to search existing resources about the topic but found almost nothing, potentially related [3], [4], and [5]. I'm not entirely sure, if java.util.spi.ToolProvider is preferred over javax.tools.ToolProvider (or java.util.ServiceLoader). [7] might be a hint that java.util.spi.ToolProvider is more current than javax.tools.ToolProvider. An additional point for keytool and jarsigner as opposed to jar, javac, and other tools is that both jarsigner and keytool can use stdin when prompting for passwords or maybe X.509 details which is not currently possible through the api of java.util.spi.ToolProvider and would require an additional parameter for Stdin such as in [6]. I would propose that when jarsigner or keytool are invoked without a Stdin that they throw an exception or return a non-zero exit code as their return value immediately whenever they would have otherwise waited for input. Some system properties also have influence on the operation of jarsigner and possibly keytool (for example user.language and java.security.properties among probably others) which could not necessarily be set individually for each invocation of a tool gotten by a ToolProvider but probably that would not be necessary in many cases anyway. Just like [3] sounds according to its subject, jdk.security.jarsigner.JarSigner already has a useful API, so the need for a ToolProvider is probably not that big. The current jdk.security.jarsigner.JarSigner API, however, expects a key or certificate or chain of certificates to be provided through the API and therefore does not leverage the jarsigner and keytool command line tools' keystore accessing features and aliases. I also don't see how it would provide a possibility to verify a signed JAR but that could as well be achieved in another way than with a ToolProvider. It might be a bit of a challenge to catch all System.out and System.err such as in sun.security.tools.KeyStoreUtil.getPassWithModifier or sun.security.util.Debug or from whatever provider classes involved with algorithms loaded with "-providerClass" or?"-altsigner" arguments. One conceivable approach might be the one used in the compiler with a context object holding references to Stdout and Stderr. What I don't like for now in the attached patch is that wrapping System.out or System.err PrintStreams into PrintWriters is repeated a few times and I wonder if that could be refactored or recombined into another PrintWriter constructor or PrintStream.toPrintWriter or something... So far I haven't found an overview over all the tools available through java.util.spi.ToolProvider other than the example in ToolProvider#name or other documentation that might have to be updated with introducing jarsigner as a tool. Also I wonder if Stdin/System.in should be added to the ToolProvider interface or a run method with only args that takes Stdin, Stdout, and Stderr from System.in, System.out, and System.err but I guess that can be discussed independently. Attached is a patch with JarSignerToolProvider that provides jarsigner as a tool. It's not yet meant as ready to merge but shows that it is possible and more or less how big the change is. I'm not really familiar at all with the processes involved with such a proposal and would appreciate greatly any kind of guidance. Was this?mailing list the right place to propose it? Regards, Philipp [1] http://hg.openjdk.org/jdk/jdk/file/9c3fe09f69bc/test/jdk/tools/jlin k/JLinkSigningTest.java#l79 [2] http://hg.openjdk.org/jdk/jdk/file/9c3fe09f69bc/src/jdk.jartool/sha re/classes/sun/security/tools/jarsigner/Main.java [3] https://bugs.openjdk.java.net/browse/JDK-8056174 [4] https://bugs.openjdk.java.net/browse/JDK-8058778 [5] http://mail.openjdk.java.net/pipermail/security-dev/2015-March/0118 31.html [6] http://hg.openjdk.org/jdk/jdk/file/9c3fe09f69bc/src/jdk.compiler/sh are/classes/com/sun/tools/javac/api/JavacTool.java#l203 [7] http://hg.openjdk.org/jdk/jdk/file/9c3fe09f69bc/src/java.compiler/s hare/classes/javax/tools/ToolProvider.java#l90 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: JarSignerToolProvider.patch Type: text/x-patch Size: 51577 bytes Desc: not available URL: From weijun.wang at oracle.com Wed Feb 27 08:48:05 2019 From: weijun.wang at oracle.com (Weijun Wang) Date: Wed, 27 Feb 2019 16:48:05 +0800 Subject: How about a ToolProvider for jarsigner (and maybe keytool)? In-Reply-To: <1551252332.2433.32.camel@paratix.ch> References: <1551252332.2433.32.camel@paratix.ch> Message-ID: <4AA6DE7E-584A-4F9E-9889-FE6ED81F3306@oracle.com> Hi Philipp, Thanks for looking into this. We have thought about this several years ago (when ToolProvider was created and javac became a tool) but had decided not to do it. There were several reasons: 1. These tools have too many functions, esp, keytool. 2. There are user interactions that do not match the ToolProvider style, especially, the password input. 3. A lot of functions are already available through public APIs, for example, verification of signed jars, reading certificates, managing entries in a keystore. So at last we decided to only extract some functions (that can only be down with the tool) into individual APIs and let these tools call them. This includes: 1. Signing of jars. 2. Generating certificates and certificate requests. The first is now a JDK API. The second one is stalled. We are not sure how useful it is and it?s a pain describing X.509 extensions. Any more discussion is welcome. Thanks, Max > ? 2019?2?27??15:25?Philipp Kunz ??? > > Quite a few command line tools are available through java.util.spi.ToolProvider. But not so jarsigner and keytool. From j.p.cranendonk at gmail.com Wed Feb 27 17:09:39 2019 From: j.p.cranendonk at gmail.com (Jeroen Cranendonk) Date: Wed, 27 Feb 2019 18:09:39 +0100 Subject: Status of JDK-8207031 In-Reply-To: <6f3681ab-dd14-53a9-e53c-4a381ad1bff8@oracle.com> References: <79e8be80-7b23-26c4-ec50-d3663e0c6d15@gmail.com> <6f3681ab-dd14-53a9-e53c-4a381ad1bff8@oracle.com> Message-ID: Hi! Thanks for the reply :) To add comments on the JIRA one needs to be at least an OpenJDK Contributor I think, which I am not (and which would involve signing the Oracle Contributor Agreement). So the mailing list is my only way of communication on the issue I think, feel free to correct me if I am wrong :) I think/hope that over the next two weeks we can do an in depth analysis of the problem, I will know better how high the prio is for us then. Right now I'm not sure yet if this is limited to certain ciphers/protocols, if it's only client,server, or both, and there might be a new pkcs11 dll which we can use which may or may not support the CKM_SSL3_PRE_MASTER_KEY_GEN mechanism, which would be a work around. I take it you don't know the details of the internal debate? Was it more whether to fix this, or on which approach to take? Cheers! Jeroen Cranendonk Java Developer On 26/02/2019 23:19, Valerie Peng wrote: > I recall that there was some debate with the fix internally. So, maybe > more polishing is needed. Just my guess. > > If it's really critical to you, maybe you should add a comment to the > bug record. Currently, it's just a P4 bug which may not get much > cycles depending on the RE's cycles as well as the complexity of the fix. > > Valerie > > On 2/24/2019 11:09 PM, Jeroen Cranendonk wrote: >> Sorry to bump my own mail, but is there anyone who could possibly >> have a look at this? :) >> >> I've got a feeling everyone is hoping someone else will :) >> >> Cheers! >> >> >> On 11/02/2019 11:43, Jeroen Cranendonk wrote: >>> Hi! >>> >>> I'm wondering what the status is on the issue: >>> https://bugs.openjdk.java.net/browse/JDK-8207031 >>> >>> I saw a request for review: >>> https://mail.openjdk.java.net/pipermail/security-dev/2018-July/017581.html >>> >>> But I don't think that's been followed up on? >>> >>> We are looking to switch to Java 11, and this is becoming one of the >>> biggest blockers to us :) >>> >>> Cheers! >>> >>> --000000000000ea0d4005819bf889--) From sha.jiang at oracle.com Thu Feb 28 02:20:11 2019 From: sha.jiang at oracle.com (sha.jiang at oracle.com) Date: Thu, 28 Feb 2019 10:20:11 +0800 Subject: RFR[13] JDK-8219723: javax/net/ssl/compatibility/Compatibility.java failed on some SNI cases Message-ID: Hi, Test javax/net/ssl/compatibility/Compatibility.java failed due to the associated certificates are expired. This fix just re-generates the certificates and set much longer validity period. Issue: https://bugs.openjdk.java.net/browse/JDK-8219723 Webrev: http://cr.openjdk.java.net/~jjiang/8219723/webrev.00/ Best regards, John Jiang From xuelei.fan at oracle.com Thu Feb 28 03:56:31 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Wed, 27 Feb 2019 19:56:31 -0800 Subject: RFR[13] JDK-8219723: javax/net/ssl/compatibility/Compatibility.java failed on some SNI cases In-Reply-To: References: Message-ID: Looks good to me. Thanks, Xuelei On 2/27/2019 6:20 PM, sha.jiang at oracle.com wrote: > Hi, > Test javax/net/ssl/compatibility/Compatibility.java failed due to the > associated certificates are expired. > This fix just re-generates the certificates and set much longer validity > period. > > Issue: https://bugs.openjdk.java.net/browse/JDK-8219723 > Webrev: http://cr.openjdk.java.net/~jjiang/8219723/webrev.00/ > > Best regards, > John Jiang > From norman.maurer at googlemail.com Thu Feb 28 08:24:49 2019 From: norman.maurer at googlemail.com (Norman Maurer) Date: Thu, 28 Feb 2019 09:24:49 +0100 Subject: SSLEngine.wrap(...) returns NOT_HANDSHAKING even when the alert was not consumed yet in latest JDK12 release (possible regression). Message-ID: Hi all, I think I found a possible regression / bug in the latest JDK12 release when trying to upgrade the Netty CI server to test with the latest JDK12 release. The problem is that SSLEngine.wrap(?) returns NOT_HANDSHAKING even when there are bytes left that should be consumed (the alert itself). My understanding is that it should only return ?NOT_HANDSHAKING? once we also consumed the alert. Please correct me if I wrong tho. I pushed a reproducer for this here: https://github.com/normanmaurer/jdk12_ssl_engine_unwrap_bug When running this on the latest JDK12 release (and later JDK versions) it will fail with an AssertionError, while everything works as expected when using earlier Java versions. Here is the Java version I used to reproduce: # java -version openjdk version "12" 2019-03-19 OpenJDK Runtime Environment (build 12+33) OpenJDK 64-Bit Server VM (build 12+33, mixed mode, sharing) It seems like this was not always the case for Java12 tho, as I can not reproduce it with this version: #java -version openjdk version "12-ea" 2019-03-19 OpenJDK Runtime Environment (build 12-ea+27) OpenJDK 64-Bit Server VM (build 12-ea+27, mixed mode, sharing) I don't have all the ?in between? releases on my machine atm so I can not tell exactly on which release this ?broke? :/ Thanks Norman -------------- next part -------------- An HTML attachment was scrubbed... URL: From xuelei.fan at oracle.com Thu Feb 28 17:52:29 2019 From: xuelei.fan at oracle.com (Xuelei Fan) Date: Thu, 28 Feb 2019 09:52:29 -0800 Subject: RFR [13] JDK-8219658: Deadlock in sun.security.ssl.SSLSocketImpl In-Reply-To: References: Message-ID: <40e7127a-bf94-3f22-d7ab-d23b6179fad7@oracle.com> ping ... On 2/25/2019 10:07 AM, Xuelei Fan wrote: > Hi, > > Please review the following update: > ?? http://cr.openjdk.java.net/~xuelei/8219658/webrev.00/ > > There could be a deadlock if different threads are used for socket > closing and reading. > > The update is similar to the bug reported proposed fix, and has been > verified.? No new regression test. > > Thanks, > Xuelei From jamil.j.nimeh at oracle.com Thu Feb 28 17:54:06 2019 From: jamil.j.nimeh at oracle.com (Jamil Nimeh) Date: Thu, 28 Feb 2019 09:54:06 -0800 Subject: RFR[13] JDK-8219723: javax/net/ssl/compatibility/Compatibility.java failed on some SNI cases In-Reply-To: References: Message-ID: <6364ede7-ab43-6f03-af3d-40d8414120f8@oracle.com> This comment doesn't directly apply to this fix, but tests that depend on the certs from Cert.java and have configurable PKIXParameters might also just set setDate to something in the middle of this validity period so you never have to worry about regenerating the certs due to date issues.? That may not work for all your tests though, if? you're not customizing the trust managers with PKIXParameter objects. Just something to consider as you're going forward, no changes to this webrev. --Jamil On 2/27/2019 6:20 PM, sha.jiang at oracle.com wrote: > Hi, > Test javax/net/ssl/compatibility/Compatibility.java failed due to the > associated certificates are expired. > This fix just re-generates the certificates and set much longer > validity period. > > Issue: https://bugs.openjdk.java.net/browse/JDK-8219723 > Webrev: http://cr.openjdk.java.net/~jjiang/8219723/webrev.00/ > > Best regards, > John Jiang > From jamil.j.nimeh at oracle.com Thu Feb 28 17:57:29 2019 From: jamil.j.nimeh at oracle.com (Jamil Nimeh) Date: Thu, 28 Feb 2019 09:57:29 -0800 Subject: RFR [13] JDK-8219658: Deadlock in sun.security.ssl.SSLSocketImpl In-Reply-To: <40e7127a-bf94-3f22-d7ab-d23b6179fad7@oracle.com> References: <40e7127a-bf94-3f22-d7ab-d23b6179fad7@oracle.com> Message-ID: <49c45ea0-4e86-2d6b-9fb6-3df468c8bcd3@oracle.com> Looks good. On 2/28/2019 9:52 AM, Xuelei Fan wrote: > ping ... > > On 2/25/2019 10:07 AM, Xuelei Fan wrote: >> Hi, >> >> Please review the following update: >> ??? http://cr.openjdk.java.net/~xuelei/8219658/webrev.00/ >> >> There could be a deadlock if different threads are used for socket >> closing and reading. >> >> The update is similar to the bug reported proposed fix, and has been >> verified.? No new regression test. >> >> Thanks, >> Xuelei