Commit Graph

118 Commits

Author SHA1 Message Date
Michael Mann a33209d69e Convert ASN.1 dissectors to remove "new" from "new-style" dissector function names that were generated from asn2wrs.py
This includes:
1. new_create_dissector_handle -> create_dissector_handle
2. new_register_dissector -> register_dissector
3. new_register_ber_oid_dissector -> register_ber_oid_dissector
4. new_register_ber_syntax_dissector -> register_ber_syntax_dissector

Also remove PDU_NEW, SYNTAX_NEW and REGISTER_NEW as there is no need for the distinction anymore.

Change-Id: I82c7de7c8ffeeab3259d1b55bb4afc5f6a1e0329
Reviewed-on: https://code.wireshark.org/review/12491
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-10 17:06:02 +00:00
Michael Mann a391a70b3b "new" dissector API -> dissector API for ASN.1 dissectors.
Change-Id: I7b794cba2feda2cae40411e2b1cb9fb091d08220
Reviewed-on: https://code.wireshark.org/review/12480
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 03:12:23 +00:00
Peter Wu a198f47c06 cmake: add asn1 target, avoid unnecessary rebuilds
Add an "asn1" build target that rebuilds all ASN.1 dissectors.

Do not always generate the ASN.1 dissector when invoking the
"generate_dissector-PROTO" target. Use a special "packet-PROTO-stamp"
file to detect whether the dissector is out of date.

This indirection is needed because cmake removes output files from
add_custom_command in the clean target, but we would like to keep the
generated packet-PROTO.c files.

Make all EXTRA_CNF and EXPORT_DEPENDS point to absolute paths for
generated exported configs (PROTO-exp.cnf). This is done by automake too
and is needed for proper dependency tracking. Example: when h225.cnf is
updated, h225-exp.cnf needs to be generated. That is the purpose of the
"generate-h225-exp.cnf" target. Now h235 (and other) dissectors need to
be regenerated as well because the h225-exp.cnf is updated. This is why
there is a separate add_custom_command and add_custom_target.

Change-Id: I8cfc1f8f43cea595267b21eae30b4548f3407c0b
Reviewed-on: https://code.wireshark.org/review/12080
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-26 12:37:21 +00:00
Michael Mann 0cd1a85064 Require BER dissector (OID) registration to be "new style".
Both old and new style API existed, just remove the "old" one.

Change-Id: If725e778a0ecad5a431d634ed5c4856b4a281013
Reviewed-on: https://code.wireshark.org/review/12107
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-25 19:21:14 +00:00
Michael Mann 8df0bac6cf Remove the LDAP wrapping for registering dissectors and just use dissector_add_string directly.
Change-Id: I307ee31562a5a84bc62691f367e3b8df3cb3f244
Reviewed-on: https://code.wireshark.org/review/12097
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-24 14:52:31 +00:00
Pascal Quantin 71b3d384cf X509AF: ensure that BER dissector successfully decoded a bit string before calling RSA Public Key dissection
Bug: 11612
Change-Id: Ia1279b5991604631241398ab19f0652e36a2114e
Reviewed-on: https://code.wireshark.org/review/11144
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>
2015-10-19 13:25:45 +00:00
Pascal Quantin e8a37694ce X509AF: protect against a comparison with a NULL algorithm_id string
Bug: 11611
Change-Id: Ide8a26f74c99405b53acf394041ddf4a599da90a
Reviewed-on: https://code.wireshark.org/review/11143
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>
2015-10-19 11:28:19 +00:00
Peter Wu 317af2c68c x509af: dissect subjectPublicKey for RSA
The subjectPublicKey field of a Certificate (TBSCertificate) is defined
as type BIT STRING. The actual contents depend on the Algorithm
Identifier which is preceding the subjectPublicKey field.

This patch adds support for dissection of the public key for RSA
public keys which show up below the subjectPublicKey tree:

    subjectPublicKeyInfo
        algorithm (rsaEncryption)
            Algorithm Id: 1.2.840.113549.1.1.1 (rsaEncryption)
        subjectPublicKey: 3082010a0282010100b7c769e2d0eacaeb929fc08238a9ff...
            modulus : 0x00b7c769e2d0eacaeb929fc08238a9ffc59cab39c28a2e26...
            publicExponent: 65537

