THIS IS A TEST INSTANCE. Feel free to ask and answer questions, but take care to avoid triggering too many notifications.
0

decode protobuf within a protobuf in lua plugin

I have a http2 packet with grpc+protobuf content.

The protobuf inside grpc has a byte array field which itself is a protobuf.

I have written a lua post-dissector which find offset and length of this byte array and calls protobuf dissector on it as follows:

        pinfo.private["pb_msg_type"] = "message," .. probmsgtype
        Dissector.get("protobuf"):call(tvb, pinfo, subtree)

i am seeing following error: Protocol Buffers: pbuf.pbufmsgtype [Packet size limited during capture: ProtoBuf truncated]

I verified that length of buffer and content is alright.

i doubt some field in http2 header messing it up.

Any ideas?

ranjeetsih's avatar
1
ranjeetsih
asked 2021-02-01 09:48:31 +0000, updated 2021-02-11 15:18:31 +0000
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

if protbuf inside protobuf is stored as byte then following will work.

local pbuf_dissector_table = DissectorTable.get("protobuf_field")
pbuf_dissector_table:add(<fullpathofbyteprotobuffield>,newprotodissector)

then in the new chained dissector do following:

pinfo.private["pb_msg_type"] = "message," .. <actulatypeofnestedprotobuf> 
Dissector.get("protobuf"):call(tvb, pinfo, subtree)
ranjeetsih's avatar
1
ranjeetsih
answered 2021-03-13 10:48:51 +0000, updated 2021-03-13 10:50:14 +0000
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer