diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-08-01 00:01:45 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-08-01 07:02:34 +0000 |
commit | 8d6e8f649894611dbe2feced7ae8eb3de863ff4b (patch) | |
tree | cb4152434c02157513bfb1d5f12b8b2b7f7076d6 /wiretap | |
parent | 75d4fac5f9163080eb442ae54c8ddbf526b8867f (diff) |
RFC 7468 is PEM-inspired, but it's not PEM.
Do some renaming.
Change-Id: If8fa85370014f9618df38d97048dd1c52a4c389f
Reviewed-on: https://code.wireshark.org/review/28918
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/CMakeLists.txt | 2 | ||||
-rw-r--r-- | wiretap/file_access.c | 8 | ||||
-rw-r--r-- | wiretap/rfc7468.c (renamed from wiretap/pem.c) | 28 | ||||
-rw-r--r-- | wiretap/rfc7468.h (renamed from wiretap/pem.h) | 4 | ||||
-rw-r--r-- | wiretap/wtap.h | 2 |
5 files changed, 22 insertions, 22 deletions
diff --git a/wiretap/CMakeLists.txt b/wiretap/CMakeLists.txt index d17bdc4a68..a672461603 100644 --- a/wiretap/CMakeLists.txt +++ b/wiretap/CMakeLists.txt @@ -68,7 +68,7 @@ set(WIRETAP_NONGENERATED_FILES pcapng.c peekclassic.c peektagged.c - pem.c + rfc7468.c pppdump.c radcom.c ruby_marshal.c diff --git a/wiretap/file_access.c b/wiretap/file_access.c index 4cc15b3d94..4f9b3ffb6f 100644 --- a/wiretap/file_access.c +++ b/wiretap/file_access.c @@ -73,7 +73,7 @@ #include "nettrace_3gpp_32_423.h" #include "mplog.h" #include "dpa400.h" -#include "pem.h" +#include "rfc7468.h" #include "ruby_marshal.h" /* @@ -356,7 +356,7 @@ static const struct open_info open_info_base[] = { { "MIME Files Format", OPEN_INFO_MAGIC, mime_file_open, NULL, NULL, NULL }, { "Micropross mplog", OPEN_INFO_MAGIC, mplog_open, "mplog", NULL, NULL }, { "Unigraf DPA-400 capture", OPEN_INFO_MAGIC, dpa400_open, "bin", NULL, NULL }, - { "ASN.1 (PEM-like encoding)", OPEN_INFO_MAGIC, pem_open, "pem;crt", NULL, NULL }, + { "RFC 7468 files", OPEN_INFO_MAGIC, rfc7468_open, "pem;crt", NULL, NULL }, { "Novell LANalyzer", OPEN_INFO_HEURISTIC, lanalyzer_open, "tr1", NULL, NULL }, /* * PacketLogger must come before MPEG, because its files @@ -1617,8 +1617,8 @@ static const struct file_type_subtype_info dump_open_table_base[] = { FALSE, FALSE, 0, NULL, NULL, NULL }, - /* WTAP_FILE_TYPE_SUBTYPE_PEM */ - { "ASN.1 (PEM-like encoding)", "pem", NULL, NULL, + /* WTAP_FILE_TYPE_SUBTYPE_RFC7468 */ + { "RFC 7468 files", "rfc7468", NULL, NULL, FALSE, FALSE, 0, NULL, NULL, NULL } }; diff --git a/wiretap/pem.c b/wiretap/rfc7468.c index d0b7b66e46..08b5a35e33 100644 --- a/wiretap/pem.c +++ b/wiretap/rfc7468.c @@ -1,4 +1,4 @@ -/* pem.c +/* rfc7468.c * * Implements loading of files in the format specified by RFC 7468. * @@ -7,7 +7,7 @@ #include "config.h" -#include "pem.h" +#include "rfc7468.h" #include "file_wrappers.h" #include "wtap-int.h" @@ -18,8 +18,8 @@ #include <string.h> -static gboolean pem_read_file(wtap *wth, FILE_T fh, wtap_rec *rec, - Buffer *buf, int *err, gchar **err_info) +static gboolean rfc7468_read_file(wtap *wth, FILE_T fh, wtap_rec *rec, + Buffer *buf, int *err, gchar **err_info) { gint64 file_size; int packet_size; @@ -33,7 +33,7 @@ static gboolean pem_read_file(wtap *wth, FILE_T fh, wtap_rec *rec, * to allocate space for an immensely-large packet. */ *err = WTAP_ERR_BAD_FILE; - *err_info = g_strdup_printf("pem: File has %" G_GINT64_MODIFIER "d-byte packet, bigger than maximum of %u", + *err_info = g_strdup_printf("rfc7468: File has %" G_GINT64_MODIFIER "d-byte packet, bigger than maximum of %u", file_size, G_MAXINT); return FALSE; } @@ -81,7 +81,7 @@ static char *read_complete_text_line(char line[MAX_LINE_LENGTH], FILE_T fh, int return line_end; } -static gboolean pem_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset) +static gboolean rfc7468_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset) { gint64 offset; @@ -95,10 +95,10 @@ static gboolean pem_read(wtap *wth, int *err, gchar **err_info, gint64 *data_off *data_offset = offset; - return pem_read_file(wth, wth->fh, &wth->rec, wth->rec_data, err, err_info); + return rfc7468_read_file(wth, wth->fh, &wth->rec, wth->rec_data, err, err_info); } -static gboolean pem_seek_read(wtap *wth, gint64 seek_off, wtap_rec *rec, +static gboolean rfc7468_seek_read(wtap *wth, gint64 seek_off, wtap_rec *rec, Buffer *buf, int *err, gchar **err_info) { /* there is only one packet */ @@ -110,16 +110,16 @@ static gboolean pem_seek_read(wtap *wth, gint64 seek_off, wtap_rec *rec, if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1) return FALSE; - return pem_read_file(wth, wth->random_fh, rec, buf, err, err_info); + return rfc7468_read_file(wth, wth->random_fh, rec, buf, err, err_info); } // -// Arbitrary value - we don't want to read all of a huge non-PEM file +// Arbitrary value - we don't want to read all of a huge non-RFC 7468 file // only to find no pre-encapsulation boundary. // #define MAX_EXPLANATORY_TEXT_LINES 20 -wtap_open_return_val pem_open(wtap *wth, int *err, gchar **err_info) +wtap_open_return_val rfc7468_open(wtap *wth, int *err, gchar **err_info) { gboolean found_preeb; static const char preeb_begin[] = "-----BEGIN "; @@ -150,14 +150,14 @@ wtap_open_return_val pem_open(wtap *wth, int *err, gchar **err_info) if (file_seek(wth->fh, 0, SEEK_SET, err) == -1) return WTAP_OPEN_ERROR; - wth->file_type_subtype = WTAP_FILE_TYPE_SUBTYPE_PEM; + wth->file_type_subtype = WTAP_FILE_TYPE_SUBTYPE_RFC7468; wth->file_encap = WTAP_ENCAP_RFC7468; wth->snapshot_length = 0; wth->file_tsprec = WTAP_TSPREC_SEC; - wth->subtype_read = pem_read; - wth->subtype_seek_read = pem_seek_read; + wth->subtype_read = rfc7468_read; + wth->subtype_seek_read = rfc7468_seek_read; return WTAP_OPEN_MINE; } diff --git a/wiretap/pem.h b/wiretap/rfc7468.h index 5a6cff58ba..9df62051c2 100644 --- a/wiretap/pem.h +++ b/wiretap/rfc7468.h @@ -1,4 +1,4 @@ -/* pem.h +/* rfc7468.h * * SPDX-License-Identifier: GPL-2.0-or-later */ @@ -9,7 +9,7 @@ #include <glib.h> #include "wtap.h" -wtap_open_return_val pem_open(wtap *wth, int *err, gchar **err_info); +wtap_open_return_val rfc7468_open(wtap *wth, int *err, gchar **err_info); #endif diff --git a/wiretap/wtap.h b/wiretap/wtap.h index 410001dddd..7f2eeb9184 100644 --- a/wiretap/wtap.h +++ b/wiretap/wtap.h @@ -375,7 +375,7 @@ extern "C" { #define WTAP_FILE_TYPE_SUBTYPE_NETTRACE_3GPP_32_423 79 #define WTAP_FILE_TYPE_SUBTYPE_MPLOG 80 #define WTAP_FILE_TYPE_SUBTYPE_DPA400 81 -#define WTAP_FILE_TYPE_SUBTYPE_PEM 82 +#define WTAP_FILE_TYPE_SUBTYPE_RFC7468 82 #define WTAP_FILE_TYPE_SUBTYPE_RUBY_MARSHAL 83 #define WTAP_NUM_FILE_TYPES_SUBTYPES wtap_get_num_file_types_subtypes() |