RFR: 8282038: CipherSpi.bufferCrypt leaves plaintext copy on the heap

2022-06-14 Thread Weijun Wang
Clearing buffers and temporary arrays to avoid data leaks in cipher operations. - Commit messages: - the fix Changes: https://git.openjdk.org/jdk/pull/9158/files Webrev: https://webrevs.openjdk.org/?repo=jdk=9158=00 Issue: https://bugs.openjdk.org/browse/JDK-8282038 Stats: 49

RFR: 8288209: SSL debug message wrong about unsupported authentication scheme

2022-06-13 Thread Weijun Wang
At the beginning, this bug was about the incorrect warning message "Unsupported authentication scheme" on line 1051 which should have been "This key algorithm has been checked, skip it". Now, it's a code refactoring that emphasizes only the key algorithm inside a signature scheme is checked in

Re: RFR: JDK-8285263 Minor cleanup could be done in java.security [v6]

2022-06-10 Thread Weijun Wang
On Fri, 10 Jun 2022 21:27:58 GMT, Mark Powers wrote: >> https://bugs.openjdk.java.net/browse/JDK-8285263 Minor cleanup could be done >> in java.security >> >> JDK-8273046 is the umbrella bug for this bug. The changes were too large for >> a single code review, so it was decided to split into

Re: Integrated: 8288270: Tier1 build failures after JDK-8287178

2022-06-10 Thread Weijun Wang
On Fri, 10 Jun 2022 23:49:45 GMT, Hai-May Chao wrote: > Please review the small fix in comment. LGTM. Thanks. - Marked as reviewed by weijun (Reviewer). PR: https://git.openjdk.org/jdk/pull/9135

Integrated: 8287178: IntegerModuloP::multiplicativeInverse returns 0 for 0

2022-06-10 Thread Weijun Wang
On Thu, 9 Jun 2022 21:34:56 GMT, Weijun Wang wrote: > Add comment to the method. This pull request has now been integrated. Changeset: d4b473d8 Author: Weijun Wang URL: https://git.openjdk.org/jdk/commit/d4b473d89046874f25aa6f65f3ae96f7d8397d50 Stats: 8 lines in 1 file chan

Re: RFR: JDK-8285263 Minor cleanup could be done in java.security [v5]

2022-06-10 Thread Weijun Wang
On Fri, 10 Jun 2022 00:35:16 GMT, Mark Powers wrote: >> src/java.base/share/classes/java/security/SecureRandom.java line 905: >> >>> 903: private static final Pattern pattern = >>> 904: Pattern.compile( >>> 905:

Re: RFR: JDK-8285263 Minor cleanup could be done in java.security [v6]

2022-06-10 Thread Weijun Wang
On Fri, 10 Jun 2022 21:27:58 GMT, Mark Powers wrote: >> https://bugs.openjdk.java.net/browse/JDK-8285263 Minor cleanup could be done >> in java.security >> >> JDK-8273046 is the umbrella bug for this bug. The changes were too large for >> a single code review, so it was decided to split into

Re: RFR: 8287178: IntegerModuloP::multiplicativeInverse returns 0 for 0 [v2]

2022-06-09 Thread Weijun Wang
On Thu, 9 Jun 2022 22:29:36 GMT, Jamil Nimeh wrote: >> Weijun Wang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> verb > > src/java.base/share/classes/sun/security/util/math/IntegerModul

Re: RFR: 8287178: IntegerModuloP::multiplicativeInverse returns 0 for 0 [v2]

2022-06-09 Thread Weijun Wang
> Add comment to the method. Weijun Wang has updated the pull request incrementally with one additional commit since the last revision: verb - Changes: - all: https://git.openjdk.org/jdk/pull/9115/files - new: https://git.openjdk.org/jdk/pull/9115/files/36741bba..15ef8

RFR: 8287178: IntegerModuloP::multiplicativeInverse returns 0 for 0

2022-06-09 Thread Weijun Wang
Add comment to the method. - Commit messages: - add comment Changes: https://git.openjdk.org/jdk/pull/9115/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk=9115=00 Issue: https://bugs.openjdk.org/browse/JDK-8287178 Stats: 8 lines in 1 file changed: 7 ins; 0 del; 1 mod

Re: RFR: JDK-8285263 Minor cleanup could be done in java.security [v5]

2022-06-08 Thread Weijun Wang
On Tue, 7 Jun 2022 15:37:02 GMT, Mark Powers wrote: >> https://bugs.openjdk.java.net/browse/JDK-8285263 Minor cleanup could be done >> in java.security >> >> JDK-8273046 is the umbrella bug for this bug. The changes were too large for >> a single code review, so it was decided to split into

RFR: 6522064: Aliases from Microsoft CryptoAPI has bad character encoding

2022-06-08 Thread Weijun Wang
Switch to wide char version of `CertGetNameString` to get the non-ASCII name. - Commit messages: - the fix Changes: https://git.openjdk.java.net/jdk/pull/9085/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk=9085=00 Issue: https://bugs.openjdk.org/browse/JDK-6522064

Re: RFR: 8287246: DSAKeyValue should check for missing params instead of relying on KeyFactory provider

2022-05-25 Thread Weijun Wang
On Tue, 24 May 2022 16:29:02 GMT, Sean Mullan wrote: > Please review this fix to the XML Signature implementation to check for null > or missing DSA parameters and throw a MarshalException before trying to > create a DSA public key from its XML encoding. This will allow the code to > fail

Re: RFR: 8287246: DSAKeyValue should check for missing params instead of relying on KeyFactory provider

2022-05-25 Thread Weijun Wang
On Tue, 24 May 2022 16:29:02 GMT, Sean Mullan wrote: > Please review this fix to the XML Signature implementation to check for null > or missing DSA parameters and throw a MarshalException before trying to > create a DSA public key from its XML encoding. This will allow the code to > fail

Re: RFR: 8286211: Update PCSC-Lite for Suse Linux to 1.9.5 [v3]

2022-05-23 Thread Weijun Wang
On Mon, 23 May 2022 21:44:39 GMT, Valerie Peng wrote: >> Need to update the 3 header files due to expiring business approval for 3rd >> party. >> >> The header files contain tabs which jcheck disallows, so I have to replace >> them with spaces. >> >> Thanks, >> Valerie > > Valerie Peng has

Integrated: 8286908: ECDSA signature should not return parameters

2022-05-23 Thread Weijun Wang
On Tue, 17 May 2022 19:56:22 GMT, Weijun Wang wrote: > Let ECDSA's `engineGetParameters()` always return null. At the same time, > remove the remembered `sigParams` field. One behavior change is that after > calling `setParameter()`, one can call `init()` again with a key using &g

Re: RFR: 8286908: ECDSA signature should not return parameters [v3]

2022-05-18 Thread Weijun Wang
t; > Also added SHA1withECDSA to the no-NULL list in `KnownOIDs`. > > All security-related tests passed. Weijun Wang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull r

Re: RFR: 8286969: Add a new test library API to execute kinit in SecurityTools.java

2022-05-18 Thread Weijun Wang
On Wed, 18 May 2022 16:19:40 GMT, Sibabrata Sahoo wrote: > A new API to execute kinit. Marked as reviewed by weijun (Reviewer). - PR: https://git.openjdk.java.net/jdk/pull/8775

Re: RFR: 8286908: ECDSA signature should not return parameters [v2]

2022-05-18 Thread Weijun Wang
t; > Also added SHA1withECDSA to the no-NULL list in `KnownOIDs`. > > All security-related tests passed. Weijun Wang has updated the pull request incrementally with one additional commit since the last revision: will not read params for ECDSA - Changes: - all: https://git.openj

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

2022-05-17 Thread Weijun Wang
On Tue, 17 May 2022 22:22:36 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

Re: RFR: 8286908: ECDSA signature should not return parameters

2022-05-17 Thread Weijun Wang
On Tue, 17 May 2022 20:27:41 GMT, Jamil Nimeh wrote: > Do the behavioral changes you've cited in the PR description warrant a CSR, > or do you feel this behavioral change is still consistent with the current > Signature API documentation? I think so. In fact, after this change, there's simply

RFR: 8286908: ECDSA signature should not return parameters

2022-05-17 Thread Weijun Wang
Let ECDSA's `engineGetParameters()` always return null. At the same time, remove the remembered `sigParams` field. One behavior change is that after calling `setParameter()`, one can call `init()` again with a key using different parameters. I think this should be allowed since we are reusing

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

2022-05-17 Thread Weijun Wang
On Thu, 12 May 2022 22:52:59 GMT, Valerie Peng wrote: >> 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 >>

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

2022-05-16 Thread Weijun Wang
On Wed, 11 May 2022 16:01:39 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

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

2022-05-16 Thread Weijun Wang
On Wed, 11 May 2022 15:55:40 GMT, Mat Carter wrote: >> Mat Carter has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add test from wangweij > > @christophbrejla - my goal is to backport to latest (18 or 19), 17 and 11 @macarte I think

Integrated: 8286428: AlgorithmId should understand PBES2

2022-05-15 Thread Weijun Wang
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 n

Integrated: 8284194: Allow empty subject fields in keytool

2022-05-15 Thread Weijun Wang
On Wed, 11 May 2022 21:55:45 GMT, Weijun Wang wrote: > This code change allows one entering "." at a distinguished name prompt to > skip a sub-component when running `keytool -genkeyapir`. Several new resource > strings are added. > > There is no detailed descriptio

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

2022-05-12 Thread Weijun Wang
On Thu, 12 May 2022 21:31:39 GMT, Valerie Peng wrote: >> src/java.base/share/classes/com/sun/crypto/provider/PBES2Core.java line 244: >> >>> 242: iCount = DEFAULT_COUNT; >>> 243: } >>> 244: //if (ivSpec == null) { // old behavior always

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

2022-05-12 Thread Weijun Wang
On Thu, 12 May 2022 03:28:15 GMT, Valerie Peng wrote: >> 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 >>

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

2022-05-12 Thread Weijun Wang
On Thu, 12 May 2022 03:28:15 GMT, Valerie Peng wrote: >> 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 >>

Re: RFR: 8284194: Allow empty subject fields in keytool [v3]

2022-05-12 Thread Weijun Wang
ot; is entered for all fields and keytool rejected it. In > the second round, CN is entered but the others are unchanged (just type > enter, because they are already entered previously). At the end, the name is > "CN=Duke". Weijun Wang has updated the pull request

Re: RFR: 8282662: Use List.of() factory method to reduce memory consumption [v3]

2022-05-12 Thread Weijun Wang
On Thu, 10 Mar 2022 08:52:17 GMT, Сергей Цыпанов wrote: >> `List.of()` along with `Set.of()` create unmodifiable `List/Set` but with >> smaller footprint comparing to `Arrays.asList()` / `new HashSet()` when >> called with vararg of size 0, 1, 2. >> >> In general replacement of

Re: RFR: 8284194: Allow empty subject fields in keytool [v2]

2022-05-12 Thread Weijun Wang
On Wed, 11 May 2022 23:40:46 GMT, Weijun Wang wrote: >> This code change allows one entering "." at a distinguished name prompt to >> skip a sub-component when running `keytool -genkeyapir`. Several new >> resource strings are added. >> >> There is

Integrated: 8286422: Add OIDs for RC2 and Blowfish

2022-05-12 Thread Weijun Wang
On Wed, 11 May 2022 22:35:32 GMT, Weijun Wang wrote: > Add missing OIDs for 2 secret key algorithms. These will be used when storing > secret keys in a PKCS12 keystore. Like DES and DESede, the OIDs were > originally defined for CBC mode cipher algorithms, they are reused here f

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

2022-05-11 Thread Weijun Wang
On Wed, 11 May 2022 15:55:40 GMT, Mat Carter wrote: > @christophbrejla - my goal is to backport to latest (18 or 19), 17 and 11 Then please add the versions to the "Fix Version(s)" field of the CSR. There are also some questions waiting for you in the comment there. - PR:

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

2022-05-11 Thread Weijun Wang
On Wed, 11 May 2022 22:02:42 GMT, Valerie Peng wrote: >> 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 >>

Re: RFR: 8284194: Allow empty subject fields in keytool [v2]

2022-05-11 Thread Weijun Wang
ot; is entered for all fields and keytool rejected it. In > the second round, CN is entered but the others are unchanged (just type > enter, because they are already entered previously). At the end, the name is > "CN=Duke". Weijun Wang has updated the pull r

Re: RFR: 8284194: Allow empty subject fields in keytool

2022-05-11 Thread Weijun Wang
On Wed, 11 May 2022 22:37:18 GMT, Jamil Nimeh wrote: >> This code change allows one entering "." at a distinguished name prompt to >> skip a sub-component when running `keytool -genkeyapir`. Several new >> resource strings are added. >> >> There is no detailed description in `keytool.html`,

RFR: 8286422: Add OIDs for RC2 and Blowfish

2022-05-11 Thread Weijun Wang
Add missing OIDs for 2 secret key algorithms. These will be used when storing secret keys in a PKCS12 keystore. Like DES and DESede, the OIDs were originally defined for CBC mode cipher algorithms, they are reused here for key algorithms. OpenSSL uses the same OIDs for cipher algorithms. 1 3 6

RFR: 8284194: Allow empty subject fields in keytool

2022-05-11 Thread Weijun Wang
This code change allows one entering "." at a distinguished name prompt to skip a sub-component when running `keytool -genkeyapir`. Several new resource strings are added. There is no detailed description in `keytool.html`, so I think there's no need to update it. I'll file a CSR to describe

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

2022-05-11 Thread Weijun Wang
On Wed, 11 May 2022 05:53:21 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

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

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.

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

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

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

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

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

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

2022-05-09 Thread Weijun Wang
On Tue, 10 May 2022 01:22:21 GMT, Valerie Peng wrote: >> src/java.base/share/classes/com/sun/crypto/provider/PKCS12PBECipherCore.java >> line 314: >> >>> 312: } else if (cipher instanceof DESedeCipher >>> tripleDes) { >>> 313:

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

2022-05-09 Thread Weijun Wang
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

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

2022-05-09 Thread Weijun Wang
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

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

2022-05-09 Thread Weijun Wang
On Mon, 9 May 2022 23:23:05 GMT, Valerie Peng wrote: >> src/java.base/share/classes/com/sun/crypto/provider/PBES2Core.java line 229: >> >>> 227: if (key instanceof javax.crypto.interfaces.PBEKey >>> pbeKey) { >>> 228: salt = check(pbeKey.getSalt()); // may

RFR: 8286428: AlgorithmId should understand PBES2

2022-05-09 Thread Weijun Wang
`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 javadoc for this method to clarify that this name is meant to

Integrated: 8285743: Ensure each IntegerPolynomial object is only created once

2022-05-09 Thread Weijun Wang
On Fri, 29 Apr 2022 22:30:04 GMT, Weijun Wang wrote: > All `IntegerPolynimial`s are singletons now. Also, hand-coded implementations > for Ed25519 and Ed448 are removed. They were not used since `FieldGen` starts > generating classes for them. > > No new regression test. Thi

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

2022-05-09 Thread Weijun Wang
On Thu, 5 May 2022 19:38:06 GMT, Valerie Peng wrote: >> 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.

Re: RFR: 8285743: Ensure each IntegerPolynomial object is only created once [v2]

2022-05-09 Thread Weijun Wang
On Fri, 29 Apr 2022 22:57:20 GMT, Weijun Wang wrote: >> All `IntegerPolynimial`s are singletons now. Also, hand-coded >> implementations for Ed25519 and Ed448 are removed. They were not used since >> `FieldGen` starts generating classes for them. >> >> No new re

Re: RFR: JDK-8284688 Minor cleanup could be done in java.security.jgss [v5]

2022-05-05 Thread Weijun Wang
On Thu, 5 May 2022 21:05:40 GMT, Mark Powers wrote: >> https://bugs.openjdk.java.net/browse/JDK-8284688 >> >> [JDK-8273046](https://bugs.openjdk.java.net/browse/JDK-8273046) is the >> umbrella bug for this bug. The changes were too large for a single code >> review, so it was decided to split

Re: RFR: 8285516: clearPassword should be called in a finally try block [v3]

2022-05-05 Thread Weijun Wang
On Thu, 5 May 2022 06:02:14 GMT, Xue-Lei Andrew Fan wrote: >> Hi, >> >> Could I have the simple update reviewed? >> >> In the PKCS12 key store implementation, the PBEKeySpec.clearPassword() >> should be called in a finally try block. Otherwise, the password cleanup >> could be interrupted

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

2022-05-05 Thread Weijun Wang
On Wed, 4 May 2022 20:32:30 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

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

2022-05-05 Thread Weijun Wang
On Wed, 4 May 2022 20:32:30 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

Re: RFR: 8285516: clearPassword should be called in a finally try block [v3]

2022-05-05 Thread Weijun Wang
On Thu, 5 May 2022 06:02:14 GMT, Xue-Lei Andrew Fan wrote: >> Hi, >> >> Could I have the simple update reviewed? >> >> In the PKCS12 key store implementation, the PBEKeySpec.clearPassword() >> should be called in a finally try block. Otherwise, the password cleanup >> could be interrupted

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

2022-05-05 Thread Weijun Wang
On Wed, 4 May 2022 20:32:30 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

Re: RFR: 8255552: Add DES/3DES/MD5 to jdk.security.legacyAlgorithms [v9]

2022-05-04 Thread Weijun Wang
On Wed, 4 May 2022 20:16:12 GMT, Hai-May Chao wrote: >> Please review these changes to add DES/3DES/MD5 to >> `jdk.security.legacyAlgorithms` security property, and to add the legacy >> algorithm constraint checking to `keytool` commands that are associated with >> secret key entries stored

Re: RFR: 8285516: clearPassword should be called in a finally try block [v2]

2022-05-04 Thread Weijun Wang
On Mon, 25 Apr 2022 14:23:17 GMT, Xue-Lei Andrew Fan wrote: >> Hi, >> >> Could I have the simple update reviewed? >> >> In the PKCS12 key store implementation, the PBEKeySpec.clearPassword() >> should be called in a finally try block. Otherwise, the password cleanup >> could be interrupted

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

2022-05-04 Thread Weijun Wang
On Wed, 4 May 2022 03:18:43 GMT, Weijun Wang wrote: >> Mat Carter has updated the pull request incrementally with one additional >> commit since the last revision: >> >> replace string parameter with int and supporting constants > > Also, please remove trailing

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

2022-05-03 Thread Weijun Wang
On Tue, 3 May 2022 22:52:49 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

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

2022-05-03 Thread Weijun Wang
On Tue, 3 May 2022 23:38:38 GMT, Mat Carter wrote: >> Mat Carter has updated the pull request incrementally with one additional >> commit since the last revision: >> >> replace string parameter with int and supporting constants > > I don't use this API much so I don't really have an opinion

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

2022-05-03 Thread Weijun Wang
On Tue, 3 May 2022 22:52:49 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

Integrated: 8286069: keytool prints out wrong key algorithm for -importpass command

2022-05-03 Thread Weijun Wang
On Tue, 3 May 2022 17:51:43 GMT, Weijun Wang wrote: > Since `keytool -importpass` always uses `KeyFactory.getInstance("PBE")` to > generate the secret key, and "PBE" is an alias of "PBEwithMD5andDES" inside > the SunJCE security provider, its `ge

Re: RFR: 8286069: keytool prints out wrong key algorithm for -importpass command [v2]

2022-05-03 Thread Weijun Wang
change modifies it to "PBE". > > Note that I haven't chosen the `-keyalg` option value here because it is > actually the algorithm used to protect the PBE secret key entry. It's a > cipher algorithm instead of a key algorithm. Weijun Wang has updated the pull reques

Re: RFR: 8286069: keytool prints out wrong key algorithm for -importpass command

2022-05-03 Thread Weijun Wang
On Wed, 4 May 2022 01:50:34 GMT, Valerie Peng wrote: >> Since `keytool -importpass` always uses `KeyFactory.getInstance("PBE")` to >> generate the secret key, and "PBE" is an alias of "PBEwithMD5andDES" inside >> the SunJCE security provider, its `getAlgorithm` is always >>

RFR: 8286069: keytool prints out wrong key algorithm for -importpass command

2022-05-03 Thread Weijun Wang
Since `keytool -importpass` always uses `KeyFactory.getInstance("PBE")` to generate the secret key, and "PBE" is an alias of "PBEwithMD5andDES" inside the SunJCE security provider, its `getAlgorithm` is always `PBEwithMD5andDES`. This code change modifies it to "PBE". Note that I haven't

Re: RFR: 8255552: Add DES/3DES/MD5 to jdk.security.legacyAlgorithms [v6]

2022-05-03 Thread Weijun Wang
On Tue, 3 May 2022 14:54:05 GMT, Hai-May Chao wrote: >> Please review these changes to add DES/3DES/MD5 to >> `jdk.security.legacyAlgorithms` security property, and to add the legacy >> algorithm constraint checking to `keytool` commands that are associated with >> secret key entries stored

Re: RFR: 8255552: Add DES/3DES/MD5 to jdk.security.legacyAlgorithms [v6]

2022-05-03 Thread Weijun Wang
On Tue, 3 May 2022 14:54:05 GMT, Hai-May Chao wrote: >> Please review these changes to add DES/3DES/MD5 to >> `jdk.security.legacyAlgorithms` security property, and to add the legacy >> algorithm constraint checking to `keytool` commands that are associated with >> secret key entries stored

Re: RFR: JDK-8284688 Minor cleanup could be done in java.security.jgss [v4]

2022-05-02 Thread Weijun Wang
On Mon, 2 May 2022 22:39:09 GMT, Mark Powers wrote: >> https://bugs.openjdk.java.net/browse/JDK-8284688 >> >> [JDK-8273046](https://bugs.openjdk.java.net/browse/JDK-8273046) is the >> umbrella bug for this bug. The changes were too large for a single code >> review, so it was decided to split

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

2022-05-02 Thread Weijun Wang
On Mon, 2 May 2022 21:14:21 GMT, Valerie Peng wrote: >> Then what does "cannot generate parameter values" mean? Any example? > > An example is RSASSA-PSS, i.e. it requires the caller to explicitly state > which message digest to use, etc. You listed 2 cases when null is returned: 1) not

Integrated: 8286024: PKCS12 keystore shows "DES/CBC" as the algorithm of a DES SecretKeyEntry

2022-05-02 Thread Weijun Wang
On Mon, 2 May 2022 17:41:52 GMT, Weijun Wang wrote: > PKCS12 stores the object identifier of a SecretKey along with it, and when > retrieved, translate the object identifier to an algorithm name. > Unfortunately, inside `KnownOIDs.java`, "DES" is [only registered >

Re: RFR: 8255552: Add DES/3DES/MD5 to jdk.security.legacyAlgorithms [v5]

2022-05-02 Thread Weijun Wang
On Fri, 29 Apr 2022 19:42:27 GMT, Hai-May Chao wrote: >> Please review these changes to add DES/3DES/MD5 to >> `jdk.security.legacyAlgorithms` security property, and to add the legacy >> algorithm constraint checking to `keytool` commands that are associated with >> secret key entries stored

RFR: 8286024: PKCS12 keystore shows "DES/CBC" as the algorithm of a DES SecretKeyEntry

2022-05-02 Thread Weijun Wang
PKCS12 stores the object identifier of a SecretKey along with it, and when retrieved, translate the object identifier to an algorithm name. Unfortunately, inside `KnownOIDs.java`, "DES" is [only registered

Re: RFR: 8255552: Add DES/3DES/MD5 to jdk.security.legacyAlgorithms [v5]

2022-05-02 Thread Weijun Wang
On Fri, 29 Apr 2022 19:42:27 GMT, Hai-May Chao wrote: >> Please review these changes to add DES/3DES/MD5 to >> `jdk.security.legacyAlgorithms` security property, and to add the legacy >> algorithm constraint checking to `keytool` commands that are associated with >> secret key entries stored

Re: RFR: 8284490: Remove finalizer method in java.security.jgss [v13]

2022-05-02 Thread Weijun Wang
On Thu, 28 Apr 2022 18:32:31 GMT, Xue-Lei Andrew Fan wrote: >> Please review the update to remove finalizer method in the >> java.security.jgss module. It is one of the efforts to clean up the use of >> finalizer method in JDK. > > Xue-Lei Andrew Fan has updated the pull request incrementally

Integrated: 8285827: Describe the keystore.pkcs12.legacy system property in the java.security file

2022-05-02 Thread Weijun Wang
On Thu, 28 Apr 2022 14:35:54 GMT, Weijun Wang wrote: > We added a new system property back in > https://bugs.openjdk.java.net/browse/JDK-8153005 but it's better to describe > it in the `java.security` file as well. > > Please review the text. I especially added the l

Re: RFR: 8285743: Ensure each IntegerPolynomial object is only created once [v2]

2022-04-29 Thread Weijun Wang
> All `IntegerPolynimial`s are singletons now. Also, hand-coded implementations > for Ed25519 and Ed448 are removed. They were not used since `FieldGen` starts > generating classes for them. > > No new regression test. This is a clean-up. Weijun Wang has updated the pull reques

RFR: 8285743: Ensure each IntegerPolynomial object is only created once

2022-04-29 Thread Weijun Wang
All `IntegerPolynimial`s are singletons now. Also, hand-coded implementations for Ed25519 and Ed448 are removed. They were not used since `FieldGen` starts generating classes for them. No new regression test. This is a clean-up. - Commit messages: - the fix Changes:

Re: RFR: 8285827: Describe the keystore.pkcs12.legacy system property in the java.security file [v2]

2022-04-29 Thread Weijun Wang
On Fri, 29 Apr 2022 20:47:08 GMT, Sean Mullan wrote: >> The reason I added the last sentence is because this property has no value. >> Someone might think they can set it to false to disable it, but that is >> equivalent to set it to true. > > Ah I see. Maybe put in the previous sentence, ex:

Re: RFR: 8285827: Describe the keystore.pkcs12.legacy system property in the java.security file [v2]

2022-04-29 Thread Weijun Wang
kcs12.legacy=false`. Weijun Wang has updated the pull request incrementally with one additional commit since the last revision: clearer text - Changes: - all: https://git.openjdk.java.net/jdk/pull/8452/files - new: https://git.openjdk.java.net/jdk/pull/8452/files/08700389..8a24c745

Re: RFR: 8285827: Describe the keystore.pkcs12.legacy system property in the java.security file

2022-04-29 Thread Weijun Wang
On Fri, 29 Apr 2022 20:35:14 GMT, Sean Mullan wrote: >> Can we say both? All these properties are only used when creating the file >> (key-related ones when creating the key). If a compatibility issue already >> happens, users need to downgrade their keystore. >> >> So, the full text will be

Re: RFR: 8285827: Describe the keystore.pkcs12.legacy system property in the java.security file

2022-04-29 Thread Weijun Wang
On Fri, 29 Apr 2022 13:17:55 GMT, Sean Mullan wrote: >> How about this? >> >> To work with legacy PKCS #12 tools that does not support the new algorithms, >> the system property "keystore.pkcs12.legacy" can be set >> which will override the properties defined here with old settings. >> This

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

2022-04-28 Thread Weijun Wang
On Thu, 28 Apr 2022 23:22:30 GMT, Valerie Peng wrote: >> I suggest the last sentence to be "null is returned if the required >> parameters were not supplied **or** the underlying signature implementation >> cannot generate the parameter values." I used "or" because for EdDSA >> parameters are

Re: RFR: 8285827: Describe the keystore.pkcs12.legacy system property in the java.security file

2022-04-28 Thread Weijun Wang
On Thu, 28 Apr 2022 19:59:07 GMT, Sean Mullan wrote: >> OpenSSL's help page shows >> >> -legacy Use legacy encryption: 3DES_CBC for keys, RC2_CBC for >> certs >> >> Can we also say "To work with legacy PKCS #12 files"? > > But isn't it mostly an issue when creating new keystores

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

2022-04-28 Thread Weijun Wang
On Thu, 28 Apr 2022 23:08:17 GMT, Valerie Peng wrote: >> So, "the underlying signature implementation supports returning the >> parameters as {@code AlgorithmParameters}" is quite necessary. Xuelei's >> suggestion is quite good, just change the last "and" to "or". > > I assume you were

Re: RFR: 8285827: Describe the keystore.pkcs12.legacy system property in the java.security file

2022-04-28 Thread Weijun Wang
On Thu, 28 Apr 2022 19:48:38 GMT, Sean Mullan wrote: >> We added a new system property back in >> https://bugs.openjdk.java.net/browse/JDK-8153005 but it's better to describe >> it in the `java.security` file as well. >> >> Please review the text. I especially added the last sentence so that

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

2022-04-28 Thread Weijun Wang
On Thu, 28 Apr 2022 19:11:23 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

Re: RFR: 8284490: Remove finalizer method in java.security.jgss [v12]

2022-04-28 Thread Weijun Wang
On Thu, 28 Apr 2022 04:34:36 GMT, Xue-Lei Andrew Fan wrote: >> Please review the update to remove finalizer method in the >> java.security.jgss module. It is one of the efforts to clean up the use of >> finalizer method in JDK. > > Xue-Lei Andrew Fan has updated the pull request incrementally

Re: RFR: 8284490: Remove finalizer method in java.security.jgss [v12]

2022-04-28 Thread Weijun Wang
On Thu, 28 Apr 2022 04:34:36 GMT, Xue-Lei Andrew Fan wrote: >> Please review the update to remove finalizer method in the >> java.security.jgss module. It is one of the efforts to clean up the use of >> finalizer method in JDK. > > Xue-Lei Andrew Fan has updated the pull request incrementally

Re: RFR: 8284490: Remove finalizer method in java.security.jgss [v12]

2022-04-28 Thread Weijun Wang
On Thu, 28 Apr 2022 04:34:36 GMT, Xue-Lei Andrew Fan wrote: >> Please review the update to remove finalizer method in the >> java.security.jgss module. It is one of the efforts to clean up the use of >> finalizer method in JDK. > > Xue-Lei Andrew Fan has updated the pull request incrementally

Re: RFR: 8255552: Add DES/3DES/MD5 to jdk.security.legacyAlgorithms [v2]

2022-04-28 Thread Weijun Wang
On Thu, 28 Apr 2022 06:46:35 GMT, Hai-May Chao wrote: >> Please review these changes to add DES/3DES/MD5 to >> `jdk.security.legacyAlgorithms` security property, and to add the legacy >> algorithm constraint checking to `keytool` commands that are associated with >> secret key entries stored

Re: RFR: JDK-8285504 Minor cleanup could be done in javax.net [v4]

2022-04-28 Thread Weijun Wang
On Thu, 28 Apr 2022 02:33:49 GMT, Mark Powers wrote: >> https://bugs.openjdk.java.net/browse/JDK-8285504 >> >> JDK-8273046 is the umbrella bug for this bug. The changes were too large for >> a single code review, so it was decided to split into smaller chunks. This >> is one such chunk: >>

RFR: 8285827: Describe the keystore.pkcs12.legacy system property in the java.security file

2022-04-28 Thread Weijun Wang
We added a new system property back in https://bugs.openjdk.java.net/browse/JDK-8153005 but it's better to describe it in the `java.security` file as well. Please review the text. I especially added the last sentence so that people won't set `-Dkeystore.pkcs12.legacy=false`. -

  1   2   3   4   5   6   7   8   9   10   >