|
|
b76b7f |
# 8009550, RH910107: PlatformPCSC should load versioned so
|
|
|
b76b7f |
# Author: Andrew Hughes <gnu.andrew@redhat.com>
|
|
|
b76b7f |
# Copyright 2019 Red Hat, Inc.
|
|
|
b76b7f |
|
|
|
b76b7f |
diff --git openjdk.orig///src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java openjdk///src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java
|
|
|
b76b7f |
--- openjdk.orig/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java
|
|
|
b76b7f |
+++ openjdk/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java
|
|
|
b76b7f |
@@ -48,9 +48,13 @@
|
|
|
b76b7f |
|
|
|
b76b7f |
private final static String PROP_NAME = "sun.security.smartcardio.library";
|
|
|
b76b7f |
|
|
|
b76b7f |
- private final static String LIB1 = "/usr/$LIBISA/libpcsclite.so";
|
|
|
b76b7f |
- private final static String LIB2 = "/usr/local/$LIBISA/libpcsclite.so";
|
|
|
b76b7f |
- private final static String PCSC_FRAMEWORK = "/System/Library/Frameworks/PCSC.framework/Versions/Current/PCSC";
|
|
|
b76b7f |
+ private final static String[] SYSTEM_LIBS = {
|
|
|
b76b7f |
+ "/usr/$LIBISA/libpcsclite.so",
|
|
|
b76b7f |
+ "/usr/local/$LIBISA/libpcsclite.so",
|
|
|
b76b7f |
+ "/usr/$LIBISA/libpcsclite.so.1",
|
|
|
b76b7f |
+ "/usr/local/$LIBISA/libpcsclite.so.1",
|
|
|
b76b7f |
+ "/System/Library/Frameworks/PCSC.framework/Versions/Current/PCSC"
|
|
|
b76b7f |
+ };
|
|
|
b76b7f |
|
|
|
b76b7f |
PlatformPCSC() {
|
|
|
b76b7f |
// empty
|
|
|
b76b7f |
@@ -104,20 +108,12 @@
|
|
|
b76b7f |
if (lib.length() != 0) {
|
|
|
b76b7f |
return lib;
|
|
|
b76b7f |
}
|
|
|
b76b7f |
- lib = expand(LIB1);
|
|
|
b76b7f |
- if (new File(lib).isFile()) {
|
|
|
b76b7f |
- // if LIB1 exists, use that
|
|
|
b76b7f |
- return lib;
|
|
|
b76b7f |
- }
|
|
|
b76b7f |
- lib = expand(LIB2);
|
|
|
b76b7f |
- if (new File(lib).isFile()) {
|
|
|
b76b7f |
- // if LIB2 exists, use that
|
|
|
b76b7f |
- return lib;
|
|
|
b76b7f |
- }
|
|
|
b76b7f |
- lib = PCSC_FRAMEWORK;
|
|
|
b76b7f |
- if (new File(lib).isFile()) {
|
|
|
b76b7f |
- // if PCSC.framework exists, use that
|
|
|
b76b7f |
- return lib;
|
|
|
b76b7f |
+ for (String sysLib : SYSTEM_LIBS) {
|
|
|
b76b7f |
+ lib = expand(sysLib);
|
|
|
b76b7f |
+ if (new File(lib).isFile()) {
|
|
|
b76b7f |
+ // if sysLib exists, use that
|
|
|
b76b7f |
+ return lib;
|
|
|
b76b7f |
+ }
|
|
|
b76b7f |
}
|
|
|
b76b7f |
throw new IOException("No PC/SC library found on this system");
|
|
|
b76b7f |
}
|