diff --git a/.github/workflows/robot.yml b/.github/workflows/robot.yml
index 5d55c33..653001e 100644
--- a/.github/workflows/robot.yml
+++ b/.github/workflows/robot.yml
@@ -34,7 +34,7 @@ jobs:
distribution: zulu
cache: maven
- name: Compile and verify
- run: ./mvnw -U -B -T1C verify
+ run: ./mvnw -P exe -U -B -T1C verify
- name: Deploy snapshot
if: (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/next' || github.ref == 'refs/heads/main')
run: ./mvnw -B deploy
@@ -44,7 +44,8 @@ jobs:
uses: softprops/action-gh-release@v2.1.0
with:
files: |
- tool/target/fido.jar
+ tool/target/yafu.jar
+ tool/target/yafu.exe
fail_on_unmatched_files: true
body: Release ${{ github.ref_name }}
prerelease: true # manually promoted
diff --git a/tool/pom.xml b/tool/pom.xml
index 24c108a..6881777 100644
--- a/tool/pom.xml
+++ b/tool/pom.xml
@@ -7,8 +7,8 @@
fido2-toolbox
24.11.23-SNAPSHOT
- fido-tool
- FIDO2/CTAP2 tool
+ yafu
+ FIDO2/CTAP2 tool "YAFU"
true
@@ -61,13 +61,13 @@
maven-shade-plugin
- fido-jar
+ yafu-jar
package
shade
- fido
+ yafu
false
@@ -109,52 +109,65 @@
-
+
+
+ exe
+
+
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+
+
+
+ com.akathist.maven.plugins.launch4j
+ launch4j-maven-plugin
+
+
+ fido-exe
+ package
+
+ launch4j
+
+
+ console
+ target/yafu.exe
+ target/yafu.jar
+ YAFU
+ src/main/resources/yafu.exe.manifest
+
+ pro.javacard.fido2.cli.FIDOTool
+
+
+ FIDO_EXE_WRAPPER=true
+
+
+ 17
+
+
+
+ ${windowsVersion.majorVersion}.${windowsVersion.minorVersion}.${windowsVersion.incrementalVersion}.${windowsVersion.buildNumber}
+
+ ${project.version}
+ YAFU FIDO tool
+ (C) 2021 - 2024 Martin Paljak and contributors (LGPL+MIT)
+
+ ${windowsVersion.majorVersion}.${windowsVersion.minorVersion}.${windowsVersion.incrementalVersion}.${windowsVersion.buildNumber}
+
+ ${project.version}
+ YAFU
+ yafu
+ yafu.exe
+
+
+
+
+
+
+
+
+
diff --git a/tool/src/main/java/pro/javacard/fido2/cli/CommandLineInterface.java b/tool/src/main/java/pro/javacard/fido2/cli/CommandLineInterface.java
index d16eb90..5ec28d0 100644
--- a/tool/src/main/java/pro/javacard/fido2/cli/CommandLineInterface.java
+++ b/tool/src/main/java/pro/javacard/fido2/cli/CommandLineInterface.java
@@ -33,6 +33,7 @@ abstract class CommandLineInterface {
// Registration/authentication
protected static OptionSpec OPT_WINK = parser.acceptsAll(Arrays.asList("W", "wink"), "Wink ;)");
+ protected static OptionSpec OPT_RESET = parser.acceptsAll(Arrays.asList("reset"), "Reset authenticator");
// PIN options
protected static OptionSpec OPT_PIN = parser.acceptsAll(Arrays.asList("p", "pin"), "Use PIN (FIDO2)").withOptionalArg().describedAs("PIN");
diff --git a/tool/src/main/java/pro/javacard/fido2/cli/FIDOTool.java b/tool/src/main/java/pro/javacard/fido2/cli/FIDOTool.java
index 7a67815..a0df00d 100644
--- a/tool/src/main/java/pro/javacard/fido2/cli/FIDOTool.java
+++ b/tool/src/main/java/pro/javacard/fido2/cli/FIDOTool.java
@@ -301,7 +301,8 @@ else if (filtered.size() > 1) {
System.out.println("PIN code set");
exitWith(0);
} else {
- System.err.println("PIN code not set!");
+ System.err.println("PIN code not set! Set it by specifying PIN value or -p");
+ exitWith(1);
}
}
}
@@ -313,7 +314,14 @@ else if (filtered.size() > 1) {
pinToken = PINProtocols.aes256_decrypt(sharedSecret, token.get("pinToken").binaryValue());
}
- if (options.has(OPT_CHANGE_PIN)) {
+ if (options.has(OPT_RESET)) {
+ if (useU2F(transport, options)) {
+ System.err.println("U2F devices can not be reset");
+ exitWith(1);
+ } else {
+ ctap2(ctap2command(CTAP2Enums.Command.authenticatorReset, new byte[0]), transport);
+ }
+ } else if (options.has(OPT_CHANGE_PIN)) {
ctap2(CTAP2Commands.make_changePIN(options.valueOf(OPT_PIN), options.valueOf(OPT_CHANGE_PIN), deviceKey, ephemeral), transport);
} else if (options.has(OPT_LIST_CREDENTIALS)) {
List credentials = CTAP2ProtocolHelpers.listCredentials(deviceInfo, transport, pinToken);
diff --git a/tool/src/main/resources/fido.exe.manifest b/tool/src/main/resources/yafu.exe.manifest
similarity index 100%
rename from tool/src/main/resources/fido.exe.manifest
rename to tool/src/main/resources/yafu.exe.manifest