Change-Id: Ib92645433b0a0078a947ff0ac26c5e6a64877b93
Reviewed-on: https://code.wireshark.org/review/10967
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-18 03:30:21 +00:00
Peter Wu 877fd03cbf ssl-utils: load RSA keys based on their modulus+exponent
Load RSA private keys based on their public key instead of relying on
the user to specify a valid address and port mapping. This is more
reliable and prepares for simplification of the SSL Keys dialog.

After this change, the "address" part of the UAT dialog will be ignored
when loading the private key. The port+protocol mapping is still
imported, but should probably be removed too.

Change-Id: I4d7a2bfcf63d17e66e336ef770759f20510fc176
Reviewed-on: https://code.wireshark.org/review/10766
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-10-07 04:09:42 +00:00
Peter Wu bec65ab1ac x509,ber: fix header field of large integers
In the past large integers would be displayed as text, later on this
was changed into a "proper" header field. In most cases you do not want
to see "ber.64bit_uint_as_bytes" though, but the original field name.

This patch allows fields that are marked as FT_BYTES to be displayed
with their original header field details (name, description, etc.).

Change-Id: I4ab1a4cce649a225c73298fbf4dcf1692c693a03
Reviewed-on: https://code.wireshark.org/review/10539
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-09-15 22:51:18 +00:00
Michael Mann e333e4c90f Convert OID APIs to use wmem.
There are a few oid functions that are only called in oids_test.c.  I'll presume the APIs are used in proprietary dissectors rather than just remove them.

Change-Id: I4595e00f93bf9ab8cf2493fe0432b91960f55a3f
Reviewed-on: https://code.wireshark.org/review/6592
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-19 02:52:11 +00:00
Pascal Quantin 506409d28c X509AF: dissect Certificate Serial Number as INT64 instead of INT32
Bug: 10862
Change-Id: Ie315298dd090b3b689f6a9bfff6f6f5bf7cc715a
Reviewed-on: https://code.wireshark.org/review/6594
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-17 22:14:19 +00:00
Bill Meier dd859eada4 asn1 generated dissectors: cleanup #include usage
Change-Id: I36b2731d67f9345d2fd0c23800bba7d2be94c387
Reviewed-on: https://code.wireshark.org/review/6008
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-23 05:39:00 +00:00
Stig Bjørlykke 4e1b5ea866 ASN1: Register PDU-dissectors as NEW
Change-Id: I1a317b19d8076588c9305dae6287bb80cc14da64
Reviewed-on: https://code.wireshark.org/review/4494
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
2014-10-13 11:24:07 +00:00
Bill Meier a379ac74d2 Fix spelling: cant-->can't, wont-->won't, etc
Change-Id: Ia6c3e7a25615bf8e052c3bacf096d76df775c9c2
Reviewed-on: https://code.wireshark.org/review/4126
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-16 15:31:58 +00:00
Guy Harris 4d90d6e38d Add some files under asn1 to the distribution.
Include CMakeLists.txt files and the gnm subdirectory, along with the
top-level Makefile.inc and Makefile.preinc files.  Don't explicitly
include Custom.make, as automake does that automatically given that it's
included by asn1/Makefile.am.

Add some files to EXTRA_DIST lists.

Move some .asn files to EXTRA_DIST; they don't need to be in SRC_FILES,
as SRC_FILES always includes EXTRA_DIST, and they *do* need to be in
EXTRA_DIST so that they're in the distribution.

Change-Id: Id91df577260fa57028d40fe098be1d79c59398e6
Reviewed-on: https://code.wireshark.org/review/3273
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-30 23:42:55 +00:00
Michael Mann 9356d5c689 convert to proto_tree_add_subtree[_format] for ASN.1 dissectors
Change-Id: I753ca95e2e1b38bad2c09955317e648c525e40ef
Reviewed-on: https://code.wireshark.org/review/2509
Tested-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-22 21:08:21 +00:00
Bill Meier 1dff4e309d Remove trailing whitespace from asn1 .cnf & template.[hc] files. Regenerate dissectors.
Change-Id: I0e779b2ac2f608356649c5bbfca438141070dea4
Reviewed-on: https://code.wireshark.org/review/412
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-26 19:38:21 +00:00
Jeff Morriss 8c608e6e82 Remove $Id$ from the ASN.1 dissectors and regenerate them.
Change-Id: Ie476c6f82f318188b41ed922b92c6fec119ea954
Reviewed-on: https://code.wireshark.org/review/244
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-02-18 03:05:28 +00:00
Stig Bjørlykke face757db3 Added back x509af_get_last_algorithm_id() removed in revision 54647 to
restore usage in cms and pkcs12.  They never got a valid value in 
actx->external.direct_reference because they use another actx in this case.

This will add back the global variable in x509af, but this is needed
until we manage to pass the value in another way.

See comments in bug 9573.

svn path=/trunk/; revision=54975
2014-01-27 09:02:06 +00:00
Michael Mann 92a567f20d Make global algorithm_id in x509af dissector a direct_reference instead. Bug 9573 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9573). Removes valgrind warnings as well as just being Good Code.
svn path=/trunk/; revision=54647
2014-01-08 04:55:59 +00:00
Michael Mann c0fcebb07a Add a data parameter to call_ber_oid_callback to be able to pass data to subdissectors found with dissector_try_string_new.
The intention is to aid in the removal of pinfo->private_data use as well as static global variables in a dissector.  For now, all calls to call_ber_oid_callback have the data parameter set to NULL.

svn path=/trunk/; revision=52994
2013-10-31 00:57:03 +00:00
Michael Mann 87eb22f464 More proper fix (per advice of bug 8515 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8515)) of global variables complained about in bug 7060 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7060). Not sure if algorithm_id of x509af dissector could also be a actx->external.direct_reference, so left it alone.
svn path=/trunk/; revision=50113
2013-06-22 15:08:18 +00:00
Jörg Mayer 369c7b75ee Allow generating some more dissectors with cmake.
svn path=/trunk/; revision=49196
2013-05-07 04:40:37 +00:00
Jörg Mayer 243e9c0ba5 Just whitespace changes
svn path=/trunk/; revision=49167
2013-05-05 08:49:18 +00:00
Guy Harris 1fe16c1d6a Fix warning.
svn path=/trunk/; revision=49118
2013-05-01 21:15:47 +00:00
Michael Mann b787f03df3 Remove some global variables in favor of private_data member of asn1_ctx_t. Bug 7060 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7060). This should (mostly) passify the bug, but it appears like this could be done with a lot more ASN.1 dissectors.
svn path=/trunk/; revision=49117
2013-05-01 20:54:31 +00:00
Jörg Mayer 8faa262e90 Stub cmake support for generating the asn1 dissectors.
It doesn't do anything yet, it is just to make svn status
readable again.

svn path=/trunk/; revision=49007
2013-04-23 23:05:33 +00:00
Anders Broman dafdc19d9e -Wmissing-prototypes
svn path=/trunk/; revision=48609
2013-03-28 07:34:13 +00:00
Anders Broman 9991973c37 Use explicit casts.
svn path=/trunk/; revision=48008
2013-03-02 14:51:04 +00:00
Stig Bjørlykke 38aeb0e1e3 Added deltaRevocationList.
svn path=/trunk/; revision=46438
2012-12-07 11:40:29 +00:00
Jeff Morriss 3551a86c36 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45015
2012-09-20 01:29:52 +00:00
Jakub Zawadzki 5a8783f5b1 Initial commit to support yet another method of passing data between dissectors.
Add new parameter 'data' to heur_dissector_t and new_dissector_t, for now it's always NULL

svn path=/trunk/; revision=44860
2012-09-10 21:40:21 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Jeff Morriss b21b495f9f Don't generate the conformance file for exported types when building the
dissector; instead built it only when the separate target (generate_export)
is built.

