Fix VisibleString character set to follow X.680 ISO/IEC 646 definition#192
Merged
6d7a merged 2 commits intolibrasn:mainfrom Jan 19, 2026
Merged
Fix VisibleString character set to follow X.680 ISO/IEC 646 definition#1926d7a merged 2 commits intolibrasn:mainfrom
6d7a merged 2 commits intolibrasn:mainfrom
Conversation
Contributor
Author
|
I post the test result. test asn fileTestVisibleStringConstraint DEFINITIONS ::= BEGIN
T ::= VisibleString
(FROM ("a".."z" | "A".."Z" | "0".."9" | ":./-_@"))
(SIZE (1..255))
ENDbefore revisionWarnings:
Unidentified generating bindings for : Character _ is not in char set: {0: 'A', 1: 'B', 2: 'C', 3: 'D', 4: 'E', 5: 'F', 6: 'G', 7: 'H', 8: 'I', 9: 'J', 10: 'K', 11: 'L', 12: 'M', 13: 'N', 14: 'O', 15: 'P', 16: 'Q', 17: 'R', 18: 'S', 19: 'T', 20: 'U', 21: 'V', 22: 'W', 23: 'X', 24: 'Y', 25: 'Z', 26: 'a', 27: 'b', 28: 'c', 29: 'd', 30: 'e', 31: 'f', 32: 'g', 33: 'h', 34: 'i', 35: 'j', 36: 'k', 37: 'l', 38: 'm', 39: 'n', 40: 'o', 41: 'p', 42: 'q', 43: 'r', 44: 's', 45: 't', 46: 'u', 47: 'v', 48: 'w', 49: 'x', 50: 'y', 51: 'z', 52: '0', 53: '1', 54: '2', 55: '3', 56: '4', 57: '5', 58: '6', 59: '7', 60: '8', 61: '9', 62: ' ', 63: '\'', 64: '(', 65: ')', 66: '+', 67: ',', 68: '-', 69: '.', 70: '/', 71: ':', 72: '=', 73: '?'}
Generated:
#[allow(
non_camel_case_types,
non_snake_case,
non_upper_case_globals,
unused,
clippy::too_many_arguments
)]
pub mod test_visible_string_constraint {
extern crate alloc;
use core::borrow::Borrow;
use rasn::prelude::*;
use std::sync::LazyLock;
}after revisionGenerated:
#[allow(
non_camel_case_types,
non_snake_case,
non_upper_case_globals,
unused,
clippy::too_many_arguments
)]
pub mod test_visible_string_constraint {
extern crate alloc;
use core::borrow::Borrow;
use rasn::prelude::*;
use std::sync::LazyLock;
#[doc = " Minimal reproduction for permitted alphabet + size constraints on VisibleString"]
#[derive(AsnType, Debug, Clone, Decode, Encode, PartialEq, Eq, Hash)]
#[rasn(
delegate,
size("1..=255"),
from(
"\u{2d}",
"\u{2e}",
"\u{2f}",
"\u{30}..=\u{39}",
"\u{3a}",
"\u{40}",
"\u{41}..=\u{5a}",
"\u{5f}",
"\u{61}..=\u{7a}"
)
)]
pub struct T(pub VisibleString);
} |
52854d9 to
de25de9
Compare
6d7a
approved these changes
Jan 19, 2026
Member
6d7a
left a comment
There was a problem hiding this comment.
Thank you for your contribution!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #191
This PR fixes an incorrect conflation of VisibleString and PrintableString during
character-set validation.
VisibleString was previously validated against the PrintableString character
repertoire, which contradicts the VisibleString definition in X.680 and causes
valid VisibleString characters to be rejected when evaluating permitted-alphabet
constraints.
Changes
Result