Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion keep-nip46/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,12 @@ impl Nip46Client {
}
let decode_result = hex::decode(hex_str.trim());
hex_str.zeroize();
// Malformed hex (odd length, non-hex chars) is an untrusted-input
// validation failure, same class as the too-long / wrong-length
// checks around it; surface it as InvalidInput so callers can
// handle all three consistently, not as a StorageErr.
let decoded = decode_result.map_err(|e| {
StorageError::invalid_format(format!("register_wallet hmac hex: {e}"))
KeepError::InvalidInput(format!("register_wallet hmac hex: {e}"))
})?;
if decoded.len() != HMAC_SHA256_LEN {
return Err(KeepError::InvalidInput(format!(
Expand Down