From 731668e87a50fbb876625bcf4baeea28bcabcc7f Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sun, 31 May 2026 14:58:45 +0200 Subject: [PATCH] Set initial signature counter to 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Returning the signature counter 0 would indicate that we don’t support signature counters or that a counter error occured. --- CHANGELOG.md | 3 ++- src/state.rs | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae12709..56eb092 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased -- +- Fix signature counter to improve spec compliance: + - Set the initial signature counter to 1. ## [v0.4.0-rc.1](https://github.com/trussed-dev/fido-authenticator/releases/tag/v0.4.0-rc.1) (2026-05-29) diff --git a/src/state.rs b/src/state.rs index 2de732b..a10a7ef 100644 --- a/src/state.rs +++ b/src/state.rs @@ -320,7 +320,9 @@ impl PersistentState { consecutive_pin_mismatches: 0, pin_hash: None, pin_code_point_length: 0, - timestamp: 0, + // Setting the signature counter to zero indicates that it is not supported or that a + // counter error occured, so we have to initialize it with a non-zero value. + timestamp: 1, min_pin_length: 0, min_pin_length_rp_ids: Vec::new(), force_pin_change: false,