martinpaljak / GlobalPlatformPro

🌐 🔐 Manage applets and keys on JavaCard-s like a pro
https://javacard.pro/globalplatform
GNU Lesser General Public License v3.0
713 stars 212 forks source link

java.security.NoSuchAlgorithmException on m1 Mac #260

Closed kategray closed 3 years ago

kategray commented 3 years ago

Describe the bug

When running the application on OS X arm64, I get an error NoSuchAlgorithmException. It seems to be related to JNI.

I think this may be the reason:

./com/sun/jna/darwin/libjnidispatch.jnilib: Mach-O universal binary with 3 architectures: [i386:Mach-O dynamically linked shared library i386] [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [ppc_7400:Mach-O dynamically linked shared library ppc_7400]
./com/sun/jna/darwin/libjnidispatch.jnilib (for architecture i386): Mach-O dynamically linked shared library i386
./com/sun/jna/darwin/libjnidispatch.jnilib (for architecture x86_64):   Mach-O 64-bit dynamically linked shared library x86_64
./com/sun/jna/darwin/libjnidispatch.jnilib (for architecture ppc7400):  Mach-O dynamically linked shared library ppc_7400

Error Message

Expected behavior

It should run normally.

M1 mac, Azul OpenJDK 11.

Full log

Re-run your command with -d -v -i switches and:

GlobalPlatformPro v20.01.23-0-g5ad373b
Running on Mac OS X 11.2.2 aarch64, Java 11.0.10 by Azul Systems, Inc.
Exception in thread "main" java.security.NoSuchAlgorithmException: /private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/jna-3506402/jna15151008010714085219.tmp: dlopen(/private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/jna-3506402/jna15151008010714085219.tmp, 1): no suitable image found.  Did find:
    /private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/jna-3506402/jna15151008010714085219.tmp: no matching architecture in universal wrapper
    /private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/jna-3506402/jna15151008010714085219.tmp: no matching architecture in universal wrapper
    at apdu4j.TerminalManager.loadTerminalFactory(TerminalManager.java:144)
    at apdu4j.TerminalManager.getTerminalFactory(TerminalManager.java:174)
    at pro.javacard.gp.GPTool.main(GPTool.java:120)
kategray commented 3 years ago

Tried to correct the issue by adding an architecture to libjnidispatch.jnilib.

First, I downloaded a proper aarch64 jar from here.

https://github.com/java-native-access/jna/blob/master/lib/native/darwin-aarch64.jar

Then I used lipo to create a fat binary with all 4 architectures:

$ lipo -create ./com/sun/jna/darwin/libjnidispatch.jnilib ../aarch-64/libjnidispatch.jnilib -output ../combined/libjnidispatch.jnilib

$ file ../combined/libjnidispatch.jnilib

../combined/libjnidispatch.jnilib: Mach-O universal binary with 4 architectures: [i386:Mach-O dynamically linked shared library i386] [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [ppc_7400:Mach-O dynamically linked shared library ppc_7400] [arm64:Mach-O 64-bit dynamically linked shared library arm64]
../combined/libjnidispatch.jnilib (for architecture i386):  Mach-O dynamically linked shared library i386
../combined/libjnidispatch.jnilib (for architecture x86_64):    Mach-O 64-bit dynamically linked shared library x86_64
../combined/libjnidispatch.jnilib (for architecture ppc7400):   Mach-O dynamically linked shared library ppc_7400
../combined/libjnidispatch.jnilib (for architecture arm64): Mach-O 64-bit dynamically linked shared library arm64

I then replaced the file in the extracted .jar and rebuilt it.

$ jar cmf0 META-INF/MANIFEST.MF ../gp.jar *

$ java -jar ../gp.jar -d -v -i

kate@Kates-MacBook-Air Projects % java -jar gp.jar -d -i -v
GlobalPlatformPro v20.01.23-0-g5ad373b
Running on Mac OS X 11.2.2 aarch64, Java 11.0.10 by Azul Systems, Inc.
Exception in thread "main" java.security.NoSuchAlgorithmException: Can't obtain static method fromNative(Method, Object) from class com.sun.jna.Native
    at apdu4j.TerminalManager.loadTerminalFactory(TerminalManager.java:144)
    at apdu4j.TerminalManager.getTerminalFactory(TerminalManager.java:174)
    at pro.javacard.gp.GPTool.main(GPTool.java:120)
martinpaljak commented 3 years ago

Thanks for the report! My M1 is still waiting for the dummy hdmi plug for headless operation. ETA is "no later than next 10..14 days"

kategray commented 3 years ago

I additionally tried building on the m1 mac, and it's complaining about the lack of bundling of jnasmartcardio.

kate@Kates-MacBook-Air GlobalPlatformPro % git describe --tags
v20.08.12
kate@Kates-MacBook-Air GlobalPlatformPro % git status
On branch test
nothing to commit, working tree clean

kate@Kates-MacBook-Air GlobalPlatformPro % ./mvnw package
[INFO] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-ssh-external/3.4.1/wagon-ssh-external-3.4.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-ssh-external/3.4.1/wagon-ssh-external-3.4.1.pom (4.1 kB at 9.6 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-providers/3.4.1/wagon-providers-3.4.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-providers/3.4.1/wagon-providers-3.4.1.pom (2.8 kB at 47 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon/3.4.1/wagon-3.4.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon/3.4.1/wagon-3.4.1.pom (21 kB at 278 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-ssh-common/3.4.1/wagon-ssh-common-3.4.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-ssh-common/3.4.1/wagon-ssh-common-3.4.1.pom (2.0 kB at 15 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-provider-api/3.4.1/wagon-provider-api-3.4.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-provider-api/3.4.1/wagon-provider-api-3.4.1.pom (1.9 kB at 25 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-ssh-external/3.4.1/wagon-ssh-external-3.4.1.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-provider-api/3.4.1/wagon-provider-api-3.4.1.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-ssh-common/3.4.1/wagon-ssh-common-3.4.1.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-ssh-external/3.4.1/wagon-ssh-external-3.4.1.jar (15 kB at 118 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-provider-api/3.4.1/wagon-provider-api-3.4.1.jar (55 kB at 355 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-ssh-common/3.4.1/wagon-ssh-common-3.4.1.jar (26 kB at 89 kB/s)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] GlobalPlatformPro                                                  [pom]
[INFO] GlobalPlatformPro library                                          [jar]
[INFO] GlobalPlatformPro CLI tool                                         [jar]
[INFO] 
[INFO] -------------------< com.github.martinpaljak:gppro >--------------------
[INFO] Building GlobalPlatformPro 20.08.12                                [1/3]
[INFO] --------------------------------[ pom ]---------------------------------
Downloading from central: https://repo.maven.apache.org/maven2/pl/project13/maven/git-commit-id-plugin/4.0.1/git-commit-id-plugin-4.0.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/pl/project13/maven/git-commit-id-plugin/4.0.1/git-commit-id-plugin-4.0.1.pom (10 kB at 45 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/pl/project13/maven/git-commit-id-plugin-parent/4.0.1/git-commit-id-plugin-parent-4.0.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/pl/project13/maven/git-commit-id-plugin-parent/4.0.1/git-commit-id-plugin-parent-4.0.1.pom (12 kB at 170 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/pl/project13/maven/git-commit-id-plugin/4.0.1/git-commit-id-plugin-4.0.1.jar
Downloaded from central: https://repo.maven.apache.org/maven2/pl/project13/maven/git-commit-id-plugin/4.0.1/git-commit-id-plugin-4.0.1.jar (39 kB at 376 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/io/github/zlika/reproducible-build-maven-plugin/0.12/reproducible-build-maven-plugin-0.12.pom
Downloaded from central: https://repo.maven.apache.org/maven2/io/github/zlika/reproducible-build-maven-plugin/0.12/reproducible-build-maven-plugin-0.12.pom (19 kB at 144 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/io/github/zlika/reproducible-build-maven-plugin/0.12/reproducible-build-maven-plugin-0.12.jar
Downloaded from central: https://repo.maven.apache.org/maven2/io/github/zlika/reproducible-build-maven-plugin/0.12/reproducible-build-maven-plugin-0.12.jar (57 kB at 436 kB/s)
Downloading from javacard-pro: https://javacard.pro/maven/com/github/spotbugs/spotbugs-annotations/4.1.1/spotbugs-annotations-4.1.1.pom
Downloading from central: https://repo.maven.apache.org/maven2/com/github/spotbugs/spotbugs-annotations/4.1.1/spotbugs-annotations-4.1.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/com/github/spotbugs/spotbugs-annotations/4.1.1/spotbugs-annotations-4.1.1.pom (2.8 kB at 29 kB/s)
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-maven) @ gppro ---
[INFO] 
[INFO] --- build-helper-maven-plugin:3.2.0:parse-version (windows-file-version) @ gppro ---
[INFO] 
[INFO] --- git-commit-id-plugin:4.0.1:revision (retrieve-git-info) @ gppro ---
Downloading from central: https://repo.maven.apache.org/maven2/pl/project13/maven/git-commit-id-plugin-core/4.0.1/git-commit-id-plugin-core-4.0.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/pl/project13/maven/git-commit-id-plugin-core/4.0.1/git-commit-id-plugin-core-4.0.1.pom (2.1 kB at 24 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/eclipse/jgit/org.eclipse.jgit/5.2.2.201904231744-r/org.eclipse.jgit-5.2.2.201904231744-r.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/eclipse/jgit/org.eclipse.jgit/5.2.2.201904231744-r/org.eclipse.jgit-5.2.2.201904231744-r.pom (9.3 kB at 133 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/eclipse/jgit/org.eclipse.jgit-parent/5.2.2.201904231744-r/org.eclipse.jgit-parent-5.2.2.201904231744-r.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/eclipse/jgit/org.eclipse.jgit-parent/5.2.2.201904231744-r/org.eclipse.jgit-parent-5.2.2.201904231744-r.pom (33 kB at 512 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/com/jcraft/jsch/0.1.54/jsch-0.1.54.pom
Downloaded from central: https://repo.maven.apache.org/maven2/com/jcraft/jsch/0.1.54/jsch-0.1.54.pom (3.2 kB at 46 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/sonatype/oss/oss-parent/6/oss-parent-6.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/sonatype/oss/oss-parent/6/oss-parent-6.pom (4.8 kB at 83 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/com/jcraft/jzlib/1.1.1/jzlib-1.1.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/com/jcraft/jzlib/1.1.1/jzlib-1.1.1.pom (3.1 kB at 42 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/com/googlecode/javaewah/JavaEWAH/1.1.6/JavaEWAH-1.1.6.pom
Downloaded from central: https://repo.maven.apache.org/maven2/com/googlecode/javaewah/JavaEWAH/1.1.6/JavaEWAH-1.1.6.pom (6.0 kB at 96 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/joda-time/joda-time/2.10.3/joda-time-2.10.3.pom
Downloaded from central: https://repo.maven.apache.org/maven2/joda-time/joda-time/2.10.3/joda-time-2.10.3.pom (37 kB at 597 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.11.1/jackson-databind-2.11.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.11.1/jackson-databind-2.11.1.pom (7.4 kB at 113 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/com/fasterxml/jackson/jackson-base/2.11.1/jackson-base-2.11.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/com/fasterxml/jackson/jackson-base/2.11.1/jackson-base-2.11.1.pom (7.4 kB at 109 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/com/fasterxml/jackson/jackson-bom/2.11.1/jackson-bom-2.11.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/com/fasterxml/jackson/jackson-bom/2.11.1/jackson-bom-2.11.1.pom (13 kB at 205 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/com/fasterxml/jackson/jackson-parent/2.11/jackson-parent-2.11.pom
Downloaded from central: https://repo.maven.apache.org/maven2/com/fasterxml/jackson/jackson-parent/2.11/jackson-parent-2.11.pom (7.8 kB at 131 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/com/fasterxml/oss-parent/38/oss-parent-38.pom
Downloaded from central: https://repo.maven.apache.org/maven2/com/fasterxml/oss-parent/38/oss-parent-38.pom (23 kB at 339 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.11.1/jackson-annotations-2.11.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.11.1/jackson-annotations-2.11.1.pom (3.5 kB at 57 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-core/2.11.1/jackson-core-2.11.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-core/2.11.1/jackson-core-2.11.1.pom (4.9 kB at 65 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/pl/project13/maven/git-commit-id-plugin-core/4.0.1/git-commit-id-plugin-core-4.0.1.jar
Downloading from central: https://repo.maven.apache.org/maven2/com/jcraft/jsch/0.1.54/jsch-0.1.54.jar
Downloading from central: https://repo.maven.apache.org/maven2/com/googlecode/javaewah/JavaEWAH/1.1.6/JavaEWAH-1.1.6.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/eclipse/jgit/org.eclipse.jgit/5.2.2.201904231744-r/org.eclipse.jgit-5.2.2.201904231744-r.jar
Downloading from central: https://repo.maven.apache.org/maven2/com/jcraft/jzlib/1.1.1/jzlib-1.1.1.jar
Downloaded from central: https://repo.maven.apache.org/maven2/pl/project13/maven/git-commit-id-plugin-core/4.0.1/git-commit-id-plugin-core-4.0.1.jar (86 kB at 695 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/joda-time/joda-time/2.10.3/joda-time-2.10.3.jar
Downloaded from central: https://repo.maven.apache.org/maven2/com/jcraft/jsch/0.1.54/jsch-0.1.54.jar (281 kB at 2.0 MB/s)
Downloading from central: https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.11.1/jackson-databind-2.11.1.jar
Downloaded from central: https://repo.maven.apache.org/maven2/com/googlecode/javaewah/JavaEWAH/1.1.6/JavaEWAH-1.1.6.jar (166 kB at 1.1 MB/s)
Downloading from central: https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.11.1/jackson-annotations-2.11.1.jar
Downloaded from central: https://repo.maven.apache.org/maven2/com/jcraft/jzlib/1.1.1/jzlib-1.1.1.jar (70 kB at 282 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-core/2.11.1/jackson-core-2.11.1.jar
Downloaded from central: https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.11.1/jackson-annotations-2.11.1.jar (68 kB at 194 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-core/2.11.1/jackson-core-2.11.1.jar (352 kB at 586 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.11.1/jackson-databind-2.11.1.jar (1.4 MB at 2.1 MB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/joda-time/joda-time/2.10.3/joda-time-2.10.3.jar (643 kB at 940 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/eclipse/jgit/org.eclipse.jgit/5.2.2.201904231744-r/org.eclipse.jgit-5.2.2.201904231744-r.jar (2.7 MB at 2.6 MB/s)
[INFO] 
[INFO] --- reproducible-build-maven-plugin:0.12:strip-jar (strip-jar) @ gppro ---
[INFO] 
[INFO] -------------< com.github.martinpaljak:globalplatformpro >--------------
[INFO] Building GlobalPlatformPro library 20.08.12                        [2/3]
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.12.4/maven-surefire-plugin-2.12.4.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.12.4/maven-surefire-plugin-2.12.4.pom (10 kB at 172 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/2.12.4/surefire-2.12.4.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/2.12.4/surefire-2.12.4.pom (14 kB at 260 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.12.4/maven-surefire-plugin-2.12.4.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.12.4/maven-surefire-plugin-2.12.4.jar (30 kB at 525 kB/s)
Downloading from javacard-pro: https://javacard.pro/maven/org/bouncycastle/bcpkix-jdk15on/1.66/bcpkix-jdk15on-1.66.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/bouncycastle/bcpkix-jdk15on/1.66/bcpkix-jdk15on-1.66.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/bouncycastle/bcpkix-jdk15on/1.66/bcpkix-jdk15on-1.66.pom (1.5 kB at 23 kB/s)
Downloading from javacard-pro: https://javacard.pro/maven/org/bouncycastle/bcprov-jdk15on/1.66/bcprov-jdk15on-1.66.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/bouncycastle/bcprov-jdk15on/1.66/bcprov-jdk15on-1.66.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/bouncycastle/bcprov-jdk15on/1.66/bcprov-jdk15on-1.66.pom (1.1 kB at 8.3 kB/s)
Downloading from javacard-pro: https://javacard.pro/maven/org/bouncycastle/bcpkix-jdk15on/1.66/bcpkix-jdk15on-1.66.jar
Downloading from javacard-pro: https://javacard.pro/maven/org/bouncycastle/bcprov-jdk15on/1.66/bcprov-jdk15on-1.66.jar
Downloading from javacard-pro: https://javacard.pro/maven/com/github/spotbugs/spotbugs-annotations/4.1.1/spotbugs-annotations-4.1.1.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/bouncycastle/bcpkix-jdk15on/1.66/bcpkix-jdk15on-1.66.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/bouncycastle/bcprov-jdk15on/1.66/bcprov-jdk15on-1.66.jar
Downloading from central: https://repo.maven.apache.org/maven2/com/github/spotbugs/spotbugs-annotations/4.1.1/spotbugs-annotations-4.1.1.jar
Downloaded from central: https://repo.maven.apache.org/maven2/com/github/spotbugs/spotbugs-annotations/4.1.1/spotbugs-annotations-4.1.1.jar (15 kB at 140 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/bouncycastle/bcpkix-jdk15on/1.66/bcpkix-jdk15on-1.66.jar (880 kB at 2.6 MB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/bouncycastle/bcprov-jdk15on/1.66/bcprov-jdk15on-1.66.jar (5.9 MB at 3.2 MB/s)
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-maven) @ globalplatformpro ---
[INFO] 
[INFO] --- build-helper-maven-plugin:3.2.0:parse-version (windows-file-version) @ globalplatformpro ---
[INFO] 
[INFO] --- git-commit-id-plugin:4.0.1:revision (retrieve-git-info) @ globalplatformpro ---
[INFO] 
[INFO] --- git-commit-id-plugin:4.0.1:revision (store-git-info) @ globalplatformpro ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ globalplatformpro ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ globalplatformpro ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 21 source files to /Users/kate/Projects/GlobalPlatformPro/library/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ globalplatformpro ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ globalplatformpro ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to /Users/kate/Projects/GlobalPlatformPro/library/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ globalplatformpro ---
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.9/maven-plugin-api-2.0.9.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.9/maven-plugin-api-2.0.9.pom (1.5 kB at 27 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven/2.0.9/maven-2.0.9.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven/2.0.9/maven-2.0.9.pom (19 kB at 305 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/8/maven-parent-8.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/8/maven-parent-8.pom (24 kB at 345 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-booter/2.12.4/surefire-booter-2.12.4.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-booter/2.12.4/surefire-booter-2.12.4.pom (3.0 kB at 50 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-api/2.12.4/surefire-api-2.12.4.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-api/2.12.4/surefire-api-2.12.4.pom (2.5 kB at 37 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/maven-surefire-common/2.12.4/maven-surefire-common-2.12.4.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/maven-surefire-common/2.12.4/maven-surefire-common-2.12.4.pom (5.5 kB at 86 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-annotations/3.1/maven-plugin-annotations-3.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-annotations/3.1/maven-plugin-annotations-3.1.pom (1.6 kB at 24 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-tools/3.1/maven-plugin-tools-3.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-tools/3.1/maven-plugin-tools-3.1.pom (16 kB at 231 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.0.9/maven-artifact-2.0.9.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.0.9/maven-artifact-2.0.9.pom (1.6 kB at 23 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.8/plexus-utils-3.0.8.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.8/plexus-utils-3.0.8.pom (3.1 kB at 42 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/3.2/plexus-3.2.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/3.2/plexus-3.2.pom (19 kB at 247 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-project/2.0.9/maven-project-2.0.9.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-project/2.0.9/maven-project-2.0.9.pom (2.7 kB at 30 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-settings/2.0.9/maven-settings-2.0.9.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-settings/2.0.9/maven-settings-2.0.9.pom (2.1 kB at 17 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-model/2.0.9/maven-model-2.0.9.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-model/2.0.9/maven-model-2.0.9.pom (3.1 kB at 51 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-profile/2.0.9/maven-profile-2.0.9.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-profile/2.0.9/maven-profile-2.0.9.pom (2.0 kB at 17 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact-manager/2.0.9/maven-artifact-manager-2.0.9.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact-manager/2.0.9/maven-artifact-manager-2.0.9.pom (2.7 kB at 40 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-repository-metadata/2.0.9/maven-repository-metadata-2.0.9.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-repository-metadata/2.0.9/maven-repository-metadata-2.0.9.pom (1.9 kB at 28 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-registry/2.0.9/maven-plugin-registry-2.0.9.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-registry/2.0.9/maven-plugin-registry-2.0.9.pom (2.0 kB at 33 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-core/2.0.9/maven-core-2.0.9.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-core/2.0.9/maven-core-2.0.9.pom (7.8 kB at 113 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-parameter-documenter/2.0.9/maven-plugin-parameter-documenter-2.0.9.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-parameter-documenter/2.0.9/maven-plugin-parameter-documenter-2.0.9.pom (2.0 kB at 35 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting-api/2.0.9/maven-reporting-api-2.0.9.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting-api/2.0.9/maven-reporting-api-2.0.9.pom (1.8 kB at 27 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting/2.0.9/maven-reporting-2.0.9.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting/2.0.9/maven-reporting-2.0.9.pom (1.5 kB at 17 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-error-diagnostics/2.0.9/maven-error-diagnostics-2.0.9.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-error-diagnostics/2.0.9/maven-error-diagnostics-2.0.9.pom (1.7 kB at 25 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-descriptor/2.0.9/maven-plugin-descriptor-2.0.9.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-descriptor/2.0.9/maven-plugin-descriptor-2.0.9.pom (2.1 kB at 31 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-monitor/2.0.9/maven-monitor-2.0.9.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-monitor/2.0.9/maven-monitor-2.0.9.pom (1.3 kB at 19 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-toolchain/2.0.9/maven-toolchain-2.0.9.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-toolchain/2.0.9/maven-toolchain-2.0.9.pom (3.5 kB at 56 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.pom (17 kB at 274 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/22/commons-parent-22.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/22/commons-parent-22.pom (42 kB at 511 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-common-artifact-filters/1.3/maven-common-artifact-filters-1.3.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-common-artifact-filters/1.3/maven-common-artifact-filters-1.3.pom (3.7 kB at 51 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-components/12/maven-shared-components-12.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-components/12/maven-shared-components-12.pom (9.3 kB at 144 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/13/maven-parent-13.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/13/maven-parent-13.pom (23 kB at 390 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.9/maven-plugin-api-2.0.9.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-booter/2.12.4/surefire-booter-2.12.4.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-api/2.12.4/surefire-api-2.12.4.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/maven-surefire-common/2.12.4/maven-surefire-common-2.12.4.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.9/maven-plugin-api-2.0.9.jar (13 kB at 165 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-common-artifact-filters/1.3/maven-common-artifact-filters-1.3.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-booter/2.12.4/surefire-booter-2.12.4.jar (35 kB at 343 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.8/plexus-utils-3.0.8.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-api/2.12.4/surefire-api-2.12.4.jar (118 kB at 884 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar (316 kB at 2.4 MB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-project/2.0.9/maven-project-2.0.9.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.0.9/maven-artifact-2.0.9.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/maven-surefire-common/2.12.4/maven-surefire-common-2.12.4.jar (263 kB at 1.6 MB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-settings/2.0.9/maven-settings-2.0.9.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-common-artifact-filters/1.3/maven-common-artifact-filters-1.3.jar (31 kB at 172 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-profile/2.0.9/maven-profile-2.0.9.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.8/plexus-utils-3.0.8.jar (232 kB at 1.1 MB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-model/2.0.9/maven-model-2.0.9.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-project/2.0.9/maven-project-2.0.9.jar (122 kB at 523 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.0.9/maven-artifact-2.0.9.jar (89 kB at 382 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact-manager/2.0.9/maven-artifact-manager-2.0.9.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-registry/2.0.9/maven-plugin-registry-2.0.9.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-profile/2.0.9/maven-profile-2.0.9.jar (35 kB at 145 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-core/2.0.9/maven-core-2.0.9.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-settings/2.0.9/maven-settings-2.0.9.jar (49 kB at 184 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-parameter-documenter/2.0.9/maven-plugin-parameter-documenter-2.0.9.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-model/2.0.9/maven-model-2.0.9.jar (87 kB at 305 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting-api/2.0.9/maven-reporting-api-2.0.9.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact-manager/2.0.9/maven-artifact-manager-2.0.9.jar (58 kB at 181 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-registry/2.0.9/maven-plugin-registry-2.0.9.jar (29 kB at 91 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-error-diagnostics/2.0.9/maven-error-diagnostics-2.0.9.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-repository-metadata/2.0.9/maven-repository-metadata-2.0.9.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-core/2.0.9/maven-core-2.0.9.jar (160 kB at 452 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-parameter-documenter/2.0.9/maven-plugin-parameter-documenter-2.0.9.jar (21 kB at 59 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-monitor/2.0.9/maven-monitor-2.0.9.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-descriptor/2.0.9/maven-plugin-descriptor-2.0.9.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting-api/2.0.9/maven-reporting-api-2.0.9.jar (10 kB at 28 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-toolchain/2.0.9/maven-toolchain-2.0.9.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-error-diagnostics/2.0.9/maven-error-diagnostics-2.0.9.jar (14 kB at 35 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-repository-metadata/2.0.9/maven-repository-metadata-2.0.9.jar (25 kB at 62 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-annotations/3.1/maven-plugin-annotations-3.1.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-monitor/2.0.9/maven-monitor-2.0.9.jar (10 kB at 24 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-descriptor/2.0.9/maven-plugin-descriptor-2.0.9.jar (37 kB at 87 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-toolchain/2.0.9/maven-toolchain-2.0.9.jar (38 kB at 89 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-annotations/3.1/maven-plugin-annotations-3.1.jar (14 kB at 30 kB/s)
[INFO] Surefire report directory: /Users/kate/Projects/GlobalPlatformPro/library/target/surefire-reports
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-testng/2.12.4/surefire-testng-2.12.4.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-testng/2.12.4/surefire-testng-2.12.4.pom (3.6 kB at 72 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-providers/2.12.4/surefire-providers-2.12.4.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-providers/2.12.4/surefire-providers-2.12.4.pom (2.3 kB at 31 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.0/maven-artifact-2.0.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.0/maven-artifact-2.0.pom (723 B at 14 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven/2.0/maven-2.0.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven/2.0/maven-2.0.pom (8.8 kB at 162 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-testng-utils/2.12.4/surefire-testng-utils-2.12.4.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-testng-utils/2.12.4/surefire-testng-utils-2.12.4.pom (3.0 kB at 35 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-grouper/2.12.4/surefire-grouper-2.12.4.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-grouper/2.12.4/surefire-grouper-2.12.4.pom (2.5 kB at 34 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/testng/testng/5.7/testng-5.7.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/testng/testng/5.7/testng-5.7.pom (12 kB at 146 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.pom (2.3 kB at 35 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.pom (680 B at 7.2 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon/1.0-beta-2/wagon-1.0-beta-2.pom (5.9 kB at 77 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/4/maven-parent-4.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/4/maven-parent-4.pom (10.0 kB at 159 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.0.8/maven-artifact-2.0.8.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.0.8/maven-artifact-2.0.8.pom (1.6 kB at 25 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven/2.0.8/maven-2.0.8.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven/2.0.8/maven-2.0.8.pom (12 kB at 183 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/6/maven-parent-6.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/6/maven-parent-6.pom (20 kB at 308 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-model/2.0.8/maven-model-2.0.8.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-model/2.0.8/maven-model-2.0.8.pom (3.1 kB at 51 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-project/2.0.8/maven-project-2.0.8.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-project/2.0.8/maven-project-2.0.8.pom (2.7 kB at 30 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.8/maven-plugin-api-2.0.8.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.8/maven-plugin-api-2.0.8.pom (1.5 kB at 20 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.4.9/plexus-utils-1.4.9.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.4.9/plexus-utils-1.4.9.pom (2.3 kB at 32 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-testng/2.12.4/surefire-testng-2.12.4.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-grouper/2.12.4/surefire-grouper-2.12.4.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.0/maven-artifact-2.0.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-testng-utils/2.12.4/surefire-testng-utils-2.12.4.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-testng/2.12.4/surefire-testng-2.12.4.jar (34 kB at 346 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-testng-utils/2.12.4/surefire-testng-utils-2.12.4.jar (24 kB at 195 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.0/maven-artifact-2.0.jar (79 kB at 646 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire-grouper/2.12.4/surefire-grouper-2.12.4.jar (38 kB at 310 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar (164 kB at 1.3 MB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar (46 kB at 691 kB/s)

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running TestSuite
Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNG652Configurator@5a8806ef
Master: 8C72C72CF908411653018807950D82FBAD947562F0828A0B10B8B9606ABF3BCD
KDD: D9B1DE5D0362DEDCE4FB
ENC: 9AAC5D0B3601F89438A0D9D0B6B256CFB47E6462DFA5228D3420C4AC7C224781
[main] WARN pro.javacard.gp.GPData - Bogus data detected, fixing double tag
Supports SCP02 i=55
Supports SCP03 i=00 i=10 with AES-128 AES-196 AES-256
Supported DOM privileges: SecurityDomain, CardLock, CardTerminate, CardReset, CVMManagement, TrustedPath, AuthorizedManagement, TokenVerification, GlobalDelete, GlobalLock, GlobalRegistry, FinalApplication, ReceiptGeneration
Supported APP privileges: CardLock, CardTerminate, CardReset, CVMManagement, FinalApplication, GlobalService
Supported LFDB hash: SHA-256
Supported Token Verification ciphers: RSA1024_SHA1, ECCP521_SHA512
Supported Receipt Generation ciphers: DES_MAC
Supported DAP Verification ciphers: RSA1024_SHA1, ECCP521_SHA512
Supported ECC Key Parameters: 0102030405
[RSA1024_SHA1, RSAPSS_SHA256, CMAC_AES128, CMAC_AES192, CMAC_AES256]
[SHA-1, SHA-256]
Tag 6: 1.2.840.114283.1
-> Global Platform card
Tag 60: 1.2.840.114283.2.2.1.1
-> GP Version: 2.1.1
Tag 63: 1.2.840.114283.3
Tag 64: 1.2.840.114283.4.2.21
-> GP SCP02 i=15
Tag 65: 1.3.656.840.100.2.1.3
Tag 66: 1.3.6.1.4.1.42.2.110.1.2
-> JavaCard v2
Tag 6: 1.2.840.114283.1
-> Global Platform card
Tag 60: 1.2.840.114283.2.2.2
-> GP Version: 2.2
Tag 63: 1.2.840.114283.3
Tag 64: 1.2.840.114283.4.3.112
-> GP SCP03 i=70
Tag 64: 1.2.840.114283.4.0
-> GP SCP80 i=00
Tag 65: 1.2.840.114283.5.4
Tag 66: 1.3.6.1.4.1.42.2.110.1.3
-> JavaCard v3
ISD: A000000003000000 (OP_READY)
     Parent:   A000000003000000
     From:     D276000005AAFFCAFE0001
     Selected: Contactless(0, 1, 2, 3), Contact(0, 1, 2, 3)
     Privs:    SecurityDomain, CardLock, CardTerminate, CardReset, CVMManagement, TrustedPath, AuthorizedManagement, TokenVerification, GlobalDelete, GlobalLock, GlobalRegistry, FinalApplication, ReceiptGeneration

Supports SCP03 i=00 i=10 i=20 i=30 i=60 i=70 with AES-128 AES-196 AES-256
Supports SCP02 i=15 i=55
Supported DOM privileges: SecurityDomain, DAPVerification, DelegatedManagement, CardLock, CardTerminate, CardReset, CVMManagement, MandatedDAPVerification, TrustedPath, GlobalDelete, GlobalLock, GlobalRegistry, FinalApplication
Supported APP privileges: CardLock, CardTerminate, CardReset, CVMManagement, GlobalDelete, GlobalRegistry, FinalApplication
Supported LFDB hash: SHA-256
Supported Token Verification ciphers: RSA1024_SHA1, RSAPSS_SHA256, DES_MAC, CMAC_AES128, CMAC_AES192, CMAC_AES256, ECCP256_SHA256, ECCP384_SHA384, ECCP521_SHA512
Supported Receipt Generation ciphers: RSA1024_SHA1, RSAPSS_SHA256, DES_MAC, CMAC_AES128, CMAC_AES192, CMAC_AES256, ECCP256_SHA256, ECCP384_SHA384, ECCP521_SHA512
Supported DAP Verification ciphers: RSA1024_SHA1, RSAPSS_SHA256, DES_MAC, CMAC_AES128, CMAC_AES192, CMAC_AES256, ECCP256_SHA256, ECCP384_SHA384, ECCP521_SHA512
[main] WARN pro.javacard.gp.GPKeyInfo - Access and Usage not parsed: 01000100
[main] WARN pro.javacard.gp.GPKeyInfo - Access and Usage not parsed: 01000100
[main] WARN pro.javacard.gp.GPKeyInfo - Access and Usage not parsed: 01000100
[main] WARN pro.javacard.gp.GPKeyInfo - Access and Usage not parsed: 01000100
[main] WARN pro.javacard.gp.GPKeyInfo - Access and Usage not parsed: 01000100
[main] WARN pro.javacard.gp.GPKeyInfo - Access and Usage not parsed: 01000100
[main] WARN pro.javacard.gp.GPKeyInfo - Access and Usage not parsed: 01000100
[main] WARN pro.javacard.gp.GPKeyInfo - Access and Usage not parsed: 01000100
[main] WARN pro.javacard.gp.GPKeyInfo - Unknown elements ignored: [GPKeyInfoElement{key=PRIVATE, keyLength=1, templateLength=4}]
[main] WARN pro.javacard.gp.GPKeyInfo - Access and Usage not parsed: 01000100
[main] WARN pro.javacard.gp.GPKeyInfo - Access and Usage not parsed: 01000100
[main] WARN pro.javacard.gp.GPKeyInfo - Access and Usage not parsed: 01000100
[main] WARN pro.javacard.gp.GPKeyInfo - Unknown elements ignored: [GPKeyInfoElement{key=PRIVATE, keyLength=1, templateLength=4}]
[main] WARN pro.javacard.gp.GPKeyInfo - Access and Usage not parsed: 01000100
[main] WARN pro.javacard.gp.GPKeyInfo - Access and Usage not parsed: 01000100
[main] WARN pro.javacard.gp.GPKeyInfo - Access and Usage not parsed: 01000100
Version:  32 (0x20) ID:   1 (0x01) type: DES3         length:  16
Version:  32 (0x20) ID:   2 (0x02) type: DES3         length:  16
Version:  32 (0x20) ID:   3 (0x03) type: DES3         length:  16
Version:   1 (0x01) ID:   1 (0x01) type: DES3         length:  16
Version:   1 (0x01) ID:   2 (0x02) type: DES3         length:  16
Version:   1 (0x01) ID:   3 (0x03) type: DES3         length:  16
Version:   2 (0x02) ID:   1 (0x01) type: AES          length:  16 (AES-128)
Version:   2 (0x02) ID:   2 (0x02) type: AES          length:  16 (AES-128)
Version:   2 (0x02) ID:   3 (0x03) type: AES          length:  16 (AES-128)
Version:   3 (0x03) ID:   1 (0x01) type: AES          length:  16 (AES-128)
Version:   3 (0x03) ID:   2 (0x02) type: AES          length:  16 (AES-128)
Version:   3 (0x03) ID:   3 (0x03) type: AES          length:  16 (AES-128)
Version:   3 (0x03) ID:  20 (0x14) type: PSK_TLS      length:  16
Version:   3 (0x03) ID:  21 (0x15) type: AES          length:  16 (AES-128)

[main] WARN pro.javacard.gp.GPKeyInfo - Extended key element not starting with 0xFF!
[main] WARN pro.javacard.gp.GPKeyInfo - Access and Usage not parsed: 01840100
Version:   1 (0x01) ID:   1 (0x01) type: DES3         length:  16
Version:   1 (0x01) ID:   2 (0x02) type: DES3         length:  16
Version:   1 (0x01) ID:   3 (0x03) type: DES3         length:  16
Version: 115 (0x73) ID:   1 (0x01) type: RSA_PUB_N    length: 128 (RSA-1024 public, DAP Verification)

Version:   1 (0x01) ID:   1 (0x01) type: AES          length:  32 (AES-256)
Version:   1 (0x01) ID:   2 (0x02) type: AES          length:  32 (AES-256)
Version:   1 (0x01) ID:   3 (0x03) type: AES          length:  32 (AES-256)
Version: 112 (0x70) ID:   1 (0x01) type: RSA_PUB_N    length: 128 (RSA-1024 public, Token Verification)
Version: 113 (0x71) ID:   1 (0x01) type: DES3         length:  16 (Receipt Generation)

Tests run: 16, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.391 sec

Results :

Tests run: 16, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ globalplatformpro ---
[INFO] Building jar: /Users/kate/Projects/GlobalPlatformPro/library/target/globalplatformpro-20.08.12.jar
[INFO] 
[INFO] --- reproducible-build-maven-plugin:0.12:strip-jar (strip-jar) @ globalplatformpro ---
[INFO] Stripping /Users/kate/Projects/GlobalPlatformPro/library/target/globalplatformpro-20.08.13-SNAPSHOT.jar
[INFO] Stripping /Users/kate/Projects/GlobalPlatformPro/library/target/globalplatformpro-20.08.12.jar
[INFO] 
[INFO] -------------------< com.github.martinpaljak:gptool >-------------------
[INFO] Building GlobalPlatformPro CLI tool 20.08.12                       [3/3]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-maven) @ gptool ---
[INFO] 
[INFO] --- build-helper-maven-plugin:3.2.0:parse-version (windows-file-version) @ gptool ---
[INFO] 
[INFO] --- git-commit-id-plugin:4.0.1:revision (retrieve-git-info) @ gptool ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ gptool ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/kate/Projects/GlobalPlatformPro/tool/target/generated-resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ gptool ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to /Users/kate/Projects/GlobalPlatformPro/tool/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ gptool ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/kate/Projects/GlobalPlatformPro/tool/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ gptool ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/kate/Projects/GlobalPlatformPro/tool/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ gptool ---
[INFO] Surefire report directory: /Users/kate/Projects/GlobalPlatformPro/tool/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running pro.javacard.gp.TestPlaintextKeysProvider
Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNG652Configurator@26aa12dd
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.166 sec

Results :

Tests run: 4, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ gptool ---
[INFO] Building jar: /Users/kate/Projects/GlobalPlatformPro/tool/target/gptool-20.08.12.jar
[INFO] 
[INFO] --- reproducible-build-maven-plugin:0.12:strip-jar (strip-jar) @ gptool ---
[INFO] Stripping /Users/kate/Projects/GlobalPlatformPro/tool/target/gptool-20.08.13-SNAPSHOT.jar
[INFO] Stripping /Users/kate/Projects/GlobalPlatformPro/tool/target/gptool-20.08.12.jar
[INFO] Stripping /Users/kate/Projects/GlobalPlatformPro/tool/target/gp.jar
[INFO] 
[INFO] --- maven-shade-plugin:3.2.1:shade (default) @ gptool ---
[INFO] Including com.github.martinpaljak:apdu4j-pcsc:jar:20.08.12 in the shaded jar.
[INFO] Including com.github.martinpaljak:apdu4j-core:jar:2020b1 in the shaded jar.
[INFO] Including com.github.martinpaljak:apdu4j-jnasmartcardio:jar:0.2.7+191107 in the shaded jar.
[INFO] Including net.java.dev.jna:jna:jar:5.5.0 in the shaded jar.
[INFO] Including org.yaml:snakeyaml:jar:1.26 in the shaded jar.
[INFO] Including org.slf4j:slf4j-api:jar:1.7.30 in the shaded jar.
[INFO] Including com.github.martinpaljak:globalplatformpro:jar:20.08.12 in the shaded jar.
[INFO] Including com.github.martinpaljak:capfile:jar:20.08.12 in the shaded jar.
[INFO] Including org.bouncycastle:bcpkix-jdk15on:jar:1.66 in the shaded jar.
[INFO] Including org.bouncycastle:bcprov-jdk15on:jar:1.66 in the shaded jar.
[INFO] Including com.payneteasy:ber-tlv:jar:1.0-11 in the shaded jar.
[INFO] Including org.slf4j:slf4j-simple:jar:1.7.30 in the shaded jar.
[INFO] Including net.sf.jopt-simple:jopt-simple:jar:5.0.4 in the shaded jar.
[INFO] Including com.google.auto.service:auto-service:jar:1.0-rc7 in the shaded jar.
[INFO] Including com.google.auto.service:auto-service-annotations:jar:1.0-rc7 in the shaded jar.
[INFO] Including com.google.auto:auto-common:jar:0.10 in the shaded jar.
[INFO] Including com.google.guava:guava:jar:27.0.1-jre in the shaded jar.
[INFO] Including com.google.guava:failureaccess:jar:1.0.1 in the shaded jar.
[INFO] Including com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava in the shaded jar.
[INFO] Including org.checkerframework:checker-qual:jar:2.5.2 in the shaded jar.
[INFO] Including com.google.errorprone:error_prone_annotations:jar:2.2.0 in the shaded jar.
[INFO] Including com.google.j2objc:j2objc-annotations:jar:1.1 in the shaded jar.
[INFO] Including org.codehaus.mojo:animal-sniffer-annotations:jar:1.17 in the shaded jar.
[INFO] Including com.google.code.findbugs:jsr305:jar:3.0.2 in the shaded jar.
[INFO] Replacing /Users/kate/Projects/GlobalPlatformPro/tool/target/gp.jar with /Users/kate/Projects/GlobalPlatformPro/tool/target/gptool-20.08.12-shaded.jar
[INFO] 
[INFO] --- launch4j-maven-plugin:1.7.25:launch4j (gp-exe) @ gptool ---
[INFO] Platform-specific work directory already exists: /Users/kate/.m2/repository/net/sf/launch4j/launch4j/3.12/launch4j-3.12-workdir-mac
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/Users/kate/.m2/repository/com/thoughtworks/xstream/xstream/1.4.8/xstream-1.4.8.jar) to field java.util.TreeMap.comparator
WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] launch4j: Compiling resources
[INFO] launch4j: Linking
[INFO] launch4j: Wrapping
WARNING: Sign the executable to minimize antivirus false positives or use launching instead of wrapping.
[INFO] launch4j: Successfully created /Users/kate/Projects/GlobalPlatformPro/tool/target/gp.exe
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for GlobalPlatformPro 20.08.12:
[INFO] 
[INFO] GlobalPlatformPro .................................. SUCCESS [  3.949 s]
[INFO] GlobalPlatformPro library .......................... SUCCESS [  9.960 s]
[INFO] GlobalPlatformPro CLI tool ......................... SUCCESS [  2.166 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  17.427 s
[INFO] Finished at: 2021-03-11T01:10:02-06:00
[INFO] ------------------------------------------------------------------------
kate@Kates-MacBook-Air GlobalPlatformPro % java -jar ./tool/target/gp.jar -d -i -v
# 
# gp -d -i -v
Error: jnasmartcardio not bundled
java.lang.IllegalStateException: jnasmartcardio not bundled
    at apdu4j.TerminalManager.getTerminalFactory(TerminalManager.java:120)
    at pro.javacard.gp.GPTool.main(GPTool.java:96)
kategray commented 3 years ago

Thanks for the report! My M1 is still waiting for the dummy hdmi plug for headless operation...

I can throw up one of them with remote desktop if you'd like to do any testing.

kategray commented 3 years ago

Also, I believe that you just need a keyboard for the mac mini headless. It will display in 1080 over remote desktop, instead of other resolutions, but it looks like it works.

https://discussions.apple.com/thread/252079747

martinpaljak commented 3 years ago

For using from CLI, there's also a workaround that I should document, let me try to verify that on M1 before writing it down.

martinpaljak commented 3 years ago

Also, I believe that you just need a keyboard for the mac mini headless. It will display in 1080 over remote desktop, instead of other resolutions, but it looks like it works.

https://discussions.apple.com/thread/252079747

Did not work for me at least. Ordered a few HDMI dummy plugs from Ali that should be already near me, but cheap shipping + covid == undefined.

kategray commented 3 years ago

I can ship you a dummy plug or two if you would like.

martinpaljak commented 3 years ago

Question: does pcsctest work for you from command line? I'm a bit amazed as some other software worked with smart cards without issues via rosetta, but for me pcsctest always hangs after listing readers (no events reported) and thus expectedly also java

$ pcsctest 

MUSCLE PC/SC Lite Test Program

Testing SCardEstablishContext    : Command successful.
Testing SCardGetStatusChange 
Please insert a working reader   : Command successful.
Testing SCardListReaders         : Command successful.
Reader 01: ACS ACR1252 Dual Reader
Enter the reader number          : 1
Waiting for card insertion         
martinpaljak commented 3 years ago

Took some time to figure it out. When connected to a headless m1 via SSH, it is only possible to list readers but not to connect to them. Once logged on via screen sharing - things will start to work both on existing SSH session as well as screenshare session (where there are no issues observed). If this reverts back after 10 minutes of inactivity (a beeping reader helped), after what it will require an active screenshare session to work again.

Via SSH:

$ java -jar apdu4j.jar -ldv
# Using JNA2PCSC version 0.2
SCardConnect("ACS ACR1252 Dual Reader", DIRECT) -> DIRECT
SCardControl("ACS ACR1252 Dual Reader", 0x42000D48, null)-> SCARD_E_NOT_TRANSACTED
SCardConnect("Gemalto Ezio Shield", DIRECT) -> DIRECT
SCardControl("Gemalto Ezio Shield", 0x42000D48, null)-> SCARD_E_NOT_TRANSACTED
1: [ ] [EEE] ACS ACR1252 Dual Reader
2: [ ] [EEE] Gemalto Ezio Shield

After screenshare opened:

$ java -jar apdu4j.jar -ldv
# Using JNA2PCSC version 0.2
SCardConnect("ACS ACR1252 Dual Reader", T=*) -> T=1, 3B8E800180318066B1840C016E01830090001C
SCardControl("ACS ACR1252 Dual Reader", 0x42000D48, null) -> 120442330012
SCardControl("ACS ACR1252 Dual Reader", 0x42330012, null) -> 010200000301000901000B022F070C023B220A0400000100
SCardConnect("Gemalto Ezio Shield", DIRECT) -> DIRECT
SCardControl("Gemalto Ezio Shield", 0x42000D48, null) -> 0604423300060704423300070A044233000A120442330012
SCardControl("Gemalto Ezio Shield", 0x4233000A, null) -> 11020200
SCardControl("Gemalto Ezio Shield", 0x42330012, null) -> 010211020402110005020200030100081047656D437830302D56352E30332E303006010407010C0201020901000B02E6080C02C2340A0400000100
# ATR info from /Users/martin/.smartcard_list.txt
1: [*] [   ] ACS ACR1252 Dual Reader
             3B8E800180318066B1840C016E01830090001C
             - Gemalto Santander Optelio TUI R7 using Contactless interface
2: [ ] [VMD] Gemalto Ezio Shield

This is with both # Running on Mac OS X 11.2.3 aarch64, Java 11.0.10 by Azul Systems, Inc. as well as Mac OS X 10.16 x86_64, Java 11.0.10 by AdoptOpenJDK (which seems to be misleading os.version)

kategray commented 3 years ago

What does a process list show before and after? It sounds like tokend or the new framework has a service set to startup conditionally.

kategray commented 3 years ago

I haven't checked if dtruss is broken on the m1 with integrity protection disabled, but I can try to replicate tonight and figure out what's hanging or being started.

kategray commented 3 years ago

Question: does pcsctest work for you from command line? I'm a bit amazed as some other software worked with smart cards without issues via rosetta, but for me pcsctest always hangs after listing readers (no events reported) and thus expectedly also java

Random yubikey.


MUSCLE PC/SC Lite Test Program

Testing SCardEstablishContext    : Command successful.
Testing SCardGetStatusChange 
Please insert a working reader   : Command successful.
Testing SCardListReaders         : Command successful.
Reader 01: Yubico YubiKey OTP+FIDO+CCID
Enter the reader number          : 01
Waiting for card insertion         
                                 : Command successful.
Testing SCardConnect             : Command successful.
Testing SCardStatus              : Command successful.
Current Reader Name              : Yubico YubiKey OTP+FIDO+CCID
Current Reader State             : 0x54
Current Reader Protocol          : 0x1
Current Reader ATR Size          : 23 (0x17)
Current Reader ATR Value         : 3B FD 13 00 00 81 31 FE 15 80 73 C0 21 C0 57 59 75 62 69 4B 65 79 40 
Testing SCardDisconnect          : Command successful.
Testing SCardReleaseContext      : Command successful.
Testing SCardEstablishContext    : Command successful.
Testing SCardGetStatusChange 
Please insert a working reader   : Command successful.
Testing SCardListReaders         : Command successful.
kategray commented 3 years ago

It looks like running the command starts up /System/Library/Frameworks/PCSC.framework/Versions/A/XPCServices/com.apple.ctkpcscd.xpc/Contents/MacOS/com.apple.ctkpcscd

On your headless mac, is that process running when running pcsctest?

kategray commented 3 years ago

It looks like the library /System/Library/Frameworks/PCSC.framework is using XPC services to sandbox pcsc.

https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingXPCServices.html

"XPC services are managed by launchd, which launches them on demand, restarts them if they crash, and terminates them (by sending SIGKILL) when they are idle. This is transparent to the application using the service, except for the case of a service that crashes while processing a message that requires a response. In that case, the application can see that its XPC connection has become invalid until the service is restarted by launchd. Because an XPC service can be terminated suddenly at any time, it must be designed to hold on to minimal state—ideally, your service should be completely stateless, although this is not always possible.

By default, XPC services are run in the most restricted environment possible—sandboxed with minimal filesystem access, network access, and so on. Elevating a service’s privileges to root is not supported. Further, an XPC service is private, and is available only to the main application that contains it."

I'm guessing that there's something that's breaking the launchd launch of the service when headless.

martinpaljak commented 3 years ago

Thanks for diggin, indeed it seems to be the case. Weird architecture, I would assume that if I can list readers via pcsc one could also connect to a reader. Will need to think how to document this to avoid time consuming head scratching.

kategray commented 3 years ago

System integrity protection is making this impossible to dtrace. If I remove the signature, the XPC mechanism breaks down, and if I don't, SIP stops dtracing it even if I've disabled SIP's dtrace limits.

My current guess is that you're running into a security model issue, with something requiring a key that's unlocked with interactive login but not SSH. This may not be fixable.

kategray commented 3 years ago

Can you try enabling automatic login and seeing if it helps?

kategray commented 3 years ago

I was able to get gp pro running under Rosetta, but it was a bit of a pain.

First, I set up a dual homebrew setup (x86_64 and arm64). With a little bit of work, I was able to switch back and forth between the platforms fairly easily.

https://gist.github.com/kategray/7fa464098da16ac42c7b4fe129f79202

After that, it took a brew install openjdk@11 in an intel shell to get an x86_64 JVM running. I can then launch gp with arch -x86_64 /usr/local/opt/openjdk@11/bin/java -jar ~/Downloads/gp.jar.

This would be expected to work, as the x86_64 native libraries were there, but it's worth documenting somewhere in case someone needs a workaround.

martinpaljak commented 3 years ago

Smoothly working release is ~1..7 days away

kategray commented 3 years ago

The easy workaround would be to install AWS Coretto using https://corretto.aws/downloads/latest/amazon-corretto-11-x64-macos-jdk.pkg .

Add something like this to your .zshrc:

alias ijava="/Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home/bin/java"

It also works as expected:

kate@Kates-MacBook-Air Downloads % ijava -jar gp.jar --info
GlobalPlatformPro v20.01.23-0-g5ad373b
Running on Mac OS X 10.16 x86_64, Java 11.0.10 by Amazon.com Inc.
Reader: SCM Microsystems Inc. SCR 3310
ATR: 3BDC18FF8191FE1FC38073C821136605036351000250
More information about your card:
    http://smartcard-atr.appspot.com/parse?ATR=3BDC18FF8191FE1FC38073C821136605036351000250

[WARN] GPData - Invalid CPLC date: 4753
CPLC: ICFabricator=4790
      ICType=0503
      OperatingSystemID=8211
      OperatingSystemReleaseDate=6351 (2016-12-16)
      OperatingSystemReleaseLevel=0302
      ICFabricationDate=9012 (2019-01-12)
      ICSerialNumber=00268407
      ICBatchIdentifier=4720
      ICModuleFabricator=4E30
      ICModulePackagingDate=5039 (2015-02-08)
      ICCManufacturer=3032
      ICEmbeddingDate=4753 (invalid date format)
      ICPrePersonalizer=5731
      ICPrePersonalizationEquipmentDate=3030 (2013-01-30)
      ICPrePersonalizationEquipmentID=32363834
      ICPersonalizer=0E00
      ICPersonalizationDate=0123 (2010-05-03)
      ICPersonalizationEquipmentID=E0EF1160

IIN: 420100
CIN: 45080000000000000000
Card Data: 
Tag 6: 1.2.840.114283.1
-> Global Platform card
Tag 60: 1.2.840.114283.2.2.1.1
-> GP Version: 2.1.1
Tag 63: 1.2.840.114283.3
Tag 64: 1.2.840.114283.4.2.85
-> GP SCP02 i=55
Tag 66: 1.3.6.1.4.1.42.2.110.1.2
-> JavaCard v2
Card Capabilities: 
[WARN] GPData - Bogus data detected, fixing double tag
Supports: SCP02 i=55
Supports: SCP03 i=00 i=10 with AES-128 AES-196 AES-256
Supported DOM privileges: SecurityDomain, CardLock, CardTerminate, CardReset, CVMManagement, TrustedPath, AuthorizedManagement, TokenVerification, GlobalDelete, GlobalLock, GlobalRegistry, FinalApplication, ReceiptGeneration
Supported APP privileges: CardLock, CardTerminate, CardReset, CVMManagement, FinalApplication, GlobalService
Supported LFDB hash: 02
Supported Token Verification ciphers: 01020840
Supported Receipt Generation ciphers: 0408
Supported DAP Verification ciphers: 01020840
Supported ECC Key Parameters: 0102030405
Version: 255 (0xFF) ID:   1 (0x01) type: DES3 length:  16 
Version: 255 (0xFF) ID:   2 (0x02) type: DES3 length:  16 
Version: 255 (0xFF) ID:   3 (0x03) type: DES3 length:  16 
Key version suggests factory keys
kategray commented 3 years ago

Smoothly working release is ~1..7 days away

Neat. Thank you.

I use gp pro a lot, and only have an m1 mac, so I figured I'd document some workarounds in case anyone else has the same problems.