avoid extraneous error logging on card enumeration
What changed, and why it matters
This commit makes two small logging and error-handling changes in code that talks to smart cards (hardware wallets). It downgrades one routine card-enumeration error from 'error' to 'info' level, and turns a swallowed CBOR parsing error into a thrown exception. There is no indication these changes fix a security vulnerability; they appear to be code-quality or diagnostic-noise improvements.
No security action required. Treat as routine maintenance. If reviewing, verify the new CardException is handled appropriately by callers of CardTransport.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In Hwi.java, a CardException during card enumeration is now logged at info instead of error, reducing log noise. In CardTransport.java, a CborException that was previously swallowed after logging is now re-thrown as a CardException. The latter changes control flow but only surfaces an already-occurring parsing failure; it does not by itself create or fix a security boundary. No memory-safety, cryptographic, authentication, or authorization changes are present.
Changed components
src/main/java/com/sparrowwallet/sparrow/io/Hwi.javasrc/main/java/com/sparrowwallet/sparrow/io/ckcard/CardTransport.javaInspect captured patch +2 / −2
diff --git a/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java b/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java
index c5351f3..75e319f 100644
--- a/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java
+++ b/src/main/java/com/sparrowwallet/sparrow/io/Hwi.java
@@ -93,7 +93,7 @@ public class Hwi {
} catch(CardNotPresentException e) {
//ignore
} catch(CardException e) {
- log.error("Error reading card", e);
+ log.info("Error reading card", e);
}
}
diff --git a/src/main/java/com/sparrowwallet/sparrow/io/ckcard/CardTransport.java b/src/main/java/com/sparrowwallet/sparrow/io/ckcard/CardTransport.java
index 5a6e501..ba747c8 100644
--- a/src/main/java/com/sparrowwallet/sparrow/io/ckcard/CardTransport.java
+++ b/src/main/java/com/sparrowwallet/sparrow/io/ckcard/CardTransport.java
@@ -140,7 +140,7 @@ public class CardTransport {
}
}
} catch(CborException e) {
- log.error("CBOR encoding error", e);
+ throw new CardException("CBOR encoding error", e);
}
return new JsonObject();
Why this scored 11/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.