aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-per.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2012-06-11 13:54:06 +0000
committerPascal Quantin <pascal.quantin@gmail.com>2012-06-11 13:54:06 +0000
commita923c28ede1dd921c324b1e6e65cf91fd3b4ff13 (patch)
tree4c004aa1e94caf0e7b0d427dadaf08d2dd06b7d1 /epan/dissectors/packet-per.c
parent3be09ce9411054c440fac838aa4ff797d98b96c7 (diff)
Use restricted character string decoding for IA5String type
Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6246 svn path=/trunk/; revision=43203
Diffstat (limited to 'epan/dissectors/packet-per.c')
-rw-r--r--epan/dissectors/packet-per.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/epan/dissectors/packet-per.c b/epan/dissectors/packet-per.c
index d7c6c47cae..3bc11b4a7b 100644
--- a/epan/dissectors/packet-per.c
+++ b/epan/dissectors/packet-per.c
@@ -518,17 +518,6 @@ DEBUG_ENTRY("dissect_per_sequence_of");
}
-/* dissect a constrained IA5String that consists of the full ASCII set,
- i.e. no FROM stuff limiting the alphabet
-*/
-guint32
-dissect_per_IA5String(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, gboolean has_extension)
-{
- offset=dissect_per_octet_string(tvb, offset, actx, tree, hf_index, min_len, max_len, has_extension, NULL);
-
- return offset;
-}
-
/* XXX we don't do >64k length strings yet */
static guint32
dissect_per_restricted_character_string_sorted(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, gboolean has_extension _U_,const char *alphabet, int alphabet_length, tvbuff_t **value_tvb)
@@ -656,7 +645,8 @@ DEBUG_ENTRY("dissect_per_restricted_character_string");
/* ALIGNED PER does not do any remapping of chars if
bitsperchar is 8
*/
- if(bits_per_char==8){
+ /* If alphabet is not provided, do not do any remapping either */
+ if((bits_per_char==8) || (alphabet==NULL)){
buf[char_pos]=val;
} else {
if (val < alphabet_length){
@@ -713,6 +703,18 @@ dissect_per_restricted_character_string(tvbuff_t *tvb, guint32 offset, asn1_ctx_
return dissect_per_restricted_character_string_sorted(tvb, offset, actx, tree, hf_index, min_len, max_len, has_extension, alphabet_ptr, alphabet_length, value_tvb);
}
+/* dissect a constrained IA5String that consists of the full ASCII set,
+ i.e. no FROM stuff limiting the alphabet
+*/
+guint32
+dissect_per_IA5String(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, gboolean has_extension)
+{
+ offset=dissect_per_restricted_character_string_sorted(tvb, offset, actx, tree, hf_index, min_len, max_len, has_extension,
+ NULL, 128, NULL);
+
+ return offset;
+}
+
guint32
dissect_per_NumericString(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index, int min_len, int max_len, gboolean has_extension)
{