On Thu, 3 Aug 2023 17:09:33 GMT, Rajan Halade <rhal...@openjdk.org> wrote:
>> test/jdk/sun/security/pkcs11/PKCS11Test.java line 277: >> >>> 275: Provider[] providers = Security.getProviders(); >>> 276: for (Provider p : providers) { >>> 277: if (p.getName().startsWith("SunPKCS11-")) { >> >> Please correct me, if i am wrong. But as per my understanding there can be >> many PKCS11 provider instance exist in same time based on different token >> configuration and the order can be different too. They all have name >> similarity which starts with "SunPKCS11-" followed by a vendor specific >> name. In that case specifying the default PKCS11 provider name could be >> better which is 'p.getName().equals("SunPKCS11")'. Also the loop should >> break immediately after finding the default provider. > > As is currently, test is run for all found providers. I am avoiding to update > existing test logic with this change. I will consider this update while > working on [JDK-8313575](https://bugs.openjdk.org/browse/JDK-8313575). More > TBD "SunPKCS11-" is wrong as default provider name itself. Because the default provider name is "SunPKCS11". Here 'default' as i understand the provider comes from JDK implementation. Someone may correct me here. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15125#discussion_r1283582326