Built generate_export when building "all".

This prevents the exp_*.cnf files from being regenerated each time another one
of the exp_*.cnf files (which the current dissector depends on) has changed
(despite the fact that the exported types does not depe

Also fix the CLEANFILES definition so it actually cleans things.

svn path=/trunk/; revision=39421
2011-10-14 10:22:01 +00:00
Jeff Morriss cf012d27b1 Build the ASN.1 dissectors directly into epan/dissectors (rather than building
them and then copying them over).  The "all" target to builds these dissectors
now (instead of "generate_files" and/or "copy_files").

asn2wrs's "-O" option now means "the dissector goes in this directory" (rather
than "all output goes in this directory"); it also means that the "-s" (single
output file) option is now required.

Fix things up so that it's possible to build all of the ASN.1 dissectors in
one shot.

Fix building of conformance files when doing out-of-source-tree builds.


Unfortunately "make all" in the asn1 directory always builds something--I think
because of circular depedencies.

svn path=/trunk/; revision=39333
2011-10-10 02:31:11 +00:00
Stig Bjørlykke 8246e87432 Moved register_ber_syntax_dissector() and register_ber_oid_syntax() from
proto_reg_handoff_* to proto_register_*.

svn path=/trunk/; revision=33345
2010-06-28 10:34:15 +00:00
Stig Bjørlykke 9bfdc344d2 Export Certificate PDU so this can be dissected from non-asn dissectors.
svn path=/trunk/; revision=32532
2010-04-21 10:14:04 +00:00
Bill Meier 9ade30a7b1 #include <string.h> and/or #include <stdio.h> not needed.
svn path=/trunk/; revision=32417
2010-04-07 16:54:29 +00:00
Bill Meier f8b92f8d0b #include <stdio.h> not needed.
svn path=/trunk/; revision=32405
2010-04-06 17:01:14 +00:00
Kovarththanan Rajaratnam 7ab993bee7 Remove unused NEED_PACKET_PROTO_H variable
svn path=/trunk/; revision=30409
2009-10-08 17:26:57 +00:00
Kovarththanan Rajaratnam cf8138e195 Remove check_col() guard
svn path=/trunk/; revision=30124
2009-09-24 19:50:43 +00:00
Kovarththanan Rajaratnam 99624329fa Don't col_clear() followed by col_set_str(). A col_set_str() will clear (replace) any existing string (the fence still needs to be respected though)
svn path=/trunk/; revision=30086
2009-09-23 14:30:36 +00:00
Kovarththanan Rajaratnam e971354a54 Don't guard col_set_str (COL_PROTOCOL) with col_check
svn path=/trunk/; revision=29340
2009-08-09 06:26:46 +00:00
Stig Bjørlykke e3ef20f3ea From Kovarththanan Rajaratnam:
Clean up header field info in asn1/*-template.c files.

From me:
Fixed a few typos in the patch.

svn path=/trunk/; revision=28817
2009-06-23 06:02:12 +00:00
Graeme Lunt 24187e9c4d Correct LDAP certificate attribute name
svn path=/trunk/; revision=28587
2009-06-02 09:20:10 +00:00
Bill Meier 35e5fa9bc1 #include <epan/conversation.h> and/or #include <epan/emem.h> not req'd ...
svn path=/trunk/; revision=27390
2009-02-07 14:33:47 +00:00
Tomas Kukosa 4726aec5b0 fix problem with X.411 asn2wrs compilation, all dissectors regenerated
svn path=/trunk/; revision=26740
2008-11-10 13:36:24 +00:00
Ronnie Sahlberg 3c8c901617 add 3 new OIDs to the x509af dissector
svn path=/trunk/; revision=26325
2008-10-01 05:23:58 +00:00
Jörg Mayer 3d22aa561b asn1/*/Makefile.nmake were not part of the source package.
Spotted by Tomas Kukosa.

svn path=/trunk/; revision=23921
2007-12-19 10:02:50 +00:00