subchunks

40 views
Skip to first unread message

Andre

unread,
Mar 11, 2012, 12:52:32 AM3/11/12
to Google Safe Browsing API
I'm a little confused on the format of subchunks. Could someone clear
this part of please.

The document states,
That is, for SUB-DATA, in the case of a COUNT value of 0, only an
ADDCHUNKNUM will be present following the COUNT, to indicate the add
chunk that contained the host key. In the case of COUNT >= 1, there
will be 1 or more [ADDCHUNKNUM PREFIX] pairs.

For the data below,

s:5282:4:26
54 94 1B FD 01 00 02 6F 3A 6B 14 54 ED 37 7F 37 6D 01 00 02 59 F9 14
7A 9F 41

hostkey = 54 94 1B FD
count = 01
ADDCHUNKNUM = 00 02 6F 3A
PREFIX = 6B 14 54 ED
ADDCHUNKNUM = 37 7F 37 6D
PREFIX = 01 00 02 59
ADDCHUNKNUM = F9 14 7A 9F
PREFIX = 41

hostkey = 4 bytes, count = 1 byte, ADDCHUNKNUM = 4 bytes, PREFIX = 4
bytes.

I'm a little confused because the last prefix is only 1 byte, am I
making a mistake somewhere?

Thanks in advance.

Mark Maunder

unread,
Mar 11, 2012, 7:29:54 AM3/11/12
to google-safe-...@googlegroups.com, and1...@gmail.com
Hi Andre,

It looks like this sub-data actually contains two hostkeys. So you'd break it up like this:

Hostkey: 54 94 1B FD 
Count: 01 
Addchunknum: 00 02 6F 3A 
Prefix: 6B 14 54 ED 
Hostkey: 37 7F 37 6D 
Count: 01 
Addchunknum: 00 02 59 F9 
Prefix: 14 7A 9F 41

Notice the "count" is 1, not two, so you only parse the first addchunk/prefix combination, then assume there's another hostkey/count/data section because the length specified was 26 bytes in the "s:5282:4:26" header. 

In the docs you'll see the RBNF looks like this:
SUB-DATA    = (HOSTKEY COUNT (ADDCHUNKNUM | (ADDCHUNKNUM PREFIX)+))+

Notice the plus sign right at the end which indicates they can stuff multiple hostkey/count/data entries into a single sub-data section. 

Kind regards,

Mark.



--
You received this message because you are subscribed to the Google Groups "Google Safe Browsing API" group.
To post to this group, send email to google-safe-...@googlegroups.com.
To unsubscribe from this group, send email to google-safe-browsi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-safe-browsing-api?hl=en.




--
Mark Maunder <mmau...@gmail.com>
France: (+33) 068-700-8029

Andre

unread,
Mar 11, 2012, 1:20:53 PM3/11/12
to Google Safe Browsing API
Thank you Mark, that makes sense.
> Mark Maunder <mmaun...@gmail.com>
> France: (+33) 068-700-8029
Reply all
Reply to author
Forward
0 new messages