https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=13932

--- Comment #13 from Huang Qiangxiong <qiangxiong.hu...@gmail.com> ---
(In reply to Michael Mann from comment #12)
> (In reply to Huang Qiangxiong from comment #0)
> > Created attachment 15730 [details]
> > grpc/protobuf sample cap file. (message compress by gzip)
> 
> I don't see in https://developers.google.cn/protocol-buffers/docs/encoding
> how bitmasks are explained.  When looking at this capture file, packet 9 has
> 5 fields, and the field number for the 5th buffer is 536870910 (i.e. really
> large number).  But ProtoBuf is trying to apply a bitmask of 0xF8 (maybe
> because it's presumed that field number should be a UINT8).  It seems like
> the current logic is "if varint has more bytes that bitmask covers, treat
> other bytes with bitmask 0xFF".  I don't think that's how bitmasks should
> work.
> 
> I'm working on https://code.wireshark.org/review/23813 (using
> packet-protobuf.c in other patches for testing) and I have it so that the
> varint number is retrieved and then the bitmask is applied, which makes the
> field number 30,  not 536870910.  This seems "more correct" to me, but
> wanted other opinions (possibly documentation showing how bitmasks are
> applied)

The 536870910 is correct field number. This is a test case made by me for
testing parsing a big field number. This package is generated by offical
protobuf library (for java) according to the attachment of "A more complicated
grpc/protobuf proto file -- helloworld.proto". You can see the definition of
this field in helloworld.proto:

message HelloRequest {
   ...
   sfixed32 sfixed32param_largefn = 536870910;
   ...
}


Dissected result like this: (with *.proto file supported)
Frame 9: 245 bytes on wire (1960 bits), 245 bytes captured (1960 bits) on
interface 0
Ethernet II, Src: Vmware_c0:00:08 (00:50:56:c0:00:08), Dst: Vmware_94:16:c4
(00:0c:29:94:16:c4)
Internet Protocol Version 4, Src: 192.168.65.1, Dst: 192.168.65.10
Transmission Control Protocol, Src Port: 61063, Dst Port: 50051, Seq: 80, Ack:
50, Len: 191
HyperText Transfer Protocol 2
    Stream: HEADERS, Stream ID: 3, Length 124, POST
/helloworld.Greeter/SayHello
    Stream: DATA, Stream ID: 3, Length 49
    GRPC Message: /helloworld.Greeter/SayHello, Request
    Protocol Buffers: /helloworld.Greeter/SayHello,request
        Message: helloworld.HelloRequest
            [Message Name: helloworld.HelloRequest]
            Field[1]: name = world (string)
            Field[2]: sint32param = -6 (sint32)
            Field[3]: uint64param = 10 (uint64)
            Field[4]: int32param = -5 (int32)
            Field[536870910]: sfixed32param_largefn = 888 (sfixed32)

-- 
You are receiving this mail because:
You are watching all bug changes.
___________________________________________________________________________
Sent via:    Wireshark-bugs mailing list <wireshark-bugs@wireshark.org>
Archives:    https://www.wireshark.org/lists/wireshark-bugs
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-bugs
             mailto:wireshark-bugs-requ...@wireshark.org?subject=unsubscribe

Reply via email to