Skip to content
Snippets Groups Projects
Commit 69b6d4ef authored by Craig Tiller's avatar Craig Tiller
Browse files

Better dictionary

parent 134a6b6f
No related branches found
No related tags found
No related merge requests found
# hpack fuzzing dictionary
kw0="\x01""0"
kw1="\x01""1"
kw2="\x01""2"
kw3="\x03""200"
kw4="\x03""204"
kw5="\x03""206"
kw6="\x03""304"
kw7="\x03""400"
kw8="\x03""404"
kw9="\x03""500"
kw10="\x06""accept"
kw11="\x0e""accept-charset"
kw12="\x0f""accept-encoding"
kw13="\x0f""accept-language"
kw14="\x0d""accept-ranges"
kw15="\x1b""access-control-allow-origin"
kw16="\x03""age"
kw17="\x05""allow"
kw18="\x10""application/grpc"
kw19="\x0a:authority"
kw20="\x0d""authorization"
kw21="\x0d""cache-control"
kw22="\x0a""census-bin"
kw23="\x11""census-binary-bin"
kw24="\x13""content-disposition"
kw25="\x10""content-encoding"
kw26="\x10""content-language"
kw27="\x0e""content-length"
kw28="\x10""content-location"
kw29="\x0d""content-range"
kw30="\x0c""content-type"
kw31="\x06""cookie"
kw32="\x04""date"
kw33="\x07""deflate"
kw34="\x0c""deflate,gzip"
kw35="\x00"
kw36="\x04""etag"
kw37="\x06""expect"
kw38="\x07""expires"
kw39="\x04""from"
kw40="\x03GET"
kw41="\x04grpc"
kw42="\x14grpc-accept-encoding"
kw43="\x0dgrpc-encoding"
kw44="\x1egrpc-internal-encoding-request"
kw45="\x0cgrpc-message"
kw46="\x0bgrpc-status"
kw47="\x0cgrpc-timeout"
kw48="\x04gzip"
kw49="\x0dgzip, deflate"
kw50="\x04host"
kw51="\x04http"
kw52="\x05https"
kw53="\x08identity"
kw54="\x10identity,deflate"
kw55="\x15identity,deflate,gzip"
kw56="\x0didentity,gzip"
kw57="\x08if-match"
kw58="\x11if-modified-since"
kw59="\x0dif-none-match"
kw60="\x08if-range"
kw61="\x13if-unmodified-since"
kw62="\x0dlast-modified"
kw63="\x04link"
kw64="\x08location"
kw65="\x0cmax-forwards"
kw66="\x07:method"
kw67="\x05:path"
kw68="\x04POST"
kw69="\x12proxy-authenticate"
kw70="\x13proxy-authorization"
kw71="\x03PUT"
kw72="\x05range"
kw73="\x07referer"
kw74="\x07refresh"
kw75="\x0bretry-after"
kw76="\x07:scheme"
kw77="\x06server"
kw78="\x0aset-cookie"
kw79="\x01/"
kw80="\x0b/index.html"
kw81="\x07:status"
kw82="\x19strict-transport-security"
kw83="\x02te"
kw84="\x08trailers"
kw85="\x11transfer-encoding"
kw86="\x0auser-agent"
kw87="\x04vary"
kw88="\x03via"
kw89="\x10www-authenticate"
"\x010"
"\x011"
"\x012"
"\x03200"
"\x03204"
"\x03206"
"\x03304"
"\x03400"
"\x03404"
"\x03500"
"\x06accept"
"\x0Eaccept-charset"
"\x0Faccept-encoding"
"\x0Faccept-language"
"\x0Daccept-ranges"
"\x1Baccess-control-allow-origin"
"\x03age"
"\x05allow"
"\x10application/grpc"
"\x0A:authority"
"\x0Dauthorization"
"\x0Dcache-control"
"\x0Acensus-bin"
"\x11census-binary-bin"
"\x13content-disposition"
"\x10content-encoding"
"\x10content-language"
"\x0Econtent-length"
"\x10content-location"
"\x0Dcontent-range"
"\x0Ccontent-type"
"\x06cookie"
"\x04date"
"\x07deflate"
"\x0Cdeflate,gzip"
"\x00"
"\x04etag"
"\x06expect"
"\x07expires"
"\x04from"
"\x03GET"
"\x04grpc"
"\x14grpc-accept-encoding"
"\x0Dgrpc-encoding"
"\x1Egrpc-internal-encoding-request"
"\x0Cgrpc-message"
"\x0Bgrpc-status"
"\x0Cgrpc-timeout"
"\x04gzip"
"\x0Dgzip, deflate"
"\x04host"
"\x04http"
"\x05https"
"\x08identity"
"\x10identity,deflate"
"\x15identity,deflate,gzip"
"\x0Didentity,gzip"
"\x08if-match"
"\x11if-modified-since"
"\x0Dif-none-match"
"\x08if-range"
"\x13if-unmodified-since"
"\x0Dlast-modified"
"\x04link"
"\x08location"
"\x0Cmax-forwards"
"\x07:method"
"\x05:path"
"\x04POST"
"\x12proxy-authenticate"
"\x13proxy-authorization"
"\x03PUT"
"\x05range"
"\x07referer"
"\x07refresh"
"\x0Bretry-after"
"\x07:scheme"
"\x06server"
"\x0Aset-cookie"
"\x01/"
"\x0B/index.html"
"\x07:status"
"\x19strict-transport-security"
"\x02te"
"\x08trailers"
"\x11transfer-encoding"
"\x0Auser-agent"
"\x04vary"
"\x03via"
"\x10www-authenticate"
......@@ -246,21 +246,16 @@ with open(sys.argv[0]) as my_source:
hex_bytes = [ord(c) for c in "abcdefABCDEF0123456789"]
def esc_c(line):
def esc_dict(line):
out = "\""
last_was_hex = False
for c in line:
if 32 <= c < 127:
if c in hex_bytes and last_was_hex:
out += "\"\""
if c != ord('"'):
out += chr(c)
else:
out += "\\\""
last_was_hex = False
else:
out += "\\x%02x" % c
last_was_hex = True
out += "\\x%02X" % c
return out + "\""
put_banner([H,C],
......@@ -293,7 +288,7 @@ print >>C
print >>D, '# hpack fuzzing dictionary'
for i, elem in enumerate(all_strs):
print >>D, 'kw%d=%s' % (i, esc_c([len(elem)] + [ord(c) for c in elem]))
print >>D, '%s' % (esc_dict([len(elem)] + [ord(c) for c in elem]))
print >>H, '#define GRPC_STATIC_MDELEM_COUNT %d' % len(all_elems)
print >>H, 'extern grpc_mdelem grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT];'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment