-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
@sosthene-nitrokey in Nitrokey#62 (comment):
Minor issue of spec compliance:
Minimum PIN Length: 4 code points.
In
decrypt_pin_check_lengthwe check 4 bytes, not 4 code points. The max is still 63 bytes, so the check should be:let pin_length = pin.iter().position(|&b| b == b'\0').unwrap_or(pin.len()); let pin_data = &pin[..pin_length]; let pin_utf8 = core::str::from_utf8(pin_data)?; let pin_len_codepoints = pin_utf8.chars().count(); if pin_len_codepoints < 4 || pin_length > 63{ return Err(Error::PinPolicyViolation); }
Transferred from Nitrokey#64
Metadata
Metadata
Assignees
Labels
No labels