Invalid allowed characters for VisibleString type #146
Labels
area/types
Related to rasn’s types for ASN.1
help wanted
Extra attention is needed
kind/bug
Something isn't working
Hey,
it seems like VisibleString allows too many characters.
Currently it supports full range of 7-bit ASCII, while it should limit the support for characters specified in ISO International Register of Coded Character Sets, registration 6. + SPACE character. (ITU-T Rec. X.680 (02/2021), Section 41, Table 8.)
Registration number 6. limits the allowed characters into so called ASCII graphics set, which has 94 characters.
Unfortunately these standards are still behind paywalls, but one might find readable version by a little bit of searching.
I might make a PR to fix this. Also the
from_iso646_bytes
function requires relative fix so that type restriction can be applied.Should we also create "new" function for these string types to enforce type restrictions further or is it unnecessary? I would like to trust for the input when defining encoder so that the coming type does not contain disallowed characters
The text was updated successfully, but these errors were encountered: