aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-p1.c
diff options
context:
space:
mode:
authorAndre Luyer <andre@luyer.nl>2019-12-27 17:45:06 +0100
committerPascal Quantin <pascal@wireshark.org>2020-01-11 18:36:35 +0000
commitdbfb204f487097032d83de318c26cacd185a9d4e (patch)
treeae59f35a9d744598a67915b2bf20a59acbc28064 /epan/dissectors/packet-p1.c
parent3f17a8948fbbe7b6e2767ae9c53e503706952a70 (diff)
ber: display x509af.utcTime year in 4 digits
Because: - the 2-digit year can only be in the range 1950..2049 according to https://tools.ietf.org/html/rfc5280#section-4.1.2.5.1 - to avoid confusion, interpreting the year/month/day in a different order may still represent a valid date. - now both utcTime and GeneralizedTime are displayed in exactly the same way. - some tools, like Perl, apply a different date range when converting 2-digit years. In packet-ber.c two parameters are added to the function dissect_ber_UTCTime: datestrptr: if not NULL return datetime string instead of adding to tree or NULL when packet is malformed tvblen: if not NULL return consumed packet bytes Also the memory allocation for outstr is now done using the recommended method as described in the README.developer document. The calling function in x509af/x509sat uses this to prepend the century. Added generated files. Change-Id: I714c2e8e7f899211caaa1f4136ca0d27cb1aba4a Reviewed-on: https://code.wireshark.org/review/35414 Petri-Dish: Pascal Quantin <pascal@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Pascal Quantin <pascal@wireshark.org>
Diffstat (limited to 'epan/dissectors/packet-p1.c')
-rw-r--r--epan/dissectors/packet-p1.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dissectors/packet-p1.c b/epan/dissectors/packet-p1.c
index 1d5033c146..1bdb0d5659 100644
--- a/epan/dissectors/packet-p1.c
+++ b/epan/dissectors/packet-p1.c
@@ -1168,7 +1168,7 @@ dissect_p1_Signature(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U
static int
dissect_p1_UTCTime(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
- offset = dissect_ber_UTCTime(implicit_tag, actx, tree, tvb, offset, hf_index);
+ offset = dissect_ber_UTCTime(implicit_tag, actx, tree, tvb, offset, hf_index, NULL, NULL);
return offset;
}
@@ -2771,7 +2771,7 @@ dissect_p1_Time(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, as
tvbuff_t *arrival = NULL;
p1_address_ctx_t* ctx = (p1_address_ctx_t*)actx->subtree.tree_ctx;
- offset = dissect_ber_UTCTime(implicit_tag, actx, tree, tvb, offset, hf_index);
+ offset = dissect_ber_UTCTime(implicit_tag, actx, tree, tvb, offset, hf_index, NULL, NULL);
if(arrival && ctx && ctx->do_address)