From ec0e217b0647eb798576a7d3366b39c159c00624 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 20 Jul 2010 00:03:44 +0200 Subject: Update to asn1c official repository svn trunk r1409 --- src/VisibleString.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/VisibleString.c') diff --git a/src/VisibleString.c b/src/VisibleString.c index 8796582..3487b6f 100644 --- a/src/VisibleString.c +++ b/src/VisibleString.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2003 Lev Walkin . All rights reserved. + * Copyright (c) 2003, 2006 Lev Walkin . All rights reserved. * Redistribution and modifications are permitted subject to BSD license. */ #include @@ -12,6 +12,11 @@ static ber_tlv_tag_t asn_DEF_VisibleString_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), /* [UNIVERSAL 26] IMPLICIT ...*/ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ }; +static asn_per_constraints_t asn_DEF_VisibleString_constraints = { + { APC_CONSTRAINED, 7, 7, 0x20, 0x7e }, /* Value */ + { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, /* Size */ + 0, 0 +}; asn_TYPE_descriptor_t asn_DEF_VisibleString = { "VisibleString", "VisibleString", @@ -22,7 +27,8 @@ asn_TYPE_descriptor_t asn_DEF_VisibleString = { OCTET_STRING_encode_der, OCTET_STRING_decode_xer_utf8, OCTET_STRING_encode_xer_utf8, - 0, 0, + OCTET_STRING_decode_uper, + OCTET_STRING_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_VisibleString_tags, sizeof(asn_DEF_VisibleString_tags) @@ -30,7 +36,7 @@ asn_TYPE_descriptor_t asn_DEF_VisibleString = { asn_DEF_VisibleString_tags, sizeof(asn_DEF_VisibleString_tags) / sizeof(asn_DEF_VisibleString_tags[0]), - 0, /* No PER visible constraints */ + &asn_DEF_VisibleString_constraints, 0, 0, /* No members */ 0 /* No specifics */ }; @@ -52,7 +58,7 @@ VisibleString_constraint(asn_TYPE_descriptor_t *td, const void *sptr, */ for(; buf < end; buf++) { if(*buf < 0x20 || *buf > 0x7e) { - _ASN_CTFAIL(app_key, td, + _ASN_CTFAIL(app_key, td, sptr, "%s: value byte %ld (%d) " "not in VisibleString alphabet (%s:%d)", td->name, @@ -63,7 +69,7 @@ VisibleString_constraint(asn_TYPE_descriptor_t *td, const void *sptr, } } } else { - _ASN_CTFAIL(app_key, td, + _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; -- cgit v1.2.3