Skip to content

Fido: accept lowercase hybrid QR URI scheme#3636

Open
Jadeiin wants to merge 1 commit into
microg:masterfrom
Jadeiin:fix-hybrid-lowercase-fido-uri
Open

Fido: accept lowercase hybrid QR URI scheme#3636
Jadeiin wants to merge 1 commit into
microg:masterfrom
Jadeiin:fix-hybrid-lowercase-fido-uri

Conversation

@Jadeiin

@Jadeiin Jadeiin commented Jul 13, 2026

Copy link
Copy Markdown

Summary

Accept hybrid QR URI schemes case-insensitively in QrCodeData.parse().

HybridAuthenticateActivity currently accepts the FIDO:/ prefix with ignoreCase = true, but QrCodeData.parse() extracts the payload using the case-sensitive expression:

data.substringAfter(PREFIX_FIDO, "")

Android delivered a valid hybrid registration URI using a lowercase scheme:

fido:/...

The activity accepted the URI, but the parser failed to find the uppercase FIDO:/ prefix, decoded an empty payload, and returned null.

Fix

Validate the prefix case-insensitively and remove it by length:

if (!data.startsWith(PREFIX_FIDO, ignoreCase = true)) return null
val encoded = data.substring(PREFIX_FIDO.length)

This keeps the encoded payload unchanged while accepting valid casing variations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants