2014-03-18 12:17:28 +00:00
|
|
|
/* packet-corosync-totemnet.c
|
|
|
|
* Dissector routines for the lowest level(encryption/decryption) protocol used in Corosync cluster engine
|
|
|
|
* Copyright 2009 2010 2014 Masatake YAMATO <yamato@redhat.com>
|
|
|
|
* Copyright (c) 2010 2014 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-02-12 11:23:27 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
2014-03-18 12:17:28 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <epan/packet.h>
|
|
|
|
#include <epan/prefs.h>
|
2017-02-13 18:31:26 +00:00
|
|
|
#include <wsutil/wsgcrypt.h>
|
2014-03-18 12:17:28 +00:00
|
|
|
#include <wsutil/sober128.h>
|
|
|
|
|
|
|
|
static dissector_handle_t corosync_totemsrp_handle;
|
|
|
|
|
|
|
|
/* This dissector deals packets defined in totemnet.c of corosync
|
|
|
|
cluster engine. In the totemnet.c the packet is encrypted and decrypted
|
|
|
|
with LibTomCrypt. This dissector tries decrypting the packet with
|
|
|
|
sober128 and sha1 functions in wireshark. */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Dissector body
|
|
|
|
*/
|
|
|
|
|
2016-10-05 20:33:54 +00:00
|
|
|
#define PORT_COROSYNC_TOTEMNET_RANGE "5404-5405" /* Not IANA registered */
|
2014-03-18 12:17:28 +00:00
|
|
|
|
|
|
|
/* Forward declaration we need below */
|
2014-08-15 07:42:36 +00:00
|
|
|
void proto_register_corosync_totemnet(void);
|
2014-03-18 12:17:28 +00:00
|
|
|
void proto_reg_handoff_corosync_totemnet(void);
|
|
|
|
|
|
|
|
/* Initialize the protocol and registered fields */
|
|
|
|
static int proto_corosync_totemnet = -1;
|
|
|
|
|
|
|
|
/* field of struct security_header */
|
|
|
|
static int hf_corosync_totemnet_security_header_hash_digest = -1;
|
|
|
|
static int hf_corosync_totemnet_security_header_salt = -1;
|
|
|
|
static int hf_corosync_totemnet_security_crypto_type = -1;
|
|
|
|
static int hf_corosync_totemnet_security_crypto_key = -1;
|
|
|
|
|
|
|
|
/* configurable parameters */
|
|
|
|
static gchar* corosync_totemnet_private_keys = NULL;
|
|
|
|
static gchar** corosync_totemnet_private_keys_list = NULL;
|
|
|
|
|
|
|
|
/* Initialize the subtree pointers */
|
|
|
|
static gint ett_corosync_totemnet_security_header = -1;
|
|
|
|
|
2017-02-13 18:31:26 +00:00
|
|
|
#define SALT_SIZE 16
|
2014-03-18 12:17:28 +00:00
|
|
|
|
|
|
|
#define TOTEM_CRYPTO_SOBER 0
|
|
|
|
#define TOTEM_CRYPTO_NSS 1
|
|
|
|
|
|
|
|
static const value_string corosync_totemnet_crypto_type[] = {
|
|
|
|
{ TOTEM_CRYPTO_SOBER, "SOBER" },
|
|
|
|
{ TOTEM_CRYPTO_NSS, "NSS" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_corosync_totemnet_security_header(tvbuff_t *tvb,
|
|
|
|
packet_info *pinfo, proto_tree *parent_tree,
|
|
|
|
gboolean check_crypt_type,
|
|
|
|
const gchar* key)
|
|
|
|
{
|
|
|
|
proto_item *item;
|
|
|
|
proto_tree *tree;
|
|
|
|
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "COROSYNC/TOTEMNET");
|
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
|
|
|
|
|
|
|
if (parent_tree)
|
|
|
|
{
|
|
|
|
item = proto_tree_add_item(parent_tree, proto_corosync_totemnet, tvb, 0,
|
2014-08-15 17:57:12 +00:00
|
|
|
-1, ENC_NA);
|
2014-03-18 12:17:28 +00:00
|
|
|
tree = proto_item_add_subtree(item, ett_corosync_totemnet_security_header);
|
|
|
|
|
|
|
|
proto_tree_add_item(tree,
|
|
|
|
hf_corosync_totemnet_security_header_hash_digest,
|
2017-02-13 18:31:26 +00:00
|
|
|
tvb, 0, HASH_SHA1_LENGTH, ENC_NA);
|
2014-03-18 12:17:28 +00:00
|
|
|
proto_tree_add_item(tree,
|
|
|
|
hf_corosync_totemnet_security_header_salt,
|
2017-02-13 18:31:26 +00:00
|
|
|
tvb, HASH_SHA1_LENGTH, SALT_SIZE, ENC_NA);
|
2014-03-18 12:17:28 +00:00
|
|
|
|
|
|
|
if (check_crypt_type)
|
|
|
|
{
|
|
|
|
int io_len = tvb_reported_length(tvb);
|
|
|
|
proto_item * key_item;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree,
|
|
|
|
hf_corosync_totemnet_security_crypto_type,
|
2014-12-13 21:26:07 +00:00
|
|
|
tvb, io_len - 1, 1, ENC_BIG_ENDIAN);
|
2014-03-18 12:17:28 +00:00
|
|
|
key_item = proto_tree_add_string(tree,
|
|
|
|
hf_corosync_totemnet_security_crypto_key,
|
|
|
|
tvb, 0, 0, key);
|
2019-04-03 21:32:30 +00:00
|
|
|
proto_item_set_generated(key_item);
|
2014-03-18 12:17:28 +00:00
|
|
|
}
|
|
|
|
}
|
2017-02-13 18:31:26 +00:00
|
|
|
return HASH_SHA1_LENGTH + SALT_SIZE;
|
2014-03-18 12:17:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* About totemnet.c of corosync cluster engine:
|
|
|
|
*
|
|
|
|
* dissect_corosynec_totemnet_with_decryption() is derived from
|
|
|
|
* totemnet.c in corosync which is licensed under 3-clause BSD license.
|
|
|
|
* However, to merge this dissector to wireshark official source tree,
|
|
|
|
* corosync developers permit EXPLICITLY to reuse totemnet.c in GPL.
|
|
|
|
*
|
|
|
|
http://permalink.gmane.org/gmane.linux.redhat.cluster/19087
|
|
|
|
------------------------------------------------------------
|
|
|
|
Steven Dake | 4 Jan 2011 22:02
|
|
|
|
Re: [Openais] packet dissectors for totempg, cman, clvmd, rgmanager, cpg,
|
|
|
|
|
|
|
|
On 12/14/2010 08:04 AM, Masatake YAMATO wrote:
|
|
|
|
> Thank you for replying.
|
|
|
|
>
|
|
|
|
>> Masatake,
|
|
|
|
>>
|
|
|
|
>> Masatake YAMATO napsal(a):
|
|
|
|
>>> I'd like to your advice more detail seriously.
|
|
|
|
>>> I've been developing this code for three years.
|
|
|
|
>>> I don't want to make this code garbage.
|
|
|
|
>>>
|
|
|
|
>>>> Masatake,
|
|
|
|
>>>> I'm pretty sure that biggest problem of your code was that it was
|
|
|
|
>>>> licensed under BSD (three clause, same as Corosync has)
|
|
|
|
>>>> license. Wireshark is licensed under GPL and even I like BSD licenses
|
|
|
|
>>>> much more, I would recommend you to try to relicense code under GPL
|
|
|
|
>>>> and send them this code.
|
|
|
|
>>>>
|
|
|
|
>>>> Regards,
|
|
|
|
>>>> Honza
|
|
|
|
>>> I got the similar comment from wireshark developer.
|
|
|
|
>>> Please, read the discussion:
|
2020-10-03 14:54:12 +00:00
|
|
|
>>> https://gitlab.com/wireshark/wireshark/-/issues/3232
|
2014-03-18 12:17:28 +00:00
|
|
|
>>>
|
|
|
|
>>
|
|
|
|
>> I've read that thread long time before I've sent previous mail, so
|
|
|
|
>> thats reason why I think that Wireshark developers just feel MUCH more
|
|
|
|
>> comfortable with GPL and thats reason why they just ignoring it.
|
|
|
|
>
|
|
|
|
> I see.
|
|
|
|
>
|
|
|
|
>>> In my understanding there is no legal problem in putting 3-clause BSD
|
|
|
|
>>> code into GPL code. Acutally wireshark includes some 3-clause BSD
|
|
|
|
>>> code:
|
|
|
|
>>>
|
|
|
|
nnn>>
|
|
|
|
>> Actually there is really not. BSD to GPL works without problem, but
|
|
|
|
>> many people just don't know it...
|
|
|
|
>
|
|
|
|
> ...it is too bad. I strongly believe FOSS developers should know the
|
|
|
|
> intent behind of the both licenses.
|
|
|
|
>
|
|
|
|
>>> epan/dissectors/packet-radiotap-defs.h:
|
|
|
|
>>> *//*-
|
|
|
|
>>> * Copyright (c) 2003, 2004 David Young. All rights reserved.
|
|
|
|
>>> *
|
|
|
|
...
|
|
|
|
>>> *
|
|
|
|
>>> * Redistribution and use in source and binary forms, with or without
|
|
|
|
>>> * modification, are permitted provided that the following conditions
|
|
|
|
>>> * are met:
|
|
|
|
>>> * 1. Redistributions of source code must retain the above copyright
|
|
|
|
>>> * notice, this list of conditions and the following disclaimer.
|
|
|
|
>>> * 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
>>> * notice, this list of conditions and the following disclaimer in the
|
|
|
|
>>> * documentation and/or other materials provided with the distribution.
|
|
|
|
>>> * 3. The name of David Young may not be used to endorse or promote
|
|
|
|
>>> * products derived from this software without specific prior
|
|
|
|
>>> * written permission.
|
|
|
|
>>> *
|
|
|
|
>>> * THIS SOFTWARE IS PROVIDED BY DAVID YOUNG ``AS IS'' AND ANY
|
|
|
|
>>> * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
>>> * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
|
|
|
>>> * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID
|
|
|
|
>>> * YOUNG BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
|
|
>>> * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
|
|
|
>>> * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
>>> * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
|
|
>>> * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
>>> * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
>>> * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
|
|
|
>>> * OF SUCH DAMAGE.
|
|
|
|
>>> *//*
|
|
|
|
>>> I'd like to separate the legal issue and preference. I think I
|
|
|
|
>>> understand the importance of preference of upstream
|
|
|
|
>>> developers. However, I'd like to clear the legal issue first.
|
|
|
|
>>>
|
|
|
|
>>
|
|
|
|
>> Legally it's ok. But as you said, developers preference are
|
|
|
|
>> different. And because you are trying to change THEIR code it's
|
|
|
|
>> sometimes better to play they rules.
|
|
|
|
>
|
|
|
|
> I see.
|
|
|
|
>
|
|
|
|
>>> I can image there are people who prefer to GPL as the license covering
|
|
|
|
>>> their software. But here I've taken some corosync code in my
|
|
|
|
>>> dissector. It is essential part of my dissector. And corosync is
|
|
|
|
>>
|
|
|
|
>> ^^^ This may be problem. Question is how big is that part and if it
|
|
|
|
>> can be possible to make exception there. Can you point that code?
|
|
|
|
>>
|
|
|
|
>> Steve, we were able to relicense HUGE portion of code in case of
|
|
|
|
>> libqb, are we able to make the same for Wireshark dissector?
|
|
|
|
>
|
|
|
|
> Could you see https://github.com/masatake/wireshark-plugin-rhcs/blob/master/src/packet-corosync-totemnet.c#L156
|
|
|
|
> I refer totemnet.c to write dissect_corosynec_totemnet_with_decryption() function.
|
|
|
|
>
|
|
|
|
>>> licensed in 3-clause BSD, as you know. I'd like to change the license
|
|
|
|
>>> to merge my code to upstream project. I cannot do it in this context.
|
2020-10-03 14:54:12 +00:00
|
|
|
>>> See https://gitlab.com/wireshark/wireshark/-/issues/3232#c13
|
2014-03-18 12:17:28 +00:00
|
|
|
>>> Thank you.
|
|
|
|
>>
|
|
|
|
>> Regards,
|
|
|
|
>> Honza
|
|
|
|
>
|
|
|
|
> Masatake YAMATO
|
|
|
|
|
|
|
|
Masatake,
|
|
|
|
|
|
|
|
Red Hat is the author of the totemnet file and can provide that code
|
|
|
|
under GPL if you like. We cannot modify the license for libtomcrypt as
|
|
|
|
we are not the authors. Feel free to change the license for that
|
|
|
|
particular code you rewrote in the link
|
|
|
|
|
|
|
|
> Could you see
|
|
|
|
https://github.com/masatake/wireshark-plugin-rhcs/blob/master/src/packet-corosync-totemnet.c#L156
|
|
|
|
|
|
|
|
under a GPL license if it helps move things along.
|
|
|
|
|
|
|
|
Regards
|
|
|
|
-steveu
|
|
|
|
*/
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_corosynec_totemnet_with_decryption(tvbuff_t *tvb,
|
|
|
|
packet_info *pinfo, proto_tree *parent_tree,
|
|
|
|
gboolean check_crypt_type,
|
|
|
|
const gchar* key_for_trial)
|
|
|
|
{
|
|
|
|
unsigned char keys[48];
|
2017-02-13 18:31:26 +00:00
|
|
|
sober128_prng keygen_prng_state;
|
|
|
|
sober128_prng stream_prng_state;
|
2014-03-18 12:17:28 +00:00
|
|
|
unsigned char *hmac_key = &keys[32];
|
|
|
|
unsigned char *cipher_key = &keys[16];
|
|
|
|
unsigned char *initial_vector = &keys[0];
|
2017-02-13 18:31:26 +00:00
|
|
|
unsigned char digest_comparison[HASH_SHA1_LENGTH];
|
2014-03-18 12:17:28 +00:00
|
|
|
|
|
|
|
int io_len;
|
|
|
|
guint8 *io_base;
|
|
|
|
|
|
|
|
#define PRIVATE_KEY_LEN_MAX 256
|
|
|
|
gchar private_key[PRIVATE_KEY_LEN_MAX];
|
2014-06-19 23:55:28 +00:00
|
|
|
gsize private_key_len;
|
2014-03-18 12:17:28 +00:00
|
|
|
unsigned char* hash_digest;
|
|
|
|
unsigned char* salt;
|
|
|
|
|
|
|
|
io_len = tvb_reported_length(tvb) - (check_crypt_type? 1: 0);
|
2017-02-13 18:31:26 +00:00
|
|
|
if (io_len < HASH_SHA1_LENGTH + SALT_SIZE) {
|
2014-03-18 12:17:28 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
io_base = (guint8 *)tvb_memdup(pinfo->pool, tvb, 0, io_len + (check_crypt_type? 1: 0));
|
|
|
|
if (check_crypt_type &&
|
|
|
|
( io_base[io_len] != TOTEM_CRYPTO_SOBER )) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
hash_digest = io_base;
|
2017-02-13 18:31:26 +00:00
|
|
|
salt = io_base + HASH_SHA1_LENGTH;
|
2014-03-18 12:17:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
memset(private_key, 0, sizeof(private_key));
|
|
|
|
|
|
|
|
private_key_len = (strlen(key_for_trial)+4) & 0xFC;
|
2021-04-30 10:18:25 +00:00
|
|
|
(void) g_strlcpy(private_key, key_for_trial, private_key_len);
|
2014-03-18 12:17:28 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Generate MAC, CIPHER, IV keys from private key
|
|
|
|
*/
|
|
|
|
memset (keys, 0, sizeof(keys));
|
|
|
|
sober128_start (&keygen_prng_state);
|
|
|
|
sober128_add_entropy(private_key,
|
2014-06-20 06:13:43 +00:00
|
|
|
(unsigned long)private_key_len, &keygen_prng_state);
|
2014-03-18 12:17:28 +00:00
|
|
|
sober128_add_entropy (salt, SALT_SIZE, &keygen_prng_state);
|
|
|
|
sober128_read (keys, sizeof (keys), &keygen_prng_state);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Setup stream cipher
|
|
|
|
*/
|
|
|
|
sober128_start (&stream_prng_state);
|
|
|
|
sober128_add_entropy (cipher_key, 16, &stream_prng_state);
|
|
|
|
sober128_add_entropy (initial_vector, 16, &stream_prng_state);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Authenticate contents of message
|
|
|
|
*/
|
2017-02-13 18:31:26 +00:00
|
|
|
if (ws_hmac_buffer(GCRY_MD_SHA1, digest_comparison, io_base + HASH_SHA1_LENGTH, io_len - HASH_SHA1_LENGTH, hmac_key, 16)) {
|
|
|
|
return 0;
|
|
|
|
}
|
2014-03-18 12:17:28 +00:00
|
|
|
|
2017-02-13 18:31:26 +00:00
|
|
|
if (memcmp (digest_comparison, hash_digest, HASH_SHA1_LENGTH) != 0)
|
2014-03-18 12:17:28 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Decrypt the contents of the message with the cipher key
|
|
|
|
*/
|
|
|
|
|
2017-02-13 18:31:26 +00:00
|
|
|
sober128_read (io_base + HASH_SHA1_LENGTH + SALT_SIZE,
|
|
|
|
io_len - (HASH_SHA1_LENGTH + SALT_SIZE),
|
2014-03-18 12:17:28 +00:00
|
|
|
&stream_prng_state);
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Dissect the decrypted data
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
tvbuff_t *decrypted_tvb;
|
|
|
|
tvbuff_t *next_tvb;
|
|
|
|
|
|
|
|
|
|
|
|
decrypted_tvb = tvb_new_real_data(io_base, io_len, io_len);
|
|
|
|
|
|
|
|
tvb_set_child_real_data_tvbuff(tvb, decrypted_tvb);
|
|
|
|
add_new_data_source(pinfo, decrypted_tvb, "Decrypted Data");
|
|
|
|
|
|
|
|
|
|
|
|
dissect_corosync_totemnet_security_header(decrypted_tvb, pinfo, parent_tree,
|
|
|
|
check_crypt_type, key_for_trial);
|
|
|
|
|
2017-01-10 06:18:49 +00:00
|
|
|
next_tvb = tvb_new_subset_length_caplen(decrypted_tvb,
|
2017-02-13 18:31:26 +00:00
|
|
|
HASH_SHA1_LENGTH + SALT_SIZE,
|
|
|
|
io_len - (HASH_SHA1_LENGTH + SALT_SIZE),
|
|
|
|
io_len - (HASH_SHA1_LENGTH + SALT_SIZE));
|
2014-03-18 12:17:28 +00:00
|
|
|
|
2017-02-13 18:31:26 +00:00
|
|
|
return call_dissector(corosync_totemsrp_handle, next_tvb, pinfo, parent_tree) + HASH_SHA1_LENGTH + SALT_SIZE;
|
2014-03-18 12:17:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_corosynec_totemnet(tvbuff_t *tvb,
|
|
|
|
packet_info *pinfo, proto_tree *parent_tree,
|
|
|
|
void *data _U_)
|
|
|
|
{
|
|
|
|
if (corosync_totemnet_private_keys_list)
|
|
|
|
{
|
|
|
|
static int last_key_index = -1;
|
|
|
|
int key_index;
|
|
|
|
|
|
|
|
static int last_check_crypt_type_index;
|
|
|
|
int check_crypt_type_index = -1;
|
|
|
|
gboolean check_crypt_type_list[] = {FALSE, TRUE};
|
|
|
|
|
|
|
|
|
|
|
|
if (last_key_index != -1)
|
|
|
|
{
|
|
|
|
int r;
|
|
|
|
|
|
|
|
r = dissect_corosynec_totemnet_with_decryption(tvb,
|
|
|
|
pinfo,
|
|
|
|
parent_tree,
|
|
|
|
check_crypt_type_list[last_check_crypt_type_index],
|
|
|
|
corosync_totemnet_private_keys_list[last_key_index]);
|
|
|
|
if (r > 0)
|
|
|
|
return r;
|
|
|
|
else
|
|
|
|
last_key_index = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (key_index = 0;
|
|
|
|
corosync_totemnet_private_keys_list[key_index];
|
|
|
|
key_index++)
|
|
|
|
{
|
|
|
|
for (check_crypt_type_index = 0;
|
|
|
|
check_crypt_type_index < 2;
|
|
|
|
check_crypt_type_index++)
|
|
|
|
{
|
|
|
|
int r;
|
|
|
|
|
|
|
|
r = dissect_corosynec_totemnet_with_decryption(tvb,
|
|
|
|
pinfo,
|
|
|
|
parent_tree,
|
|
|
|
check_crypt_type_list[check_crypt_type_index],
|
|
|
|
corosync_totemnet_private_keys_list[key_index]);
|
|
|
|
if (r > 0)
|
|
|
|
{
|
|
|
|
last_key_index = key_index;
|
|
|
|
last_check_crypt_type_index = check_crypt_type_index;
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
else if (r < 0)
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Not encrypted */
|
|
|
|
return call_dissector(corosync_totemsrp_handle, tvb, pinfo, parent_tree);
|
|
|
|
}
|
|
|
|
|
2017-01-20 16:08:57 +00:00
|
|
|
static void
|
|
|
|
corosync_totemnet_shutdown(void)
|
|
|
|
{
|
|
|
|
g_strfreev(corosync_totemnet_private_keys_list);
|
|
|
|
}
|
2014-03-18 12:17:28 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_corosync_totemnet(void)
|
|
|
|
{
|
|
|
|
module_t *corosync_totemnet_module;
|
|
|
|
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_corosync_totemnet_security_header_hash_digest,
|
|
|
|
{ "Hash digest", "corosync_totemnet.security_header_hash_digest",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_corosync_totemnet_security_header_salt,
|
|
|
|
{ "Salt", "corosync_totemnet.security_header_salt",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_corosync_totemnet_security_crypto_type,
|
|
|
|
{ "Cryptographic Type", "corosync_totemnet.security_crypto_type",
|
|
|
|
FT_UINT8, BASE_DEC, VALS(corosync_totemnet_crypto_type), 0x0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
{ &hf_corosync_totemnet_security_crypto_key,
|
|
|
|
{ "Private Key for decryption", "corosync_totemnet.security_crypto_key",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
|
|
|
|
};
|
|
|
|
|
|
|
|
static gint *ett_corosync_totemnet[] = {
|
|
|
|
&ett_corosync_totemnet_security_header,
|
|
|
|
};
|
|
|
|
|
|
|
|
proto_corosync_totemnet = proto_register_protocol("Totemnet Layer of Corosync Cluster Engine",
|
|
|
|
"COROSYNC/TOTEMNET", "corosync_totemnet");
|
|
|
|
proto_register_field_array(proto_corosync_totemnet, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett_corosync_totemnet, array_length(ett_corosync_totemnet));
|
|
|
|
|
|
|
|
corosync_totemnet_module = prefs_register_protocol(proto_corosync_totemnet,
|
|
|
|
proto_reg_handoff_corosync_totemnet);
|
|
|
|
|
|
|
|
prefs_register_string_preference(corosync_totemnet_module, "private_keys", "Private keys",
|
|
|
|
"Semicolon-separated list of keys for decryption(e.g. key1;key2;..." ,
|
|
|
|
(const gchar **)&corosync_totemnet_private_keys);
|
2017-01-20 16:08:57 +00:00
|
|
|
|
|
|
|
register_shutdown_routine(corosync_totemnet_shutdown);
|
2014-03-18 12:17:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_corosync_totemnet(void)
|
|
|
|
{
|
2014-06-19 18:27:07 +00:00
|
|
|
static gboolean initialized = FALSE;
|
2014-03-18 12:17:28 +00:00
|
|
|
static dissector_handle_t corosync_totemnet_handle;
|
|
|
|
|
|
|
|
|
2016-10-05 20:33:54 +00:00
|
|
|
if (!initialized)
|
|
|
|
{
|
|
|
|
corosync_totemnet_handle = create_dissector_handle(dissect_corosynec_totemnet, proto_corosync_totemnet);
|
|
|
|
corosync_totemsrp_handle = find_dissector_add_dependency("corosync_totemsrp", proto_corosync_totemnet);
|
2014-03-18 12:17:28 +00:00
|
|
|
|
2016-10-05 20:33:54 +00:00
|
|
|
dissector_add_uint_range_with_preference("udp.port", PORT_COROSYNC_TOTEMNET_RANGE, corosync_totemnet_handle);
|
|
|
|
initialized = TRUE;
|
|
|
|
}
|
2014-03-18 12:17:28 +00:00
|
|
|
|
2017-08-26 08:30:47 +00:00
|
|
|
g_strfreev(corosync_totemnet_private_keys_list);
|
2016-10-05 20:33:54 +00:00
|
|
|
corosync_totemnet_private_keys_list = g_strsplit(corosync_totemnet_private_keys, ";", 0);
|
2014-03-18 12:17:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2019-07-26 18:43:17 +00:00
|
|
|
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
2014-03-18 12:17:28 +00:00
|
|
|
*
|
|
|
|
* Local variables:
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* vi: set shiftwidth=4 tabstop=8 expandtab:
|
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
|
|
*/
|