Commit 69353a32 authored by Lev Walkin's avatar Lev Walkin

test that we ignore size constraints on not-known-multipler character string (utf8string)

parent 1d76f3c4
...@@ -19,14 +19,15 @@ int main() { ...@@ -19,14 +19,15 @@ int main() {
memset(&source, 0, sizeof(source)); memset(&source, 0, sizeof(source));
OCTET_STRING_fromBuf(&source.unconstrained.ia5, "foo", 3); OCTET_STRING_fromBuf(&source.unconstrained.unc_ia5, "foo", 3);
OCTET_STRING_fromBuf(&source.unconstrained.utf8, "bar", 3); OCTET_STRING_fromBuf(&source.unconstrained.unc_utf8, "bar-whatever", 12);
OCTET_STRING_fromBuf(&source.unconstrained.universal, OCTET_STRING_fromBuf(&source.unconstrained.unc_universal,
"\0\0\0b\0\0\0a\0\0\0z", 12); "\0\0\0b\0\0\0a\0\0\0z", 12);
OCTET_STRING_fromBuf(&source.constrained.ia5, "ab", 2); OCTET_STRING_fromBuf(&source.constrained.con_ia5, "ab", 2);
OCTET_STRING_fromBuf(&source.constrained.utf8, "cd", 2); OCTET_STRING_fromBuf(&source.constrained.con_utf8, "cd-whatever", 11);
OCTET_STRING_fromBuf(&source.constrained.universal, "\0\0\0e\0\0\0f", 8); OCTET_STRING_fromBuf(&source.constrained.con_universal, "\0\0\0e\0\0\0f",
8);
asn_enc_rval_t er = asn_enc_rval_t er =
oer_encode_to_buffer(&asn_DEF_T, 0, &source, tmpbuf, sizeof(tmpbuf)); oer_encode_to_buffer(&asn_DEF_T, 0, &source, tmpbuf, sizeof(tmpbuf));
......
This diff is collapsed.
...@@ -13,14 +13,14 @@ BEGIN ...@@ -13,14 +13,14 @@ BEGIN
T ::= SEQUENCE { T ::= SEQUENCE {
unconstrained SEQUENCE { unconstrained SEQUENCE {
ia5 IA5String, unc-ia5 IA5String,
utf8 UTF8String, unc-utf8 UTF8String,
universal UniversalString unc-universal UniversalString
}, },
constrained SEQUENCE { constrained SEQUENCE {
ia5 IA5String (SIZE(2..2)), con-ia5 IA5String (SIZE(2..2)),
utf8 UTF8String (SIZE(2)), con-utf8 UTF8String (SIZE(2)),
universal UniversalString (SIZE(2 | 2)) con-universal UniversalString (SIZE(2 | 2))
} }
} }
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment