Re: RFR: 8283577: SSLEngine.unwrap on read-only input ByteBuffer

2022-05-10 Thread Xue-Lei Andrew Fan
On Fri, 29 Apr 2022 03:58:57 GMT, Anthony Scarpino wrote: > Hi, > > I need a review of this fix to allow a read-only 'src' buffer to be used with > SSLEngine.unwrap(). A temporary read-write buffer is created in the SSLCipher > operation when a read-only buffer is passed. If the 'src' is read

Re: RFR: 8286423: Destroy password protection in the example code in KeyStore [v3]

2022-05-10 Thread Xue-Lei Andrew Fan
On Tue, 10 May 2022 22:09:14 GMT, Weijun Wang wrote: >> Oops, I tried to check but finally forgot about it. Thanks! > > It's probably better to convert these long example code to snippets, maybe > next time. The length is a little bit long, but it is fine to me. It may be nice to revise the

Re: RFR: 8286423: Destroy password protection in the example code in KeyStore [v3]

2022-05-10 Thread Xue-Lei Andrew Fan
> Hi, > > May I have this simple example update in the KeyStore specification? > > Password protection should be destroyed in the example code in KeyStore > specification. Otherwise, applications may just copy and past the code, and > forget to clean up password protection. > > It's a trivial

Re: RFR: 8286378: Address possibly lossy conversions in java.base [v2]

2022-05-10 Thread Alan Bateman
On Tue, 10 May 2022 23:01:33 GMT, Roger Riggs wrote: >> PR#8599 8244681: proposes to add compiler warnings for possible lossy >> conversions >> From the CSR: >> >> "If the type of the right-hand operand of a compound assignment is not >> assignment compatible with the type of the variable, a c

Re: RFR: 8002277: Refactor two PBE classes to simplify maintenance [v2]

2022-05-10 Thread Weijun Wang
On Wed, 11 May 2022 01:14:00 GMT, Valerie Peng wrote: >> The `core.init(..., cipher)` is actually >> `cipher.init(core.translateKeyAndParams())`. Is it possible we write it this >> way? > > It's possible, more refactoring would be needed and not necessarily less > lines of code. With your sugg

Re: RFR: 8283577: SSLEngine.unwrap on read-only input ByteBuffer

2022-05-10 Thread Bradford Wetmore
On Fri, 29 Apr 2022 03:58:57 GMT, Anthony Scarpino wrote: > Hi, > > I need a review of this fix to allow a read-only 'src' buffer to be used with > SSLEngine.unwrap(). A temporary read-write buffer is created in the SSLCipher > operation when a read-only buffer is passed. If the 'src' is read

Re: RFR: 8002277: Refactor two PBE classes to simplify maintenance [v2]

2022-05-10 Thread Valerie Peng
On Tue, 10 May 2022 02:27:13 GMT, Weijun Wang wrote: >> Currently, the specified CipherSpi object is one of RC4, RC2, DESede. The >> "else" part is for catching new PKCS12 PBE algorithms support which uses >> other cipher algorithms. >> CipherSpi.engineInit(...) is protected, so that's why we u

Re: RFR: 8283577: SSLEngine.unwrap on read-only input ByteBuffer

2022-05-10 Thread Bradford Wetmore
On Fri, 29 Apr 2022 03:58:57 GMT, Anthony Scarpino wrote: > Hi, > > I need a review of this fix to allow a read-only 'src' buffer to be used with > SSLEngine.unwrap(). A temporary read-write buffer is created in the SSLCipher > operation when a read-only buffer is passed. If the 'src' is read

Re: RFR: 8286428: AlgorithmId should understand PBES2

2022-05-10 Thread Valerie Peng
On Mon, 9 May 2022 21:44:10 GMT, Weijun Wang wrote: > `AlgorithmId.getName` is updated for PBES2 algorithm identifiers so it > directly returns the standard algorithm defined by Java (Ex: > `PBEWithHmacSHA256AndAES_256`), instead of a simple "PBES2". > > Please note I specifically update the j

Re: RFR: 8283577: SSLEngine.unwrap on read-only input ByteBuffer

2022-05-10 Thread Mark Powers
On Fri, 29 Apr 2022 03:58:57 GMT, Anthony Scarpino wrote: > Hi, > > I need a review of this fix to allow a read-only 'src' buffer to be used with > SSLEngine.unwrap(). A temporary read-write buffer is created in the SSLCipher > operation when a read-only buffer is passed. If the 'src' is read

Re: RFR: JDK-6782021: It is not possible to read local computer certificates with the SunMSCAPI provider [v5]

2022-05-10 Thread Mat Carter
On Tue, 10 May 2022 22:01:16 GMT, Weijun Wang wrote: >> Mat Carter has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add test from wangweij > > test/jdk/sun/security/mscapi/AllTypes.java line 60: > >> 58: return true; >> 59:

Re: RFR: 8286378: Address possibly lossy conversions in java.base [v2]

2022-05-10 Thread Roger Riggs
> PR#8599 8244681: proposes to add compiler warnings for possible lossy > conversions > From the CSR: > > "If the type of the right-hand operand of a compound assignment is not > assignment compatible with the type of the variable, a cast is implied and > possible lossy conversion may silently

Re: RFR: 8286378: Address possibly lossy conversions in java.base

2022-05-10 Thread Brian Burkhalter
On Tue, 10 May 2022 21:32:10 GMT, Roger Riggs wrote: > PR#8599 8244681: proposes to add compiler warnings for possible lossy > conversions > From the CSR: > > "If the type of the right-hand operand of a compound assignment is not > assignment compatible with the type of the variable, a cast is

Re: RFR: 8002277: Refactor two PBE classes to simplify maintenance [v4]

2022-05-10 Thread Valerie Peng
> This change refactors the PBES2Core and PKCS12PBECipherCore classes in SunJCE > provider as requested in the bug record. Functionality should remain the same > with a clearer and simplified code/control flow with less lines of code. > This should improve readability and maintenance. I enhance

Re: RFR: 8286378: Address possibly lossy conversions in java.base

2022-05-10 Thread Xue-Lei Andrew Fan
On Tue, 10 May 2022 21:32:10 GMT, Roger Riggs wrote: > PR#8599 8244681: proposes to add compiler warnings for possible lossy > conversions > From the CSR: > > "If the type of the right-hand operand of a compound assignment is not > assignment compatible with the type of the variable, a cast is

Re: RFR: 8286423: Destroy password protection in the example code in KeyStore [v2]

2022-05-10 Thread Weijun Wang
On Tue, 10 May 2022 22:03:19 GMT, Xue-Lei Andrew Fan wrote: >> src/java.base/share/classes/java/security/KeyStore.java line 165: >> >>> 163: *} >>> 164: *} finally { >>> 165: *protParam.destroy(); >> >> `KeyStore.ProtectionParameter` does not have a `destroy` method. Only

Re: RFR: 8286423: Destroy password protection in the example code in KeyStore [v2]

2022-05-10 Thread Weijun Wang
On Tue, 10 May 2022 22:07:47 GMT, Xue-Lei Andrew Fan wrote: >> Hi, >> >> May I have this simple example update in the KeyStore specification? >> >> Password protection should be destroyed in the example code in KeyStore >> specification. Otherwise, applications may just copy and past the code,

Re: RFR: 8286423: Destroy password protection in the example code in KeyStore [v2]

2022-05-10 Thread Xue-Lei Andrew Fan
On Tue, 10 May 2022 13:36:19 GMT, Weijun Wang wrote: >> Xue-Lei Andrew Fan has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Use PasswordProtection > > src/java.base/share/classes/java/security/KeyStore.java line 165: > >> 163: *

Re: RFR: 8286423: Destroy password protection in the example code in KeyStore [v2]

2022-05-10 Thread Xue-Lei Andrew Fan
> Hi, > > May I have this simple example update in the KeyStore specification? > > Password protection should be destroyed in the example code in KeyStore > specification. Otherwise, applications may just copy and past the code, and > forget to clean up password protection. > > It's a trivial

Re: RFR: 8002277: Refactor two PBE classes to simplify maintenance [v2]

2022-05-10 Thread Valerie Peng
On Tue, 10 May 2022 00:09:16 GMT, Weijun Wang wrote: >> Oh, the comment about "may be 0" is meant toward the >> pbeKey.getInterationCount() call... Hmm, I will make it clearer. > > I see. Another question, shall we reset `salt` and `iCount` at the beginning? > If `params` is null and `key` is n

Re: RFR: JDK-6782021: It is not possible to read local computer certificates with the SunMSCAPI provider [v5]

2022-05-10 Thread Weijun Wang
On Tue, 10 May 2022 18:55:50 GMT, Mat Carter wrote: >> On Windows you can now access the local machine keystores using the strings >> "Windows-MY-LOCALMACHINE" and "Windows-ROOT-LOCALMACHINE"; note the >> application requires admin privileges. >> >> "Windows-MY" and "Windows-ROOT" remain uncha

Re: RFR: 8286378: Address possibly lossy conversions in java.base

2022-05-10 Thread Naoto Sato
On Tue, 10 May 2022 21:32:10 GMT, Roger Riggs wrote: > PR#8599 8244681: proposes to add compiler warnings for possible lossy > conversions > From the CSR: > > "If the type of the right-hand operand of a compound assignment is not > assignment compatible with the type of the variable, a cast is

RFR: 8286378: Address possibly lossy conversions in java.base

2022-05-10 Thread Roger Riggs
PR#8599 8244681: proposes to add compiler warnings for possible lossy conversions >From the CSR: "If the type of the right-hand operand of a compound assignment is not assignment compatible with the type of the variable, a cast is implied and possible lossy conversion may silently occur. While

Re: RFR: JDK-6782021: It is not possible to read local computer certificates with the SunMSCAPI provider [v3]

2022-05-10 Thread Weijun Wang
On Tue, 10 May 2022 18:51:07 GMT, Mat Carter wrote: >> @macarte You need to finalize your CSR soon if you want to include this >> change into JDK 19. RDP1 is 2022/06/09, and all enhancements require >> approval after that. >> >> BTW, is it possible to detect whether you have admin privilege in

Re: RFR: 8253176: Signature.getParameters should specify that it can throw UnsupportedOperationException [v4]

2022-05-10 Thread Sean Mullan
On Mon, 9 May 2022 18:45:05 GMT, Valerie Peng wrote: >> This is to update the method javadoc of >> java.security.Signature.getParameters() with the missing `@throws >> UnsupportedOperationException`. In addition, the wording on the returned >> parameters are updated to match those in Cipher an

Re: RFR: 8209038: Clarify the javadoc of Cipher.getParameters() [v5]

2022-05-10 Thread Sean Mullan
On Mon, 9 May 2022 18:28:04 GMT, Valerie Peng wrote: >> Anyone can help review this javadoc update? The main change is the wording >> for the method javadoc of >> Cipher.getParameters()/CipherSpi.engineGetParameters(). The original wording >> is somewhat restrictive and request is to broaden t

Re: RFR: JDK-6725221 Standardize obtaining boolean properties with defaults

2022-05-10 Thread Mark Powers
On Fri, 6 May 2022 17:56:44 GMT, Alan Bateman wrote: >> JDK-6725221 Standardize obtaining boolean properties with defaults > > src/java.base/share/classes/java/lang/reflect/AccessibleObject.java line 777: > >> 775: if (!printStackPropertiesSet && VM.initLevel() >= 1) { >> 776:

Re: RFR: JDK-6782021: It is not possible to read local computer certificates with the SunMSCAPI provider [v4]

2022-05-10 Thread Weijun Wang
On Tue, 10 May 2022 17:23:24 GMT, Mat Carter wrote: >> On Windows you can now access the local machine keystores using the strings >> "Windows-MY-LOCALMACHINE" and "Windows-ROOT-LOCALMACHINE"; note the >> application requires admin privileges. >> >> "Windows-MY" and "Windows-ROOT" remain uncha

Re: RFR: JDK-6782021: It is not possible to read local computer certificates with the SunMSCAPI provider [v3]

2022-05-10 Thread Mat Carter
On Tue, 10 May 2022 13:07:02 GMT, Weijun Wang wrote: >> @wangweij - regarding the two tests for localmachine, these will throw a >> KeyStore exception "Access denied" if the test is not run as admin, is there >> anyway in the test to make that a requirement? If so we could split into >> two t

Re: RFR: JDK-6782021: It is not possible to read local computer certificates with the SunMSCAPI provider [v5]

2022-05-10 Thread Mat Carter
> On Windows you can now access the local machine keystores using the strings > "Windows-MY-LOCALMACHINE" and "Windows-ROOT-LOCALMACHINE"; note the > application requires admin privileges. > > "Windows-MY" and "Windows-ROOT" remain unchanged, however given these > original keystore strings mapp

Re: RFR: JDK-6782021: It is not possible to read local computer certificates with the SunMSCAPI provider [v4]

2022-05-10 Thread Mat Carter
> On Windows you can now access the local machine keystores using the strings > "Windows-MY-LOCALMACHINE" and "Windows-ROOT-LOCALMACHINE"; note the > application requires admin privileges. > > "Windows-MY" and "Windows-ROOT" remain unchanged, however given these > original keystore strings mapp

Re: RFR: 8286423: Destroy password protection in the example code in KeyStore

2022-05-10 Thread Weijun Wang
On Tue, 10 May 2022 04:13:43 GMT, Xue-Lei Andrew Fan wrote: > Hi, > > May I have this simple example update in the KeyStore specification? > > Password protection should be destroyed in the example code in KeyStore > specification. Otherwise, applications may just copy and past the code, and

Re: RFR: JDK-6782021: It is not possible to read local computer certificates with the SunMSCAPI provider [v3]

2022-05-10 Thread Weijun Wang
On Thu, 5 May 2022 16:36:04 GMT, Mat Carter wrote: >> I'd like to contribute a test. Please modify it as much as you like. You can >> put it inside `test/jdk/sun/security/mscapi/`. >> >> /* >> * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. >> * DO NOT ALTER OR REMOVE