Re: JEP 411 - Secure Java Distribution

2021-06-02 Thread Andrew Haley
On 6/1/21 10:06 AM, Peter Firmstone wrote: > If a vendor were to continue supporting SecurityManager and was > backporting from OpenJDK, if it passes the JCK with SecurityManager > disabled, that's still acceptable right? Look at the licence agreement in conjunction with the JCK users' guide. Se

Re: JEP 411 - Secure Java Distribution

2021-06-02 Thread Peter Firmstone
Thanks Andrew, I've been thinking about how to do this in a compatible manner. The Guard.check call checks whether SecurityManager is enabled. All permission checks in the JDK could be changed to call the Guard.check method.  Unfortunately other permission checks in user code will be broken,

Integrated: 8264774: Implementation of Foreign Function and Memory API (Incubator)

2021-06-02 Thread Maurizio Cimadamore
On Mon, 26 Apr 2021 17:10:13 GMT, Maurizio Cimadamore wrote: > This PR contains the API and implementation changes for JEP-412 [1]. A more > detailed description of such changes, to avoid repetitions during the review > process, is included as a separate comment. > > [1] - https://openjdk.jav

Re: RFR: 8266459: Implement JEP 411: Deprecate the Security Manager for Removal [v9]

2021-06-02 Thread Weijun Wang
> Please review this implementation of [JEP > 411](https://openjdk.java.net/jeps/411). > > The code change is divided into 3 commits. Please review them one by one. > > 1. > https://github.com/openjdk/jdk/commit/576161d15423f58281e384174d28c9f9be7941a1 > The essential change for this JEP, incl

Integrated: 8266459: Implement JEP 411: Deprecate the Security Manager for Removal

2021-06-02 Thread Weijun Wang
On Mon, 17 May 2021 18:23:41 GMT, Weijun Wang wrote: > Please review this implementation of [JEP > 411](https://openjdk.java.net/jeps/411). > > The code change is divided into 3 commits. Please review them one by one. > > 1. > https://github.com/openjdk/jdk/commit/576161d15423f58281e384174d28

Re: RFR: 8267543: Post JEP 411 refactoring: security [v2]

2021-06-02 Thread openjdk-notifier [bot]
On Tue, 25 May 2021 16:20:35 GMT, Weijun Wang wrote: >> For all modified files in #4073 having "security", "crypto", or "ssl" in >> their names. Codes are refactored to bring a `@SuppressWarning` annotation >> nearer to the deprecated API usage and also shrink the size of its target. >> >> I'l

Re: RFR: 8267521: Post JEP 411 refactoring: maximum covering > 50K [v3]

2021-06-02 Thread openjdk-notifier [bot]
On Fri, 21 May 2021 20:37:30 GMT, Weijun Wang wrote: >> The code change refactors classes that have a `SuppressWarnings("removal")` >> annotation that covers more than 50KB of code. The big annotation is often >> quite faraway from the actual deprecated API usage it is suppressing, and >> with

RFR: 8262409: sun/security/ssl/SSLSocketImpl/SSLSocketImplThrowsWrongExceptions. SSL test failures caused by java failed with "Server reported the wrong exception"

2021-06-02 Thread Fernando Guallini
The test `SSLSocketImplThrowsWrongExceptions` is failing intermittently after the change: [JDK-8259662: Don't wrap SocketExceptions into SSLExceptions in SSLSocketImpl](https://bugs.openjdk.java.net/browse/JDK-8259662) Since SocketExceptions are not wrapped into SSLException, also need to be ca

Re: RFR: 8262409: sun/security/ssl/SSLSocketImpl/SSLSocketImplThrowsWrongExceptions. SSL test failures caused by java failed with "Server reported the wrong exception"

2021-06-02 Thread Rajan Halade
On Wed, 2 Jun 2021 14:03:57 GMT, Fernando Guallini wrote: > The test `SSLSocketImplThrowsWrongExceptions` is failing intermittently after > the change: [JDK-8259662: Don't wrap SocketExceptions into SSLExceptions in > SSLSocketImpl](https://bugs.openjdk.java.net/browse/JDK-8259662) > > Since

Re: RFR: 8267521: Post JEP 411 refactoring: maximum covering > 50K [v4]

2021-06-02 Thread Weijun Wang
> The code change refactors classes that have a `SuppressWarnings("removal")` > annotation that covers more than 50KB of code. The big annotation is often > quite faraway from the actual deprecated API usage it is suppressing, and > with the annotation covering too big a portion it's easy to cal

Re: RFR: 8267543: Post JEP 411 refactoring: security [v3]

2021-06-02 Thread Weijun Wang
> For all modified files in #4073 having "security", "crypto", or "ssl" in > their names. Codes are refactored to bring a `@SuppressWarning` annotation > nearer to the deprecated API usage and also shrink the size of its target. > > I'll add a copyright year update commit before integration. We

Integrated: 8267521: Post JEP 411 refactoring: maximum covering > 50K

2021-06-02 Thread Weijun Wang
On Fri, 21 May 2021 01:52:27 GMT, Weijun Wang wrote: > The code change refactors classes that have a `SuppressWarnings("removal")` > annotation that covers more than 50KB of code. The big annotation is often > quite faraway from the actual deprecated API usage it is suppressing, and > with the

Integrated: 8267543: Post JEP 411 refactoring: security

2021-06-02 Thread Weijun Wang
On Mon, 24 May 2021 20:23:27 GMT, Weijun Wang wrote: > For all modified files in #4073 having "security", "crypto", or "ssl" in > their names. Codes are refactored to bring a `@SuppressWarning` annotation > nearer to the deprecated API usage and also shrink the size of its target. > > I'll add

Re: RFR: 8255557: Decouple GCM from CipherCore [v4]

2021-06-02 Thread Anthony Scarpino
On Thu, 20 May 2021 18:38:35 GMT, Valerie Peng wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix perf problem by reorganizing doLastBlock() > > src/java.base/share/classes/com/sun/crypto/provider/GaloisCounte

Re: RFR: 8262409: sun/security/ssl/SSLSocketImpl/SSLSocketImplThrowsWrongExceptions. SSL test failures caused by java failed with "Server reported the wrong exception"

2021-06-02 Thread Xue-Lei Andrew Fan
On Wed, 2 Jun 2021 14:03:57 GMT, Fernando Guallini wrote: > The test `SSLSocketImplThrowsWrongExceptions` is failing intermittently after > the change: [JDK-8259662: Don't wrap SocketExceptions into SSLExceptions in > SSLSocketImpl](https://bugs.openjdk.java.net/browse/JDK-8259662) > > Since

Re: RFR: 8255557: Decouple GCM from CipherCore [v4]

2021-06-02 Thread Anthony Scarpino
On Thu, 20 May 2021 19:06:31 GMT, Valerie Peng wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix perf problem by reorganizing doLastBlock() > > src/java.base/share/classes/com/sun/crypto/provider/GaloisCounte

Re: RFR: 8255557: Decouple GCM from CipherCore [v4]

2021-06-02 Thread Anthony Scarpino
On Thu, 20 May 2021 19:46:51 GMT, Valerie Peng wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix perf problem by reorganizing doLastBlock() > > src/java.base/share/classes/com/sun/crypto/provider/GaloisCounte

Re: RFR: 8240256: Better resource cleaning for SunPKCS11 Provider [v3]

2021-06-02 Thread Valerie Peng
On Fri, 28 May 2021 14:31:25 GMT, Sean Coffey wrote: >> Added capability to allow the PKCS11 Token to be destroyed once a session is >> logged out from. New configuration properties via pkcs11 config file. >> Cleaned up the native resource poller also. >> >> New unit test case to test behaviou

RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries

2021-06-02 Thread Maurizio Cimadamore
This patch overhauls the library loading mechanism used by the Foreign Linker API. We realized that, while handy, the *default* lookup abstraction (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. This patch replaces `LibraryLookup` with a simpler `SymbolLookup` abstract

Re: RFR: 8262409: sun/security/ssl/SSLSocketImpl/SSLSocketImplThrowsWrongExceptions. SSL test failures caused by java failed with "Server reported the wrong exception"

2021-06-02 Thread Clive Verghese
On Wed, 2 Jun 2021 14:03:57 GMT, Fernando Guallini wrote: > The test `SSLSocketImplThrowsWrongExceptions` is failing intermittently after > the change: [JDK-8259662: Don't wrap SocketExceptions into SSLExceptions in > SSLSocketImpl](https://bugs.openjdk.java.net/browse/JDK-8259662) > > Since

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries

2021-06-02 Thread Maurizio Cimadamore
On Wed, 2 Jun 2021 17:19:06 GMT, Maurizio Cimadamore wrote: > This patch overhauls the library loading mechanism used by the Foreign Linker > API. We realized that, while handy, the *default* lookup abstraction > (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. > > T

Re: RFR: 8248268: Support KWP in addition to KW [v10]

2021-06-02 Thread Valerie Peng
> This change updates SunJCE provider as below: > - updated existing AESWrap support with AES/KW/NoPadding cipher > transformation. > - added support for AES/KWP/NoPadding and AES/KW/PKCS5Padding. > > Existing AESWrap impl, i.e. AESWrapCipher class, is re-factored and renamed > to KeyWrapCipher

Re: RFR: 8255557: Decouple GCM from CipherCore [v4]

2021-06-02 Thread Anthony Scarpino
On Thu, 20 May 2021 20:00:07 GMT, Valerie Peng wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix perf problem by reorganizing doLastBlock() > > src/java.base/share/classes/com/sun/crypto/provider/GaloisCounte

RFR: 8267485: Remove the dependency on SecurityManager in JceSecurityManager.java

2021-06-02 Thread Bradford Wetmore
The JceSecurityManager is currently a subclass of java.security.SecurityManager. Now that JEP 411 has been integrated, this class should be updated to no longer subclass SecurityManager. The only reason for using SecurityManager to easily get the Class Context (call stack), but we can achieve

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries

2021-06-02 Thread Chapman Flack
On 06/02/21 13:30, Maurizio Cimadamore wrote: > This patch replaces `LibraryLookup` with a simpler `SymbolLookup` > abstraction, a functional interface. Crucially, `SymbolLookup` does not > concern with library loading, only symbol lookup. For this reason, two > factories are added: Hi, While I a

Re: RFR: 8255557: Decouple GCM from CipherCore [v4]

2021-06-02 Thread Anthony Scarpino
On Thu, 20 May 2021 23:27:51 GMT, Valerie Peng wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix perf problem by reorganizing doLastBlock() > > src/java.base/share/classes/com/sun/crypto/provider/GaloisCounte

Re: RFR: 8248268: Support KWP in addition to KW [v10]

2021-06-02 Thread Valerie Peng
On Wed, 2 Jun 2021 17:52:07 GMT, Valerie Peng wrote: >> This change updates SunJCE provider as below: >> - updated existing AESWrap support with AES/KW/NoPadding cipher >> transformation. >> - added support for AES/KWP/NoPadding and AES/KW/PKCS5Padding. >> >> Existing AESWrap impl, i.e. AESWra

Re: RFR: 8255557: Decouple GCM from CipherCore [v4]

2021-06-02 Thread Anthony Scarpino
On Thu, 20 May 2021 22:59:18 GMT, Valerie Peng wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix perf problem by reorganizing doLastBlock() > > src/java.base/share/classes/com/sun/crypto/provider/GaloisCounte

Re: RFR: 8267485: Remove the dependency on SecurityManager in JceSecurityManager.java

2021-06-02 Thread Daniel Fuchs
On Sat, 22 May 2021 00:20:11 GMT, Bradford Wetmore wrote: > The JceSecurityManager is currently a subclass of > java.security.SecurityManager. Now that JEP 411 has been integrated, this > class should be updated to no longer subclass SecurityManager. > > The only reason for using SecurityMana

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries

2021-06-02 Thread Jorn Vernee
On Wed, 2 Jun 2021 17:19:06 GMT, Maurizio Cimadamore wrote: > This patch overhauls the library loading mechanism used by the Foreign Linker > API. We realized that, while handy, the *default* lookup abstraction > (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. > > T

Re: RFR: 8262409: sun/security/ssl/SSLSocketImpl/SSLSocketImplThrowsWrongExceptions. SSL test failures caused by java failed with "Server reported the wrong exception"

2021-06-02 Thread Fernando Guallini
On Wed, 2 Jun 2021 17:29:51 GMT, Clive Verghese wrote: > Thank you @fguallini for fixing this test. > > Should the SocketException be expected by the client logic as well? > https://github.com/openjdk/jdk/blob/3631a39a4797919acbc7862cb94fa7f7be7f4f8a/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSo

Re: RFR: 8255557: Decouple GCM from CipherCore [v4]

2021-06-02 Thread Anthony Scarpino
On Fri, 21 May 2021 00:05:17 GMT, Valerie Peng wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix perf problem by reorganizing doLastBlock() > > src/java.base/share/classes/com/sun/crypto/provider/GaloisCounte

Re: RFR: 8255557: Decouple GCM from CipherCore [v4]

2021-06-02 Thread Valerie Peng
On Wed, 2 Jun 2021 01:53:51 GMT, Anthony Scarpino wrote: >> src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java >> line 741: >> >>> 739: } else { >>> 740: // If the remaining in buffer + data does >>> not fill a >>> 741

Re: RFR: 8255557: Decouple GCM from CipherCore [v4]

2021-06-02 Thread Anthony Scarpino
On Fri, 21 May 2021 00:03:40 GMT, Valerie Peng wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix perf problem by reorganizing doLastBlock() > > src/java.base/share/classes/com/sun/crypto/provider/GaloisCounte

Re: RFR: 8262409: sun/security/ssl/SSLSocketImpl/SSLSocketImplThrowsWrongExceptions. SSL test failures caused by java failed with "Server reported the wrong exception"

2021-06-02 Thread Clive Verghese
On Wed, 2 Jun 2021 14:03:57 GMT, Fernando Guallini wrote: > The test `SSLSocketImplThrowsWrongExceptions` is failing intermittently after > the change: [JDK-8259662: Don't wrap SocketExceptions into SSLExceptions in > SSLSocketImpl](https://bugs.openjdk.java.net/browse/JDK-8259662) > > Since

Re: RFR: 8255557: Decouple GCM from CipherCore [v4]

2021-06-02 Thread Valerie Peng
On Wed, 2 Jun 2021 03:26:03 GMT, Anthony Scarpino wrote: >> src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java >> line 975: >> >>> 973: doUpdate(in, inOff, inLen, output, 0); >>> 974: } catch (ShortBufferException e) { >>> 975:

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries [v2]

2021-06-02 Thread Maurizio Cimadamore
> This patch overhauls the library loading mechanism used by the Foreign Linker > API. We realized that, while handy, the *default* lookup abstraction > (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. > > This patch replaces `LibraryLookup` with a simpler `SymbolLookup

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries

2021-06-02 Thread Maurizio Cimadamore
On Wed, 2 Jun 2021 17:19:06 GMT, Maurizio Cimadamore wrote: > This patch overhauls the library loading mechanism used by the Foreign Linker > API. We realized that, while handy, the *default* lookup abstraction > (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. > > T

Re: RFR: 8255557: Decouple GCM from CipherCore [v4]

2021-06-02 Thread Anthony Scarpino
On Fri, 21 May 2021 01:19:44 GMT, Valerie Peng wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix perf problem by reorganizing doLastBlock() > > src/java.base/share/classes/com/sun/crypto/provider/GaloisCounte

Re: RFR: 8255557: Decouple GCM from CipherCore [v5]

2021-06-02 Thread Anthony Scarpino
On Mon, 24 May 2021 20:33:33 GMT, Valerie Peng wrote: >> Anthony Scarpino has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Review comments update > > test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMBufferTest.java line 673: > >> 671: >>

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries [v2]

2021-06-02 Thread Paul Sandoz
On Wed, 2 Jun 2021 20:17:20 GMT, Maurizio Cimadamore wrote: >> This patch overhauls the library loading mechanism used by the Foreign >> Linker API. We realized that, while handy, the *default* lookup abstraction >> (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. >>

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries [v3]

2021-06-02 Thread Maurizio Cimadamore
On Wed, 2 Jun 2021 18:40:48 GMT, Paul Sandoz wrote: >> Maurizio Cimadamore has updated the pull request incrementally with 10 >> additional commits since the last revision: >> >> - Update test/jdk/java/foreign/TestIntrinsics.java >> >>Co-authored-by: Paul Sandoz >> - Update test/jdk/

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries [v3]

2021-06-02 Thread Maurizio Cimadamore
> This patch overhauls the library loading mechanism used by the Foreign Linker > API. We realized that, while handy, the *default* lookup abstraction > (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. > > This patch replaces `LibraryLookup` with a simpler `SymbolLookup

Re: RFR: 8268129: LibraryLookup::ofDefault leaks symbols from loaded libraries [v4]

2021-06-02 Thread Maurizio Cimadamore
> This patch overhauls the library loading mechanism used by the Foreign Linker > API. We realized that, while handy, the *default* lookup abstraction > (`LibraryLookup::ofDefault`) was behaving inconsistentlt across platforms. > > This patch replaces `LibraryLookup` with a simpler `SymbolLookup

Integrated: 8248268: Support KWP in addition to KW

2021-06-02 Thread Valerie Peng
On Thu, 4 Feb 2021 10:51:12 GMT, Valerie Peng wrote: > This change updates SunJCE provider as below: > - updated existing AESWrap support with AES/KW/NoPadding cipher > transformation. > - added support for AES/KWP/NoPadding and AES/KW/PKCS5Padding. > > Existing AESWrap impl, i.e. AESWrapCiphe

Re: RFR: 8267485: Remove the dependency on SecurityManager in JceSecurityManager.java [v2]

2021-06-02 Thread Bradford Wetmore
> The JceSecurityManager is currently a subclass of > java.security.SecurityManager. Now that JEP 411 has been integrated, this > class should be updated to no longer subclass SecurityManager. > > The only reason for using SecurityManager to easily get the Class Context > (call stack), but we

Re: RFR: 8267485: Remove the dependency on SecurityManager in JceSecurityManager.java [v2]

2021-06-02 Thread Bradford Wetmore
On Wed, 2 Jun 2021 18:18:46 GMT, Daniel Fuchs wrote: >> Bradford Wetmore has updated the pull request with a new target base due to >> a merge or a rebase. The pull request now contains six commits: >> >> - Merge branch 'master' into JDK-8267485 >> - Merge branch 'master' into JDK-8267485 >>

Re: RFR: 8267485: Remove the dependency on SecurityManager in JceSecurityManager.java [v3]

2021-06-02 Thread Bradford Wetmore
> The JceSecurityManager is currently a subclass of > java.security.SecurityManager. Now that JEP 411 has been integrated, this > class should be updated to no longer subclass SecurityManager. > > The only reason for using SecurityManager to easily get the Class Context > (call stack), but we

Authorization Layer post JEP 411

2021-06-02 Thread Peter Firmstone
A comment from Ron highlites our issue: the JDK contains only things that either only the JDK can technically do We have a need to distinguish between different sources of code, as well as user principles, and as well as Services.   Our services are loaded by separate ClassLoaders and are to

Re: Authorization Layer post JEP 411

2021-06-02 Thread Chapman Flack
On 06/02/21 19:41, Peter Firmstone wrote: > We need the power of AccessController's stack walk, StackWalker doesn't work > with compiled code, only bytecode. Is this correct? I have not tried it, but the apidocs had led me to understand it did not distinguish much between JITed and interpreted cod

Integrated: 8240256: Better resource cleaning for SunPKCS11 Provider

2021-06-02 Thread Sean Coffey
On Fri, 16 Apr 2021 11:24:57 GMT, Sean Coffey wrote: > Added capability to allow the PKCS11 Token to be destroyed once a session is > logged out from. New configuration properties via pkcs11 config file. Cleaned > up the native resource poller also. > > New unit test case to test behaviour. So