8305336: java.security.debug=sunpkcs11 breaks PKCS#11 configuration with slotListIndex

Reviewed-by: mpowers, weijun
This commit is contained in:
Valerie Peng 2023-04-17 04:47:40 +00:00
parent caa841d9a5
commit e575924131

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2023, 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
@ -363,8 +363,8 @@ public final class SunPKCS11 extends AuthProvider {
long[] slots = p11.C_GetSlotList(false);
if (showInfo) {
System.out.println("All slots: " + toString(slots));
slots = p11.C_GetSlotList(true);
System.out.println("Slots with tokens: " + toString(slots));
System.out.println("Slots with tokens: " +
toString(p11.C_GetSlotList(true)));
}
if (slotID < 0) {
if ((slotListIndex < 0)