diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2016-01-18 22:08:38 +0100 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2016-01-19 15:05:34 +0000 |
commit | 5a8020a1b6bb73fcb8bb7eb7d53177bc8a9fc703 (patch) | |
tree | bed0360daeb47f37026ca6d1472577f09d794f68 /asn1 | |
parent | 69b8f6ca552007e5d62097293c7474d7bb08f8e5 (diff) |
X509AF: make a local copy of algorithm_id in file scope for later use
Bug: 12002
Change-Id: Iff48863c1954f76d6fc34150d315d15295dc1f5c
Reviewed-on: https://code.wireshark.org/review/13406
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/x509af/packet-x509af-template.c | 2 | ||||
-rw-r--r-- | asn1/x509af/x509af.cnf | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/asn1/x509af/packet-x509af-template.c b/asn1/x509af/packet-x509af-template.c index 198970a427..aaad34ab93 100644 --- a/asn1/x509af/packet-x509af-template.c +++ b/asn1/x509af/packet-x509af-template.c @@ -54,7 +54,7 @@ static int hf_x509af_extension_id = -1; /* Initialize the subtree pointers */ static gint ett_pkix_crl = -1; #include "packet-x509af-ett.c" -static const char *algorithm_id; +static const char *algorithm_id = NULL; static void x509af_export_publickey(tvbuff_t *tvb, asn1_ctx_t *actx, int offset, int len); #include "packet-x509af-fn.c" diff --git a/asn1/x509af/x509af.cnf b/asn1/x509af/x509af.cnf index 936379c8a7..965b221cba 100644 --- a/asn1/x509af/x509af.cnf +++ b/asn1/x509af/x509af.cnf @@ -70,12 +70,18 @@ CertificateList/signedCertificateList/revokedCertificates/_item/userCertificate %(DEFAULT_BODY)s - algorithm_id = actx->external.direct_reference; + if (algorithm_id) { + wmem_free(wmem_file_scope(), (void*)algorithm_id); + } if(actx->external.direct_reference) { + algorithm_id = (const char *)wmem_strdup(wmem_file_scope(), actx->external.direct_reference); + name = oid_resolved_from_string(wmem_packet_scope(), actx->external.direct_reference); proto_item_append_text(tree, " (%%s)", name ? name : actx->external.direct_reference); + } else { + algorithm_id = NULL; } #.FN_BODY AlgorithmIdentifier/parameters |