Better dictionary

pull/6222/head
Craig Tiller 9 years ago
parent 134a6b6ffd
commit 69b6d4ef62
  1. 180
      test/core/end2end/fuzzers/hpack.dictionary
  2. 11
      tools/codegen/core/gen_static_metadata.py

@ -1,91 +1,91 @@
# hpack fuzzing dictionary # hpack fuzzing dictionary
kw0="\x01""0" "\x010"
kw1="\x01""1" "\x011"
kw2="\x01""2" "\x012"
kw3="\x03""200" "\x03200"
kw4="\x03""204" "\x03204"
kw5="\x03""206" "\x03206"
kw6="\x03""304" "\x03304"
kw7="\x03""400" "\x03400"
kw8="\x03""404" "\x03404"
kw9="\x03""500" "\x03500"
kw10="\x06""accept" "\x06accept"
kw11="\x0e""accept-charset" "\x0Eaccept-charset"
kw12="\x0f""accept-encoding" "\x0Faccept-encoding"
kw13="\x0f""accept-language" "\x0Faccept-language"
kw14="\x0d""accept-ranges" "\x0Daccept-ranges"
kw15="\x1b""access-control-allow-origin" "\x1Baccess-control-allow-origin"
kw16="\x03""age" "\x03age"
kw17="\x05""allow" "\x05allow"
kw18="\x10""application/grpc" "\x10application/grpc"
kw19="\x0a:authority" "\x0A:authority"
kw20="\x0d""authorization" "\x0Dauthorization"
kw21="\x0d""cache-control" "\x0Dcache-control"
kw22="\x0a""census-bin" "\x0Acensus-bin"
kw23="\x11""census-binary-bin" "\x11census-binary-bin"
kw24="\x13""content-disposition" "\x13content-disposition"
kw25="\x10""content-encoding" "\x10content-encoding"
kw26="\x10""content-language" "\x10content-language"
kw27="\x0e""content-length" "\x0Econtent-length"
kw28="\x10""content-location" "\x10content-location"
kw29="\x0d""content-range" "\x0Dcontent-range"
kw30="\x0c""content-type" "\x0Ccontent-type"
kw31="\x06""cookie" "\x06cookie"
kw32="\x04""date" "\x04date"
kw33="\x07""deflate" "\x07deflate"
kw34="\x0c""deflate,gzip" "\x0Cdeflate,gzip"
kw35="\x00" "\x00"
kw36="\x04""etag" "\x04etag"
kw37="\x06""expect" "\x06expect"
kw38="\x07""expires" "\x07expires"
kw39="\x04""from" "\x04from"
kw40="\x03GET" "\x03GET"
kw41="\x04grpc" "\x04grpc"
kw42="\x14grpc-accept-encoding" "\x14grpc-accept-encoding"
kw43="\x0dgrpc-encoding" "\x0Dgrpc-encoding"
kw44="\x1egrpc-internal-encoding-request" "\x1Egrpc-internal-encoding-request"
kw45="\x0cgrpc-message" "\x0Cgrpc-message"
kw46="\x0bgrpc-status" "\x0Bgrpc-status"
kw47="\x0cgrpc-timeout" "\x0Cgrpc-timeout"
kw48="\x04gzip" "\x04gzip"
kw49="\x0dgzip, deflate" "\x0Dgzip, deflate"
kw50="\x04host" "\x04host"
kw51="\x04http" "\x04http"
kw52="\x05https" "\x05https"
kw53="\x08identity" "\x08identity"
kw54="\x10identity,deflate" "\x10identity,deflate"
kw55="\x15identity,deflate,gzip" "\x15identity,deflate,gzip"
kw56="\x0didentity,gzip" "\x0Didentity,gzip"
kw57="\x08if-match" "\x08if-match"
kw58="\x11if-modified-since" "\x11if-modified-since"
kw59="\x0dif-none-match" "\x0Dif-none-match"
kw60="\x08if-range" "\x08if-range"
kw61="\x13if-unmodified-since" "\x13if-unmodified-since"
kw62="\x0dlast-modified" "\x0Dlast-modified"
kw63="\x04link" "\x04link"
kw64="\x08location" "\x08location"
kw65="\x0cmax-forwards" "\x0Cmax-forwards"
kw66="\x07:method" "\x07:method"
kw67="\x05:path" "\x05:path"
kw68="\x04POST" "\x04POST"
kw69="\x12proxy-authenticate" "\x12proxy-authenticate"
kw70="\x13proxy-authorization" "\x13proxy-authorization"
kw71="\x03PUT" "\x03PUT"
kw72="\x05range" "\x05range"
kw73="\x07referer" "\x07referer"
kw74="\x07refresh" "\x07refresh"
kw75="\x0bretry-after" "\x0Bretry-after"
kw76="\x07:scheme" "\x07:scheme"
kw77="\x06server" "\x06server"
kw78="\x0aset-cookie" "\x0Aset-cookie"
kw79="\x01/" "\x01/"
kw80="\x0b/index.html" "\x0B/index.html"
kw81="\x07:status" "\x07:status"
kw82="\x19strict-transport-security" "\x19strict-transport-security"
kw83="\x02te" "\x02te"
kw84="\x08trailers" "\x08trailers"
kw85="\x11transfer-encoding" "\x11transfer-encoding"
kw86="\x0auser-agent" "\x0Auser-agent"
kw87="\x04vary" "\x04vary"
kw88="\x03via" "\x03via"
kw89="\x10www-authenticate" "\x10www-authenticate"

@ -246,21 +246,16 @@ with open(sys.argv[0]) as my_source:
hex_bytes = [ord(c) for c in "abcdefABCDEF0123456789"] hex_bytes = [ord(c) for c in "abcdefABCDEF0123456789"]
def esc_c(line): def esc_dict(line):
out = "\"" out = "\""
last_was_hex = False
for c in line: for c in line:
if 32 <= c < 127: if 32 <= c < 127:
if c in hex_bytes and last_was_hex:
out += "\"\""
if c != ord('"'): if c != ord('"'):
out += chr(c) out += chr(c)
else: else:
out += "\\\"" out += "\\\""
last_was_hex = False
else: else:
out += "\\x%02x" % c out += "\\x%02X" % c
last_was_hex = True
return out + "\"" return out + "\""
put_banner([H,C], put_banner([H,C],
@ -293,7 +288,7 @@ print >>C
print >>D, '# hpack fuzzing dictionary' print >>D, '# hpack fuzzing dictionary'
for i, elem in enumerate(all_strs): 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, '#define GRPC_STATIC_MDELEM_COUNT %d' % len(all_elems)
print >>H, 'extern grpc_mdelem grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT];' print >>H, 'extern grpc_mdelem grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT];'

Loading…
Cancel
Save