Merge "veyron2/ipc: Server context should have a method to return a context.T."
diff --git a/lib/flags/flags.go b/lib/flags/flags.go
index bbd71ce..d6a4810 100644
--- a/lib/flags/flags.go
+++ b/lib/flags/flags.go
@@ -54,6 +54,11 @@
nsr.isSet = true
nsr.roots = []string{}
}
+ for _, t := range nsr.roots {
+ if v == t {
+ return nil
+ }
+ }
nsr.roots = append(nsr.roots, v)
return nil
}
@@ -123,11 +128,57 @@
return af.flag.files[name]
}
+// ListenAddrs is the set of listen addresses captured from the command line.
+// ListenAddrs mirrors ipc.ListenAddrs.
+type ListenAddrs []struct {
+ Protocol, Address string
+}
+
// ListenFlags contains the values of the Listen flag group.
type ListenFlags struct {
- ListenProtocol TCPProtocolFlag
- ListenAddress IPHostPortFlag
- ListenProxy string
+ Addrs ListenAddrs
+ ListenProxy string
+ protocol TCPProtocolFlag
+ addresses ipHostPortFlagVar
+}
+
+type ipHostPortFlagVar struct {
+ validator IPHostPortFlag
+ flags *ListenFlags
+}
+
+// Implements flag.Value.Get
+func (ip ipHostPortFlagVar) Get() interface{} {
+ return ip.String()
+}
+
+// Implements flag.Value.Set
+func (ip *ipHostPortFlagVar) Set(s string) error {
+ if err := ip.validator.Set(s); err != nil {
+ return err
+ }
+ a := struct {
+ Protocol, Address string
+ }{
+ ip.flags.protocol.String(),
+ ip.validator.String(),
+ }
+ for _, t := range ip.flags.Addrs {
+ if t.Protocol == a.Protocol && t.Address == a.Address {
+ return nil
+ }
+ }
+ ip.flags.Addrs = append(ip.flags.Addrs, a)
+ return nil
+}
+
+// Implements flag.Value.String
+func (ip ipHostPortFlagVar) String() string {
+ s := ""
+ for _, a := range ip.flags.Addrs {
+ s += fmt.Sprintf("(%s %s)", a.Protocol, a.Address)
+ }
+ return s
}
// createAndRegisterRuntimeFlags creates and registers the RuntimeFlags
@@ -160,11 +211,14 @@
// createAndRegisterListenFlags creates and registers the ListenFlags
// group with the supplied flag.FlagSet.
func createAndRegisterListenFlags(fs *flag.FlagSet) *ListenFlags {
- f := &ListenFlags{}
- f.ListenProtocol = TCPProtocolFlag{"tcp"}
- f.ListenAddress = IPHostPortFlag{Port: "0"}
- fs.Var(&f.ListenProtocol, "veyron.tcp.protocol", "protocol to listen with")
- fs.Var(&f.ListenAddress, "veyron.tcp.address", "address to listen on")
+ f := &ListenFlags{
+ protocol: TCPProtocolFlag{"tcp"},
+ addresses: ipHostPortFlagVar{validator: IPHostPortFlag{Port: "0"}},
+ }
+ f.addresses.flags = f
+
+ fs.Var(&f.protocol, "veyron.tcp.protocol", "protocol to listen with")
+ fs.Var(&f.addresses, "veyron.tcp.address", "address to listen on")
fs.StringVar(&f.ListenProxy, "veyron.proxy", "", "object name of proxy service to use to export services across network boundaries")
return f
}
@@ -209,7 +263,16 @@
// method can be used for testing to see if any given group was configured.
func (f *Flags) ListenFlags() ListenFlags {
if p := f.groups[Listen]; p != nil {
- return *(p.(*ListenFlags))
+ lf := p.(*ListenFlags)
+ n := *lf
+ if len(lf.Addrs) == 0 {
+ n.Addrs = ListenAddrs{{n.protocol.String(),
+ n.addresses.validator.String()}}
+ return n
+ }
+ n.Addrs = make(ListenAddrs, len(lf.Addrs))
+ copy(n.Addrs, lf.Addrs)
+ return n
}
return ListenFlags{}
}
diff --git a/lib/flags/flags_test.go b/lib/flags/flags_test.go
index a3da088..8adaacf 100644
--- a/lib/flags/flags_test.go
+++ b/lib/flags/flags_test.go
@@ -77,7 +77,6 @@
}
fs = flag.NewFlagSet("test", flag.ContinueOnError)
- //fs.SetOutput(ioutil.Discard)
fl = flags.CreateAndRegister(fs, flags.ACL)
args = []string{"--veyron.acl=noname"}
err = fl.Parse(args)
@@ -99,7 +98,7 @@
if got, want := fl.RuntimeFlags().NamespaceRoots, roots; !reflect.DeepEqual(got, want) {
t.Errorf("got %v, want %v", got, want)
}
- if got, want := lf.ListenAddress.String(), addr; got != want {
+ if got, want := lf.Addrs[0].Address, addr; got != want {
t.Errorf("got %q, want %q", got, want)
}
}
@@ -180,3 +179,83 @@
t.Errorf("got %q, want %q", got, want)
}
}
+
+func TestListenFlags(t *testing.T) {
+ fl := flags.CreateAndRegister(flag.NewFlagSet("test", flag.ContinueOnError), flags.Listen)
+ if err := fl.Parse([]string{}); err != nil {
+ t.Fatalf("unexpected error: %s", err)
+ }
+ lf := fl.ListenFlags()
+ if got, want := len(lf.Addrs), 1; got != want {
+ t.Errorf("got %d, want %d", got, want)
+ }
+ def := struct{ Protocol, Address string }{"tcp", ":0"}
+ if got, want := lf.Addrs[0], def; !reflect.DeepEqual(got, want) {
+ t.Errorf("got %v, want %v", got, want)
+ }
+
+ fl = flags.CreateAndRegister(flag.NewFlagSet("test", flag.ContinueOnError), flags.Listen)
+ if err := fl.Parse([]string{
+ "--veyron.tcp.address=172.0.0.1:10", "--veyron.tcp.protocol=ws", "--veyron.tcp.address=127.0.0.10:34", "--veyron.tcp.protocol=tcp6", "--veyron.tcp.address=172.0.0.100:100"}); err != nil {
+ t.Fatalf("unexpected error: %s", err)
+ }
+ lf = fl.ListenFlags()
+ if got, want := len(lf.Addrs), 3; got != want {
+ t.Errorf("got %d, want %d", got, want)
+ }
+ for i, p := range []string{"tcp", "ws", "tcp6"} {
+ if got, want := lf.Addrs[i].Protocol, p; got != want {
+ t.Errorf("got %q, want %q", got, want)
+ }
+ }
+ for i, p := range []string{"172.0.0.1:10", "127.0.0.10:34", "172.0.0.100:100"} {
+ if got, want := lf.Addrs[i].Address, p; got != want {
+ t.Errorf("got %q, want %q", got, want)
+ }
+ }
+}
+
+func TestDuplicateFlags(t *testing.T) {
+ fl := flags.CreateAndRegister(flag.NewFlagSet("test", flag.ContinueOnError), flags.Listen)
+ if err := fl.Parse([]string{
+ "--veyron.tcp.address=172.0.0.1:10", "--veyron.tcp.address=172.0.0.1:10", "--veyron.tcp.address=172.0.0.1:34", "--veyron.tcp.protocol=ws", "--veyron.tcp.address=172.0.0.1:10", "--veyron.tcp.address=172.0.0.1:34", "--veyron.tcp.address=172.0.0.1:34"}); err != nil {
+ t.Fatalf("unexpected error: %s", err)
+ }
+ lf := fl.ListenFlags()
+ if got, want := len(lf.Addrs), 4; got != want {
+ t.Errorf("got %d, want %d", got, want)
+ }
+ expected := flags.ListenAddrs{
+ {"tcp", "172.0.0.1:10"},
+ {"tcp", "172.0.0.1:34"},
+ {"ws", "172.0.0.1:10"},
+ {"ws", "172.0.0.1:34"},
+ }
+ if got, want := lf.Addrs, expected; !reflect.DeepEqual(got, want) {
+ t.Fatalf("got %#v, want %#v", got, want)
+ }
+ if err := fl.Parse([]string{
+ "--veyron.tcp.address=172.0.0.1:10", "--veyron.tcp.address=172.0.0.1:10", "--veyron.tcp.address=172.0.0.1:34", "--veyron.tcp.protocol=ws", "--veyron.tcp.address=172.0.0.1:10", "--veyron.tcp.address=127.0.0.1:34", "--veyron.tcp.address=127.0.0.1:34"}); err != nil {
+ t.Fatalf("unexpected error: %s", err)
+ }
+ if got, want := len(lf.Addrs), 4; got != want {
+ t.Errorf("got %d, want %d", got, want)
+ }
+ if got, want := lf.Addrs, expected; !reflect.DeepEqual(got, want) {
+ t.Fatalf("got %#v, want %#v", got, want)
+ }
+
+ fl = flags.CreateAndRegister(flag.NewFlagSet("test", flag.ContinueOnError), flags.Runtime)
+
+ if err := fl.Parse([]string{"--veyron.namespace.root=ab", "--veyron.namespace.root=xy", "--veyron.namespace.root=ab"}); err != nil {
+ t.Fatalf("unexpected error: %s", err)
+ }
+
+ rf := fl.RuntimeFlags()
+ if got, want := len(rf.NamespaceRoots), 2; got != want {
+ t.Errorf("got %d, want %d", got, want)
+ }
+ if got, want := rf.NamespaceRoots, []string{"ab", "xy"}; !reflect.DeepEqual(got, want) {
+ t.Fatalf("got %#v, want %#v", got, want)
+ }
+}
diff --git a/lib/flags/listen.go b/lib/flags/listen.go
index 929dd56..1812fe4 100644
--- a/lib/flags/listen.go
+++ b/lib/flags/listen.go
@@ -7,8 +7,8 @@
)
// TCPProtocolFlag implements flag.Value to provide validation of the
-// command line values passed to it: tcp, tcp4 or tcp6 being the
-// only allowed values.
+// command line values passed to it: tcp, tcp4 or tcp6, ws, ws4 and ws6
+// being the only allowed values.
type TCPProtocolFlag struct{ Protocol string }
// Implements flag.Value.Get
@@ -19,7 +19,7 @@
// Implements flag.Value.Set
func (t *TCPProtocolFlag) Set(s string) error {
switch s {
- case "tcp", "tcp4", "tcp6":
+ case "tcp", "tcp4", "tcp6", "ws", "ws4", "ws6":
t.Protocol = s
return nil
default:
diff --git a/lib/flags/main.go b/lib/flags/main.go
index cae781a..044c91e 100644
--- a/lib/flags/main.go
+++ b/lib/flags/main.go
@@ -22,8 +22,9 @@
fmt.Printf("Runtime: Credentials: %s\n", rtf.Credentials)
fmt.Printf("Runtime: Namespace Roots: %s\n", rtf.NamespaceRoots)
lf := fl.ListenFlags()
- fmt.Printf("Listen: Protocol %q\n", lf.ListenProtocol)
- fmt.Printf("Listen: Address %q\n", lf.ListenAddress)
+ for _, a := range lf.ListenAddrs {
+ fmt.Printf("Listen: Protocol %q, Address %q\n", a.Protocol, a.Address)
+ }
fmt.Printf("Listen: Proxy %q\n", lf.ListenProxy)
fmt.Printf("ACL: %v\n", fl.ACLFlags())
}
diff --git a/lib/modules/core/core.go b/lib/modules/core/core.go
index a3a889c..0a49e3e 100644
--- a/lib/modules/core/core.go
+++ b/lib/modules/core/core.go
@@ -5,7 +5,8 @@
//
// root
// runs a root mount table as a subprocess
-// prints the MT_NAME=<root name>, PID=<pid> variables to stdout
+// prints the PID=<pid> variable to stdout followed by
+// an arbitrary number of MT_NAME and MT_ADDR variables.
// waits for stdin to be closed before it exits
// prints "done" to stdout when stdin is closed.
// mt <mp>
@@ -40,7 +41,9 @@
//
// echoServer <message> <name>
// runs on echoServer at <name>, it will echo back <message>: <text>
-// where <text> is supplied by the client
+// where <text> is supplied by the client. It prints the PID=<pid>
+// variable to stdout followd by an arbitrary number of NAME, ADDR
+// variables.
// echoClient <name> <text>
// invoke <name>.Echo(<text>)
//
diff --git a/lib/modules/core/core_test.go b/lib/modules/core/core_test.go
index cd9e26b..f00a65a 100644
--- a/lib/modules/core/core_test.go
+++ b/lib/modules/core/core_test.go
@@ -34,6 +34,8 @@
testutil.Init()
}
+// TODO(cnicolaou): add test for proxyd
+
func newShell(t *testing.T) (*modules.Shell, func()) {
sh, err := modules.NewShell(nil)
if err != nil {
@@ -62,9 +64,9 @@
t.Fatalf("unexpected error: %s", err)
}
s := expect.NewSession(t, root.Stdout(), time.Second)
+ s.ExpectVar("PID")
s.ExpectVar("MT_NAME")
s.ExpectVar("MT_ADDR")
- s.ExpectVar("PID")
root.CloseStdin()
}
@@ -76,6 +78,7 @@
}
sh.Forget(root)
rootSession := expect.NewSession(t, root.Stdout(), time.Minute)
+ rootSession.ExpectVar("PID")
rootName := rootSession.ExpectVar("MT_NAME")
if t.Failed() {
return nil, nil, rootSession.Error()
@@ -93,6 +96,7 @@
s := expect.NewSession(t, h.Stdout(), time.Minute)
// Wait until each mount table has at least called Serve to
// mount itself.
+ s.ExpectVar("PID")
mountAddrs[mp] = s.ExpectVar("MT_NAME")
if s.Failed() {
return nil, nil, s.Error()
@@ -179,6 +183,7 @@
t.Fatalf("unexpected error: %s", err)
}
srvSession := expect.NewSession(t, srv.Stdout(), time.Minute)
+ srvSession.ExpectVar("PID")
name := srvSession.ExpectVar("NAME")
if len(name) == 0 {
t.Fatalf("failed to get name")
diff --git a/lib/modules/core/echo.go b/lib/modules/core/echo.go
index 5f82c34..c8c432c 100644
--- a/lib/modules/core/echo.go
+++ b/lib/modules/core/echo.go
@@ -68,16 +68,18 @@
return err
}
defer server.Stop()
- ep, err := server.Listen(initListenSpec(fl))
+ eps, err := server.Listen(initListenSpec(fl))
if err != nil {
return err
}
if err := server.ServeDispatcher(mp, disp); err != nil {
return err
}
- fmt.Fprintf(stdout, "NAME=%s\n", naming.JoinAddressName(ep.String(), ""))
- fmt.Fprintf(stdout, "ADDR=%s\n", ep.String())
fmt.Fprintf(stdout, "PID=%d\n", os.Getpid())
+ for _, ep := range eps {
+ fmt.Fprintf(stdout, "NAME=%s\n", naming.JoinAddressName(ep.String(), ""))
+ fmt.Fprintf(stdout, "ADDR=%s\n", ep)
+ }
modules.WaitForEOF(stdin)
return nil
}
diff --git a/lib/modules/core/mounttable.go b/lib/modules/core/mounttable.go
index 066cf10..26a65e3 100644
--- a/lib/modules/core/mounttable.go
+++ b/lib/modules/core/mounttable.go
@@ -58,17 +58,19 @@
if err != nil {
return fmt.Errorf("mounttable.NewMountTable failed: %s", err)
}
- ep, err := server.Listen(lspec)
+ eps, err := server.Listen(lspec)
if err != nil {
return fmt.Errorf("server.Listen failed: %s", err)
}
if err := server.ServeDispatcher(mp, mt); err != nil {
return fmt.Errorf("root failed: %s", err)
}
- name := naming.JoinAddressName(ep.String(), "")
- fmt.Fprintf(stdout, "MT_NAME=%s\n", name)
- fmt.Fprintf(stdout, "MT_ADDR=%s\n", ep.String())
fmt.Fprintf(stdout, "PID=%d\n", os.Getpid())
+ for _, ep := range eps {
+ name := naming.JoinAddressName(ep.String(), "")
+ fmt.Fprintf(stdout, "MT_NAME=%s\n", name)
+ fmt.Fprintf(stdout, "MT_ADDR=%s\n", ep.String())
+ }
modules.WaitForEOF(stdin)
return nil
}
diff --git a/lib/modules/core/proxy.go b/lib/modules/core/proxy.go
index d1d2477..4ec2a2c 100644
--- a/lib/modules/core/proxy.go
+++ b/lib/modules/core/proxy.go
@@ -3,7 +3,7 @@
import (
"fmt"
"io"
- "strings"
+ "os"
"time"
"veyron.io/veyron/veyron2/naming"
@@ -19,65 +19,59 @@
}
func proxyServer(stdin io.Reader, stdout, stderr io.Writer, env map[string]string, args ...string) error {
+ r, err := rt.New()
+ if err != nil {
+ panic(err)
+ }
fl, args, err := parseListenFlags(args)
if err != nil {
return fmt.Errorf("failed to parse args: %s", err)
}
- // TODO(sadovsky): Why does this require >=1 arg? Seems 0 should be fine.
- // Also note, we have no way to specify ">=0".
- if err := checkArgs(args, -1, ""); err != nil {
- return err
- }
expected := len(args)
rid, err := naming.NewRoutingID()
if err != nil {
return err
}
lf := fl.ListenFlags()
- // TODO(ashankar): Set the second argument to r.Principal() once the
- // old security model is no longer operational.
- proxy, err := proxy.New(rid, nil, lf.ListenProtocol.String(), lf.ListenAddress.String(), "")
+
+ proxy, err := proxy.New(rid, r.Principal(), lf.Addrs[0].Protocol, lf.Addrs[0].Address, "")
if err != nil {
return err
}
defer proxy.Shutdown()
+
pname := naming.JoinAddressName(proxy.Endpoint().String(), "")
+ fmt.Fprintf(stdout, "PID=%d\n", os.Getpid())
fmt.Fprintf(stdout, "PROXY_ADDR=%s\n", proxy.Endpoint().String())
fmt.Fprintf(stdout, "PROXY_NAME=%s\n", pname)
-
- r, err := rt.New()
- if err != nil {
- panic(err)
- }
- defer r.Cleanup()
-
- pub := publisher.New(r.NewContext(), r.Namespace(), time.Minute)
- defer pub.WaitForStop()
- defer pub.Stop()
- pub.AddServer(pname, false)
- // If the protocol is tcp we need to also publish the websocket endpoint.
- // TODO(bjornick): Remove this hack before we launch.
- if strings.HasPrefix(proxy.Endpoint().Addr().Network(), "tcp") {
- wsEP := strings.Replace(pname, "@"+proxy.Endpoint().Addr().Network()+"@", "@ws@", 1)
- pub.AddServer(wsEP, false)
- }
- for _, name := range args {
- pub.AddName(name)
- }
- // Wait for all the entries to be published.
- for {
- got := len(pub.Published())
- if expected == got {
- break
+ if expected > 0 {
+ defer r.Cleanup()
+ pub := publisher.New(r.NewContext(), r.Namespace(), time.Minute)
+ defer pub.WaitForStop()
+ defer pub.Stop()
+ pub.AddServer(pname, false)
+ for _, name := range args {
+ if len(name) == 0 {
+ return fmt.Errorf("empty name specified on the command line")
+ }
+ pub.AddName(name)
}
- fmt.Fprintf(stderr, "%s\n", pub.DebugString())
- delay := time.Second
- fmt.Fprintf(stderr, "Sleeping: %s\n", delay)
- time.Sleep(delay)
- }
- for _, p := range pub.Published() {
- fmt.Fprintf(stdout, "PUBLISHED_PROXY_NAME=%s\n", p)
+ // Wait for all the entries to be published.
+ for {
+ got := len(pub.Published())
+ if expected == got {
+ break
+ }
+ fmt.Fprintf(stderr, "%s\n", pub.DebugString())
+ delay := time.Second
+ fmt.Fprintf(stderr, "Sleeping: %s\n", delay)
+ time.Sleep(delay)
+ }
+ for _, p := range pub.Published() {
+ fmt.Fprintf(stdout, "PUBLISHED_PROXY_NAME=%s\n", p)
+ }
}
modules.WaitForEOF(stdin)
+ fmt.Fprintf(stdout, "DONE\n")
return nil
}
diff --git a/lib/modules/core/util.go b/lib/modules/core/util.go
index a429651..4207bf4 100644
--- a/lib/modules/core/util.go
+++ b/lib/modules/core/util.go
@@ -28,9 +28,8 @@
func initListenSpec(fl *flags.Flags) ipc.ListenSpec {
lf := fl.ListenFlags()
return ipc.ListenSpec{
- Protocol: lf.ListenProtocol.String(),
- Address: lf.ListenAddress.String(),
- Proxy: lf.ListenProxy,
+ Addrs: ipc.ListenAddrs(lf.Addrs),
+ Proxy: lf.ListenProxy,
}
}
diff --git a/lib/modules/exec.go b/lib/modules/exec.go
index 2d517d7..2e2271a 100644
--- a/lib/modules/exec.go
+++ b/lib/modules/exec.go
@@ -139,6 +139,7 @@
eh.stdin = stdin
eh.handle = handle
eh.cmd = cmd
+ vlog.VI(1).Infof("Start: %q stderr: %s", eh.name, stderr.Name())
vlog.VI(1).Infof("Start: %q args: %v", eh.name, cmd.Args)
vlog.VI(2).Infof("Start: %q env: %v", eh.name, cmd.Env)
if err := handle.Start(); err != nil {
diff --git a/lib/modules/modules_test.go b/lib/modules/modules_test.go
index 074d39a..c8512eb 100644
--- a/lib/modules/modules_test.go
+++ b/lib/modules/modules_test.go
@@ -430,10 +430,9 @@
sh.Cleanup(nil, nil)
// Test child credentials when VeyronCredentials are set.
- root := tsecurity.NewPrincipal("root")
old := os.Getenv(consts.VeyronCredentials)
defer os.Setenv(consts.VeyronCredentials, old)
- dir := tsecurity.NewVeyronCredentials(root, "os")
+ dir, _ := tsecurity.NewCredentials("os")
defer os.RemoveAll(dir)
if err := os.Setenv(consts.VeyronCredentials, dir); err != nil {
t.Fatal(err)
@@ -442,7 +441,7 @@
if err != nil {
t.Fatalf("unexpected error: %s", err)
}
- if err := validateCredentials(startChildAndGetCredentials(sh, nil), "root/os/child"); err != nil {
+ if err := validateCredentials(startChildAndGetCredentials(sh, nil), "os/child"); err != nil {
t.Fatal(err)
}
sh.Cleanup(nil, nil)
@@ -453,34 +452,34 @@
}
// Test that VeyronCredentials specified on the shell override the OS ones.
- dir = tsecurity.NewVeyronCredentials(root, "shell")
+ dir, _ = tsecurity.NewCredentials("shell")
defer os.RemoveAll(dir)
sh, err = modules.NewShell(nil)
if err != nil {
t.Fatalf("unexpected error: %s", err)
}
sh.SetVar(consts.VeyronCredentials, dir)
- if err := validateCredentials(startChildAndGetCredentials(sh, nil), "root/shell/child"); err != nil {
+ if err := validateCredentials(startChildAndGetCredentials(sh, nil), "shell/child"); err != nil {
t.Fatal(err)
}
sh.ClearVar(consts.VeyronCredentials)
if credentials := startChildAndGetCredentials(sh, nil); len(credentials) != 0 {
t.Fatalf("found credentials %v set for child even when shell credentials were cleared", credentials)
}
- anotherDir := tsecurity.NewVeyronCredentials(root, "anotherShell")
+ anotherDir, _ := tsecurity.NewCredentials("anotherShell")
defer os.RemoveAll(anotherDir)
sh.SetVar(consts.VeyronCredentials, anotherDir)
- if err := validateCredentials(startChildAndGetCredentials(sh, nil), "root/anotherShell/child"); err != nil {
+ if err := validateCredentials(startChildAndGetCredentials(sh, nil), "anotherShell/child"); err != nil {
t.Fatal(err)
}
sh.Cleanup(nil, nil)
// Test that VeyronCredentials specified as a parameter overrides the OS and
// shell ones.
- dir = tsecurity.NewVeyronCredentials(root, "param")
+ dir, _ = tsecurity.NewCredentials("param")
defer os.RemoveAll(dir)
env := []string{consts.VeyronCredentials + "=" + dir}
- if err := validateCredentials(startChildAndGetCredentials(sh, env), "root/param"); err != nil {
+ if err := validateCredentials(startChildAndGetCredentials(sh, env), "param"); err != nil {
t.Fatal(err)
}
diff --git a/lib/signals/signals_test.go b/lib/signals/signals_test.go
index 198f830..635bac8 100644
--- a/lib/signals/signals_test.go
+++ b/lib/signals/signals_test.go
@@ -323,14 +323,14 @@
t.Fatalf("Got error: %v", err)
}
ch := make(chan string)
- var ep naming.Endpoint
+ var ep []naming.Endpoint
if ep, err = server.Listen(profiles.LocalListenSpec); err != nil {
t.Fatalf("Got error: %v", err)
}
if err := server.Serve("", device.ConfigServer(&configServer{ch}), vflag.NewAuthorizerOrDie()); err != nil {
t.Fatalf("Got error: %v", err)
}
- return server, naming.JoinAddressName(ep.String(), ""), ch
+ return server, naming.JoinAddressName(ep[0].String(), ""), ch
}
@@ -350,7 +350,7 @@
// Set the child process up with a blessing from the parent so that
// the default authorization works for RPCs between the two.
- childcreds := security.NewVeyronCredentials(runtime.Principal(), "child")
+ childcreds, _ := security.ForkCredentials(runtime.Principal(), "child")
defer os.RemoveAll(childcreds)
configServer, configServiceName, ch := createConfigServer(t, runtime)
defer configServer.Stop()
diff --git a/lib/tcp/init.go b/lib/tcp/init.go
index a62422e..bbc525c 100644
--- a/lib/tcp/init.go
+++ b/lib/tcp/init.go
@@ -1,37 +1,13 @@
package tcp
import (
- "fmt"
"net"
- "time"
"veyron.io/veyron/veyron2/ipc/stream"
-
- "veyron.io/veyron/veyron/lib/websocket"
)
-func dialer(network, address string, timeout time.Duration) (net.Conn, error) {
- conn, err := net.DialTimeout(network, address, timeout)
- if err != nil {
- return nil, err
- }
- // For tcp connections we add an extra magic byte so we can differentiate between
- // raw tcp and websocket on the same port.
- switch n, err := conn.Write([]byte{websocket.BinaryMagicByte}); {
- case err != nil:
- return nil, err
- case n != 1:
- return nil, fmt.Errorf("Unable to write the magic byte")
- }
- return conn, nil
-}
-
-func listener(network, address string) (net.Listener, error) {
- return net.Listen(network, address)
-}
-
func init() {
for _, p := range []string{"tcp", "tcp4", "tcp6"} {
- stream.RegisterProtocol(p, dialer, listener)
+ stream.RegisterProtocol(p, net.DialTimeout, net.Listen)
}
}
diff --git a/lib/testutil/integration/util.go b/lib/testutil/integration/util.go
index 4e7e1d9..fdc0afa 100644
--- a/lib/testutil/integration/util.go
+++ b/lib/testutil/integration/util.go
@@ -2,20 +2,317 @@
import (
"bufio"
+ "bytes"
"fmt"
+ "io"
"io/ioutil"
"os"
"os/exec"
"path"
"path/filepath"
"strings"
+ "syscall"
+ "testing"
"time"
"veyron.io/veyron/veyron/lib/expect"
"veyron.io/veyron/veyron/lib/modules"
"veyron.io/veyron/veyron/lib/modules/core"
+ tsecurity "veyron.io/veyron/veyron/lib/testutil/security"
+ "veyron.io/veyron/veyron2/security"
)
+// TestEnvironment represents a test environment. You should obtain
+// an instance with NewTestEnvironment. Typically, an end-to-end
+// test will begin with:
+// func TestFoo(t *testing.T) {
+// env := integration.NewTestEnvironment(t)
+// defer env.Cleanup()
+//
+// ...
+// }
+type TestEnvironment interface {
+ // Cleanup cleans up the environment and deletes all its artifacts.
+ Cleanup()
+
+ // BuildGoPkg expects a Go package path that identifies a "main"
+ // package and returns a TestBinary representing the newly built
+ // binary.
+ BuildGoPkg(path string) TestBinary
+
+ // RootMT returns the endpoint to the root mounttable for this test
+ // environment.
+ RootMT() string
+
+ // Principal returns the security principal of this environment.
+ Principal() security.Principal
+
+ // DebugShell drops the user into a debug shell. If there is no
+ // controlling TTY, DebugShell will emit a warning message and take no
+ // futher action.
+ DebugShell()
+
+ // TempFile creates a temporary file. Temporary files will be deleted
+ // by Cleanup.
+ TempFile() *os.File
+}
+
+type TestBinary interface {
+ // Start starts the given binary with the given arguments.
+ Start(args ...string) Invocation
+
+ // Path returns the path to the binary.
+ Path() string
+}
+
+type Invocation interface {
+ Stdin() io.Writer
+ Stdout() io.Reader
+ Stderr() io.Reader
+
+ // Output reads the invocation's stdout until EOF and then returns what
+ // was read as a string.
+ Output() string
+
+ // ErrorOutput reads the invocation's stderr until EOF and then returns
+ // what was read as a string.
+ ErrorOutput() string
+
+ // Wait waits for this invocation to finish. If either stdout or stderr
+ // is non-nil, any remaining unread output from those sources will be
+ // written to the corresponding writer.
+ Wait(stdout, stderr io.Writer)
+}
+
+type integrationTestEnvironment struct {
+ // The testing framework.
+ t *testing.T
+
+ // The shell to use to start commands.
+ shell *modules.Shell
+
+ // The environment's root security principal.
+ principal security.Principal
+
+ // Maps path to TestBinary.
+ builtBinaries map[string]*integrationTestBinary
+
+ mtHandle *modules.Handle
+ mtEndpoint string
+
+ tempFiles []*os.File
+}
+
+type integrationTestBinary struct {
+ // The environment to which this binary belongs.
+ env *integrationTestEnvironment
+
+ // The path to the binary.
+ path string
+
+ // The cleanup function to run when the binary exits.
+ cleanupFunc func()
+}
+
+type integrationTestBinaryInvocation struct {
+ // The environment to which this invocation belongs.
+ env *integrationTestEnvironment
+
+ // The handle to the process that was run when this invocation was started.
+ handle *modules.Handle
+}
+
+func (i *integrationTestBinaryInvocation) Stdin() io.Writer {
+ return (*i.handle).Stdin()
+}
+
+func (i *integrationTestBinaryInvocation) Stdout() io.Reader {
+ return (*i.handle).Stdout()
+}
+
+func readerToString(t *testing.T, r io.Reader) string {
+ buf := bytes.Buffer{}
+ _, err := buf.ReadFrom(r)
+ if err != nil {
+ t.Fatalf("ReadFrom() failed: %v", err)
+ }
+ return buf.String()
+}
+
+func (i *integrationTestBinaryInvocation) Output() string {
+ return readerToString(i.env.t, i.Stdout())
+}
+
+func (i *integrationTestBinaryInvocation) Stderr() io.Reader {
+ return (*i.handle).Stderr()
+}
+
+func (i *integrationTestBinaryInvocation) ErrorOutput() string {
+ return readerToString(i.env.t, i.Stderr())
+}
+
+func (i *integrationTestBinaryInvocation) Wait(stdout, stderr io.Writer) {
+ if err := (*i.handle).Shutdown(stdout, stderr); err != nil {
+ i.env.t.Fatalf("Shutdown() failed: %v", err)
+ }
+}
+
+func (b *integrationTestBinary) cleanup() {
+ binaryDir := path.Dir(b.path)
+ b.env.t.Logf("cleaning up %s", binaryDir)
+ if err := os.RemoveAll(binaryDir); err != nil {
+ b.env.t.Logf("WARNING: RemoveAll(%s) failed (%v)", binaryDir, err)
+ }
+}
+
+func (b *integrationTestBinary) Path() string {
+ return b.path
+}
+
+func (b *integrationTestBinary) Start(args ...string) Invocation {
+ b.env.t.Logf("starting %s %s", b.Path(), strings.Join(args, " "))
+ handle, err := b.env.shell.Start("exec", nil, append([]string{b.Path()}, args...)...)
+ if err != nil {
+ b.env.t.Fatalf("Start(%v, %v) failed: %v", b.Path(), strings.Join(args, ", "), err)
+ }
+ return &integrationTestBinaryInvocation{
+ env: b.env,
+ handle: &handle,
+ }
+}
+
+func (e *integrationTestEnvironment) RootMT() string {
+ return e.mtEndpoint
+}
+
+func (e *integrationTestEnvironment) Principal() security.Principal {
+ return e.principal
+}
+
+func (e *integrationTestEnvironment) Cleanup() {
+ for _, binary := range e.builtBinaries {
+ binary.cleanupFunc()
+ }
+
+ for _, tempFile := range e.tempFiles {
+ e.t.Logf("cleaning up %s", tempFile.Name())
+ if err := tempFile.Close(); err != nil {
+ e.t.Logf("WARNING: Close(%s) failed", tempFile, err)
+ }
+ if err := os.Remove(tempFile.Name()); err != nil {
+ e.t.Logf("WARNING: Remove(%s) failed: %v", tempFile.Name(), err)
+ }
+ }
+
+ if err := e.shell.Cleanup(os.Stdout, os.Stderr); err != nil {
+ e.t.Fatalf("WARNING: could not clean up shell (%v)", err)
+ }
+}
+
+func (e *integrationTestEnvironment) DebugShell() {
+ // Get the current working directory.
+ cwd, err := os.Getwd()
+ if err != nil {
+ e.t.Fatalf("Getwd() failed: %v", err)
+ }
+
+ // Transfer stdin, stdout, and stderr to the new process
+ // and also set target directory for the shell to start in.
+ dev := "/dev/tty"
+ fd, err := syscall.Open(dev, 0, 0)
+ if err != nil {
+ e.t.Logf("WARNING: Open(%v) failed, not going to create a debug shell: %v", dev, err)
+ return
+ }
+ attr := os.ProcAttr{
+ Files: []*os.File{os.NewFile(uintptr(fd), "/dev/tty"), os.Stdout, os.Stderr},
+ Dir: cwd,
+ }
+
+ // Start up a new shell.
+ fmt.Printf(">> Starting a new interactive shell\n")
+ fmt.Printf("Hit CTRL-D to resume the test\n")
+ if len(e.builtBinaries) > 0 {
+ fmt.Println("Built binaries:")
+ for _, value := range e.builtBinaries {
+ fmt.Println(value.Path())
+ }
+ }
+ fmt.Println("Root mounttable endpoint:", e.RootMT())
+
+ shellPath := "/bin/sh"
+ proc, err := os.StartProcess(shellPath, []string{}, &attr)
+ if err != nil {
+ e.t.Fatalf("StartProcess(%v) failed: %v", shellPath, err)
+ }
+
+ // Wait until user exits the shell
+ state, err := proc.Wait()
+ if err != nil {
+ e.t.Fatalf("Wait(%v) failed: %v", shellPath, err)
+ }
+
+ fmt.Printf("<< Exited shell: %s\n", state.String())
+}
+
+func (e *integrationTestEnvironment) BuildGoPkg(binary_path string) TestBinary {
+ e.t.Logf("building %s...", binary_path)
+ if cached_binary := e.builtBinaries[binary_path]; cached_binary != nil {
+ e.t.Logf("using cached binary for %s at %s.", binary_path, cached_binary.Path())
+ return cached_binary
+ }
+ built_path, cleanup, err := BuildPkgs([]string{binary_path})
+ if err != nil {
+ e.t.Fatalf("BuildPkgs() failed: %v", err)
+ return nil
+ }
+ output_path := path.Join(built_path, path.Base(binary_path))
+ e.t.Logf("done building %s, written to %s.", binary_path, output_path)
+ binary := &integrationTestBinary{
+ env: e,
+ path: output_path,
+ cleanupFunc: cleanup,
+ }
+ e.builtBinaries[binary_path] = binary
+ return binary
+}
+
+func (e *integrationTestEnvironment) TempFile() *os.File {
+ f, err := ioutil.TempFile("", "")
+ if err != nil {
+ e.t.Fatalf("TempFile() failed: %v", err)
+ }
+ e.t.Logf("created temporary file at %s", f.Name())
+ e.tempFiles = append(e.tempFiles, f)
+ return f
+}
+
+func NewTestEnvironment(t *testing.T) TestEnvironment {
+ t.Log("creating root principal")
+ principal := tsecurity.NewPrincipal("root")
+ shell, err := modules.NewShell(principal)
+ if err != nil {
+ t.Fatalf("NewShell() failed: %v", err)
+ }
+
+ t.Log("starting root mounttable...")
+ mtHandle, mtEndpoint, err := StartRootMT(shell)
+ if err != nil {
+ t.Fatalf("StartRootMT() failed: %v", err)
+ }
+ t.Logf("mounttable available at %s", mtEndpoint)
+
+ return &integrationTestEnvironment{
+ t: t,
+ principal: principal,
+ builtBinaries: make(map[string]*integrationTestBinary),
+ shell: shell,
+ mtHandle: &mtHandle,
+ mtEndpoint: mtEndpoint,
+ tempFiles: []*os.File{},
+ }
+}
+
// BuildPkgs returns a path to a directory that contains the built
// binaries for the given set of packages and a function that should
// be invoked to clean up the build artifacts. Note that the clients
@@ -61,7 +358,11 @@
if err != nil {
return nil, "", err
}
- s := expect.NewSession(nil, handle.Stdout(), time.Second)
+ s := expect.NewSession(nil, handle.Stdout(), 10*time.Second)
+ s.ExpectVar("PID")
+ if err := s.Error(); err != nil {
+ return nil, "", err
+ }
name := s.ExpectVar("MT_NAME")
if err := s.Error(); err != nil {
return nil, "", err
@@ -70,10 +371,7 @@
if err := s.Error(); err != nil {
return nil, "", err
}
- s.ExpectVar("PID")
- if err := s.Error(); err != nil {
- return nil, "", err
- }
+
return handle, name, nil
}
@@ -102,12 +400,14 @@
go func() {
defer outPipe.Close()
scanner := bufio.NewScanner(outPipe)
- nmounts := 0
+ mounts := 0
for scanner.Scan() {
line := scanner.Text()
+ // TODO(cnicolaou): find a better way of synchronizing with
+ // the child process, this is way too fragile.
if strings.Index(line, "ipc pub: mount") != -1 {
- nmounts++
- if nmounts == 2 {
+ mounts++
+ if mounts == 1 {
close(ready)
}
}
diff --git a/lib/testutil/security/util.go b/lib/testutil/security/util.go
index a696269..40a7279 100644
--- a/lib/testutil/security/util.go
+++ b/lib/testutil/security/util.go
@@ -1,5 +1,25 @@
// Package security contains utility testing functions related to
-// security.
+// veyron2/security.
+//
+// Suggested Usage:
+//
+// Create a new in-memory principal with an empty BlessingStore.
+// p := NewPrincipal()
+//
+// Create a new in-memory principal with self-signed blessing for "alice".
+// p := NewPrincipal("alice")
+//
+// Create a VeyronCredentials directory with a new persistent principal that has a
+// self-signed blessing for "alice" -- this directory can be set as the value
+// of the VEYRON_CREDENTIALS environment variable or the --veyron.credentials flag
+// used to initialize a runtime. All updates to the principal's state get subsequently
+// persisted to the directory. Both the directory and a handle to the created principal
+// are returned.
+// dir, p := NewCredentials("alice") // principal p has blessing "alice"
+//
+// Create a VeyronCredentials directory with a new persistent principal that is
+// blessed by the principal p under the extension "friend"
+// forkdir, forkp := ForkCredentials(p, "friend") // principal forkp has blessing "alice/friend"
package security
import (
@@ -12,31 +32,85 @@
"veyron.io/veyron/veyron2/services/security/access"
)
-// NewVeyronCredentials generates a directory with a new principal
-// that can be used as a value for the VEYRON_CREDENTIALS environment
-// variable to initialize a Runtime.
-//
-// The principal created uses a blessing from 'parent', with the extension
-// 'name' as its default blessing.
-//
-// It returns the path to the directory created.
-func NewVeyronCredentials(parent security.Principal, name string) string {
+func newCredentials() (string, security.Principal) {
dir, err := ioutil.TempDir("", "veyron_credentials")
if err != nil {
panic(err)
}
- p, err := vsecurity.LoadPersistentPrincipal(dir, nil)
- if err != nil {
- if p, err = vsecurity.CreatePersistentPrincipal(dir, nil); err != nil {
- panic(err)
- }
- }
- blessings, err := parent.Bless(p.PublicKey(), parent.BlessingStore().Default(), name, security.UnconstrainedUse())
+ p, err := vsecurity.CreatePersistentPrincipal(dir, nil)
if err != nil {
panic(err)
}
- SetDefaultBlessings(p, blessings)
- return dir
+ return dir, p
+}
+
+func selfBlessings(p security.Principal, names ...string) security.Blessings {
+ var blessings security.Blessings
+ for _, name := range names {
+ b, err := p.BlessSelf(name)
+ if err != nil {
+ panic(err)
+ }
+ if blessings, err = security.UnionOfBlessings(blessings, b); err != nil {
+ panic(err)
+ }
+ }
+ return blessings
+}
+
+// NewCredentials generates a directory with a new principal with
+// self-signed blessings.
+//
+// In particular, the principal is initialized with self-signed
+// blessings for the provided 'names', marked as default and shareable
+// with all peers on the principal's blessing store.
+//
+// It returns the path to the directory created and the principal.
+// The directory can be used as a value for the VEYRON_CREDENTIALS
+// environment variable (or the --veyron.credentials flag) used to
+// initialize a Runtime.
+func NewCredentials(requiredName string, otherNames ...string) (string, security.Principal) {
+ dir, p := newCredentials()
+ if def := selfBlessings(p, append([]string{requiredName}, otherNames...)...); def != nil {
+ SetDefaultBlessings(p, def)
+ }
+ return dir, p
+}
+
+// ForkCredentials generates a directory with a new principal whose
+// blessings are provided by the 'parent'.
+//
+// In particular, the principal is initialized with blessings from
+// 'parent' under the provided 'extensions', and marked as default and
+// shareable with all peers on the principal's blessing store.
+//
+// It returns the path to the directory created and the principal.
+// The directory can be used as a value for the VEYRON_CREDENTIALS
+// environment variable (or the --veyron.credentials flag) used to
+// initialize a Runtime.
+func ForkCredentials(parent security.Principal, requiredExtension string, otherExtensions ...string) (string, security.Principal) {
+ dir, err := ioutil.TempDir("", "veyron_credentials")
+ if err != nil {
+ panic(err)
+ }
+ p, err := vsecurity.CreatePersistentPrincipal(dir, nil)
+ if err != nil {
+ panic(err)
+ }
+ var def security.Blessings
+ for _, extension := range append([]string{requiredExtension}, otherExtensions...) {
+ b, err := parent.Bless(p.PublicKey(), parent.BlessingStore().Default(), extension, security.UnconstrainedUse())
+ if err != nil {
+ panic(err)
+ }
+ if def, err = security.UnionOfBlessings(def, b); err != nil {
+ panic(err)
+ }
+ }
+ if def != nil {
+ SetDefaultBlessings(p, def)
+ }
+ return dir, p
}
// NewPrincipal creates a new security.Principal.
@@ -49,17 +123,7 @@
if err != nil {
panic(err)
}
- var def security.Blessings
- for _, blessing := range defaultBlessings {
- b, err := p.BlessSelf(blessing)
- if err != nil {
- panic(err)
- }
- if def, err = security.UnionOfBlessings(def, b); err != nil {
- panic(err)
- }
- }
- if def != nil {
+ if def := selfBlessings(p, defaultBlessings...); def != nil {
SetDefaultBlessings(p, def)
}
return p
diff --git a/lib/testutil/security/util_test.go b/lib/testutil/security/util_test.go
index 8b3070a..06fc209 100644
--- a/lib/testutil/security/util_test.go
+++ b/lib/testutil/security/util_test.go
@@ -1,8 +1,10 @@
package security
import (
+ "fmt"
"os"
"reflect"
+ "sort"
"testing"
"veyron.io/veyron/veyron2/rt"
@@ -13,24 +15,46 @@
vsecurity "veyron.io/veyron/veyron/security"
)
-func TestNewVeyronCredentials(t *testing.T) {
- r, err := rt.New()
+func unsortedEquals(a, b []string) bool {
+ sort.Strings(a)
+ sort.Strings(b)
+ return reflect.DeepEqual(a, b)
+}
+
+func testCredentials(cred string, wantPrincipal security.Principal, wantBlessings []string) error {
+ pFromCred, err := vsecurity.LoadPersistentPrincipal(cred, nil)
if err != nil {
+ return fmt.Errorf("LoadPersistentPrincipal(%q, nil) failed: %v", cred, err)
+ }
+ if !reflect.DeepEqual(pFromCred, wantPrincipal) {
+ fmt.Errorf("got principal from directory: %v, want: %v", pFromCred, wantPrincipal)
+ }
+
+ bs := pFromCred.BlessingStore()
+ if got := pFromCred.BlessingsInfo(bs.ForPeer("foo")); !unsortedEquals(got, wantBlessings) {
+ return fmt.Errorf("got peer blessings: %v, want: %v", got, wantBlessings)
+ }
+ if got := pFromCred.BlessingsInfo(bs.Default()); !unsortedEquals(got, wantBlessings) {
+ return fmt.Errorf("got default blessings: %v, want: %v", got, wantBlessings)
+ }
+ return nil
+}
+
+func TestCredentials(t *testing.T) {
+ dir, p := NewCredentials("ali", "alice")
+ if err := testCredentials(dir, p, []string{"ali", "alice"}); err != nil {
t.Fatal(err)
}
- defer r.Cleanup()
- parent := r.Principal()
- childdir := NewVeyronCredentials(parent, "child")
- defer os.RemoveAll(childdir)
- if _, err = vsecurity.LoadPersistentPrincipal(childdir, nil); err != nil {
- t.Fatalf("Expected NewVeyronCredentials to have populated the directory %q: %v", childdir, err)
+ forkdir, forkp := ForkCredentials(p, "friend", "enemy")
+ if err := testCredentials(forkdir, forkp, []string{"ali/friend", "alice/friend", "ali/enemy", "alice/enemy"}); err != nil {
+ t.Fatal(err)
}
- // TODO(ashankar,ataly): Figure out what APIs should we use for more detailed testing
- // of the child principal, for example:
- // - Parent should recognize the child's default blessing
- // - Child should recognize the parent's default blessing
- // - Child's blessing name should be that of the parent with "/child" appended.
+
+ forkforkdir, forkforkp := ForkCredentials(forkp, "spouse")
+ if err := testCredentials(forkforkdir, forkforkp, []string{"ali/friend/spouse", "alice/friend/spouse", "ali/enemy/spouse", "alice/enemy/spouse"}); err != nil {
+ t.Fatal(err)
+ }
}
func TestSaveACLToFile(t *testing.T) {
diff --git a/lib/websocket/conn.go b/lib/websocket/conn.go
index e6963c4..3a291ea 100644
--- a/lib/websocket/conn.go
+++ b/lib/websocket/conn.go
@@ -4,11 +4,12 @@
import (
"fmt"
- "github.com/gorilla/websocket"
"io"
"net"
"sync"
"time"
+
+ "github.com/gorilla/websocket"
)
// WebsocketConn provides a net.Conn interface for a websocket connection.
diff --git a/lib/websocket/dialer.go b/lib/websocket/dialer.go
index dea1262..111acb2 100644
--- a/lib/websocket/dialer.go
+++ b/lib/websocket/dialer.go
@@ -3,10 +3,11 @@
package websocket
import (
- "github.com/gorilla/websocket"
"net"
"net/http"
"net/url"
+
+ "github.com/gorilla/websocket"
)
func Dial(address string) (net.Conn, error) {
@@ -23,6 +24,5 @@
if err != nil {
return nil, err
}
-
return WebsocketConn(ws), nil
}
diff --git a/lib/websocket/init.go b/lib/websocket/init.go
index ac60189..314c07a 100644
--- a/lib/websocket/init.go
+++ b/lib/websocket/init.go
@@ -7,8 +7,11 @@
"veyron.io/veyron/veyron2/ipc/stream"
)
+var mapWebSocketToTCP = map[string]string{"ws": "tcp", "ws4": "tcp4", "ws6": "tcp6"}
+
func wsListener(protocol, address string) (net.Listener, error) {
- ln, err := net.Listen(protocol, address)
+ tcp := mapWebSocketToTCP[protocol]
+ ln, err := net.Listen(tcp, address)
if err != nil {
return nil, err
}
@@ -21,7 +24,48 @@
}
func init() {
+ // ws, ws4, ws6 represent websocket protocol instances.
for _, p := range []string{"ws", "ws4", "ws6"} {
stream.RegisterProtocol(p, wsDialer, wsListener)
}
+
+ // TODO(cnicolaou): fully enable and test this 'hybrid mode'.
+ // hws, hws4, hws6 represent a 'hybrid' protocol that can accept
+ // both websockets and tcp, using a 'magic' byte to discriminate
+ // between the two. These are needed when a single network port must
+ // be use to serve both websocket and tcp clients, we prefer to use
+ // tcp whenever we can to avoid the overhead of websockets. Clients
+ // decide whether to use hybrid tcp or websockets by electing to dial
+ // using the hws protocol or the ws protocol respectively.
+ //for _, p := range []string{"wsh", "wsh4", "wsh6"} {
+ // stream.RegisterProtocol(p, tcpHybridDialer, wsHybridListener)
+ //}
+
+ // The implementation strategy is as follows:
+ // tcpHybridDialer will create and return a wrapped net.Conn which will
+ // write the 'magic' time the first time that its Write method is called
+ // but will otherwise be indistinguishable from the underlying net.Conn.
+ // This first write will require an extra copy, but avoid potentially
+ // sending two packets.
+ // wsHybridListener is essentially the same as the current wsTCPListener,
+ // but the magic byte handling implemented on a conditional basis.
}
+
+/*
+func dialer(network, address string, timeout time.Duration) (net.Conn, error) {
+ conn, err := net.DialTimeout(network, address, timeout)
+ if err != nil {
+ return nil, err
+ }
+ // For tcp connections we add an extra magic byte so we can differentiate between
+ // raw tcp and websocket on the same port.
+ switch n, err := conn.Write([]byte{websocket.BinaryMagicByte}); {
+ case err != nil:
+ return nil, err
+ case n != 1:
+ return nil, fmt.Errorf("Unable to write the magic byte")
+ }
+ return conn, nil
+ }
+}
+*/
diff --git a/lib/websocket/listener.go b/lib/websocket/listener.go
index 3c4922e..10d3f51 100644
--- a/lib/websocket/listener.go
+++ b/lib/websocket/listener.go
@@ -3,7 +3,6 @@
package websocket
import (
- "bufio"
"errors"
"fmt"
"net"
@@ -42,6 +41,7 @@
wsLoop sync.WaitGroup
}
+/*
// bufferedConn is used to allow us to Peek at the first byte to see if it
// is the magic byte used by veyron tcp requests. Other than that it behaves
// like a normal net.Conn.
@@ -63,6 +63,7 @@
func (c *bufferedConn) Read(p []byte) (int, error) {
return c.r.Read(p)
}
+*/
// queueListener is a listener that returns connections that are in q.
type queueListener struct {
@@ -144,35 +145,39 @@
return
}
vlog.VI(1).Infof("New net.Conn accepted from %s (local address: %s)", conn.RemoteAddr(), conn.LocalAddr())
- bc := newBufferedConn(conn)
- magic, err := bc.Peek(1)
- if err != nil {
- vlog.VI(1).Infof("Shutting down conn from %s (local address: %s) as the magic byte failed to be read: %v", conn.RemoteAddr(), conn.LocalAddr(), err)
- bc.Close()
- continue
- }
+ /*
+ bc := newBufferedConn(conn)
+ magic, err := bc.Peek(1)
+ if err != nil {
+ vlog.VI(1).Infof("Shutting down conn from %s (local address: %s) as the magic byte failed to be read: %v", conn.RemoteAddr(), conn.LocalAddr(), err)
+ bc.Close()
+ continue
+ }
- vlog.VI(1).Infof("Got a connection from %s (local address: %s)", conn.RemoteAddr(), conn.LocalAddr())
- // Check to see if it is a regular connection or a http connection.
- if magic[0] == BinaryMagicByte {
- if _, err := bc.r.ReadByte(); err != nil {
- vlog.VI(1).Infof("Shutting down conn from %s (local address: %s), could read past the magic byte: %v", conn.RemoteAddr(), conn.LocalAddr(), err)
- bc.Close()
- continue
- }
- if err := ln.q.Put(&bc); err != nil {
- vlog.VI(1).Infof("Shutting down conn from %s (local address: %s) as Put failed in vifLoop: %v", conn.RemoteAddr(), conn.LocalAddr(), err)
- bc.Close()
- continue
- }
- continue
- }
+ vlog.VI(1).Infof("Got a connection from %s (local address: %s)", conn.RemoteAddr(), conn.LocalAddr())
+ // Check to see if it is a regular connection or a http connection.
+ if magic[0] == BinaryMagicByte {
+ if _, err := bc.r.ReadByte(); err != nil {
+ vlog.VI(1).Infof("Shutting down conn from %s (local address: %s), could read past the magic byte: %v", conn.RemoteAddr(), conn.LocalAddr(), err)
+ bc.Close()
+ continue
+ }
+ if err := ln.q.Put(&bc); err != nil {
+ vlog.VI(1).Infof("Shutting down conn from %s (local address: %s) as Put failed in vifLoop: %v", conn.RemoteAddr(), conn.LocalAddr(), err)
+ bc.Close()
+ continue
+ }
+ continue
+ }
+ */
ln.wsLoop.Add(1)
- if err := ln.httpQ.Put(&bc); err != nil {
+ // if err := ln.httpQ.Put(&bc); err != nil {
+ if err := ln.httpQ.Put(conn); err != nil {
ln.wsLoop.Done()
vlog.VI(1).Infof("Shutting down conn from %s (local address: %s) as Put failed in vifLoop: %v", conn.RemoteAddr(), conn.LocalAddr(), err)
- bc.Close()
+ //bc.Close()
+ conn.Close()
continue
}
}
@@ -207,6 +212,17 @@
return nil
}
+type addr struct{ n, a string }
+
+func (a *addr) Network() string {
+ return a.n
+}
+
+func (a *addr) String() string {
+ return a.a
+}
+
func (ln *wsTCPListener) Addr() net.Addr {
- return ln.netLn.Addr()
+ a := &addr{"ws", ln.netLn.Addr().String()}
+ return a
}
diff --git a/profiles/gce/init.go b/profiles/gce/init.go
index 49ead70..815b6dd 100644
--- a/profiles/gce/init.go
+++ b/profiles/gce/init.go
@@ -25,17 +25,15 @@
)
var (
- listenAddressFlag = flags.IPHostPortFlag{Port: "0"}
+ commonFlags *flags.Flags
- ListenSpec = &ipc.ListenSpec{
- Protocol: "tcp",
- Address: "127.0.0.1:0",
- }
+ // ListenSpec is an initialized instance of ipc.ListenSpec that can
+ // be used with ipc.Listen.
+ ListenSpec ipc.ListenSpec
)
func init() {
- flag.Var(&listenAddressFlag, "veyron.tcp.address", "address to listen on")
-
+ commonFlags = flags.CreateAndRegister(flag.CommandLine, flags.Listen)
rt.RegisterProfile(&profile{})
}
@@ -64,8 +62,15 @@
if !gce.RunningOnGCE() {
return nil, fmt.Errorf("GCE profile used on a non-GCE system")
}
+
+ lf := commonFlags.ListenFlags()
+ ListenSpec = ipc.ListenSpec{
+ Addrs: ipc.ListenAddrs(lf.Addrs),
+ Proxy: lf.ListenProxy,
+ }
+
p.ac = appcycle.New()
- ListenSpec.Address = listenAddressFlag.String()
+
if ip, err := gce.ExternalIPAddress(); err != nil {
return p.ac, err
} else {
diff --git a/profiles/generic.go b/profiles/generic.go
index 421ff22..5b6f2d7 100644
--- a/profiles/generic.go
+++ b/profiles/generic.go
@@ -16,8 +16,7 @@
// LocalListenSpec is a ListenSpec for 127.0.0.1.
var LocalListenSpec = ipc.ListenSpec{
- Protocol: "tcp",
- Address: "127.0.0.1:0",
+ Addrs: ipc.ListenAddrs{{"tcp", "127.0.0.1:0"}},
AddressChooser: internal.IPAddressChooser,
}
diff --git a/profiles/roaming/roaming.go b/profiles/roaming/roaming.go
index 3d4d638..c772848 100644
--- a/profiles/roaming/roaming.go
+++ b/profiles/roaming/roaming.go
@@ -83,9 +83,8 @@
lf := commonFlags.ListenFlags()
ListenSpec = ipc.ListenSpec{
- Protocol: lf.ListenProtocol.Protocol,
- Address: lf.ListenAddress.String(),
- Proxy: lf.ListenProxy,
+ Addrs: ipc.ListenAddrs(lf.Addrs),
+ Proxy: lf.ListenProxy,
}
p.ac = appcycle.New()
@@ -158,6 +157,8 @@
log := rt.Logger()
+ // TODO(cnicolaou): add support for listening on multiple network addresses.
+
done:
for {
select {
@@ -182,7 +183,7 @@
ch <- ipc.NewRmAddrsSetting(removed)
}
// We will always send the best currently available address
- if chosen, err := listenSpec.AddressChooser(listenSpec.Protocol, cur); err == nil && chosen != nil {
+ if chosen, err := listenSpec.AddressChooser(listenSpec.Addrs[0].Protocol, cur); err == nil && chosen != nil {
ch <- ipc.NewAddAddrsSetting(chosen)
}
prev = cur
diff --git a/profiles/static/static.go b/profiles/static/static.go
index f30137c..a6b03c3 100644
--- a/profiles/static/static.go
+++ b/profiles/static/static.go
@@ -67,9 +67,8 @@
lf := commonFlags.ListenFlags()
ListenSpec = ipc.ListenSpec{
- Protocol: lf.ListenProtocol.Protocol,
- Address: lf.ListenAddress.String(),
- Proxy: lf.ListenProxy,
+ Addrs: ipc.ListenAddrs(lf.Addrs),
+ Proxy: lf.ListenProxy,
}
p.ac = appcycle.New()
diff --git a/runtimes/google/ipc/benchmarks/README.txt b/runtimes/google/ipc/benchmarks/README.txt
index a63e453..e2edd4f 100644
--- a/runtimes/google/ipc/benchmarks/README.txt
+++ b/runtimes/google/ipc/benchmarks/README.txt
@@ -25,42 +25,42 @@
$ veyron go test -test.bench=. -timeout=1h -test.cpu=1 -test.benchtime=5s \
veyron/runtimes/google/ipc/benchmarks
-Benchmark____1B 2000 3895391 ns/op 0.00 MB/s
-Benchmark___10B 2000 3982372 ns/op 0.01 MB/s
-Benchmark___1KB 5000 3251297 ns/op 0.62 MB/s
-Benchmark_100KB 2000 6244664 ns/op 32.03 MB/s
-Benchmark____1_chunk_____1B 5000 4070866 ns/op 0.00 MB/s
-Benchmark____1_chunk____10B 2000 4242328 ns/op 0.00 MB/s
-Benchmark____1_chunk____1KB 2000 3679679 ns/op 0.54 MB/s
-Benchmark____1_chunk___10KB 2000 4070936 ns/op 4.91 MB/s
-Benchmark___10_chunks____1B 2000 3828552 ns/op 0.01 MB/s
-Benchmark___10_chunks___10B 5000 3685269 ns/op 0.05 MB/s
-Benchmark___10_chunks___1KB 2000 6831116 ns/op 2.93 MB/s
-Benchmark___10_chunks__10KB 1000 9662880 ns/op 20.70 MB/s
-Benchmark__100_chunks____1B 2000 8938980 ns/op 0.02 MB/s
-Benchmark__100_chunks___10B 2000 5924969 ns/op 0.34 MB/s
-Benchmark__100_chunks___1KB 500 37264103 ns/op 5.37 MB/s
-Benchmark__100_chunks__10KB 100 64999728 ns/op 30.77 MB/s
-Benchmark__per_chunk____1B 500000 1535312 ns/op 0.00 MB/s
-Benchmark__per_chunk___10B 2000 9416017 ns/op 0.00 MB/s
-Benchmark__per_chunk___1KB 1000 7803789 ns/op 0.26 MB/s
-Benchmark__per_chunk__10KB 1000 7828585 ns/op 2.55 MB/s
-Benchmark____1B_mux___10_chunks___10B 1000 9233379 ns/op 0.00 MB/s
-Benchmark____1B_mux___10_chunks___1KB 1000 8639613 ns/op 0.00 MB/s
-Benchmark____1B_mux__100_chunks___10B 500 30530925 ns/op 0.00 MB/s
-Benchmark____1B_mux__100_chunks___1KB 200 40886630 ns/op 0.00 MB/s
+Benchmark____1B 2000 5144219 ns/op 0.00 MB/s
+Benchmark___10B 2000 5526448 ns/op 0.00 MB/s
+Benchmark___1KB 2000 4528221 ns/op 0.44 MB/s
+Benchmark_100KB 1000 7569096 ns/op 26.42 MB/s
+Benchmark____1_chunk_____1B 1000 8945290 ns/op 0.00 MB/s
+Benchmark____1_chunk____10B 1000 9711084 ns/op 0.00 MB/s
+Benchmark____1_chunk____1KB 1000 8541689 ns/op 0.23 MB/s
+Benchmark____1_chunk___10KB 1000 8972995 ns/op 2.23 MB/s
+Benchmark___10_chunks____1B 1000 13114807 ns/op 0.00 MB/s
+Benchmark___10_chunks___10B 1000 13219493 ns/op 0.02 MB/s
+Benchmark___10_chunks___1KB 1000 13292236 ns/op 1.50 MB/s
+Benchmark___10_chunks__10KB 500 15733197 ns/op 12.71 MB/s
+Benchmark__100_chunks____1B 500 45078939 ns/op 0.00 MB/s
+Benchmark__100_chunks___10B 200 49113585 ns/op 0.04 MB/s
+Benchmark__100_chunks___1KB 100 57982457 ns/op 3.45 MB/s
+Benchmark__100_chunks__10KB 100 81632487 ns/op 24.50 MB/s
+Benchmark__per_chunk____1B 50000 357880 ns/op 0.01 MB/s
+Benchmark__per_chunk___10B 20000 476941 ns/op 0.04 MB/s
+Benchmark__per_chunk___1KB 10000 806491 ns/op 2.48 MB/s
+Benchmark__per_chunk__10KB 10000 1185081 ns/op 16.88 MB/s
+Benchmark____1B_mux___10_chunks___10B 1000 20235386 ns/op 0.00 MB/s
+Benchmark____1B_mux___10_chunks___1KB 500 21346428 ns/op 0.00 MB/s
+Benchmark____1B_mux__100_chunks___10B 100 72942436 ns/op 0.00 MB/s
+Benchmark____1B_mux__100_chunks___1KB 100 81538481 ns/op 0.00 MB/s
-'Benchmark___1KB' shows that it takes an average of 3.251 ms to
+'Benchmark___1KB' shows that it takes an average of 4.528 ms to
execute a simple Echo RPC with a 1 KB payload.
'Benchmark___10_chunks___1KB' shows that a streaming RPC with the
-same payload (i.e. 10 chunks of 1 KB) takes about 6.831 ms on average.
+same payload (i.e. 10 chunks of 1 KB) takes about 13.292 ms on average.
'Benchmark__per_chunk___1KB' shows that sending a stream of 1 KB chunks
-takes an average of 7.804 ms per chunk.
+takes an average of 0.806 ms per chunk.
'Benchmark____1B_mux___10_chunks___1KB' shows that it takes an average
-of 9.233 ms to execute a simple Echo RPC with a 1 B payload while streaming
+of 21.346 ms to execute a simple Echo RPC with a 1 B payload while streaming
10 chunks of 1 KB payloads continuously in the same process.
bm/main.go does the same benchmarks as ipc_test.go but with more varying
@@ -73,29 +73,39 @@
================================================================================
-Running the client and server as separate processes.
-
-In this case, we can see the cost of name resolution, creating the VC, etc. in
+bmserver/main.go and bmclient/main.go are simple command-line tools to run the
+benchmark server and client as separate processes. Unlike the benchmarks above,
+this test includes the startup cost of name resolution, creating the VC, etc. in
the first RPC.
-$ $VEYRON_ROOT/veyron/go/bin/bmserver --address=localhost:8888 --acl='{"...":"A"}'
+$ veyron go run veyron/runtimes/google/ipc/benchmarks/bmserver/main.go \
+ -veyron.tcp.address=localhost:8888 -acl='{"In":{"...":"R"}}'
(In a different shell)
-$ $VEYRON_ROOT/veyron/go/bin/bmclient --server=/localhost:8888 --count=10 \
- --payload_size=1000
-CallEcho 0 64133467
-CallEcho 1 766223
-CallEcho 2 703860
-CallEcho 3 697590
-CallEcho 4 601134
-CallEcho 5 601142
-CallEcho 6 624079
-CallEcho 7 644664
-CallEcho 8 605195
-CallEcho 9 637037
-
-It took about 64 ms to execute the first RPC, and then 0.60-0.70 ms to execute
-the next ones.
+$ veyron go run veyron/runtimes/google/ipc/benchmarks/bmclient/main.go \
+ -server=/localhost:8888 -iterations=100 -chunk_count=0 -payload_size=10
+iterations: 100 chunk_count: 0 payload_size: 10
+elapsed time: 619.75741ms
+Histogram (unit: ms)
+Count: 100 Min: 4 Max: 54 Avg: 5.65
+------------------------------------------------------------
+[ 4, 5) 42 42.0% 42.0% ####
+[ 5, 6) 32 32.0% 74.0% ###
+[ 6, 7) 8 8.0% 82.0% #
+[ 7, 9) 13 13.0% 95.0% #
+[ 9, 11) 3 3.0% 98.0%
+[ 11, 14) 1 1.0% 99.0%
+[ 14, 18) 0 0.0% 99.0%
+[ 18, 24) 0 0.0% 99.0%
+[ 24, 32) 0 0.0% 99.0%
+[ 32, 42) 0 0.0% 99.0%
+[ 42, 55) 1 1.0% 100.0%
+[ 55, 72) 0 0.0% 100.0%
+[ 72, 94) 0 0.0% 100.0%
+[ 94, 123) 0 0.0% 100.0%
+[123, 161) 0 0.0% 100.0%
+[161, 211) 0 0.0% 100.0%
+[211, inf) 0 0.0% 100.0%
On a Raspberry Pi, everything is much slower. The same tests show the following
diff --git a/runtimes/google/ipc/benchmarks/RESULTS.txt b/runtimes/google/ipc/benchmarks/RESULTS.txt
index c04a1ea..979b2ac 100644
--- a/runtimes/google/ipc/benchmarks/RESULTS.txt
+++ b/runtimes/google/ipc/benchmarks/RESULTS.txt
@@ -1,374 +1,122 @@
-Date: 10/12/2014
+Date: 12/14/2014
Platform: Intel(R) Xeon(R) CPU E5-2689 0 @ 2.60GHz, 66114888KB Memory
$ veyron go run veyron/runtimes/google/ipc/benchmarks/bm/main.go \
-test.cpu=1,2 -test.benchtime=5s -histogram
-Benchmark____1B 10000 1347426 ns/op 0.00 MB/s
-Benchmark____1B-2 10000 1241765 ns/op 0.00 MB/s
-Benchmark___10B 5000 1521595 ns/op 0.01 MB/s
-Benchmark___10B-2 10000 1345906 ns/op 0.01 MB/s
-Benchmark__100B 5000 1627288 ns/op 0.12 MB/s
-Benchmark__100B-2 10000 1395559 ns/op 0.14 MB/s
-Benchmark___1KB 5000 1548449 ns/op 1.29 MB/s
-Benchmark___1KB-2 10000 1296259 ns/op 1.54 MB/s
-Benchmark__10KB 5000 1960759 ns/op 10.20 MB/s
-Benchmark__10KB-2 10000 1516984 ns/op 13.18 MB/s
-Benchmark_100KB 2000 4950737 ns/op 40.40 MB/s
-Benchmark_100KB-2 5000 3536973 ns/op 56.55 MB/s
-Benchmark____1_chunk_____1B 5000 1733706 ns/op 0.00 MB/s
-Benchmark____1_chunk_____1B-2 10000 1549342 ns/op 0.00 MB/s
-Benchmark____1_chunk____10B 5000 1841027 ns/op 0.01 MB/s
-Benchmark____1_chunk____10B-2 5000 1645809 ns/op 0.01 MB/s
-Benchmark____1_chunk___100B 5000 1891259 ns/op 0.11 MB/s
-Benchmark____1_chunk___100B-2 5000 1720838 ns/op 0.12 MB/s
-Benchmark____1_chunk____1KB 5000 1834957 ns/op 1.09 MB/s
-Benchmark____1_chunk____1KB-2 5000 1641668 ns/op 1.22 MB/s
-Benchmark____1_chunk___10KB 5000 2169053 ns/op 9.22 MB/s
-Benchmark____1_chunk___10KB-2 5000 1825946 ns/op 10.95 MB/s
-Benchmark____1_chunk__100KB 2000 4712135 ns/op 42.44 MB/s
-Benchmark____1_chunk__100KB-2 5000 3674554 ns/op 54.43 MB/s
-Benchmark___10_chunks____1B 5000 2281402 ns/op 0.01 MB/s
-Benchmark___10_chunks____1B-2 5000 1959491 ns/op 0.01 MB/s
-Benchmark___10_chunks___10B 5000 2539394 ns/op 0.08 MB/s
-Benchmark___10_chunks___10B-2 5000 2019503 ns/op 0.10 MB/s
-Benchmark___10_chunks__100B 5000 2950881 ns/op 0.68 MB/s
-Benchmark___10_chunks__100B-2 5000 2239554 ns/op 0.89 MB/s
-Benchmark___10_chunks___1KB 5000 3151938 ns/op 6.35 MB/s
-Benchmark___10_chunks___1KB-2 5000 2323991 ns/op 8.61 MB/s
-Benchmark___10_chunks__10KB 2000 6023388 ns/op 33.20 MB/s
-Benchmark___10_chunks__10KB-2 2000 3955363 ns/op 50.56 MB/s
-Benchmark___10_chunks_100KB 500 31665379 ns/op 63.16 MB/s
-Benchmark___10_chunks_100KB-2 500 18414841 ns/op 108.61 MB/s
-Benchmark__100_chunks____1B 5000 4505724 ns/op 0.04 MB/s
-Benchmark__100_chunks____1B-2 5000 3512335 ns/op 0.06 MB/s
-Benchmark__100_chunks___10B 1000 8713484 ns/op 0.23 MB/s
-Benchmark__100_chunks___10B-2 2000 4561723 ns/op 0.44 MB/s
-Benchmark__100_chunks__100B 1000 10864592 ns/op 1.84 MB/s
-Benchmark__100_chunks__100B-2 2000 6852262 ns/op 2.92 MB/s
-Benchmark__100_chunks___1KB 1000 13501720 ns/op 14.81 MB/s
-Benchmark__100_chunks___1KB-2 1000 8613532 ns/op 23.22 MB/s
-Benchmark__100_chunks__10KB 200 39616552 ns/op 50.48 MB/s
-Benchmark__100_chunks__10KB-2 500 23658254 ns/op 84.54 MB/s
-Benchmark__100_chunks_100KB 50 276789691 ns/op 72.26 MB/s
-Benchmark__100_chunks_100KB-2 100 154635652 ns/op 129.34 MB/s
-Benchmark___1K_chunks____1B 500 39420649 ns/op 0.05 MB/s
-Benchmark___1K_chunks____1B-2 500 29693618 ns/op 0.07 MB/s
-Benchmark___1K_chunks___10B 100 83758352 ns/op 0.24 MB/s
-Benchmark___1K_chunks___10B-2 200 48382055 ns/op 0.41 MB/s
-Benchmark___1K_chunks__100B 100 106033135 ns/op 1.89 MB/s
-Benchmark___1K_chunks__100B-2 100 62612895 ns/op 3.19 MB/s
-Benchmark___1K_chunks___1KB 100 137482628 ns/op 14.55 MB/s
-Benchmark___1K_chunks___1KB-2 100 79534604 ns/op 25.15 MB/s
-Benchmark___1K_chunks__10KB 20 405074363 ns/op 49.37 MB/s
-Benchmark___1K_chunks__10KB-2 50 219752224 ns/op 91.01 MB/s
-Benchmark___1K_chunks_100KB 2 2735626324 ns/op 73.11 MB/s
-Benchmark___1K_chunks_100KB-2 5 1536631217 ns/op 130.15 MB/s
-Benchmark__per_chunk____1B 200000 1142388 ns/op 0.00 MB/s
-Benchmark__per_chunk____1B-2 10000 2615337 ns/op 0.00 MB/s
-Benchmark__per_chunk___10B 5000 5240078 ns/op 0.00 MB/s
-Benchmark__per_chunk___10B-2 5000 3873372 ns/op 0.01 MB/s
-Benchmark__per_chunk__100B 2000 4133802 ns/op 0.05 MB/s
-Benchmark__per_chunk__100B-2 5000 4392527 ns/op 0.05 MB/s
-Benchmark__per_chunk___1KB 2000 4073315 ns/op 0.49 MB/s
-Benchmark__per_chunk___1KB-2 2000 4173645 ns/op 0.48 MB/s
-Benchmark__per_chunk__10KB 1000 6355059 ns/op 3.15 MB/s
-Benchmark__per_chunk__10KB-2 2000 4659057 ns/op 4.29 MB/s
-Benchmark__per_chunk_100KB 1000 9065425 ns/op 22.06 MB/s
-Benchmark__per_chunk_100KB-2 2000 5900078 ns/op 33.90 MB/s
-Benchmark___10B_mux__100_chunks___10B 1000 8940566 ns/op 0.00 MB/s
-Benchmark___10B_mux__100_chunks___10B-2 5000 3061921 ns/op 0.01 MB/s
-Benchmark___10B_mux__100_chunks__100B 1000 10060243 ns/op 0.00 MB/s
-Benchmark___10B_mux__100_chunks__100B-2 2000 4415919 ns/op 0.00 MB/s
-Benchmark___10B_mux__100_chunks___1KB 1000 11654085 ns/op 0.00 MB/s
-Benchmark___10B_mux__100_chunks___1KB-2 2000 4707737 ns/op 0.00 MB/s
-Benchmark___10B_mux___1K_chunks___10B 100 62531874 ns/op 0.00 MB/s
-Benchmark___10B_mux___1K_chunks___10B-2 500 17551728 ns/op 0.00 MB/s
-Benchmark___10B_mux___1K_chunks__100B 100 75553069 ns/op 0.00 MB/s
-Benchmark___10B_mux___1K_chunks__100B-2 500 24959801 ns/op 0.00 MB/s
-Benchmark___10B_mux___1K_chunks___1KB 100 79070593 ns/op 0.00 MB/s
-Benchmark___10B_mux___1K_chunks___1KB-2 500 20596205 ns/op 0.00 MB/s
-Benchmark__100B_mux__100_chunks___10B 2000 10355660 ns/op 0.02 MB/s
-Benchmark__100B_mux__100_chunks___10B-2 5000 3570382 ns/op 0.06 MB/s
-Benchmark__100B_mux__100_chunks__100B 1000 12339288 ns/op 0.02 MB/s
-Benchmark__100B_mux__100_chunks__100B-2 2000 5116350 ns/op 0.04 MB/s
-Benchmark__100B_mux__100_chunks___1KB 1000 14696248 ns/op 0.01 MB/s
-Benchmark__100B_mux__100_chunks___1KB-2 2000 5375339 ns/op 0.04 MB/s
-Benchmark__100B_mux___1K_chunks___10B 100 70735100 ns/op 0.00 MB/s
-Benchmark__100B_mux___1K_chunks___10B-2 500 17267283 ns/op 0.01 MB/s
-Benchmark__100B_mux___1K_chunks__100B 100 72232967 ns/op 0.00 MB/s
-Benchmark__100B_mux___1K_chunks__100B-2 500 25789652 ns/op 0.01 MB/s
-Benchmark__100B_mux___1K_chunks___1KB 100 87959533 ns/op 0.00 MB/s
-Benchmark__100B_mux___1K_chunks___1KB-2 500 22515508 ns/op 0.01 MB/s
+Benchmark____1B 3000 2260153 ns/op 0.00 MB/s
+Benchmark____1B-2 3000 2362339 ns/op 0.00 MB/s
+Benchmark___10B 3000 2595581 ns/op 0.01 MB/s
+Benchmark___10B-2 3000 2372671 ns/op 0.01 MB/s
+Benchmark__100B 3000 2690733 ns/op 0.07 MB/s
+Benchmark__100B-2 3000 2419120 ns/op 0.08 MB/s
+Benchmark___1KB 3000 2498211 ns/op 0.80 MB/s
+Benchmark___1KB-2 3000 2244818 ns/op 0.89 MB/s
+Benchmark__10KB 3000 2740536 ns/op 7.30 MB/s
+Benchmark__10KB-2 3000 2394824 ns/op 8.35 MB/s
+Benchmark_100KB 2000 5581491 ns/op 35.83 MB/s
+Benchmark_100KB-2 2000 4127286 ns/op 48.46 MB/s
+
+Benchmark____1_chunk_____1B 3000 2744128 ns/op 0.00 MB/s
+Benchmark____1_chunk_____1B-2 3000 2347418 ns/op 0.00 MB/s
+Benchmark____1_chunk____10B 3000 2857309 ns/op 0.01 MB/s
+Benchmark____1_chunk____10B-2 3000 2363346 ns/op 0.01 MB/s
+Benchmark____1_chunk___100B 3000 2922993 ns/op 0.07 MB/s
+Benchmark____1_chunk___100B-2 3000 2558699 ns/op 0.08 MB/s
+Benchmark____1_chunk____1KB 3000 2646432 ns/op 0.76 MB/s
+Benchmark____1_chunk____1KB-2 3000 2400649 ns/op 0.83 MB/s
+Benchmark____1_chunk___10KB 3000 2954627 ns/op 6.77 MB/s
+Benchmark____1_chunk___10KB-2 3000 2546084 ns/op 7.86 MB/s
+Benchmark____1_chunk__100KB 2000 5517042 ns/op 36.25 MB/s
+Benchmark____1_chunk__100KB-2 2000 4157872 ns/op 48.10 MB/s
+Benchmark___10_chunks____1B 2000 4177247 ns/op 0.00 MB/s
+Benchmark___10_chunks____1B-2 2000 3432532 ns/op 0.01 MB/s
+Benchmark___10_chunks___10B 2000 4664935 ns/op 0.04 MB/s
+Benchmark___10_chunks___10B-2 2000 3548029 ns/op 0.06 MB/s
+Benchmark___10_chunks__100B 2000 4845710 ns/op 0.41 MB/s
+Benchmark___10_chunks__100B-2 2000 3658666 ns/op 0.55 MB/s
+Benchmark___10_chunks___1KB 2000 4971196 ns/op 4.02 MB/s
+Benchmark___10_chunks___1KB-2 2000 3662827 ns/op 5.46 MB/s
+Benchmark___10_chunks__10KB 1000 7533684 ns/op 26.55 MB/s
+Benchmark___10_chunks__10KB-2 2000 4922363 ns/op 40.63 MB/s
+Benchmark___10_chunks_100KB 200 31539312 ns/op 63.41 MB/s
+Benchmark___10_chunks_100KB-2 500 18574440 ns/op 107.67 MB/s
+Benchmark__100_chunks____1B 500 18036549 ns/op 0.01 MB/s
+Benchmark__100_chunks____1B-2 1000 12395699 ns/op 0.02 MB/s
+Benchmark__100_chunks___10B 300 20669375 ns/op 0.10 MB/s
+Benchmark__100_chunks___10B-2 500 12634978 ns/op 0.16 MB/s
+Benchmark__100_chunks__100B 300 23164692 ns/op 0.86 MB/s
+Benchmark__100_chunks__100B-2 500 13821225 ns/op 1.45 MB/s
+Benchmark__100_chunks___1KB 300 26071439 ns/op 7.67 MB/s
+Benchmark__100_chunks___1KB-2 500 15738134 ns/op 12.71 MB/s
+Benchmark__100_chunks__10KB 100 50248311 ns/op 39.80 MB/s
+Benchmark__100_chunks__10KB-2 300 28614761 ns/op 69.89 MB/s
+Benchmark__100_chunks_100KB 30 272889576 ns/op 73.29 MB/s
+Benchmark__100_chunks_100KB-2 50 149680912 ns/op 133.62 MB/s
+Benchmark___1K_chunks____1B 100 111621410 ns/op 0.02 MB/s
+Benchmark___1K_chunks____1B-2 100 103311101 ns/op 0.02 MB/s
+Benchmark___1K_chunks___10B 50 189580683 ns/op 0.11 MB/s
+Benchmark___1K_chunks___10B-2 100 107068429 ns/op 0.19 MB/s
+Benchmark___1K_chunks__100B 30 223128293 ns/op 0.90 MB/s
+Benchmark___1K_chunks__100B-2 50 125690815 ns/op 1.59 MB/s
+Benchmark___1K_chunks___1KB 30 251956982 ns/op 7.94 MB/s
+Benchmark___1K_chunks___1KB-2 50 144214400 ns/op 13.87 MB/s
+Benchmark___1K_chunks__10KB 20 474946063 ns/op 42.11 MB/s
+Benchmark___1K_chunks__10KB-2 30 267531367 ns/op 74.76 MB/s
+Benchmark___1K_chunks_100KB 2 2675372295 ns/op 74.76 MB/s
+Benchmark___1K_chunks_100KB-2 5 1421481350 ns/op 140.70 MB/s
+
+Benchmark__per_chunk____1B 50000 163939 ns/op 0.01 MB/s
+Benchmark__per_chunk____1B-2 50000 118409 ns/op 0.02 MB/s
+Benchmark__per_chunk___10B 20000 321908 ns/op 0.06 MB/s
+Benchmark__per_chunk___10B-2 50000 176818 ns/op 0.11 MB/s
+Benchmark__per_chunk__100B 20000 411514 ns/op 0.49 MB/s
+Benchmark__per_chunk__100B-2 30000 231565 ns/op 0.86 MB/s
+Benchmark__per_chunk___1KB 20000 423999 ns/op 4.72 MB/s
+Benchmark__per_chunk___1KB-2 30000 248721 ns/op 8.04 MB/s
+Benchmark__per_chunk__10KB 10000 631536 ns/op 31.67 MB/s
+Benchmark__per_chunk__10KB-2 20000 346868 ns/op 57.66 MB/s
+Benchmark__per_chunk_100KB 3000 2613430 ns/op 76.53 MB/s
+Benchmark__per_chunk_100KB-2 5000 1369809 ns/op 146.01 MB/s
+
+Benchmark___10B_mux__100_chunks___10B 500 18817141 ns/op 0.00 MB/s
+Benchmark___10B_mux__100_chunks___10B-2 1000 7104449 ns/op 0.00 MB/s
+Benchmark___10B_mux__100_chunks__100B 300 21167617 ns/op 0.00 MB/s
+Benchmark___10B_mux__100_chunks__100B-2 1000 8372251 ns/op 0.00 MB/s
+Benchmark___10B_mux__100_chunks___1KB 300 22817830 ns/op 0.00 MB/s
+Benchmark___10B_mux__100_chunks___1KB-2 1000 8831943 ns/op 0.00 MB/s
+Benchmark___10B_mux___1K_chunks___10B 100 123136622 ns/op 0.00 MB/s
+Benchmark___10B_mux___1K_chunks___10B-2 300 22274569 ns/op 0.00 MB/s
+Benchmark___10B_mux___1K_chunks__100B 100 143814971 ns/op 0.00 MB/s
+Benchmark___10B_mux___1K_chunks__100B-2 200 34125016 ns/op 0.00 MB/s
+Benchmark___10B_mux___1K_chunks___1KB 100 136987808 ns/op 0.00 MB/s
+Benchmark___10B_mux___1K_chunks___1KB-2 200 35831221 ns/op 0.00 MB/s
+Benchmark__100B_mux__100_chunks___10B 500 20748811 ns/op 0.01 MB/s
+Benchmark__100B_mux__100_chunks___10B-2 1000 7604070 ns/op 0.03 MB/s
+Benchmark__100B_mux__100_chunks__100B 300 21922577 ns/op 0.01 MB/s
+Benchmark__100B_mux__100_chunks__100B-2 1000 9164254 ns/op 0.02 MB/s
+Benchmark__100B_mux__100_chunks___1KB 300 23892634 ns/op 0.01 MB/s
+Benchmark__100B_mux__100_chunks___1KB-2 1000 9288578 ns/op 0.02 MB/s
+Benchmark__100B_mux___1K_chunks___10B 100 120357166 ns/op 0.00 MB/s
+Benchmark__100B_mux___1K_chunks___10B-2 300 23110788 ns/op 0.01 MB/s
+Benchmark__100B_mux___1K_chunks__100B 100 146211502 ns/op 0.00 MB/s
+Benchmark__100B_mux___1K_chunks__100B-2 200 36485527 ns/op 0.01 MB/s
+Benchmark__100B_mux___1K_chunks___1KB 100 145242261 ns/op 0.00 MB/s
+Benchmark__100B_mux___1K_chunks___1KB-2 200 37420006 ns/op 0.01 MB/s
+
% The followings are the full output with histograms.
================================================================================
Echo RPC
================================================================================
-Benchmark____1B 10000 1347426 ns/op 0.00 MB/s
+Benchmark____1B 3000 2260153 ns/op 0.00 MB/s
Histogram (unit: ms)
-Count: 10000 Min: 1 Max: 4 Avg: 1.16
+Count: 3000 Min: 1 Max: 3 Avg: 1.54
------------------------------------------------------------
-[ 1, 2) 8730 87.3% 87.3% #########
-[ 2, 3) 910 9.1% 96.4% #
-[ 3, 4) 359 3.6% 100.0%
-[ 4, 5) 1 0.0% 100.0%
-[ 5, 6) 0 0.0% 100.0%
-[ 6, 7) 0 0.0% 100.0%
-[ 7, 8) 0 0.0% 100.0%
-[ 8, 9) 0 0.0% 100.0%
-[ 9, 10) 0 0.0% 100.0%
-[ 10, 11) 0 0.0% 100.0%
-[ 11, 13) 0 0.0% 100.0%
-[ 13, 15) 0 0.0% 100.0%
-[ 15, 17) 0 0.0% 100.0%
-[ 17, 19) 0 0.0% 100.0%
-[ 19, 21) 0 0.0% 100.0%
-[ 21, 23) 0 0.0% 100.0%
-[ 23, inf) 0 0.0% 100.0%
-Benchmark____1B-2 10000 1241765 ns/op 0.00 MB/s
-Histogram (unit: us)
-Count: 10000 Min: 908 Max: 4837 Avg: 1240.94
-------------------------------------------------------------
-[ 908, 909) 1 0.0% 0.0%
-[ 909, 910) 1 0.0% 0.0%
-[ 910, 913) 2 0.0% 0.0%
-[ 913, 918) 1 0.0% 0.1%
-[ 918, 927) 6 0.1% 0.1%
-[ 927, 942) 29 0.3% 0.4%
-[ 942, 969) 182 1.8% 2.2%
-[ 969, 1016) 1701 17.0% 19.2% ##
-[ 1016, 1098) 4180 41.8% 61.0% ####
-[ 1098, 1241) 2657 26.6% 87.6% ###
-[ 1241, 1489) 464 4.6% 92.2%
-[ 1489, 1921) 36 0.4% 92.6%
-[ 1921, 2671) 101 1.0% 93.6%
-[ 2671, 3974) 531 5.3% 98.9% #
-[ 3974, 6236) 108 1.1% 100.0%
-[ 6236, 10165) 0 0.0% 100.0%
-[10165, inf) 0 0.0% 100.0%
-Benchmark___10B 5000 1521595 ns/op 0.01 MB/s
-Histogram (unit: ms)
-Count: 5000 Min: 1 Max: 10 Avg: 1.28
-------------------------------------------------------------
-[ 1, 2) 4713 94.3% 94.3% #########
-[ 2, 3) 9 0.2% 94.4%
-[ 3, 4) 1 0.0% 94.5%
-[ 4, 5) 2 0.0% 94.5%
-[ 5, 6) 67 1.3% 95.8%
-[ 6, 8) 201 4.0% 99.9%
-[ 8, 10) 6 0.1% 100.0%
-[ 10, 12) 1 0.0% 100.0%
-[ 12, 15) 0 0.0% 100.0%
-[ 15, 18) 0 0.0% 100.0%
-[ 18, 22) 0 0.0% 100.0%
-[ 22, 27) 0 0.0% 100.0%
-[ 27, 32) 0 0.0% 100.0%
-[ 32, 38) 0 0.0% 100.0%
-[ 38, 45) 0 0.0% 100.0%
-[ 45, 54) 0 0.0% 100.0%
-[ 54, inf) 0 0.0% 100.0%
-Benchmark___10B-2 10000 1345906 ns/op 0.01 MB/s
-Histogram (unit: us)
-Count: 10000 Min: 933 Max: 7348 Avg: 1345.04
-------------------------------------------------------------
-[ 933, 934) 1 0.0% 0.0%
-[ 934, 935) 0 0.0% 0.0%
-[ 935, 938) 0 0.0% 0.0%
-[ 938, 943) 1 0.0% 0.0%
-[ 943, 953) 9 0.1% 0.1%
-[ 953, 971) 34 0.3% 0.5%
-[ 971, 1004) 359 3.6% 4.0%
-[ 1004, 1063) 1750 17.5% 21.5% ##
-[ 1063, 1170) 3524 35.2% 56.8% ####
-[ 1170, 1362) 3531 35.3% 92.1% ####
-[ 1362, 1707) 326 3.3% 95.4%
-[ 1707, 2326) 13 0.1% 95.5%
-[ 2326, 3437) 0 0.0% 95.5%
-[ 3437, 5430) 251 2.5% 98.0%
-[ 5430, 9005) 201 2.0% 100.0%
-[ 9005, 15419) 0 0.0% 100.0%
-[15419, inf) 0 0.0% 100.0%
-Benchmark__100B 5000 1627288 ns/op 0.12 MB/s
-Histogram (unit: ms)
-Count: 5000 Min: 1 Max: 12 Avg: 1.37
-------------------------------------------------------------
-[ 1, 2) 4795 95.9% 95.9% ##########
-[ 2, 3) 7 0.1% 96.0%
-[ 3, 4) 11 0.2% 96.3%
-[ 4, 5) 0 0.0% 96.3%
-[ 5, 6) 0 0.0% 96.3%
-[ 6, 8) 0 0.0% 96.3%
-[ 8, 10) 14 0.3% 96.5%
-[ 10, 13) 173 3.5% 100.0%
-[ 13, 16) 0 0.0% 100.0%
-[ 16, 20) 0 0.0% 100.0%
-[ 20, 24) 0 0.0% 100.0%
-[ 24, 29) 0 0.0% 100.0%
-[ 29, 35) 0 0.0% 100.0%
-[ 35, 42) 0 0.0% 100.0%
-[ 42, 51) 0 0.0% 100.0%
-[ 51, 62) 0 0.0% 100.0%
-[ 62, inf) 0 0.0% 100.0%
-Benchmark__100B-2 10000 1395559 ns/op 0.14 MB/s
-Histogram (unit: us)
-Count: 10000 Min: 943 Max: 10888 Avg: 1394.71
-------------------------------------------------------------
-[ 943, 944) 1 0.0% 0.0%
-[ 944, 945) 0 0.0% 0.0%
-[ 945, 948) 0 0.0% 0.0%
-[ 948, 954) 0 0.0% 0.0%
-[ 954, 965) 2 0.0% 0.0%
-[ 965, 986) 14 0.1% 0.2%
-[ 986, 1025) 261 2.6% 2.8%
-[ 1025, 1098) 2684 26.8% 29.6% ###
-[ 1098, 1233) 4347 43.5% 73.1% ####
-[ 1233, 1483) 2135 21.4% 94.4% ##
-[ 1483, 1945) 225 2.2% 96.7%
-[ 1945, 2799) 3 0.0% 96.7%
-[ 2799, 4376) 0 0.0% 96.7%
-[ 4376, 7290) 105 1.1% 97.8%
-[ 7290, 12673) 223 2.2% 100.0%
-[12673, 22618) 0 0.0% 100.0%
-[22618, inf) 0 0.0% 100.0%
-Benchmark___1KB 5000 1548449 ns/op 1.29 MB/s
-Histogram (unit: ms)
-Count: 5000 Min: 1 Max: 18 Avg: 1.44
-------------------------------------------------------------
-[ 1, 2) 4854 97.1% 97.1% ##########
-[ 2, 3) 0 0.0% 97.1%
-[ 3, 4) 0 0.0% 97.1%
-[ 4, 5) 5 0.1% 97.2%
-[ 5, 7) 0 0.0% 97.2%
-[ 7, 9) 0 0.0% 97.2%
-[ 9, 12) 0 0.0% 97.2%
-[ 12, 15) 5 0.1% 97.3%
-[ 15, 19) 136 2.7% 100.0%
-[ 19, 24) 0 0.0% 100.0%
-[ 24, 30) 0 0.0% 100.0%
-[ 30, 37) 0 0.0% 100.0%
-[ 37, 46) 0 0.0% 100.0%
-[ 46, 57) 0 0.0% 100.0%
-[ 57, 71) 0 0.0% 100.0%
-[ 71, 88) 0 0.0% 100.0%
-[ 88, inf) 0 0.0% 100.0%
-Benchmark___1KB-2 10000 1296259 ns/op 1.54 MB/s
-Histogram (unit: us)
-Count: 10000 Min: 889 Max: 13746 Avg: 1295.42
-------------------------------------------------------------
-[ 889, 890) 1 0.0% 0.0%
-[ 890, 891) 0 0.0% 0.0%
-[ 891, 894) 2 0.0% 0.0%
-[ 894, 900) 2 0.0% 0.1%
-[ 900, 912) 16 0.2% 0.2%
-[ 912, 935) 205 2.0% 2.3%
-[ 935, 979) 2047 20.5% 22.7% ##
-[ 979, 1061) 3556 35.6% 58.3% ####
-[ 1061, 1216) 3264 32.6% 90.9% ###
-[ 1216, 1508) 633 6.3% 97.3% #
-[ 1508, 2056) 19 0.2% 97.5%
-[ 2056, 3087) 1 0.0% 97.5%
-[ 3087, 5024) 0 0.0% 97.5%
-[ 5024, 8665) 0 0.0% 97.5%
-[ 8665, 15507) 254 2.5% 100.0%
-[15507, 28364) 0 0.0% 100.0%
-[28364, inf) 0 0.0% 100.0%
-Benchmark__10KB 5000 1960759 ns/op 10.20 MB/s
-Histogram (unit: ms)
-Count: 5000 Min: 1 Max: 31 Avg: 1.68
-------------------------------------------------------------
-[ 1, 2) 4844 96.9% 96.9% ##########
-[ 2, 3) 0 0.0% 96.9%
-[ 3, 4) 0 0.0% 96.9%
-[ 4, 5) 2 0.0% 96.9%
-[ 5, 7) 10 0.2% 97.1%
-[ 7, 10) 0 0.0% 97.1%
-[ 10, 13) 0 0.0% 97.1%
-[ 13, 17) 0 0.0% 97.1%
-[ 17, 23) 50 1.0% 98.1%
-[ 23, 30) 93 1.9% 100.0%
-[ 30, 39) 1 0.0% 100.0%
-[ 39, 51) 0 0.0% 100.0%
-[ 51, 66) 0 0.0% 100.0%
-[ 66, 85) 0 0.0% 100.0%
-[ 85, 108) 0 0.0% 100.0%
-[108, 137) 0 0.0% 100.0%
-[137, inf) 0 0.0% 100.0%
-Benchmark__10KB-2 10000 1516984 ns/op 13.18 MB/s
-Histogram (unit: us)
-Count: 10000 Min: 953 Max: 18285 Avg: 1516.12
-------------------------------------------------------------
-[ 953, 954) 1 0.0% 0.0%
-[ 954, 955) 0 0.0% 0.0%
-[ 955, 958) 0 0.0% 0.0%
-[ 958, 965) 1 0.0% 0.0%
-[ 965, 978) 17 0.2% 0.2%
-[ 978, 1003) 129 1.3% 1.5%
-[ 1003, 1052) 1126 11.3% 12.7% #
-[ 1052, 1147) 3525 35.2% 48.0% ####
-[ 1147, 1329) 4301 43.0% 91.0% ####
-[ 1329, 1678) 509 5.1% 96.1% #
-[ 1678, 2347) 120 1.2% 97.3%
-[ 2347, 3630) 5 0.1% 97.3%
-[ 3630, 6090) 0 0.0% 97.3%
-[ 6090, 10807) 0 0.0% 97.3%
-[10807, 19848) 266 2.7% 100.0%
-[19848, 37179) 0 0.0% 100.0%
-[37179, inf) 0 0.0% 100.0%
-Benchmark_100KB 2000 4950737 ns/op 40.40 MB/s
-Histogram (unit: ms)
-Count: 2000 Min: 2 Max: 35 Avg: 4.12
-------------------------------------------------------------
-[ 2, 3) 1723 86.2% 86.2% #########
-[ 3, 4) 123 6.2% 92.3% #
-[ 4, 5) 0 0.0% 92.3%
-[ 5, 7) 7 0.4% 92.7%
-[ 7, 9) 15 0.8% 93.4%
-[ 9, 12) 0 0.0% 93.4%
-[ 12, 16) 0 0.0% 93.4%
-[ 16, 21) 0 0.0% 93.4%
-[ 21, 27) 0 0.0% 93.4%
-[ 27, 35) 130 6.5% 99.9% #
-[ 35, 45) 2 0.1% 100.0%
-[ 45, 57) 0 0.0% 100.0%
-[ 57, 73) 0 0.0% 100.0%
-[ 73, 93) 0 0.0% 100.0%
-[ 93, 119) 0 0.0% 100.0%
-[119, 152) 0 0.0% 100.0%
-[152, inf) 0 0.0% 100.0%
-Benchmark_100KB-2 5000 3536973 ns/op 56.55 MB/s
-Histogram (unit: ms)
-Count: 5000 Min: 2 Max: 20 Avg: 2.99
-------------------------------------------------------------
-[ 2, 3) 4473 89.5% 89.5% #########
-[ 3, 4) 209 4.2% 93.6%
-[ 4, 5) 1 0.0% 93.7%
-[ 5, 6) 0 0.0% 93.7%
-[ 6, 8) 0 0.0% 93.7%
-[ 8, 10) 0 0.0% 93.7%
-[ 10, 13) 0 0.0% 93.7%
-[ 13, 16) 89 1.8% 95.4%
-[ 16, 20) 227 4.5% 100.0%
-[ 20, 25) 1 0.0% 100.0%
-[ 25, 31) 0 0.0% 100.0%
-[ 31, 39) 0 0.0% 100.0%
-[ 39, 49) 0 0.0% 100.0%
-[ 49, 61) 0 0.0% 100.0%
-[ 61, 75) 0 0.0% 100.0%
-[ 75, 92) 0 0.0% 100.0%
-[ 92, inf) 0 0.0% 100.0%
-
-================================================================================
-Echo streaming RPC
-================================================================================
-Benchmark____1_chunk_____1B 5000 1733706 ns/op 0.00 MB/s
-Histogram (unit: ms)
-Count: 5000 Min: 1 Max: 3 Avg: 1.19
-------------------------------------------------------------
-[ 1, 2) 4198 84.0% 84.0% ########
-[ 2, 3) 670 13.4% 97.4% #
-[ 3, 4) 132 2.6% 100.0%
+[ 1, 2) 1754 58.5% 58.5% ######
+[ 2, 3) 864 28.8% 87.3% ###
+[ 3, 4) 382 12.7% 100.0% #
[ 4, 5) 0 0.0% 100.0%
[ 5, 6) 0 0.0% 100.0%
[ 6, 7) 0 0.0% 100.0%
@@ -383,37 +131,100 @@
[ 15, 16) 0 0.0% 100.0%
[ 16, 17) 0 0.0% 100.0%
[ 17, inf) 0 0.0% 100.0%
-Benchmark____1_chunk_____1B-2 10000 1549342 ns/op 0.00 MB/s
+Benchmark____1B-2 3000 2362339 ns/op 0.00 MB/s
Histogram (unit: ms)
-Count: 10000 Min: 1 Max: 4 Avg: 1.13
+Count: 3000 Min: 1 Max: 4 Avg: 1.98
------------------------------------------------------------
-[ 1, 2) 9051 90.5% 90.5% #########
-[ 2, 3) 638 6.4% 96.9% #
-[ 3, 4) 251 2.5% 99.4%
-[ 4, 5) 60 0.6% 100.0%
-[ 5, 6) 0 0.0% 100.0%
-[ 6, 7) 0 0.0% 100.0%
-[ 7, 8) 0 0.0% 100.0%
-[ 8, 9) 0 0.0% 100.0%
-[ 9, 10) 0 0.0% 100.0%
-[ 10, 11) 0 0.0% 100.0%
-[ 11, 13) 0 0.0% 100.0%
-[ 13, 15) 0 0.0% 100.0%
-[ 15, 17) 0 0.0% 100.0%
-[ 17, 19) 0 0.0% 100.0%
-[ 19, 21) 0 0.0% 100.0%
-[ 21, 23) 0 0.0% 100.0%
-[ 23, inf) 0 0.0% 100.0%
-Benchmark____1_chunk____10B 5000 1841027 ns/op 0.01 MB/s
+[ 1, 2) 608 20.3% 20.3% ##
+[ 2, 3) 1864 62.1% 82.4% ######
+[ 3, 4) 520 17.3% 99.7% ##
+[ 4, 5) 8 0.3% 100.0%
+[ 5, 6) 0 0.0% 100.0%
+[ 6, 7) 0 0.0% 100.0%
+[ 7, 8) 0 0.0% 100.0%
+[ 8, 9) 0 0.0% 100.0%
+[ 9, 10) 0 0.0% 100.0%
+[ 10, 11) 0 0.0% 100.0%
+[ 11, 13) 0 0.0% 100.0%
+[ 13, 15) 0 0.0% 100.0%
+[ 15, 17) 0 0.0% 100.0%
+[ 17, 19) 0 0.0% 100.0%
+[ 19, 21) 0 0.0% 100.0%
+[ 21, 23) 0 0.0% 100.0%
+[ 23, inf) 0 0.0% 100.0%
+Benchmark___10B 3000 2595581 ns/op 0.01 MB/s
Histogram (unit: ms)
-Count: 5000 Min: 1 Max: 6 Avg: 1.26
+Count: 3000 Min: 2 Max: 5 Avg: 2.37
------------------------------------------------------------
-[ 1, 2) 4657 93.1% 93.1% #########
-[ 2, 3) 14 0.3% 93.4%
-[ 3, 4) 0 0.0% 93.4%
-[ 4, 5) 21 0.4% 93.8%
-[ 5, 6) 298 6.0% 99.8% #
-[ 6, 7) 10 0.2% 100.0%
+[ 2, 3) 2459 82.0% 82.0% ########
+[ 3, 4) 45 1.5% 83.5%
+[ 4, 5) 437 14.6% 98.0% #
+[ 5, 6) 59 2.0% 100.0%
+[ 6, 7) 0 0.0% 100.0%
+[ 7, 8) 0 0.0% 100.0%
+[ 8, 9) 0 0.0% 100.0%
+[ 9, 10) 0 0.0% 100.0%
+[ 10, 11) 0 0.0% 100.0%
+[ 11, 12) 0 0.0% 100.0%
+[ 12, 14) 0 0.0% 100.0%
+[ 14, 16) 0 0.0% 100.0%
+[ 16, 18) 0 0.0% 100.0%
+[ 18, 20) 0 0.0% 100.0%
+[ 20, 22) 0 0.0% 100.0%
+[ 22, 24) 0 0.0% 100.0%
+[ 24, inf) 0 0.0% 100.0%
+Benchmark___10B-2 3000 2372671 ns/op 0.01 MB/s
+Histogram (unit: ms)
+Count: 3000 Min: 1 Max: 5 Avg: 1.93
+------------------------------------------------------------
+[ 1, 2) 866 28.9% 28.9% ###
+[ 2, 3) 1691 56.4% 85.2% ######
+[ 3, 4) 233 7.8% 93.0% #
+[ 4, 5) 201 6.7% 99.7% #
+[ 5, 6) 9 0.3% 100.0%
+[ 6, 7) 0 0.0% 100.0%
+[ 7, 8) 0 0.0% 100.0%
+[ 8, 9) 0 0.0% 100.0%
+[ 9, 11) 0 0.0% 100.0%
+[ 11, 13) 0 0.0% 100.0%
+[ 13, 15) 0 0.0% 100.0%
+[ 15, 17) 0 0.0% 100.0%
+[ 17, 20) 0 0.0% 100.0%
+[ 20, 23) 0 0.0% 100.0%
+[ 23, 26) 0 0.0% 100.0%
+[ 26, 29) 0 0.0% 100.0%
+[ 29, inf) 0 0.0% 100.0%
+Benchmark__100B 3000 2690733 ns/op 0.07 MB/s
+Histogram (unit: ms)
+Count: 3000 Min: 2 Max: 7 Avg: 2.48
+------------------------------------------------------------
+[ 2, 3) 2544 84.8% 84.8% ########
+[ 3, 4) 82 2.7% 87.5%
+[ 4, 5) 0 0.0% 87.5%
+[ 5, 6) 146 4.9% 92.4%
+[ 6, 7) 226 7.5% 99.9% #
+[ 7, 8) 2 0.1% 100.0%
+[ 8, 9) 0 0.0% 100.0%
+[ 9, 11) 0 0.0% 100.0%
+[ 11, 13) 0 0.0% 100.0%
+[ 13, 15) 0 0.0% 100.0%
+[ 15, 17) 0 0.0% 100.0%
+[ 17, 20) 0 0.0% 100.0%
+[ 20, 23) 0 0.0% 100.0%
+[ 23, 27) 0 0.0% 100.0%
+[ 27, 31) 0 0.0% 100.0%
+[ 31, 35) 0 0.0% 100.0%
+[ 35, inf) 0 0.0% 100.0%
+Benchmark__100B-2 3000 2419120 ns/op 0.08 MB/s
+Histogram (unit: ms)
+Count: 3000 Min: 1 Max: 6 Avg: 2.05
+------------------------------------------------------------
+[ 1, 2) 647 21.6% 21.6% ##
+[ 2, 3) 2027 67.6% 89.1% #######
+[ 3, 4) 1 0.0% 89.2%
+[ 4, 5) 184 6.1% 95.3% #
+[ 5, 6) 128 4.3% 99.6%
+[ 6, 7) 13 0.4% 100.0%
[ 7, 8) 0 0.0% 100.0%
[ 8, 10) 0 0.0% 100.0%
[ 10, 12) 0 0.0% 100.0%
@@ -425,39 +236,18 @@
[ 26, 30) 0 0.0% 100.0%
[ 30, 34) 0 0.0% 100.0%
[ 34, inf) 0 0.0% 100.0%
-Benchmark____1_chunk____10B-2 5000 1645809 ns/op 0.01 MB/s
+Benchmark___1KB 3000 2498211 ns/op 0.80 MB/s
Histogram (unit: ms)
-Count: 5000 Min: 1 Max: 6 Avg: 1.19
+Count: 3000 Min: 1 Max: 10 Avg: 1.76
------------------------------------------------------------
-[ 1, 2) 4710 94.2% 94.2% #########
-[ 2, 3) 11 0.2% 94.4%
-[ 3, 4) 12 0.2% 94.7%
-[ 4, 5) 175 3.5% 98.2%
-[ 5, 6) 89 1.8% 99.9%
-[ 6, 7) 3 0.1% 100.0%
-[ 7, 8) 0 0.0% 100.0%
-[ 8, 10) 0 0.0% 100.0%
-[ 10, 12) 0 0.0% 100.0%
-[ 12, 14) 0 0.0% 100.0%
-[ 14, 16) 0 0.0% 100.0%
-[ 16, 19) 0 0.0% 100.0%
-[ 19, 22) 0 0.0% 100.0%
-[ 22, 26) 0 0.0% 100.0%
-[ 26, 30) 0 0.0% 100.0%
-[ 30, 34) 0 0.0% 100.0%
-[ 34, inf) 0 0.0% 100.0%
-Benchmark____1_chunk___100B 5000 1891259 ns/op 0.11 MB/s
-Histogram (unit: ms)
-Count: 5000 Min: 1 Max: 10 Avg: 1.33
-------------------------------------------------------------
-[ 1, 2) 4748 95.0% 95.0% #########
-[ 2, 3) 5 0.1% 95.1%
-[ 3, 4) 8 0.2% 95.2%
-[ 4, 5) 0 0.0% 95.2%
-[ 5, 6) 0 0.0% 95.2%
-[ 6, 8) 54 1.1% 96.3%
-[ 8, 10) 182 3.6% 99.9%
-[ 10, 12) 3 0.1% 100.0%
+[ 1, 2) 2191 73.0% 73.0% #######
+[ 2, 3) 449 15.0% 88.0% #
+[ 3, 4) 75 2.5% 90.5%
+[ 4, 5) 3 0.1% 90.6%
+[ 5, 6) 6 0.2% 90.8%
+[ 6, 8) 240 8.0% 98.8% #
+[ 8, 10) 35 1.2% 100.0%
+[ 10, 12) 1 0.0% 100.0%
[ 12, 15) 0 0.0% 100.0%
[ 15, 18) 0 0.0% 100.0%
[ 18, 22) 0 0.0% 100.0%
@@ -467,17 +257,59 @@
[ 38, 45) 0 0.0% 100.0%
[ 45, 54) 0 0.0% 100.0%
[ 54, inf) 0 0.0% 100.0%
-Benchmark____1_chunk___100B-2 5000 1720838 ns/op 0.12 MB/s
+Benchmark___1KB-2 3000 2244818 ns/op 0.89 MB/s
Histogram (unit: ms)
-Count: 5000 Min: 1 Max: 8 Avg: 1.22
+Count: 3000 Min: 1 Max: 7 Avg: 1.62
------------------------------------------------------------
-[ 1, 2) 4746 94.9% 94.9% #########
-[ 2, 3) 40 0.8% 95.7%
-[ 3, 4) 0 0.0% 95.7%
-[ 4, 5) 0 0.0% 95.7%
-[ 5, 6) 86 1.7% 97.4%
-[ 6, 7) 79 1.6% 99.0%
-[ 7, 9) 49 1.0% 100.0%
+[ 1, 2) 1949 65.0% 65.0% ######
+[ 2, 3) 795 26.5% 91.5% ###
+[ 3, 4) 0 0.0% 91.5%
+[ 4, 5) 63 2.1% 93.6%
+[ 5, 6) 112 3.7% 97.3%
+[ 6, 7) 72 2.4% 99.7%
+[ 7, 9) 9 0.3% 100.0%
+[ 9, 11) 0 0.0% 100.0%
+[ 11, 13) 0 0.0% 100.0%
+[ 13, 15) 0 0.0% 100.0%
+[ 15, 18) 0 0.0% 100.0%
+[ 18, 21) 0 0.0% 100.0%
+[ 21, 25) 0 0.0% 100.0%
+[ 25, 29) 0 0.0% 100.0%
+[ 29, 34) 0 0.0% 100.0%
+[ 34, 40) 0 0.0% 100.0%
+[ 40, inf) 0 0.0% 100.0%
+Benchmark__10KB 3000 2740536 ns/op 7.30 MB/s
+Histogram (unit: ms)
+Count: 3000 Min: 2 Max: 10 Avg: 2.62
+------------------------------------------------------------
+[ 2, 3) 2652 88.4% 88.4% #########
+[ 3, 4) 72 2.4% 90.8%
+[ 4, 5) 0 0.0% 90.8%
+[ 5, 6) 0 0.0% 90.8%
+[ 6, 7) 0 0.0% 90.8%
+[ 7, 9) 93 3.1% 93.9%
+[ 9, 11) 183 6.1% 100.0% #
+[ 11, 13) 0 0.0% 100.0%
+[ 13, 16) 0 0.0% 100.0%
+[ 16, 19) 0 0.0% 100.0%
+[ 19, 23) 0 0.0% 100.0%
+[ 23, 27) 0 0.0% 100.0%
+[ 27, 32) 0 0.0% 100.0%
+[ 32, 38) 0 0.0% 100.0%
+[ 38, 44) 0 0.0% 100.0%
+[ 44, 52) 0 0.0% 100.0%
+[ 52, inf) 0 0.0% 100.0%
+Benchmark__10KB-2 3000 2394824 ns/op 8.35 MB/s
+Histogram (unit: ms)
+Count: 3000 Min: 1 Max: 8 Avg: 1.84
+------------------------------------------------------------
+[ 1, 2) 1531 51.0% 51.0% #####
+[ 2, 3) 1214 40.5% 91.5% ####
+[ 3, 4) 0 0.0% 91.5%
+[ 4, 5) 0 0.0% 91.5%
+[ 5, 6) 83 2.8% 94.3%
+[ 6, 7) 69 2.3% 96.6%
+[ 7, 9) 103 3.4% 100.0%
[ 9, 11) 0 0.0% 100.0%
[ 11, 13) 0 0.0% 100.0%
[ 13, 16) 0 0.0% 100.0%
@@ -488,124 +320,464 @@
[ 32, 38) 0 0.0% 100.0%
[ 38, 44) 0 0.0% 100.0%
[ 44, inf) 0 0.0% 100.0%
-Benchmark____1_chunk____1KB 5000 1834957 ns/op 1.09 MB/s
+Benchmark_100KB 2000 5581491 ns/op 35.83 MB/s
Histogram (unit: ms)
-Count: 5000 Min: 1 Max: 17 Avg: 1.43
+Count: 2000 Min: 3 Max: 15 Avg: 4.93
------------------------------------------------------------
-[ 1, 2) 4809 96.2% 96.2% ##########
-[ 2, 3) 0 0.0% 96.2%
-[ 3, 4) 4 0.1% 96.3%
-[ 4, 5) 1 0.0% 96.3%
-[ 5, 7) 0 0.0% 96.3%
-[ 7, 9) 0 0.0% 96.3%
-[ 9, 12) 13 0.3% 96.5%
-[ 12, 15) 172 3.4% 100.0%
-[ 15, 19) 1 0.0% 100.0%
-[ 19, 24) 0 0.0% 100.0%
-[ 24, 30) 0 0.0% 100.0%
-[ 30, 37) 0 0.0% 100.0%
-[ 37, 46) 0 0.0% 100.0%
-[ 46, 57) 0 0.0% 100.0%
-[ 57, 70) 0 0.0% 100.0%
-[ 70, 86) 0 0.0% 100.0%
-[ 86, inf) 0 0.0% 100.0%
-Benchmark____1_chunk____1KB-2 5000 1641668 ns/op 1.22 MB/s
-Histogram (unit: ms)
-Count: 5000 Min: 1 Max: 9 Avg: 1.23
-------------------------------------------------------------
-[ 1, 2) 4825 96.5% 96.5% ##########
-[ 2, 3) 4 0.1% 96.6%
-[ 3, 4) 0 0.0% 96.6%
-[ 4, 5) 0 0.0% 96.6%
-[ 5, 6) 0 0.0% 96.6%
-[ 6, 8) 72 1.4% 98.0%
-[ 8, 10) 99 2.0% 100.0%
-[ 10, 12) 0 0.0% 100.0%
-[ 12, 15) 0 0.0% 100.0%
-[ 15, 18) 0 0.0% 100.0%
+[ 3, 4) 1253 62.7% 62.7% ######
+[ 4, 5) 259 13.0% 75.6% #
+[ 5, 6) 124 6.2% 81.8% #
+[ 6, 7) 1 0.1% 81.9%
+[ 7, 8) 0 0.0% 81.9%
+[ 8, 10) 0 0.0% 81.9%
+[ 10, 12) 84 4.2% 86.1%
+[ 12, 15) 274 13.7% 99.8% #
+[ 15, 18) 5 0.2% 100.0%
[ 18, 22) 0 0.0% 100.0%
-[ 22, 26) 0 0.0% 100.0%
-[ 26, 31) 0 0.0% 100.0%
-[ 31, 37) 0 0.0% 100.0%
-[ 37, 43) 0 0.0% 100.0%
-[ 43, 51) 0 0.0% 100.0%
-[ 51, inf) 0 0.0% 100.0%
-Benchmark____1_chunk___10KB 5000 2169053 ns/op 9.22 MB/s
+[ 22, 27) 0 0.0% 100.0%
+[ 27, 33) 0 0.0% 100.0%
+[ 33, 40) 0 0.0% 100.0%
+[ 40, 48) 0 0.0% 100.0%
+[ 48, 58) 0 0.0% 100.0%
+[ 58, 69) 0 0.0% 100.0%
+[ 69, inf) 0 0.0% 100.0%
+Benchmark_100KB-2 2000 4127286 ns/op 48.46 MB/s
Histogram (unit: ms)
-Count: 5000 Min: 1 Max: 18 Avg: 1.60
+Count: 2000 Min: 2 Max: 10 Avg: 3.78
------------------------------------------------------------
-[ 1, 2) 4777 95.5% 95.5% ##########
-[ 2, 3) 4 0.1% 95.6%
-[ 3, 4) 0 0.0% 95.6%
-[ 4, 5) 23 0.5% 96.1%
-[ 5, 7) 2 0.0% 96.1%
-[ 7, 9) 0 0.0% 96.1%
-[ 9, 12) 0 0.0% 96.1%
-[ 12, 15) 23 0.5% 96.6%
-[ 15, 19) 171 3.4% 100.0%
+[ 2, 3) 373 18.7% 18.7% ##
+[ 3, 4) 1286 64.3% 83.0% ######
+[ 4, 5) 0 0.0% 83.0%
+[ 5, 6) 0 0.0% 83.0%
+[ 6, 7) 0 0.0% 83.0%
+[ 7, 9) 116 5.8% 88.8% #
+[ 9, 11) 225 11.2% 100.0% #
+[ 11, 13) 0 0.0% 100.0%
+[ 13, 16) 0 0.0% 100.0%
+[ 16, 19) 0 0.0% 100.0%
+[ 19, 23) 0 0.0% 100.0%
+[ 23, 27) 0 0.0% 100.0%
+[ 27, 32) 0 0.0% 100.0%
+[ 32, 38) 0 0.0% 100.0%
+[ 38, 44) 0 0.0% 100.0%
+[ 44, 52) 0 0.0% 100.0%
+[ 52, inf) 0 0.0% 100.0%
+
+================================================================================
+Echo streaming RPC
+================================================================================
+Benchmark____1_chunk_____1B 3000 2744128 ns/op 0.00 MB/s
+Histogram (unit: ms)
+Count: 3000 Min: 2 Max: 4 Avg: 2.31
+------------------------------------------------------------
+[ 2, 3) 2072 69.1% 69.1% #######
+[ 3, 4) 921 30.7% 99.8% ###
+[ 4, 5) 7 0.2% 100.0%
+[ 5, 6) 0 0.0% 100.0%
+[ 6, 7) 0 0.0% 100.0%
+[ 7, 8) 0 0.0% 100.0%
+[ 8, 9) 0 0.0% 100.0%
+[ 9, 10) 0 0.0% 100.0%
+[ 10, 11) 0 0.0% 100.0%
+[ 11, 12) 0 0.0% 100.0%
+[ 12, 13) 0 0.0% 100.0%
+[ 13, 14) 0 0.0% 100.0%
+[ 14, 15) 0 0.0% 100.0%
+[ 15, 16) 0 0.0% 100.0%
+[ 16, 17) 0 0.0% 100.0%
+[ 17, 18) 0 0.0% 100.0%
+[ 18, inf) 0 0.0% 100.0%
+Benchmark____1_chunk_____1B-2 3000 2347418 ns/op 0.00 MB/s
+Histogram (unit: ms)
+Count: 3000 Min: 1 Max: 4 Avg: 2.18
+------------------------------------------------------------
+[ 1, 2) 46 1.5% 1.5%
+[ 2, 3) 2381 79.4% 80.9% ########
+[ 3, 4) 567 18.9% 99.8% ##
+[ 4, 5) 6 0.2% 100.0%
+[ 5, 6) 0 0.0% 100.0%
+[ 6, 7) 0 0.0% 100.0%
+[ 7, 8) 0 0.0% 100.0%
+[ 8, 9) 0 0.0% 100.0%
+[ 9, 10) 0 0.0% 100.0%
+[ 10, 11) 0 0.0% 100.0%
+[ 11, 13) 0 0.0% 100.0%
+[ 13, 15) 0 0.0% 100.0%
+[ 15, 17) 0 0.0% 100.0%
+[ 17, 19) 0 0.0% 100.0%
+[ 19, 21) 0 0.0% 100.0%
+[ 21, 23) 0 0.0% 100.0%
+[ 23, inf) 0 0.0% 100.0%
+Benchmark____1_chunk____10B 3000 2857309 ns/op 0.01 MB/s
+Histogram (unit: ms)
+Count: 3000 Min: 2 Max: 5 Avg: 2.45
+------------------------------------------------------------
+[ 2, 3) 2387 79.6% 79.6% ########
+[ 3, 4) 88 2.9% 82.5%
+[ 4, 5) 303 10.1% 92.6% #
+[ 5, 6) 222 7.4% 100.0% #
+[ 6, 7) 0 0.0% 100.0%
+[ 7, 8) 0 0.0% 100.0%
+[ 8, 9) 0 0.0% 100.0%
+[ 9, 10) 0 0.0% 100.0%
+[ 10, 11) 0 0.0% 100.0%
+[ 11, 12) 0 0.0% 100.0%
+[ 12, 14) 0 0.0% 100.0%
+[ 14, 16) 0 0.0% 100.0%
+[ 16, 18) 0 0.0% 100.0%
+[ 18, 20) 0 0.0% 100.0%
+[ 20, 22) 0 0.0% 100.0%
+[ 22, 24) 0 0.0% 100.0%
+[ 24, inf) 0 0.0% 100.0%
+Benchmark____1_chunk____10B-2 3000 2363346 ns/op 0.01 MB/s
+Histogram (unit: ms)
+Count: 3000 Min: 1 Max: 5 Avg: 2.18
+------------------------------------------------------------
+[ 1, 2) 32 1.1% 1.1%
+[ 2, 3) 2535 84.5% 85.6% ########
+[ 3, 4) 293 9.8% 95.3% #
+[ 4, 5) 139 4.6% 100.0%
+[ 5, 6) 1 0.0% 100.0%
+[ 6, 7) 0 0.0% 100.0%
+[ 7, 8) 0 0.0% 100.0%
+[ 8, 9) 0 0.0% 100.0%
+[ 9, 11) 0 0.0% 100.0%
+[ 11, 13) 0 0.0% 100.0%
+[ 13, 15) 0 0.0% 100.0%
+[ 15, 17) 0 0.0% 100.0%
+[ 17, 20) 0 0.0% 100.0%
+[ 20, 23) 0 0.0% 100.0%
+[ 23, 26) 0 0.0% 100.0%
+[ 26, 29) 0 0.0% 100.0%
+[ 29, inf) 0 0.0% 100.0%
+Benchmark____1_chunk___100B 3000 2922993 ns/op 0.07 MB/s
+Histogram (unit: ms)
+Count: 3000 Min: 2 Max: 7 Avg: 2.50
+------------------------------------------------------------
+[ 2, 3) 2527 84.2% 84.2% ########
+[ 3, 4) 106 3.5% 87.8%
+[ 4, 5) 0 0.0% 87.8%
+[ 5, 6) 99 3.3% 91.1%
+[ 6, 7) 255 8.5% 99.6% #
+[ 7, 8) 13 0.4% 100.0%
+[ 8, 9) 0 0.0% 100.0%
+[ 9, 11) 0 0.0% 100.0%
+[ 11, 13) 0 0.0% 100.0%
+[ 13, 15) 0 0.0% 100.0%
+[ 15, 17) 0 0.0% 100.0%
+[ 17, 20) 0 0.0% 100.0%
+[ 20, 23) 0 0.0% 100.0%
+[ 23, 27) 0 0.0% 100.0%
+[ 27, 31) 0 0.0% 100.0%
+[ 31, 35) 0 0.0% 100.0%
+[ 35, inf) 0 0.0% 100.0%
+Benchmark____1_chunk___100B-2 3000 2558699 ns/op 0.08 MB/s
+Histogram (unit: ms)
+Count: 3000 Min: 1 Max: 6 Avg: 2.28
+------------------------------------------------------------
+[ 1, 2) 5 0.2% 0.2%
+[ 2, 3) 2673 89.1% 89.3% #########
+[ 3, 4) 2 0.1% 89.3%
+[ 4, 5) 177 5.9% 95.2% #
+[ 5, 6) 96 3.2% 98.4%
+[ 6, 7) 47 1.6% 100.0%
+[ 7, 8) 0 0.0% 100.0%
+[ 8, 10) 0 0.0% 100.0%
+[ 10, 12) 0 0.0% 100.0%
+[ 12, 14) 0 0.0% 100.0%
+[ 14, 16) 0 0.0% 100.0%
+[ 16, 19) 0 0.0% 100.0%
+[ 19, 22) 0 0.0% 100.0%
+[ 22, 26) 0 0.0% 100.0%
+[ 26, 30) 0 0.0% 100.0%
+[ 30, 34) 0 0.0% 100.0%
+[ 34, inf) 0 0.0% 100.0%
+Benchmark____1_chunk____1KB 3000 2646432 ns/op 0.76 MB/s
+Histogram (unit: ms)
+Count: 3000 Min: 2 Max: 10 Avg: 2.49
+------------------------------------------------------------
+[ 2, 3) 2647 88.2% 88.2% #########
+[ 3, 4) 71 2.4% 90.6%
+[ 4, 5) 4 0.1% 90.7%
+[ 5, 6) 0 0.0% 90.7%
+[ 6, 7) 67 2.2% 93.0%
+[ 7, 9) 209 7.0% 99.9% #
+[ 9, 11) 2 0.1% 100.0%
+[ 11, 13) 0 0.0% 100.0%
+[ 13, 16) 0 0.0% 100.0%
+[ 16, 19) 0 0.0% 100.0%
+[ 19, 23) 0 0.0% 100.0%
+[ 23, 27) 0 0.0% 100.0%
+[ 27, 32) 0 0.0% 100.0%
+[ 32, 38) 0 0.0% 100.0%
+[ 38, 44) 0 0.0% 100.0%
+[ 44, 52) 0 0.0% 100.0%
+[ 52, inf) 0 0.0% 100.0%
+Benchmark____1_chunk____1KB-2 3000 2400649 ns/op 0.83 MB/s
+Histogram (unit: ms)
+Count: 3000 Min: 1 Max: 7 Avg: 2.01
+------------------------------------------------------------
+[ 1, 2) 864 28.8% 28.8% ###
+[ 2, 3) 1881 62.7% 91.5% ######
+[ 3, 4) 2 0.1% 91.6%
+[ 4, 5) 10 0.3% 91.9%
+[ 5, 6) 127 4.2% 96.1%
+[ 6, 7) 94 3.1% 99.3%
+[ 7, 9) 22 0.7% 100.0%
+[ 9, 11) 0 0.0% 100.0%
+[ 11, 13) 0 0.0% 100.0%
+[ 13, 15) 0 0.0% 100.0%
+[ 15, 18) 0 0.0% 100.0%
+[ 18, 21) 0 0.0% 100.0%
+[ 21, 25) 0 0.0% 100.0%
+[ 25, 29) 0 0.0% 100.0%
+[ 29, 34) 0 0.0% 100.0%
+[ 34, 40) 0 0.0% 100.0%
+[ 40, inf) 0 0.0% 100.0%
+Benchmark____1_chunk___10KB 3000 2954627 ns/op 6.77 MB/s
+Histogram (unit: ms)
+Count: 3000 Min: 2 Max: 10 Avg: 2.65
+------------------------------------------------------------
+[ 2, 3) 2621 87.4% 87.4% #########
+[ 3, 4) 93 3.1% 90.5%
+[ 4, 5) 13 0.4% 90.9%
+[ 5, 6) 0 0.0% 90.9%
+[ 6, 7) 0 0.0% 90.9%
+[ 7, 9) 99 3.3% 94.2%
+[ 9, 11) 174 5.8% 100.0% #
+[ 11, 13) 0 0.0% 100.0%
+[ 13, 16) 0 0.0% 100.0%
+[ 16, 19) 0 0.0% 100.0%
+[ 19, 23) 0 0.0% 100.0%
+[ 23, 27) 0 0.0% 100.0%
+[ 27, 32) 0 0.0% 100.0%
+[ 32, 38) 0 0.0% 100.0%
+[ 38, 44) 0 0.0% 100.0%
+[ 44, 52) 0 0.0% 100.0%
+[ 52, inf) 0 0.0% 100.0%
+Benchmark____1_chunk___10KB-2 3000 2546084 ns/op 7.86 MB/s
+Histogram (unit: ms)
+Count: 3000 Min: 1 Max: 8 Avg: 2.25
+------------------------------------------------------------
+[ 1, 2) 414 13.8% 13.8% #
+[ 2, 3) 2335 77.8% 91.6% ########
+[ 3, 4) 0 0.0% 91.6%
+[ 4, 5) 0 0.0% 91.6%
+[ 5, 6) 37 1.2% 92.9%
+[ 6, 7) 88 2.9% 95.8%
+[ 7, 9) 126 4.2% 100.0%
+[ 9, 11) 0 0.0% 100.0%
+[ 11, 13) 0 0.0% 100.0%
+[ 13, 16) 0 0.0% 100.0%
+[ 16, 19) 0 0.0% 100.0%
+[ 19, 23) 0 0.0% 100.0%
+[ 23, 27) 0 0.0% 100.0%
+[ 27, 32) 0 0.0% 100.0%
+[ 32, 38) 0 0.0% 100.0%
+[ 38, 44) 0 0.0% 100.0%
+[ 44, inf) 0 0.0% 100.0%
+Benchmark____1_chunk__100KB 2000 5517042 ns/op 36.25 MB/s
+Histogram (unit: ms)
+Count: 2000 Min: 3 Max: 15 Avg: 4.82
+------------------------------------------------------------
+[ 3, 4) 1247 62.4% 62.4% ######
+[ 4, 5) 256 12.8% 75.2% #
+[ 5, 6) 146 7.3% 82.5% #
+[ 6, 7) 0 0.0% 82.5%
+[ 7, 8) 0 0.0% 82.5%
+[ 8, 10) 0 0.0% 82.5%
+[ 10, 12) 132 6.6% 89.1% #
+[ 12, 15) 217 10.9% 99.9% #
+[ 15, 18) 2 0.1% 100.0%
+[ 18, 22) 0 0.0% 100.0%
+[ 22, 27) 0 0.0% 100.0%
+[ 27, 33) 0 0.0% 100.0%
+[ 33, 40) 0 0.0% 100.0%
+[ 40, 48) 0 0.0% 100.0%
+[ 48, 58) 0 0.0% 100.0%
+[ 58, 69) 0 0.0% 100.0%
+[ 69, inf) 0 0.0% 100.0%
+Benchmark____1_chunk__100KB-2 2000 4157872 ns/op 48.10 MB/s
+Histogram (unit: ms)
+Count: 2000 Min: 2 Max: 11 Avg: 3.83
+------------------------------------------------------------
+[ 2, 3) 159 8.0% 8.0% #
+[ 3, 4) 1495 74.8% 82.7% #######
+[ 4, 5) 11 0.6% 83.2%
+[ 5, 6) 0 0.0% 83.2%
+[ 6, 7) 0 0.0% 83.2%
+[ 7, 9) 167 8.3% 91.6% #
+[ 9, 11) 166 8.3% 99.9% #
+[ 11, 13) 2 0.1% 100.0%
+[ 13, 16) 0 0.0% 100.0%
+[ 16, 19) 0 0.0% 100.0%
+[ 19, 23) 0 0.0% 100.0%
+[ 23, 28) 0 0.0% 100.0%
+[ 28, 33) 0 0.0% 100.0%
+[ 33, 39) 0 0.0% 100.0%
+[ 39, 46) 0 0.0% 100.0%
+[ 46, 55) 0 0.0% 100.0%
+[ 55, inf) 0 0.0% 100.0%
+Benchmark___10_chunks____1B 2000 4177247 ns/op 0.00 MB/s
+Histogram (unit: ms)
+Count: 2000 Min: 2 Max: 17 Avg: 3.75
+------------------------------------------------------------
+[ 2, 3) 49 2.5% 2.5%
+[ 3, 4) 1771 88.6% 91.0% #########
+[ 4, 5) 0 0.0% 91.0%
+[ 5, 6) 2 0.1% 91.1%
+[ 6, 8) 42 2.1% 93.2%
+[ 8, 10) 0 0.0% 93.2%
+[ 10, 12) 33 1.7% 94.9%
+[ 12, 15) 73 3.7% 98.5%
+[ 15, 19) 30 1.5% 100.0%
[ 19, 24) 0 0.0% 100.0%
[ 24, 30) 0 0.0% 100.0%
[ 30, 37) 0 0.0% 100.0%
-[ 37, 46) 0 0.0% 100.0%
-[ 46, 57) 0 0.0% 100.0%
-[ 57, 71) 0 0.0% 100.0%
-[ 71, 88) 0 0.0% 100.0%
-[ 88, inf) 0 0.0% 100.0%
-Benchmark____1_chunk___10KB-2 5000 1825946 ns/op 10.95 MB/s
+[ 37, 45) 0 0.0% 100.0%
+[ 45, 55) 0 0.0% 100.0%
+[ 55, 67) 0 0.0% 100.0%
+[ 67, 81) 0 0.0% 100.0%
+[ 81, inf) 0 0.0% 100.0%
+Benchmark___10_chunks____1B-2 2000 3432532 ns/op 0.01 MB/s
Histogram (unit: ms)
-Count: 5000 Min: 1 Max: 12 Avg: 1.33
+Count: 2000 Min: 2 Max: 12 Avg: 2.82
------------------------------------------------------------
-[ 1, 2) 4780 95.6% 95.6% ##########
-[ 2, 3) 40 0.8% 96.4%
-[ 3, 4) 0 0.0% 96.4%
-[ 4, 5) 0 0.0% 96.4%
-[ 5, 6) 0 0.0% 96.4%
-[ 6, 8) 0 0.0% 96.4%
-[ 8, 10) 42 0.8% 97.2%
-[ 10, 13) 138 2.8% 100.0%
+[ 2, 3) 1276 63.8% 63.8% ######
+[ 3, 4) 541 27.1% 90.9% ###
+[ 4, 5) 45 2.2% 93.1%
+[ 5, 6) 0 0.0% 93.1%
+[ 6, 7) 0 0.0% 93.1%
+[ 7, 9) 41 2.1% 95.2%
+[ 9, 11) 68 3.4% 98.6%
+[ 11, 13) 29 1.5% 100.0%
[ 13, 16) 0 0.0% 100.0%
-[ 16, 20) 0 0.0% 100.0%
-[ 20, 24) 0 0.0% 100.0%
-[ 24, 29) 0 0.0% 100.0%
-[ 29, 35) 0 0.0% 100.0%
-[ 35, 42) 0 0.0% 100.0%
-[ 42, 51) 0 0.0% 100.0%
-[ 51, 62) 0 0.0% 100.0%
-[ 62, inf) 0 0.0% 100.0%
-Benchmark____1_chunk__100KB 2000 4712135 ns/op 42.44 MB/s
+[ 16, 19) 0 0.0% 100.0%
+[ 19, 23) 0 0.0% 100.0%
+[ 23, 28) 0 0.0% 100.0%
+[ 28, 34) 0 0.0% 100.0%
+[ 34, 41) 0 0.0% 100.0%
+[ 41, 49) 0 0.0% 100.0%
+[ 49, 58) 0 0.0% 100.0%
+[ 58, inf) 0 0.0% 100.0%
+Benchmark___10_chunks___10B 2000 4664935 ns/op 0.04 MB/s
Histogram (unit: ms)
-Count: 2000 Min: 3 Max: 21 Avg: 4.41
+Count: 2000 Min: 3 Max: 19 Avg: 3.94
------------------------------------------------------------
-[ 3, 4) 1779 89.0% 89.0% #########
-[ 4, 5) 1 0.1% 89.0%
-[ 5, 6) 44 2.2% 91.2%
-[ 6, 7) 2 0.1% 91.3%
-[ 7, 9) 0 0.0% 91.3%
-[ 9, 11) 0 0.0% 91.3%
-[ 11, 14) 0 0.0% 91.3%
-[ 14, 17) 1 0.1% 91.4%
-[ 17, 21) 171 8.6% 99.9% #
-[ 21, 26) 2 0.1% 100.0%
+[ 3, 4) 1739 87.0% 87.0% #########
+[ 4, 5) 94 4.7% 91.7%
+[ 5, 6) 0 0.0% 91.7%
+[ 6, 7) 9 0.5% 92.1%
+[ 7, 9) 26 1.3% 93.4%
+[ 9, 11) 0 0.0% 93.4%
+[ 11, 14) 33 1.7% 95.1%
+[ 14, 17) 63 3.2% 98.2%
+[ 17, 21) 36 1.8% 100.0%
+[ 21, 26) 0 0.0% 100.0%
[ 26, 32) 0 0.0% 100.0%
-[ 32, 40) 0 0.0% 100.0%
-[ 40, 50) 0 0.0% 100.0%
-[ 50, 62) 0 0.0% 100.0%
-[ 62, 76) 0 0.0% 100.0%
-[ 76, 93) 0 0.0% 100.0%
-[ 93, inf) 0 0.0% 100.0%
-Benchmark____1_chunk__100KB-2 5000 3674554 ns/op 54.43 MB/s
+[ 32, 39) 0 0.0% 100.0%
+[ 39, 48) 0 0.0% 100.0%
+[ 48, 59) 0 0.0% 100.0%
+[ 59, 72) 0 0.0% 100.0%
+[ 72, 88) 0 0.0% 100.0%
+[ 88, inf) 0 0.0% 100.0%
+Benchmark___10_chunks___10B-2 2000 3548029 ns/op 0.06 MB/s
Histogram (unit: ms)
-Count: 5000 Min: 2 Max: 15 Avg: 2.93
+Count: 2000 Min: 2 Max: 14 Avg: 3.02
------------------------------------------------------------
-[ 2, 3) 4335 86.7% 86.7% #########
-[ 3, 4) 244 4.9% 91.6%
-[ 4, 5) 0 0.0% 91.6%
-[ 5, 6) 0 0.0% 91.6%
+[ 2, 3) 971 48.6% 48.6% #####
+[ 3, 4) 835 41.8% 90.3% ####
+[ 4, 5) 67 3.4% 93.7%
+[ 5, 6) 0 0.0% 93.7%
+[ 6, 7) 0 0.0% 93.7%
+[ 7, 9) 16 0.8% 94.5%
+[ 9, 11) 40 2.0% 96.5%
+[ 11, 14) 70 3.5% 100.0%
+[ 14, 17) 1 0.1% 100.0%
+[ 17, 21) 0 0.0% 100.0%
+[ 21, 26) 0 0.0% 100.0%
+[ 26, 32) 0 0.0% 100.0%
+[ 32, 39) 0 0.0% 100.0%
+[ 39, 47) 0 0.0% 100.0%
+[ 47, 57) 0 0.0% 100.0%
+[ 57, 68) 0 0.0% 100.0%
+[ 68, inf) 0 0.0% 100.0%
+Benchmark___10_chunks__100B 2000 4845710 ns/op 0.41 MB/s
+Histogram (unit: ms)
+Count: 2000 Min: 3 Max: 20 Avg: 4.09
+------------------------------------------------------------
+[ 3, 4) 1559 78.0% 78.0% ########
+[ 4, 5) 272 13.6% 91.6% #
+[ 5, 6) 1 0.1% 91.6%
[ 6, 7) 0 0.0% 91.6%
-[ 7, 9) 0 0.0% 91.6%
-[ 9, 11) 1 0.0% 91.6%
-[ 11, 14) 370 7.4% 99.0% #
-[ 14, 17) 50 1.0% 100.0%
+[ 7, 9) 43 2.1% 93.8%
+[ 9, 11) 1 0.1% 93.8%
+[ 11, 14) 0 0.0% 93.8%
+[ 14, 17) 44 2.2% 96.0%
+[ 17, 21) 80 4.0% 100.0%
+[ 21, 26) 0 0.0% 100.0%
+[ 26, 32) 0 0.0% 100.0%
+[ 32, 39) 0 0.0% 100.0%
+[ 39, 48) 0 0.0% 100.0%
+[ 48, 59) 0 0.0% 100.0%
+[ 59, 73) 0 0.0% 100.0%
+[ 73, 90) 0 0.0% 100.0%
+[ 90, inf) 0 0.0% 100.0%
+Benchmark___10_chunks__100B-2 2000 3658666 ns/op 0.55 MB/s
+Histogram (unit: ms)
+Count: 2000 Min: 2 Max: 14 Avg: 3.26
+------------------------------------------------------------
+[ 2, 3) 567 28.4% 28.4% ###
+[ 3, 4) 1240 62.0% 90.4% ######
+[ 4, 5) 68 3.4% 93.8%
+[ 5, 6) 5 0.2% 94.0%
+[ 6, 7) 0 0.0% 94.0%
+[ 7, 9) 0 0.0% 94.0%
+[ 9, 11) 50 2.5% 96.5%
+[ 11, 14) 62 3.1% 99.6%
+[ 14, 17) 8 0.4% 100.0%
+[ 17, 21) 0 0.0% 100.0%
+[ 21, 26) 0 0.0% 100.0%
+[ 26, 32) 0 0.0% 100.0%
+[ 32, 39) 0 0.0% 100.0%
+[ 39, 47) 0 0.0% 100.0%
+[ 47, 57) 0 0.0% 100.0%
+[ 57, 68) 0 0.0% 100.0%
+[ 68, inf) 0 0.0% 100.0%
+Benchmark___10_chunks___1KB 2000 4971196 ns/op 4.02 MB/s
+Histogram (unit: ms)
+Count: 2000 Min: 3 Max: 23 Avg: 4.37
+------------------------------------------------------------
+[ 3, 4) 1222 61.1% 61.1% ######
+[ 4, 5) 620 31.0% 92.1% ###
+[ 5, 6) 0 0.0% 92.1%
+[ 6, 7) 0 0.0% 92.1%
+[ 7, 9) 31 1.6% 93.7%
+[ 9, 11) 1 0.1% 93.7%
+[ 11, 14) 0 0.0% 93.7%
+[ 14, 18) 32 1.6% 95.3%
+[ 18, 22) 90 4.5% 99.8%
+[ 22, 28) 4 0.2% 100.0%
+[ 28, 35) 0 0.0% 100.0%
+[ 35, 43) 0 0.0% 100.0%
+[ 43, 53) 0 0.0% 100.0%
+[ 53, 66) 0 0.0% 100.0%
+[ 66, 82) 0 0.0% 100.0%
+[ 82, 101) 0 0.0% 100.0%
+[101, inf) 0 0.0% 100.0%
+Benchmark___10_chunks___1KB-2 2000 3662827 ns/op 5.46 MB/s
+Histogram (unit: ms)
+Count: 2000 Min: 2 Max: 15 Avg: 3.11
+------------------------------------------------------------
+[ 2, 3) 1012 50.6% 50.6% #####
+[ 3, 4) 794 39.7% 90.3% ####
+[ 4, 5) 67 3.4% 93.7%
+[ 5, 6) 4 0.2% 93.9%
+[ 6, 7) 0 0.0% 93.9%
+[ 7, 9) 0 0.0% 93.9%
+[ 9, 11) 25 1.2% 95.1%
+[ 11, 14) 53 2.7% 97.8%
+[ 14, 17) 45 2.2% 100.0%
[ 17, 21) 0 0.0% 100.0%
[ 21, 26) 0 0.0% 100.0%
[ 26, 32) 0 0.0% 100.0%
@@ -614,721 +786,553 @@
[ 48, 58) 0 0.0% 100.0%
[ 58, 70) 0 0.0% 100.0%
[ 70, inf) 0 0.0% 100.0%
-Benchmark___10_chunks____1B 5000 2281402 ns/op 0.01 MB/s
+Benchmark___10_chunks__10KB 1000 7533684 ns/op 26.55 MB/s
Histogram (unit: ms)
-Count: 5000 Min: 1 Max: 28 Avg: 1.62
+Count: 1000 Min: 5 Max: 26 Avg: 7.03
------------------------------------------------------------
-[ 1, 2) 4869 97.4% 97.4% ##########
-[ 2, 3) 2 0.0% 97.4%
-[ 3, 4) 0 0.0% 97.4%
-[ 4, 5) 0 0.0% 97.4%
-[ 5, 7) 0 0.0% 97.4%
-[ 7, 10) 5 0.1% 97.5%
-[ 10, 13) 0 0.0% 97.5%
-[ 13, 17) 0 0.0% 97.5%
-[ 17, 22) 5 0.1% 97.6%
-[ 22, 29) 119 2.4% 100.0%
-[ 29, 38) 0 0.0% 100.0%
-[ 38, 49) 0 0.0% 100.0%
-[ 49, 62) 0 0.0% 100.0%
-[ 62, 79) 0 0.0% 100.0%
-[ 79, 100) 0 0.0% 100.0%
-[100, 127) 0 0.0% 100.0%
-[127, inf) 0 0.0% 100.0%
-Benchmark___10_chunks____1B-2 5000 1959491 ns/op 0.01 MB/s
+[ 5, 6) 831 83.1% 83.1% ########
+[ 6, 7) 4 0.4% 83.5%
+[ 7, 8) 0 0.0% 83.5%
+[ 8, 9) 29 2.9% 86.4%
+[ 9, 11) 18 1.8% 88.2%
+[ 11, 13) 0 0.0% 88.2%
+[ 13, 16) 0 0.0% 88.2%
+[ 16, 20) 39 3.9% 92.1%
+[ 20, 25) 78 7.8% 99.9% #
+[ 25, 31) 1 0.1% 100.0%
+[ 31, 38) 0 0.0% 100.0%
+[ 38, 47) 0 0.0% 100.0%
+[ 47, 58) 0 0.0% 100.0%
+[ 58, 71) 0 0.0% 100.0%
+[ 71, 88) 0 0.0% 100.0%
+[ 88, 108) 0 0.0% 100.0%
+[108, inf) 0 0.0% 100.0%
+Benchmark___10_chunks__10KB-2 2000 4922363 ns/op 40.63 MB/s
Histogram (unit: ms)
-Count: 5000 Min: 1 Max: 16 Avg: 1.36
+Count: 2000 Min: 3 Max: 18 Avg: 4.32
------------------------------------------------------------
-[ 1, 2) 4632 92.6% 92.6% #########
-[ 2, 3) 249 5.0% 97.6%
-[ 3, 4) 0 0.0% 97.6%
-[ 4, 5) 0 0.0% 97.6%
-[ 5, 7) 0 0.0% 97.6%
-[ 7, 9) 0 0.0% 97.6%
-[ 9, 11) 0 0.0% 97.6%
-[ 11, 14) 33 0.7% 98.3%
-[ 14, 18) 86 1.7% 100.0%
-[ 18, 23) 0 0.0% 100.0%
-[ 23, 29) 0 0.0% 100.0%
-[ 29, 36) 0 0.0% 100.0%
-[ 36, 44) 0 0.0% 100.0%
-[ 44, 54) 0 0.0% 100.0%
-[ 54, 66) 0 0.0% 100.0%
-[ 66, 80) 0 0.0% 100.0%
-[ 80, inf) 0 0.0% 100.0%
-Benchmark___10_chunks___10B 5000 2539394 ns/op 0.08 MB/s
+[ 3, 4) 1573 78.7% 78.7% ########
+[ 4, 5) 146 7.3% 86.0% #
+[ 5, 6) 53 2.7% 88.6%
+[ 6, 7) 0 0.0% 88.6%
+[ 7, 9) 0 0.0% 88.6%
+[ 9, 11) 3 0.2% 88.8%
+[ 11, 13) 79 4.0% 92.7%
+[ 13, 16) 107 5.4% 98.1% #
+[ 16, 20) 39 2.0% 100.0%
+[ 20, 25) 0 0.0% 100.0%
+[ 25, 31) 0 0.0% 100.0%
+[ 31, 38) 0 0.0% 100.0%
+[ 38, 46) 0 0.0% 100.0%
+[ 46, 56) 0 0.0% 100.0%
+[ 56, 68) 0 0.0% 100.0%
+[ 68, 82) 0 0.0% 100.0%
+[ 82, inf) 0 0.0% 100.0%
+Benchmark___10_chunks_100KB 200 31539312 ns/op 63.41 MB/s
Histogram (unit: ms)
-Count: 5000 Min: 1 Max: 33 Avg: 1.70
+Count: 200 Min: 22 Max: 40 Avg: 30.91
------------------------------------------------------------
-[ 1, 2) 4831 96.6% 96.6% ##########
-[ 2, 3) 52 1.0% 97.7%
-[ 3, 4) 0 0.0% 97.7%
-[ 4, 5) 0 0.0% 97.7%
-[ 5, 7) 0 0.0% 97.7%
-[ 7, 10) 4 0.1% 97.7%
-[ 10, 13) 0 0.0% 97.7%
-[ 13, 18) 0 0.0% 97.7%
-[ 18, 24) 0 0.0% 97.7%
-[ 24, 31) 20 0.4% 98.1%
-[ 31, 41) 93 1.9% 100.0%
-[ 41, 53) 0 0.0% 100.0%
-[ 53, 68) 0 0.0% 100.0%
-[ 68, 88) 0 0.0% 100.0%
-[ 88, 113) 0 0.0% 100.0%
-[113, 144) 0 0.0% 100.0%
-[144, inf) 0 0.0% 100.0%
-Benchmark___10_chunks___10B-2 5000 2019503 ns/op 0.10 MB/s
+[ 22, 23) 1 0.5% 0.5%
+[ 23, 24) 1 0.5% 1.0%
+[ 24, 25) 69 34.5% 35.5% ###
+[ 25, 26) 22 11.0% 46.5% #
+[ 26, 28) 7 3.5% 50.0%
+[ 28, 30) 0 0.0% 50.0%
+[ 30, 33) 0 0.0% 50.0%
+[ 33, 36) 0 0.0% 50.0%
+[ 36, 40) 95 47.5% 97.5% #####
+[ 40, 45) 5 2.5% 100.0%
+[ 45, 51) 0 0.0% 100.0%
+[ 51, 59) 0 0.0% 100.0%
+[ 59, 69) 0 0.0% 100.0%
+[ 69, 81) 0 0.0% 100.0%
+[ 81, 95) 0 0.0% 100.0%
+[ 95, 112) 0 0.0% 100.0%
+[112, inf) 0 0.0% 100.0%
+Benchmark___10_chunks_100KB-2 500 18574440 ns/op 107.67 MB/s
Histogram (unit: ms)
-Count: 5000 Min: 1 Max: 20 Avg: 1.38
+Count: 500 Min: 12 Max: 27 Avg: 18.10
------------------------------------------------------------
-[ 1, 2) 4651 93.0% 93.0% #########
-[ 2, 3) 233 4.7% 97.7%
-[ 3, 4) 10 0.2% 97.9%
-[ 4, 5) 0 0.0% 97.9%
-[ 5, 7) 0 0.0% 97.9%
-[ 7, 9) 0 0.0% 97.9%
-[ 9, 12) 0 0.0% 97.9%
-[ 12, 15) 12 0.2% 98.1%
-[ 15, 19) 92 1.8% 100.0%
-[ 19, 24) 2 0.0% 100.0%
-[ 24, 31) 0 0.0% 100.0%
-[ 31, 39) 0 0.0% 100.0%
-[ 39, 49) 0 0.0% 100.0%
-[ 49, 61) 0 0.0% 100.0%
-[ 61, 76) 0 0.0% 100.0%
-[ 76, 94) 0 0.0% 100.0%
-[ 94, inf) 0 0.0% 100.0%
-Benchmark___10_chunks__100B 5000 2950881 ns/op 0.68 MB/s
+[ 12, 13) 79 15.8% 15.8% ##
+[ 13, 14) 168 33.6% 49.4% ###
+[ 14, 15) 12 2.4% 51.8%
+[ 15, 16) 1 0.2% 52.0%
+[ 16, 18) 0 0.0% 52.0%
+[ 18, 20) 0 0.0% 52.0%
+[ 20, 22) 30 6.0% 58.0% #
+[ 22, 25) 94 18.8% 76.8% ##
+[ 25, 29) 116 23.2% 100.0% ##
+[ 29, 34) 0 0.0% 100.0%
+[ 34, 40) 0 0.0% 100.0%
+[ 40, 47) 0 0.0% 100.0%
+[ 47, 55) 0 0.0% 100.0%
+[ 55, 65) 0 0.0% 100.0%
+[ 65, 77) 0 0.0% 100.0%
+[ 77, 91) 0 0.0% 100.0%
+[ 91, inf) 0 0.0% 100.0%
+Benchmark__100_chunks____1B 500 18036549 ns/op 0.01 MB/s
Histogram (unit: ms)
-Count: 5000 Min: 2 Max: 38 Avg: 2.67
+Count: 500 Min: 14 Max: 41 Avg: 17.44
------------------------------------------------------------
-[ 2, 3) 4890 97.8% 97.8% ##########
-[ 3, 4) 0 0.0% 97.8%
-[ 4, 5) 0 0.0% 97.8%
-[ 5, 7) 0 0.0% 97.8%
-[ 7, 9) 0 0.0% 97.8%
-[ 9, 12) 4 0.1% 97.9%
-[ 12, 16) 0 0.0% 97.9%
-[ 16, 21) 0 0.0% 97.9%
-[ 21, 27) 3 0.1% 97.9%
-[ 27, 35) 80 1.6% 99.5%
-[ 35, 45) 23 0.5% 100.0%
-[ 45, 58) 0 0.0% 100.0%
-[ 58, 75) 0 0.0% 100.0%
-[ 75, 97) 0 0.0% 100.0%
-[ 97, 125) 0 0.0% 100.0%
-[125, 161) 0 0.0% 100.0%
-[161, inf) 0 0.0% 100.0%
-Benchmark___10_chunks__100B-2 5000 2239554 ns/op 0.89 MB/s
+[ 14, 15) 280 56.0% 56.0% ######
+[ 15, 16) 106 21.2% 77.2% ##
+[ 16, 17) 10 2.0% 79.2%
+[ 17, 18) 1 0.2% 79.4%
+[ 18, 20) 6 1.2% 80.6%
+[ 20, 23) 22 4.4% 85.0%
+[ 23, 26) 0 0.0% 85.0%
+[ 26, 30) 16 3.2% 88.2%
+[ 30, 35) 27 5.4% 93.6% #
+[ 35, 42) 32 6.4% 100.0% #
+[ 42, 51) 0 0.0% 100.0%
+[ 51, 62) 0 0.0% 100.0%
+[ 62, 75) 0 0.0% 100.0%
+[ 75, 92) 0 0.0% 100.0%
+[ 92, 113) 0 0.0% 100.0%
+[113, 140) 0 0.0% 100.0%
+[140, inf) 0 0.0% 100.0%
+Benchmark__100_chunks____1B-2 1000 12395699 ns/op 0.02 MB/s
Histogram (unit: ms)
-Count: 5000 Min: 1 Max: 21 Avg: 1.45
+Count: 1000 Min: 7 Max: 31 Avg: 11.90
------------------------------------------------------------
-[ 1, 2) 4502 90.0% 90.0% #########
-[ 2, 3) 333 6.7% 96.7% #
-[ 3, 4) 63 1.3% 98.0%
-[ 4, 5) 0 0.0% 98.0%
-[ 5, 7) 0 0.0% 98.0%
-[ 7, 9) 0 0.0% 98.0%
-[ 9, 12) 0 0.0% 98.0%
-[ 12, 16) 0 0.0% 98.0%
-[ 16, 20) 64 1.3% 99.2%
-[ 20, 26) 38 0.8% 100.0%
-[ 26, 33) 0 0.0% 100.0%
+[ 7, 8) 26 2.6% 2.6%
+[ 8, 9) 14 1.4% 4.0%
+[ 9, 10) 171 17.1% 21.1% ##
+[ 10, 11) 528 52.8% 73.9% #####
+[ 11, 13) 71 7.1% 81.0% #
+[ 13, 15) 23 2.3% 83.3%
+[ 15, 18) 8 0.8% 84.1%
+[ 18, 22) 68 6.8% 90.9% #
+[ 22, 27) 89 8.9% 99.8% #
+[ 27, 33) 2 0.2% 100.0%
[ 33, 41) 0 0.0% 100.0%
[ 41, 51) 0 0.0% 100.0%
-[ 51, 64) 0 0.0% 100.0%
-[ 64, 80) 0 0.0% 100.0%
-[ 80, 99) 0 0.0% 100.0%
-[ 99, inf) 0 0.0% 100.0%
-Benchmark___10_chunks___1KB 5000 3151938 ns/op 6.35 MB/s
+[ 51, 63) 0 0.0% 100.0%
+[ 63, 78) 0 0.0% 100.0%
+[ 78, 97) 0 0.0% 100.0%
+[ 97, 121) 0 0.0% 100.0%
+[121, inf) 0 0.0% 100.0%
+Benchmark__100_chunks___10B 300 20669375 ns/op 0.10 MB/s
Histogram (unit: ms)
-Count: 5000 Min: 2 Max: 43 Avg: 2.88
+Count: 300 Min: 17 Max: 39 Avg: 20.31
------------------------------------------------------------
-[ 2, 3) 4877 97.5% 97.5% ##########
-[ 3, 4) 0 0.0% 97.5%
-[ 4, 5) 0 0.0% 97.5%
-[ 5, 7) 0 0.0% 97.5%
-[ 7, 9) 0 0.0% 97.5%
-[ 9, 12) 10 0.2% 97.7%
-[ 12, 16) 0 0.0% 97.7%
-[ 16, 21) 0 0.0% 97.7%
-[ 21, 28) 0 0.0% 97.7%
-[ 28, 37) 16 0.3% 98.1%
-[ 37, 48) 97 1.9% 100.0%
-[ 48, 63) 0 0.0% 100.0%
-[ 63, 82) 0 0.0% 100.0%
-[ 82, 106) 0 0.0% 100.0%
-[106, 138) 0 0.0% 100.0%
-[138, 178) 0 0.0% 100.0%
-[178, inf) 0 0.0% 100.0%
-Benchmark___10_chunks___1KB-2 5000 2323991 ns/op 8.61 MB/s
+[ 17, 18) 228 76.0% 76.0% ########
+[ 18, 19) 8 2.7% 78.7%
+[ 19, 20) 2 0.7% 79.3%
+[ 20, 21) 0 0.0% 79.3%
+[ 21, 23) 3 1.0% 80.3%
+[ 23, 25) 12 4.0% 84.3%
+[ 25, 28) 0 0.0% 84.3%
+[ 28, 32) 0 0.0% 84.3%
+[ 32, 37) 15 5.0% 89.3% #
+[ 37, 43) 32 10.7% 100.0% #
+[ 43, 50) 0 0.0% 100.0%
+[ 50, 59) 0 0.0% 100.0%
+[ 59, 70) 0 0.0% 100.0%
+[ 70, 84) 0 0.0% 100.0%
+[ 84, 101) 0 0.0% 100.0%
+[101, 122) 0 0.0% 100.0%
+[122, inf) 0 0.0% 100.0%
+Benchmark__100_chunks___10B-2 500 12634978 ns/op 0.16 MB/s
Histogram (unit: ms)
-Count: 5000 Min: 1 Max: 24 Avg: 1.56
+Count: 500 Min: 9 Max: 27 Avg: 12.11
------------------------------------------------------------
-[ 1, 2) 4439 88.8% 88.8% #########
-[ 2, 3) 364 7.3% 96.1% #
-[ 3, 4) 87 1.7% 97.8%
-[ 4, 5) 1 0.0% 97.8%
-[ 5, 7) 0 0.0% 97.8%
-[ 7, 9) 0 0.0% 97.8%
-[ 9, 12) 0 0.0% 97.8%
-[ 12, 16) 0 0.0% 97.8%
-[ 16, 21) 20 0.4% 98.2%
-[ 21, 27) 89 1.8% 100.0%
-[ 27, 35) 0 0.0% 100.0%
-[ 35, 44) 0 0.0% 100.0%
-[ 44, 56) 0 0.0% 100.0%
-[ 56, 71) 0 0.0% 100.0%
-[ 71, 89) 0 0.0% 100.0%
-[ 89, 111) 0 0.0% 100.0%
-[111, inf) 0 0.0% 100.0%
-Benchmark___10_chunks__10KB 2000 6023388 ns/op 33.20 MB/s
-Histogram (unit: ms)
-Count: 2000 Min: 3 Max: 47 Avg: 5.22
-------------------------------------------------------------
-[ 3, 4) 1770 88.5% 88.5% #########
-[ 4, 5) 83 4.2% 92.7%
-[ 5, 6) 1 0.1% 92.7%
-[ 6, 8) 0 0.0% 92.7%
-[ 8, 10) 38 1.9% 94.6%
-[ 10, 13) 2 0.1% 94.7%
-[ 13, 17) 0 0.0% 94.7%
-[ 17, 22) 0 0.0% 94.7%
-[ 22, 29) 0 0.0% 94.7%
-[ 29, 38) 0 0.0% 94.7%
-[ 38, 50) 106 5.3% 100.0% #
-[ 50, 66) 0 0.0% 100.0%
-[ 66, 86) 0 0.0% 100.0%
-[ 86, 112) 0 0.0% 100.0%
-[112, 146) 0 0.0% 100.0%
-[146, 190) 0 0.0% 100.0%
-[190, inf) 0 0.0% 100.0%
-Benchmark___10_chunks__10KB-2 2000 3955363 ns/op 50.56 MB/s
-Histogram (unit: ms)
-Count: 2000 Min: 2 Max: 27 Avg: 3.20
-------------------------------------------------------------
-[ 2, 3) 1814 90.7% 90.7% #########
-[ 3, 4) 18 0.9% 91.6%
-[ 4, 5) 10 0.5% 92.1%
-[ 5, 6) 52 2.6% 94.7%
-[ 6, 8) 1 0.1% 94.8%
-[ 8, 10) 0 0.0% 94.8%
-[ 10, 13) 0 0.0% 94.8%
-[ 13, 17) 0 0.0% 94.8%
-[ 17, 22) 26 1.3% 96.1%
-[ 22, 28) 79 4.0% 100.0%
-[ 28, 36) 0 0.0% 100.0%
-[ 36, 46) 0 0.0% 100.0%
-[ 46, 59) 0 0.0% 100.0%
-[ 59, 75) 0 0.0% 100.0%
-[ 75, 95) 0 0.0% 100.0%
-[ 95, 119) 0 0.0% 100.0%
-[119, inf) 0 0.0% 100.0%
-Benchmark___10_chunks_100KB 500 31665379 ns/op 63.16 MB/s
-Histogram (unit: ms)
-Count: 500 Min: 20 Max: 64 Avg: 31.39
-------------------------------------------------------------
-[ 20, 21) 282 56.4% 56.4% ######
-[ 21, 22) 6 1.2% 57.6%
-[ 22, 23) 1 0.2% 57.8%
-[ 23, 25) 68 13.6% 71.4% #
-[ 25, 27) 1 0.2% 71.6%
-[ 27, 30) 0 0.0% 71.6%
-[ 30, 34) 0 0.0% 71.6%
-[ 34, 39) 0 0.0% 71.6%
-[ 39, 46) 0 0.0% 71.6%
-[ 46, 55) 0 0.0% 71.6%
-[ 55, 67) 142 28.4% 100.0% ###
-[ 67, 83) 0 0.0% 100.0%
-[ 83, 103) 0 0.0% 100.0%
-[103, 129) 0 0.0% 100.0%
-[129, 163) 0 0.0% 100.0%
-[163, 207) 0 0.0% 100.0%
-[207, inf) 0 0.0% 100.0%
-Benchmark___10_chunks_100KB-2 500 18414841 ns/op 108.61 MB/s
-Histogram (unit: ms)
-Count: 500 Min: 11 Max: 37 Avg: 17.92
-------------------------------------------------------------
-[ 11, 12) 152 30.4% 30.4% ###
-[ 12, 13) 189 37.8% 68.2% ####
-[ 13, 14) 13 2.6% 70.8%
-[ 14, 15) 5 1.0% 71.8%
-[ 15, 17) 0 0.0% 71.8%
-[ 17, 19) 0 0.0% 71.8%
-[ 19, 22) 0 0.0% 71.8%
-[ 22, 26) 0 0.0% 71.8%
-[ 26, 31) 6 1.2% 73.0%
-[ 31, 38) 135 27.0% 100.0% ###
+[ 9, 10) 69 13.8% 13.8% #
+[ 10, 11) 287 57.4% 71.2% ######
+[ 11, 12) 47 9.4% 80.6% #
+[ 12, 13) 10 2.0% 82.6%
+[ 13, 15) 8 1.6% 84.2%
+[ 15, 17) 0 0.0% 84.2%
+[ 17, 20) 5 1.0% 85.2%
+[ 20, 23) 28 5.6% 90.8% #
+[ 23, 27) 43 8.6% 99.4% #
+[ 27, 32) 3 0.6% 100.0%
+[ 32, 38) 0 0.0% 100.0%
[ 38, 46) 0 0.0% 100.0%
[ 46, 56) 0 0.0% 100.0%
-[ 56, 69) 0 0.0% 100.0%
-[ 69, 85) 0 0.0% 100.0%
-[ 85, 105) 0 0.0% 100.0%
-[105, 130) 0 0.0% 100.0%
-[130, inf) 0 0.0% 100.0%
-Benchmark__100_chunks____1B 5000 4505724 ns/op 0.04 MB/s
+[ 56, 68) 0 0.0% 100.0%
+[ 68, 82) 0 0.0% 100.0%
+[ 82, 99) 0 0.0% 100.0%
+[ 99, inf) 0 0.0% 100.0%
+Benchmark__100_chunks__100B 300 23164692 ns/op 0.86 MB/s
Histogram (unit: ms)
-Count: 5000 Min: 2 Max: 55 Avg: 3.80
+Count: 300 Min: 19 Max: 42 Avg: 22.72
------------------------------------------------------------
-[ 2, 3) 3905 78.1% 78.1% ########
-[ 3, 4) 22 0.4% 78.5%
-[ 4, 5) 914 18.3% 96.8% ##
-[ 5, 7) 10 0.2% 97.0%
-[ 7, 9) 0 0.0% 97.0%
-[ 9, 12) 0 0.0% 97.0%
-[ 12, 16) 4 0.1% 97.1%
-[ 16, 22) 3 0.1% 97.2%
-[ 22, 30) 0 0.0% 97.2%
-[ 30, 40) 3 0.1% 97.2%
-[ 40, 54) 131 2.6% 99.8%
-[ 54, 72) 8 0.2% 100.0%
-[ 72, 95) 0 0.0% 100.0%
-[ 95, 126) 0 0.0% 100.0%
-[126, 166) 0 0.0% 100.0%
-[166, 219) 0 0.0% 100.0%
-[219, inf) 0 0.0% 100.0%
-Benchmark__100_chunks____1B-2 5000 3512335 ns/op 0.06 MB/s
+[ 19, 20) 209 69.7% 69.7% #######
+[ 20, 21) 17 5.7% 75.3% #
+[ 21, 22) 6 2.0% 77.3%
+[ 22, 23) 1 0.3% 77.7%
+[ 23, 25) 1 0.3% 78.0%
+[ 25, 27) 17 5.7% 83.7% #
+[ 27, 30) 0 0.0% 83.7%
+[ 30, 34) 0 0.0% 83.7%
+[ 34, 39) 19 6.3% 90.0% #
+[ 39, 45) 30 10.0% 100.0% #
+[ 45, 53) 0 0.0% 100.0%
+[ 53, 62) 0 0.0% 100.0%
+[ 62, 74) 0 0.0% 100.0%
+[ 74, 89) 0 0.0% 100.0%
+[ 89, 107) 0 0.0% 100.0%
+[107, 129) 0 0.0% 100.0%
+[129, inf) 0 0.0% 100.0%
+Benchmark__100_chunks__100B-2 500 13821225 ns/op 1.45 MB/s
Histogram (unit: ms)
-Count: 5000 Min: 2 Max: 33 Avg: 2.87
+Count: 500 Min: 10 Max: 29 Avg: 13.29
------------------------------------------------------------
-[ 2, 3) 4535 90.7% 90.7% #########
-[ 3, 4) 228 4.6% 95.3%
-[ 4, 5) 9 0.2% 95.4%
-[ 5, 6) 0 0.0% 95.4%
-[ 6, 8) 12 0.2% 95.7%
-[ 8, 11) 74 1.5% 97.2%
-[ 11, 14) 0 0.0% 97.2%
-[ 14, 18) 0 0.0% 97.2%
-[ 18, 24) 17 0.3% 97.5%
-[ 24, 31) 89 1.8% 99.3%
-[ 31, 40) 36 0.7% 100.0%
-[ 40, 52) 0 0.0% 100.0%
-[ 52, 67) 0 0.0% 100.0%
-[ 67, 86) 0 0.0% 100.0%
-[ 86, 110) 0 0.0% 100.0%
-[110, 140) 0 0.0% 100.0%
-[140, inf) 0 0.0% 100.0%
-Benchmark__100_chunks___10B 1000 8713484 ns/op 0.23 MB/s
+[ 10, 11) 47 9.4% 9.4% #
+[ 11, 12) 307 61.4% 70.8% ######
+[ 12, 13) 46 9.2% 80.0% #
+[ 13, 14) 9 1.8% 81.8%
+[ 14, 16) 9 1.8% 83.6%
+[ 16, 18) 0 0.0% 83.6%
+[ 18, 21) 5 1.0% 84.6%
+[ 21, 24) 25 5.0% 89.6% #
+[ 24, 28) 49 9.8% 99.4% #
+[ 28, 33) 3 0.6% 100.0%
+[ 33, 40) 0 0.0% 100.0%
+[ 40, 48) 0 0.0% 100.0%
+[ 48, 58) 0 0.0% 100.0%
+[ 58, 70) 0 0.0% 100.0%
+[ 70, 85) 0 0.0% 100.0%
+[ 85, 103) 0 0.0% 100.0%
+[103, inf) 0 0.0% 100.0%
+Benchmark__100_chunks___1KB 300 26071439 ns/op 7.67 MB/s
Histogram (unit: ms)
-Count: 1000 Min: 6 Max: 63 Avg: 8.15
+Count: 300 Min: 20 Max: 48 Avg: 25.72
------------------------------------------------------------
-[ 6, 7) 524 52.4% 52.4% #####
-[ 7, 8) 433 43.3% 95.7% ####
-[ 8, 9) 7 0.7% 96.4%
-[ 9, 11) 3 0.3% 96.7%
-[ 11, 13) 0 0.0% 96.7%
-[ 13, 16) 0 0.0% 96.7%
-[ 16, 21) 1 0.1% 96.8%
-[ 21, 27) 0 0.0% 96.8%
-[ 27, 35) 0 0.0% 96.8%
-[ 35, 46) 0 0.0% 96.8%
-[ 46, 60) 19 1.9% 98.7%
-[ 60, 79) 13 1.3% 100.0%
-[ 79, 104) 0 0.0% 100.0%
-[104, 137) 0 0.0% 100.0%
-[137, 180) 0 0.0% 100.0%
-[180, 237) 0 0.0% 100.0%
-[237, inf) 0 0.0% 100.0%
-Benchmark__100_chunks___10B-2 2000 4561723 ns/op 0.44 MB/s
+[ 20, 21) 1 0.3% 0.3%
+[ 21, 22) 195 65.0% 65.3% #######
+[ 22, 23) 13 4.3% 69.7%
+[ 23, 24) 5 1.7% 71.3%
+[ 24, 26) 0 0.0% 71.3%
+[ 26, 29) 23 7.7% 79.0% #
+[ 29, 32) 0 0.0% 79.0%
+[ 32, 36) 0 0.0% 79.0%
+[ 36, 41) 23 7.7% 86.7% #
+[ 41, 48) 39 13.0% 99.7% #
+[ 48, 57) 1 0.3% 100.0%
+[ 57, 68) 0 0.0% 100.0%
+[ 68, 82) 0 0.0% 100.0%
+[ 82, 99) 0 0.0% 100.0%
+[ 99, 121) 0 0.0% 100.0%
+[121, 148) 0 0.0% 100.0%
+[148, inf) 0 0.0% 100.0%
+Benchmark__100_chunks___1KB-2 500 15738134 ns/op 12.71 MB/s
Histogram (unit: ms)
-Count: 2000 Min: 2 Max: 34 Avg: 4.05
+Count: 500 Min: 11 Max: 30 Avg: 15.24
------------------------------------------------------------
-[ 2, 3) 45 2.2% 2.2%
-[ 3, 4) 1493 74.7% 76.9% #######
-[ 4, 5) 346 17.3% 94.2% ##
-[ 5, 6) 10 0.5% 94.7%
-[ 6, 8) 8 0.4% 95.1%
-[ 8, 11) 39 2.0% 97.1%
-[ 11, 14) 0 0.0% 97.1%
-[ 14, 19) 0 0.0% 97.1%
-[ 19, 25) 5 0.2% 97.3%
-[ 25, 32) 43 2.1% 99.5%
-[ 32, 42) 11 0.6% 100.0%
-[ 42, 54) 0 0.0% 100.0%
-[ 54, 69) 0 0.0% 100.0%
-[ 69, 89) 0 0.0% 100.0%
-[ 89, 114) 0 0.0% 100.0%
-[114, 145) 0 0.0% 100.0%
-[145, inf) 0 0.0% 100.0%
-Benchmark__100_chunks__100B 1000 10864592 ns/op 1.84 MB/s
+[ 11, 12) 19 3.8% 3.8%
+[ 12, 13) 253 50.6% 54.4% #####
+[ 13, 14) 97 19.4% 73.8% ##
+[ 14, 15) 11 2.2% 76.0%
+[ 15, 17) 15 3.0% 79.0%
+[ 17, 19) 0 0.0% 79.0%
+[ 19, 22) 3 0.6% 79.6%
+[ 22, 25) 28 5.6% 85.2% #
+[ 25, 29) 61 12.2% 97.4% #
+[ 29, 34) 13 2.6% 100.0%
+[ 34, 41) 0 0.0% 100.0%
+[ 41, 49) 0 0.0% 100.0%
+[ 49, 59) 0 0.0% 100.0%
+[ 59, 71) 0 0.0% 100.0%
+[ 71, 86) 0 0.0% 100.0%
+[ 86, 104) 0 0.0% 100.0%
+[104, inf) 0 0.0% 100.0%
+Benchmark__100_chunks__10KB 100 50248311 ns/op 39.80 MB/s
Histogram (unit: ms)
-Count: 1000 Min: 8 Max: 61 Avg: 10.22
+Count: 100 Min: 37 Max: 60 Avg: 49.72
------------------------------------------------------------
-[ 8, 9) 553 55.3% 55.3% ######
-[ 9, 10) 391 39.1% 94.4% ####
-[ 10, 11) 2 0.2% 94.6%
-[ 11, 13) 11 1.1% 95.7%
-[ 13, 15) 1 0.1% 95.8%
-[ 15, 18) 2 0.2% 96.0%
-[ 18, 22) 0 0.0% 96.0%
-[ 22, 28) 4 0.4% 96.4%
-[ 28, 36) 0 0.0% 96.4%
-[ 36, 46) 3 0.3% 96.7%
-[ 46, 60) 31 3.1% 99.8%
-[ 60, 78) 2 0.2% 100.0%
-[ 78, 101) 0 0.0% 100.0%
-[101, 132) 0 0.0% 100.0%
-[132, 172) 0 0.0% 100.0%
-[172, 225) 0 0.0% 100.0%
-[225, inf) 0 0.0% 100.0%
-Benchmark__100_chunks__100B-2 2000 6852262 ns/op 2.92 MB/s
+[ 37, 38) 4 4.0% 4.0%
+[ 38, 39) 7 7.0% 11.0% #
+[ 39, 40) 6 6.0% 17.0% #
+[ 40, 41) 5 5.0% 22.0% #
+[ 41, 43) 18 18.0% 40.0% ##
+[ 43, 45) 0 0.0% 40.0%
+[ 45, 48) 0 0.0% 40.0%
+[ 48, 52) 0 0.0% 40.0%
+[ 52, 57) 24 24.0% 64.0% ##
+[ 57, 63) 36 36.0% 100.0% ####
+[ 63, 71) 0 0.0% 100.0%
+[ 71, 80) 0 0.0% 100.0%
+[ 80, 92) 0 0.0% 100.0%
+[ 92, 107) 0 0.0% 100.0%
+[107, 125) 0 0.0% 100.0%
+[125, 147) 0 0.0% 100.0%
+[147, inf) 0 0.0% 100.0%
+Benchmark__100_chunks__10KB-2 300 28614761 ns/op 69.89 MB/s
Histogram (unit: ms)
-Count: 2000 Min: 5 Max: 37 Avg: 6.29
+Count: 300 Min: 19 Max: 38 Avg: 28.11
------------------------------------------------------------
-[ 5, 6) 1488 74.4% 74.4% #######
-[ 6, 7) 386 19.3% 93.7% ##
-[ 7, 8) 2 0.1% 93.8%
-[ 8, 9) 14 0.7% 94.5%
-[ 9, 11) 23 1.2% 95.7%
-[ 11, 14) 15 0.8% 96.4%
-[ 14, 17) 0 0.0% 96.4%
-[ 17, 22) 0 0.0% 96.4%
-[ 22, 28) 3 0.2% 96.6%
-[ 28, 35) 55 2.8% 99.3%
-[ 35, 45) 14 0.7% 100.0%
-[ 45, 57) 0 0.0% 100.0%
-[ 57, 72) 0 0.0% 100.0%
-[ 72, 92) 0 0.0% 100.0%
-[ 92, 117) 0 0.0% 100.0%
-[117, 148) 0 0.0% 100.0%
-[148, inf) 0 0.0% 100.0%
-Benchmark__100_chunks___1KB 1000 13501720 ns/op 14.81 MB/s
+[ 19, 20) 7 2.3% 2.3%
+[ 20, 21) 55 18.3% 20.7% ##
+[ 21, 22) 43 14.3% 35.0% #
+[ 22, 23) 9 3.0% 38.0%
+[ 23, 25) 3 1.0% 39.0%
+[ 25, 27) 0 0.0% 39.0%
+[ 27, 30) 3 1.0% 40.0%
+[ 30, 33) 84 28.0% 68.0% ###
+[ 33, 37) 94 31.3% 99.3% ###
+[ 37, 42) 2 0.7% 100.0%
+[ 42, 49) 0 0.0% 100.0%
+[ 49, 57) 0 0.0% 100.0%
+[ 57, 67) 0 0.0% 100.0%
+[ 67, 79) 0 0.0% 100.0%
+[ 79, 94) 0 0.0% 100.0%
+[ 94, 112) 0 0.0% 100.0%
+[112, inf) 0 0.0% 100.0%
+Benchmark__100_chunks_100KB 30 272889576 ns/op 73.29 MB/s
Histogram (unit: ms)
-Count: 1000 Min: 10 Max: 58 Avg: 12.97
+Count: 30 Min: 267 Max: 292 Avg: 272.40
------------------------------------------------------------
-[ 10, 11) 772 77.2% 77.2% ########
-[ 11, 12) 141 14.1% 91.3% #
-[ 12, 13) 8 0.8% 92.1%
-[ 13, 15) 4 0.4% 92.5%
-[ 15, 17) 0 0.0% 92.5%
-[ 17, 20) 0 0.0% 92.5%
-[ 20, 24) 14 1.4% 93.9%
-[ 24, 30) 0 0.0% 93.9%
-[ 30, 37) 0 0.0% 93.9%
-[ 37, 47) 14 1.4% 95.3%
-[ 47, 60) 47 4.7% 100.0%
-[ 60, 77) 0 0.0% 100.0%
-[ 77, 99) 0 0.0% 100.0%
-[ 99, 127) 0 0.0% 100.0%
-[127, 164) 0 0.0% 100.0%
-[164, 211) 0 0.0% 100.0%
-[211, inf) 0 0.0% 100.0%
-Benchmark__100_chunks___1KB-2 1000 8613532 ns/op 23.22 MB/s
+[267, 268) 3 10.0% 10.0% #
+[268, 269) 8 26.7% 36.7% ###
+[269, 270) 4 13.3% 50.0% #
+[270, 271) 4 13.3% 63.3% #
+[271, 273) 4 13.3% 76.7% #
+[273, 275) 1 3.3% 80.0%
+[275, 278) 1 3.3% 83.3%
+[278, 282) 0 0.0% 83.3%
+[282, 287) 1 3.3% 86.7%
+[287, 293) 4 13.3% 100.0% #
+[293, 301) 0 0.0% 100.0%
+[301, 311) 0 0.0% 100.0%
+[311, 324) 0 0.0% 100.0%
+[324, 340) 0 0.0% 100.0%
+[340, 360) 0 0.0% 100.0%
+[360, 384) 0 0.0% 100.0%
+[384, inf) 0 0.0% 100.0%
+Benchmark__100_chunks_100KB-2 50 149680912 ns/op 133.62 MB/s
Histogram (unit: ms)
-Count: 1000 Min: 6 Max: 38 Avg: 8.10
+Count: 50 Min: 138 Max: 158 Avg: 149.14
------------------------------------------------------------
-[ 6, 7) 649 64.9% 64.9% ######
-[ 7, 8) 255 25.5% 90.4% ###
-[ 8, 9) 3 0.3% 90.7%
-[ 9, 10) 16 1.6% 92.3%
-[ 10, 12) 12 1.2% 93.5%
-[ 12, 15) 2 0.2% 93.7%
-[ 15, 18) 0 0.0% 93.7%
-[ 18, 23) 0 0.0% 93.7%
-[ 23, 29) 1 0.1% 93.8%
-[ 29, 36) 52 5.2% 99.0% #
-[ 36, 46) 10 1.0% 100.0%
-[ 46, 58) 0 0.0% 100.0%
-[ 58, 73) 0 0.0% 100.0%
-[ 73, 93) 0 0.0% 100.0%
-[ 93, 118) 0 0.0% 100.0%
-[118, 149) 0 0.0% 100.0%
-[149, inf) 0 0.0% 100.0%
-Benchmark__100_chunks__10KB 200 39616552 ns/op 50.48 MB/s
+[138, 139) 2 4.0% 4.0%
+[139, 140) 0 0.0% 4.0%
+[140, 141) 0 0.0% 4.0%
+[141, 142) 2 4.0% 8.0%
+[142, 144) 4 8.0% 16.0% #
+[144, 146) 4 8.0% 24.0% #
+[146, 149) 6 12.0% 36.0% #
+[149, 153) 20 40.0% 76.0% ####
+[153, 157) 11 22.0% 98.0% ##
+[157, 163) 1 2.0% 100.0%
+[163, 170) 0 0.0% 100.0%
+[170, 178) 0 0.0% 100.0%
+[178, 188) 0 0.0% 100.0%
+[188, 201) 0 0.0% 100.0%
+[201, 217) 0 0.0% 100.0%
+[217, 236) 0 0.0% 100.0%
+[236, inf) 0 0.0% 100.0%
+Benchmark___1K_chunks____1B 100 111621410 ns/op 0.02 MB/s
Histogram (unit: ms)
-Count: 200 Min: 26 Max: 74 Avg: 39.05
+Count: 100 Min: 93 Max: 120 Avg: 111.11
------------------------------------------------------------
-[ 26, 27) 80 40.0% 40.0% ####
-[ 27, 28) 30 15.0% 55.0% ##
-[ 28, 29) 6 3.0% 58.0%
-[ 29, 31) 0 0.0% 58.0%
-[ 31, 33) 22 11.0% 69.0% #
-[ 33, 36) 5 2.5% 71.5%
-[ 36, 40) 0 0.0% 71.5%
-[ 40, 46) 0 0.0% 71.5%
-[ 46, 53) 0 0.0% 71.5%
-[ 53, 63) 7 3.5% 75.0%
-[ 63, 76) 50 25.0% 100.0% ###
-[ 76, 93) 0 0.0% 100.0%
-[ 93, 115) 0 0.0% 100.0%
-[115, 143) 0 0.0% 100.0%
-[143, 180) 0 0.0% 100.0%
-[180, 227) 0 0.0% 100.0%
-[227, inf) 0 0.0% 100.0%
-Benchmark__100_chunks__10KB-2 500 23658254 ns/op 84.54 MB/s
+[ 93, 94) 1 1.0% 1.0%
+[ 94, 95) 0 0.0% 1.0%
+[ 95, 96) 0 0.0% 1.0%
+[ 96, 97) 0 0.0% 1.0%
+[ 97, 99) 0 0.0% 1.0%
+[ 99, 102) 17 17.0% 18.0% ##
+[102, 105) 12 12.0% 30.0% #
+[105, 109) 1 1.0% 31.0%
+[109, 114) 6 6.0% 37.0% #
+[114, 121) 63 63.0% 100.0% ######
+[121, 130) 0 0.0% 100.0%
+[130, 141) 0 0.0% 100.0%
+[141, 154) 0 0.0% 100.0%
+[154, 171) 0 0.0% 100.0%
+[171, 192) 0 0.0% 100.0%
+[192, 219) 0 0.0% 100.0%
+[219, inf) 0 0.0% 100.0%
+Benchmark___1K_chunks____1B-2 100 103311101 ns/op 0.02 MB/s
Histogram (unit: ms)
-Count: 500 Min: 14 Max: 45 Avg: 23.17
+Count: 100 Min: 62 Max: 168 Avg: 102.82
------------------------------------------------------------
-[ 14, 15) 35 7.0% 7.0% #
-[ 15, 16) 257 51.4% 58.4% #####
-[ 16, 17) 30 6.0% 64.4% #
-[ 17, 18) 14 2.8% 67.2%
-[ 18, 20) 13 2.6% 69.8%
-[ 20, 23) 0 0.0% 69.8%
-[ 23, 26) 0 0.0% 69.8%
-[ 26, 30) 0 0.0% 69.8%
-[ 30, 36) 1 0.2% 70.0%
-[ 36, 43) 85 17.0% 87.0% ##
-[ 43, 52) 65 13.0% 100.0% #
-[ 52, 64) 0 0.0% 100.0%
-[ 64, 79) 0 0.0% 100.0%
-[ 79, 98) 0 0.0% 100.0%
-[ 98, 122) 0 0.0% 100.0%
-[122, 152) 0 0.0% 100.0%
-[152, inf) 0 0.0% 100.0%
-Benchmark__100_chunks_100KB 50 276789691 ns/op 72.26 MB/s
+[ 62, 63) 1 1.0% 1.0%
+[ 63, 64) 0 0.0% 1.0%
+[ 64, 65) 0 0.0% 1.0%
+[ 65, 67) 0 0.0% 1.0%
+[ 67, 70) 0 0.0% 1.0%
+[ 70, 74) 1 1.0% 2.0%
+[ 74, 80) 2 2.0% 4.0%
+[ 80, 88) 2 2.0% 6.0%
+[ 88, 100) 23 23.0% 29.0% ##
+[100, 116) 61 61.0% 90.0% ######
+[116, 138) 9 9.0% 99.0% #
+[138, 168) 0 0.0% 99.0%
+[168, 209) 1 1.0% 100.0%
+[209, 265) 0 0.0% 100.0%
+[265, 342) 0 0.0% 100.0%
+[342, 447) 0 0.0% 100.0%
+[447, inf) 0 0.0% 100.0%
+Benchmark___1K_chunks___10B 50 189580683 ns/op 0.11 MB/s
Histogram (unit: ms)
-Count: 50 Min: 272 Max: 283 Avg: 276.24
+Count: 50 Min: 181 Max: 210 Avg: 189.10
------------------------------------------------------------
-[272, 273) 2 4.0% 4.0%
-[273, 274) 5 10.0% 14.0% #
-[274, 275) 3 6.0% 20.0% #
-[275, 276) 4 8.0% 28.0% #
-[276, 277) 16 32.0% 60.0% ###
-[277, 279) 15 30.0% 90.0% ###
-[279, 281) 2 4.0% 94.0%
-[281, 284) 3 6.0% 100.0% #
-[284, 287) 0 0.0% 100.0%
-[287, 291) 0 0.0% 100.0%
-[291, 295) 0 0.0% 100.0%
-[295, 300) 0 0.0% 100.0%
-[300, 306) 0 0.0% 100.0%
-[306, 313) 0 0.0% 100.0%
-[313, 322) 0 0.0% 100.0%
-[322, 333) 0 0.0% 100.0%
-[333, inf) 0 0.0% 100.0%
-Benchmark__100_chunks_100KB-2 100 154635652 ns/op 129.34 MB/s
+[181, 182) 2 4.0% 4.0%
+[182, 183) 0 0.0% 4.0%
+[183, 184) 1 2.0% 6.0%
+[184, 185) 1 2.0% 8.0%
+[185, 187) 16 32.0% 40.0% ###
+[187, 190) 20 40.0% 80.0% ####
+[190, 193) 2 4.0% 84.0%
+[193, 197) 1 2.0% 86.0%
+[197, 203) 3 6.0% 92.0% #
+[203, 210) 3 6.0% 98.0% #
+[210, 219) 1 2.0% 100.0%
+[219, 230) 0 0.0% 100.0%
+[230, 244) 0 0.0% 100.0%
+[244, 262) 0 0.0% 100.0%
+[262, 285) 0 0.0% 100.0%
+[285, 313) 0 0.0% 100.0%
+[313, inf) 0 0.0% 100.0%
+Benchmark___1K_chunks___10B-2 100 107068429 ns/op 0.19 MB/s
Histogram (unit: ms)
-Count: 100 Min: 143 Max: 163 Avg: 154.17
+Count: 100 Min: 98 Max: 124 Avg: 106.53
------------------------------------------------------------
-[143, 144) 1 1.0% 1.0%
-[144, 145) 0 0.0% 1.0%
-[145, 146) 0 0.0% 1.0%
-[146, 147) 0 0.0% 1.0%
-[147, 149) 3 3.0% 4.0%
-[149, 151) 5 5.0% 9.0% #
-[151, 154) 19 19.0% 28.0% ##
-[154, 158) 67 67.0% 95.0% #######
-[158, 162) 3 3.0% 98.0%
-[162, 168) 2 2.0% 100.0%
-[168, 175) 0 0.0% 100.0%
-[175, 183) 0 0.0% 100.0%
-[183, 193) 0 0.0% 100.0%
-[193, 206) 0 0.0% 100.0%
-[206, 222) 0 0.0% 100.0%
-[222, 241) 0 0.0% 100.0%
-[241, inf) 0 0.0% 100.0%
-Benchmark___1K_chunks____1B 500 39420649 ns/op 0.05 MB/s
+[ 98, 99) 1 1.0% 1.0%
+[ 99, 100) 0 0.0% 1.0%
+[100, 101) 5 5.0% 6.0% #
+[101, 102) 12 12.0% 18.0% #
+[102, 104) 20 20.0% 38.0% ##
+[104, 106) 18 18.0% 56.0% ##
+[106, 109) 23 23.0% 79.0% ##
+[109, 113) 4 4.0% 83.0%
+[113, 118) 7 7.0% 90.0% #
+[118, 125) 10 10.0% 100.0% #
+[125, 133) 0 0.0% 100.0%
+[133, 143) 0 0.0% 100.0%
+[143, 156) 0 0.0% 100.0%
+[156, 172) 0 0.0% 100.0%
+[172, 192) 0 0.0% 100.0%
+[192, 217) 0 0.0% 100.0%
+[217, inf) 0 0.0% 100.0%
+Benchmark___1K_chunks__100B 30 223128293 ns/op 0.90 MB/s
Histogram (unit: ms)
-Count: 500 Min: 14 Max: 93 Avg: 38.93
+Count: 30 Min: 210 Max: 241 Avg: 222.53
------------------------------------------------------------
-[ 14, 15) 10 2.0% 2.0%
-[ 15, 16) 91 18.2% 20.2% ##
-[ 16, 17) 15 3.0% 23.2%
-[ 17, 19) 4 0.8% 24.0%
-[ 19, 22) 0 0.0% 24.0%
-[ 22, 26) 0 0.0% 24.0%
-[ 26, 31) 0 0.0% 24.0%
-[ 31, 38) 117 23.4% 47.4% ##
-[ 38, 48) 168 33.6% 81.0% ###
-[ 48, 61) 23 4.6% 85.6%
-[ 61, 79) 37 7.4% 93.0% #
-[ 79, 103) 35 7.0% 100.0% #
-[103, 135) 0 0.0% 100.0%
-[135, 179) 0 0.0% 100.0%
-[179, 238) 0 0.0% 100.0%
-[238, 317) 0 0.0% 100.0%
-[317, inf) 0 0.0% 100.0%
-Benchmark___1K_chunks____1B-2 500 29693618 ns/op 0.07 MB/s
+[210, 211) 1 3.3% 3.3%
+[211, 212) 0 0.0% 3.3%
+[212, 213) 0 0.0% 3.3%
+[213, 214) 0 0.0% 3.3%
+[214, 216) 2 6.7% 10.0% #
+[216, 219) 8 26.7% 36.7% ###
+[219, 222) 8 26.7% 63.3% ###
+[222, 226) 5 16.7% 80.0% ##
+[226, 232) 0 0.0% 80.0%
+[232, 239) 5 16.7% 96.7% ##
+[239, 248) 1 3.3% 100.0%
+[248, 260) 0 0.0% 100.0%
+[260, 275) 0 0.0% 100.0%
+[275, 294) 0 0.0% 100.0%
+[294, 318) 0 0.0% 100.0%
+[318, 348) 0 0.0% 100.0%
+[348, inf) 0 0.0% 100.0%
+Benchmark___1K_chunks__100B-2 50 125690815 ns/op 1.59 MB/s
Histogram (unit: ms)
-Count: 500 Min: 15 Max: 69 Avg: 29.17
+Count: 50 Min: 117 Max: 142 Avg: 125.22
------------------------------------------------------------
-[ 15, 16) 3 0.6% 0.6%
-[ 16, 17) 2 0.4% 1.0%
-[ 17, 18) 4 0.8% 1.8%
-[ 18, 20) 36 7.2% 9.0% #
-[ 20, 22) 69 13.8% 22.8% #
-[ 22, 25) 138 27.6% 50.4% ###
-[ 25, 29) 133 26.6% 77.0% ###
-[ 29, 35) 28 5.6% 82.6% #
-[ 35, 43) 9 1.8% 84.4%
-[ 43, 53) 19 3.8% 88.2%
-[ 53, 67) 58 11.6% 99.8% #
-[ 67, 85) 1 0.2% 100.0%
-[ 85, 109) 0 0.0% 100.0%
-[109, 140) 0 0.0% 100.0%
-[140, 181) 0 0.0% 100.0%
-[181, 235) 0 0.0% 100.0%
-[235, inf) 0 0.0% 100.0%
-Benchmark___1K_chunks___10B 100 83758352 ns/op 0.24 MB/s
+[117, 118) 4 8.0% 8.0% #
+[118, 119) 1 2.0% 10.0%
+[119, 120) 1 2.0% 12.0%
+[120, 121) 8 16.0% 28.0% ##
+[121, 123) 9 18.0% 46.0% ##
+[123, 125) 9 18.0% 64.0% ##
+[125, 128) 6 12.0% 76.0% #
+[128, 132) 2 4.0% 80.0%
+[132, 137) 5 10.0% 90.0% #
+[137, 143) 5 10.0% 100.0% #
+[143, 151) 0 0.0% 100.0%
+[151, 161) 0 0.0% 100.0%
+[161, 174) 0 0.0% 100.0%
+[174, 190) 0 0.0% 100.0%
+[190, 210) 0 0.0% 100.0%
+[210, 234) 0 0.0% 100.0%
+[234, inf) 0 0.0% 100.0%
+Benchmark___1K_chunks___1KB 30 251956982 ns/op 7.94 MB/s
Histogram (unit: ms)
-Count: 100 Min: 69 Max: 128 Avg: 83.29
+Count: 30 Min: 238 Max: 266 Avg: 251.50
------------------------------------------------------------
-[ 69, 70) 1 1.0% 1.0%
-[ 70, 71) 2 2.0% 3.0%
-[ 71, 72) 3 3.0% 6.0%
-[ 72, 74) 33 33.0% 39.0% ###
-[ 74, 76) 22 22.0% 61.0% ##
-[ 76, 79) 9 9.0% 70.0% #
-[ 79, 84) 1 1.0% 71.0%
-[ 84, 90) 9 9.0% 80.0% #
-[ 90, 98) 1 1.0% 81.0%
-[ 98, 109) 0 0.0% 81.0%
-[109, 124) 13 13.0% 94.0% #
-[124, 143) 6 6.0% 100.0% #
-[143, 169) 0 0.0% 100.0%
-[169, 203) 0 0.0% 100.0%
-[203, 247) 0 0.0% 100.0%
-[247, 305) 0 0.0% 100.0%
-[305, inf) 0 0.0% 100.0%
-Benchmark___1K_chunks___10B-2 200 48382055 ns/op 0.41 MB/s
+[238, 239) 1 3.3% 3.3%
+[239, 240) 0 0.0% 3.3%
+[240, 241) 1 3.3% 6.7%
+[241, 242) 0 0.0% 6.7%
+[242, 244) 3 10.0% 16.7% #
+[244, 247) 7 23.3% 40.0% ##
+[247, 250) 3 10.0% 50.0% #
+[250, 254) 3 10.0% 60.0% #
+[254, 259) 1 3.3% 63.3%
+[259, 266) 10 33.3% 96.7% ###
+[266, 275) 1 3.3% 100.0%
+[275, 286) 0 0.0% 100.0%
+[286, 300) 0 0.0% 100.0%
+[300, 317) 0 0.0% 100.0%
+[317, 339) 0 0.0% 100.0%
+[339, 366) 0 0.0% 100.0%
+[366, inf) 0 0.0% 100.0%
+Benchmark___1K_chunks___1KB-2 50 144214400 ns/op 13.87 MB/s
Histogram (unit: ms)
-Count: 200 Min: 34 Max: 80 Avg: 47.87
+Count: 50 Min: 130 Max: 158 Avg: 143.70
------------------------------------------------------------
-[ 34, 35) 1 0.5% 0.5%
-[ 35, 36) 0 0.0% 0.5%
-[ 36, 37) 2 1.0% 1.5%
-[ 37, 39) 17 8.5% 10.0% #
-[ 39, 41) 33 16.5% 26.5% ##
-[ 41, 44) 74 37.0% 63.5% ####
-[ 44, 48) 30 15.0% 78.5% ##
-[ 48, 53) 5 2.5% 81.0%
-[ 53, 60) 0 0.0% 81.0%
-[ 60, 69) 3 1.5% 82.5%
-[ 69, 81) 35 17.5% 100.0% ##
-[ 81, 97) 0 0.0% 100.0%
-[ 97, 118) 0 0.0% 100.0%
-[118, 145) 0 0.0% 100.0%
-[145, 180) 0 0.0% 100.0%
-[180, 225) 0 0.0% 100.0%
-[225, inf) 0 0.0% 100.0%
-Benchmark___1K_chunks__100B 100 106033135 ns/op 1.89 MB/s
+[130, 131) 1 2.0% 2.0%
+[131, 132) 0 0.0% 2.0%
+[132, 133) 1 2.0% 4.0%
+[133, 134) 6 12.0% 16.0% #
+[134, 136) 6 12.0% 28.0% #
+[136, 139) 4 8.0% 36.0% #
+[139, 142) 6 12.0% 48.0% #
+[142, 146) 1 2.0% 50.0%
+[146, 151) 13 26.0% 76.0% ###
+[151, 158) 9 18.0% 94.0% ##
+[158, 167) 3 6.0% 100.0% #
+[167, 178) 0 0.0% 100.0%
+[178, 192) 0 0.0% 100.0%
+[192, 209) 0 0.0% 100.0%
+[209, 231) 0 0.0% 100.0%
+[231, 258) 0 0.0% 100.0%
+[258, inf) 0 0.0% 100.0%
+Benchmark___1K_chunks__10KB 20 474946063 ns/op 42.11 MB/s
Histogram (unit: ms)
-Count: 100 Min: 91 Max: 155 Avg: 105.49
+Count: 20 Min: 458 Max: 492 Avg: 474.60
------------------------------------------------------------
-[ 91, 92) 5 5.0% 5.0% #
-[ 92, 93) 40 40.0% 45.0% ####
-[ 93, 94) 13 13.0% 58.0% #
-[ 94, 96) 4 4.0% 62.0%
-[ 96, 99) 2 2.0% 64.0%
-[ 99, 102) 2 2.0% 66.0%
-[102, 107) 12 12.0% 78.0% #
-[107, 113) 0 0.0% 78.0%
-[113, 122) 0 0.0% 78.0%
-[122, 134) 1 1.0% 79.0%
-[134, 149) 13 13.0% 92.0% #
-[149, 170) 8 8.0% 100.0% #
-[170, 197) 0 0.0% 100.0%
-[197, 233) 0 0.0% 100.0%
-[233, 281) 0 0.0% 100.0%
-[281, 344) 0 0.0% 100.0%
-[344, inf) 0 0.0% 100.0%
-Benchmark___1K_chunks__100B-2 100 62612895 ns/op 3.19 MB/s
+[458, 459) 1 5.0% 5.0% #
+[459, 460) 0 0.0% 5.0%
+[460, 461) 1 5.0% 10.0% #
+[461, 463) 3 15.0% 25.0% ##
+[463, 465) 1 5.0% 30.0% #
+[465, 468) 4 20.0% 50.0% ##
+[468, 472) 0 0.0% 50.0%
+[472, 477) 0 0.0% 50.0%
+[477, 483) 1 5.0% 55.0% #
+[483, 491) 8 40.0% 95.0% ####
+[491, 501) 1 5.0% 100.0% #
+[501, 514) 0 0.0% 100.0%
+[514, 530) 0 0.0% 100.0%
+[530, 551) 0 0.0% 100.0%
+[551, 577) 0 0.0% 100.0%
+[577, 610) 0 0.0% 100.0%
+[610, inf) 0 0.0% 100.0%
+Benchmark___1K_chunks__10KB-2 30 267531367 ns/op 74.76 MB/s
Histogram (unit: ms)
-Count: 100 Min: 52 Max: 95 Avg: 62.12
+Count: 30 Min: 250 Max: 294 Avg: 267.07
------------------------------------------------------------
-[ 52, 53) 8 8.0% 8.0% #
-[ 53, 54) 13 13.0% 21.0% #
-[ 54, 55) 18 18.0% 39.0% ##
-[ 55, 57) 28 28.0% 67.0% ###
-[ 57, 59) 10 10.0% 77.0% #
-[ 59, 62) 1 1.0% 78.0%
-[ 62, 66) 0 0.0% 78.0%
-[ 66, 71) 0 0.0% 78.0%
-[ 71, 78) 0 0.0% 78.0%
-[ 78, 87) 4 4.0% 82.0%
-[ 87, 99) 18 18.0% 100.0% ##
-[ 99, 114) 0 0.0% 100.0%
-[114, 134) 0 0.0% 100.0%
-[134, 160) 0 0.0% 100.0%
-[160, 193) 0 0.0% 100.0%
-[193, 236) 0 0.0% 100.0%
-[236, inf) 0 0.0% 100.0%
-Benchmark___1K_chunks___1KB 100 137482628 ns/op 14.55 MB/s
-Histogram (unit: ms)
-Count: 100 Min: 110 Max: 177 Avg: 136.97
-------------------------------------------------------------
-[110, 111) 2 2.0% 2.0%
-[111, 112) 7 7.0% 9.0% #
-[112, 113) 11 11.0% 20.0% #
-[113, 115) 10 10.0% 30.0% #
-[115, 118) 9 9.0% 39.0% #
-[118, 122) 6 6.0% 45.0% #
-[122, 127) 6 6.0% 51.0% #
-[127, 134) 5 5.0% 56.0% #
-[134, 143) 0 0.0% 56.0%
-[143, 155) 5 5.0% 61.0% #
-[155, 171) 34 34.0% 95.0% ###
-[171, 192) 5 5.0% 100.0% #
-[192, 220) 0 0.0% 100.0%
-[220, 258) 0 0.0% 100.0%
-[258, 308) 0 0.0% 100.0%
-[308, 374) 0 0.0% 100.0%
-[374, inf) 0 0.0% 100.0%
-Benchmark___1K_chunks___1KB-2 100 79534604 ns/op 25.15 MB/s
-Histogram (unit: ms)
-Count: 100 Min: 60 Max: 107 Avg: 78.97
-------------------------------------------------------------
-[ 60, 61) 1 1.0% 1.0%
-[ 61, 62) 4 4.0% 5.0%
-[ 62, 63) 4 4.0% 9.0%
-[ 63, 65) 14 14.0% 23.0% #
-[ 65, 67) 26 26.0% 49.0% ###
-[ 67, 70) 5 5.0% 54.0% #
-[ 70, 74) 0 0.0% 54.0%
-[ 74, 80) 0 0.0% 54.0%
-[ 80, 87) 1 1.0% 55.0%
-[ 87, 97) 23 23.0% 78.0% ##
-[ 97, 110) 22 22.0% 100.0% ##
-[110, 126) 0 0.0% 100.0%
-[126, 147) 0 0.0% 100.0%
-[147, 175) 0 0.0% 100.0%
-[175, 211) 0 0.0% 100.0%
-[211, 257) 0 0.0% 100.0%
-[257, inf) 0 0.0% 100.0%
-Benchmark___1K_chunks__10KB 20 405074363 ns/op 49.37 MB/s
-Histogram (unit: ms)
-Count: 20 Min: 374 Max: 429 Avg: 404.60
-------------------------------------------------------------
-[374, 375) 1 5.0% 5.0% #
-[375, 376) 2 10.0% 15.0% #
-[376, 377) 1 5.0% 20.0% #
-[377, 379) 3 15.0% 35.0% ##
-[379, 381) 1 5.0% 40.0% #
-[381, 384) 0 0.0% 40.0%
-[384, 388) 0 0.0% 40.0%
-[388, 394) 0 0.0% 40.0%
-[394, 402) 0 0.0% 40.0%
-[402, 413) 0 0.0% 40.0%
-[413, 427) 11 55.0% 95.0% ######
-[427, 445) 1 5.0% 100.0% #
-[445, 469) 0 0.0% 100.0%
-[469, 501) 0 0.0% 100.0%
-[501, 543) 0 0.0% 100.0%
-[543, 598) 0 0.0% 100.0%
-[598, inf) 0 0.0% 100.0%
-Benchmark___1K_chunks__10KB-2 50 219752224 ns/op 91.01 MB/s
-Histogram (unit: ms)
-Count: 50 Min: 198 Max: 237 Avg: 219.22
-------------------------------------------------------------
-[198, 199) 1 2.0% 2.0%
-[199, 200) 0 0.0% 2.0%
-[200, 201) 0 0.0% 2.0%
-[201, 203) 4 8.0% 10.0% #
-[203, 205) 8 16.0% 26.0% ##
-[205, 208) 8 16.0% 42.0% ##
-[208, 212) 2 4.0% 46.0%
-[212, 217) 0 0.0% 46.0%
-[217, 224) 0 0.0% 46.0%
-[224, 233) 14 28.0% 74.0% ###
-[233, 244) 13 26.0% 100.0% ###
-[244, 258) 0 0.0% 100.0%
-[258, 276) 0 0.0% 100.0%
-[276, 299) 0 0.0% 100.0%
-[299, 329) 0 0.0% 100.0%
-[329, 367) 0 0.0% 100.0%
-[367, inf) 0 0.0% 100.0%
-Benchmark___1K_chunks_100KB 2 2735626324 ns/op 73.11 MB/s
+[250, 251) 1 3.3% 3.3%
+[251, 252) 1 3.3% 6.7%
+[252, 253) 0 0.0% 6.7%
+[253, 255) 0 0.0% 6.7%
+[255, 257) 2 6.7% 13.3% #
+[257, 260) 2 6.7% 20.0% #
+[260, 264) 7 23.3% 43.3% ##
+[264, 269) 3 10.0% 53.3% #
+[269, 276) 8 26.7% 80.0% ###
+[276, 285) 5 16.7% 96.7% ##
+[285, 297) 1 3.3% 100.0%
+[297, 313) 0 0.0% 100.0%
+[313, 333) 0 0.0% 100.0%
+[333, 359) 0 0.0% 100.0%
+[359, 393) 0 0.0% 100.0%
+[393, 437) 0 0.0% 100.0%
+[437, inf) 0 0.0% 100.0%
+Benchmark___1K_chunks_100KB 2 2675372295 ns/op 74.76 MB/s
Histogram (unit: s)
Count: 2 Min: 2 Max: 2 Avg: 2.00
------------------------------------------------------------
@@ -1349,7 +1353,7 @@
[ 3, 3) 0 0.0% 100.0%
[ 3, 3) 0 0.0% 100.0%
[ 3, inf) 0 0.0% 100.0%
-Benchmark___1K_chunks_100KB-2 5 1536631217 ns/op 130.15 MB/s
+Benchmark___1K_chunks_100KB-2 5 1421481350 ns/op 140.70 MB/s
Histogram (unit: s)
Count: 5 Min: 1 Max: 1 Avg: 1.00
------------------------------------------------------------
@@ -1374,91 +1378,7 @@
================================================================================
Echo streaming RPC (Per chunk)
================================================================================
-Benchmark__per_chunk____1B 200000 1142388 ns/op 0.00 MB/s
-Histogram (unit: s)
-Count: 1 Min: 228 Max: 228 Avg: 228.00
-------------------------------------------------------------
-[228, 229) 1 100.0% 100.0% ##########
-[229, 229) 0 0.0% 100.0%
-[229, 229) 0 0.0% 100.0%
-[229, 229) 0 0.0% 100.0%
-[229, 229) 0 0.0% 100.0%
-[229, 229) 0 0.0% 100.0%
-[229, 229) 0 0.0% 100.0%
-[229, 229) 0 0.0% 100.0%
-[229, 229) 0 0.0% 100.0%
-[229, 229) 0 0.0% 100.0%
-[229, 229) 0 0.0% 100.0%
-[229, 229) 0 0.0% 100.0%
-[229, 229) 0 0.0% 100.0%
-[229, 229) 0 0.0% 100.0%
-[229, 229) 0 0.0% 100.0%
-[229, 229) 0 0.0% 100.0%
-[229, inf) 0 0.0% 100.0%
-Benchmark__per_chunk____1B-2 10000 2615337 ns/op 0.00 MB/s
-Histogram (unit: s)
-Count: 1 Min: 26 Max: 26 Avg: 26.00
-------------------------------------------------------------
-[ 26, 27) 1 100.0% 100.0% ##########
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, inf) 0 0.0% 100.0%
-Benchmark__per_chunk___10B 5000 5240078 ns/op 0.00 MB/s
-Histogram (unit: s)
-Count: 1 Min: 26 Max: 26 Avg: 26.00
-------------------------------------------------------------
-[ 26, 27) 1 100.0% 100.0% ##########
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, 27) 0 0.0% 100.0%
-[ 27, inf) 0 0.0% 100.0%
-Benchmark__per_chunk___10B-2 5000 3873372 ns/op 0.01 MB/s
-Histogram (unit: s)
-Count: 1 Min: 19 Max: 19 Avg: 19.00
-------------------------------------------------------------
-[ 19, 20) 1 100.0% 100.0% ##########
-[ 20, 20) 0 0.0% 100.0%
-[ 20, 20) 0 0.0% 100.0%
-[ 20, 20) 0 0.0% 100.0%
-[ 20, 20) 0 0.0% 100.0%
-[ 20, 20) 0 0.0% 100.0%
-[ 20, 20) 0 0.0% 100.0%
-[ 20, 20) 0 0.0% 100.0%
-[ 20, 20) 0 0.0% 100.0%
-[ 20, 20) 0 0.0% 100.0%
-[ 20, 20) 0 0.0% 100.0%
-[ 20, 20) 0 0.0% 100.0%
-[ 20, 20) 0 0.0% 100.0%
-[ 20, 20) 0 0.0% 100.0%
-[ 20, 20) 0 0.0% 100.0%
-[ 20, 20) 0 0.0% 100.0%
-[ 20, inf) 0 0.0% 100.0%
-Benchmark__per_chunk__100B 2000 4133802 ns/op 0.05 MB/s
+Benchmark__per_chunk____1B 50000 163939 ns/op 0.01 MB/s
Histogram (unit: s)
Count: 1 Min: 8 Max: 8 Avg: 8.00
------------------------------------------------------------
@@ -1479,70 +1399,28 @@
[ 9, 9) 0 0.0% 100.0%
[ 9, 9) 0 0.0% 100.0%
[ 9, inf) 0 0.0% 100.0%
-Benchmark__per_chunk__100B-2 5000 4392527 ns/op 0.05 MB/s
+Benchmark__per_chunk____1B-2 50000 118409 ns/op 0.02 MB/s
Histogram (unit: s)
-Count: 1 Min: 21 Max: 21 Avg: 21.00
+Count: 1 Min: 5 Max: 5 Avg: 5.00
------------------------------------------------------------
-[ 21, 22) 1 100.0% 100.0% ##########
-[ 22, 22) 0 0.0% 100.0%
-[ 22, 22) 0 0.0% 100.0%
-[ 22, 22) 0 0.0% 100.0%
-[ 22, 22) 0 0.0% 100.0%
-[ 22, 22) 0 0.0% 100.0%
-[ 22, 22) 0 0.0% 100.0%
-[ 22, 22) 0 0.0% 100.0%
-[ 22, 22) 0 0.0% 100.0%
-[ 22, 22) 0 0.0% 100.0%
-[ 22, 22) 0 0.0% 100.0%
-[ 22, 22) 0 0.0% 100.0%
-[ 22, 22) 0 0.0% 100.0%
-[ 22, 22) 0 0.0% 100.0%
-[ 22, 22) 0 0.0% 100.0%
-[ 22, 22) 0 0.0% 100.0%
-[ 22, inf) 0 0.0% 100.0%
-Benchmark__per_chunk___1KB 2000 4073315 ns/op 0.49 MB/s
-Histogram (unit: s)
-Count: 1 Min: 8 Max: 8 Avg: 8.00
-------------------------------------------------------------
-[ 8, 9) 1 100.0% 100.0% ##########
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, inf) 0 0.0% 100.0%
-Benchmark__per_chunk___1KB-2 2000 4173645 ns/op 0.48 MB/s
-Histogram (unit: s)
-Count: 1 Min: 8 Max: 8 Avg: 8.00
-------------------------------------------------------------
-[ 8, 9) 1 100.0% 100.0% ##########
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, 9) 0 0.0% 100.0%
-[ 9, inf) 0 0.0% 100.0%
-Benchmark__per_chunk__10KB 1000 6355059 ns/op 3.15 MB/s
+[ 5, 6) 1 100.0% 100.0% ##########
+[ 6, 6) 0 0.0% 100.0%
+[ 6, 6) 0 0.0% 100.0%
+[ 6, 6) 0 0.0% 100.0%
+[ 6, 6) 0 0.0% 100.0%
+[ 6, 6) 0 0.0% 100.0%
+[ 6, 6) 0 0.0% 100.0%
+[ 6, 6) 0 0.0% 100.0%
+[ 6, 6) 0 0.0% 100.0%
+[ 6, 6) 0 0.0% 100.0%
+[ 6, 6) 0 0.0% 100.0%
+[ 6, 6) 0 0.0% 100.0%
+[ 6, 6) 0 0.0% 100.0%
+[ 6, 6) 0 0.0% 100.0%
+[ 6, 6) 0 0.0% 100.0%
+[ 6, 6) 0 0.0% 100.0%
+[ 6, inf) 0 0.0% 100.0%
+Benchmark__per_chunk___10B 20000 321908 ns/op 0.06 MB/s
Histogram (unit: s)
Count: 1 Min: 6 Max: 6 Avg: 6.00
------------------------------------------------------------
@@ -1563,574 +1441,700 @@
[ 7, 7) 0 0.0% 100.0%
[ 7, 7) 0 0.0% 100.0%
[ 7, inf) 0 0.0% 100.0%
-Benchmark__per_chunk__10KB-2 2000 4659057 ns/op 4.29 MB/s
+Benchmark__per_chunk___10B-2 50000 176818 ns/op 0.11 MB/s
Histogram (unit: s)
-Count: 1 Min: 9 Max: 9 Avg: 9.00
+Count: 1 Min: 8 Max: 8 Avg: 8.00
------------------------------------------------------------
-[ 9, 10) 1 100.0% 100.0% ##########
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, inf) 0 0.0% 100.0%
-Benchmark__per_chunk_100KB 1000 9065425 ns/op 22.06 MB/s
+[ 8, 9) 1 100.0% 100.0% ##########
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, inf) 0 0.0% 100.0%
+Benchmark__per_chunk__100B 20000 411514 ns/op 0.49 MB/s
Histogram (unit: s)
-Count: 1 Min: 9 Max: 9 Avg: 9.00
+Count: 1 Min: 8 Max: 8 Avg: 8.00
------------------------------------------------------------
-[ 9, 10) 1 100.0% 100.0% ##########
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, 10) 0 0.0% 100.0%
-[ 10, inf) 0 0.0% 100.0%
-Benchmark__per_chunk_100KB-2 2000 5900078 ns/op 33.90 MB/s
+[ 8, 9) 1 100.0% 100.0% ##########
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, inf) 0 0.0% 100.0%
+Benchmark__per_chunk__100B-2 30000 231565 ns/op 0.86 MB/s
Histogram (unit: s)
-Count: 1 Min: 11 Max: 11 Avg: 11.00
+Count: 1 Min: 6 Max: 6 Avg: 6.00
------------------------------------------------------------
-[ 11, 12) 1 100.0% 100.0% ##########
-[ 12, 12) 0 0.0% 100.0%
-[ 12, 12) 0 0.0% 100.0%
-[ 12, 12) 0 0.0% 100.0%
-[ 12, 12) 0 0.0% 100.0%
-[ 12, 12) 0 0.0% 100.0%
-[ 12, 12) 0 0.0% 100.0%
-[ 12, 12) 0 0.0% 100.0%
-[ 12, 12) 0 0.0% 100.0%
-[ 12, 12) 0 0.0% 100.0%
-[ 12, 12) 0 0.0% 100.0%
-[ 12, 12) 0 0.0% 100.0%
-[ 12, 12) 0 0.0% 100.0%
-[ 12, 12) 0 0.0% 100.0%
-[ 12, 12) 0 0.0% 100.0%
-[ 12, 12) 0 0.0% 100.0%
-[ 12, inf) 0 0.0% 100.0%
+[ 6, 7) 1 100.0% 100.0% ##########
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, inf) 0 0.0% 100.0%
+Benchmark__per_chunk___1KB 20000 423999 ns/op 4.72 MB/s
+Histogram (unit: s)
+Count: 1 Min: 8 Max: 8 Avg: 8.00
+------------------------------------------------------------
+[ 8, 9) 1 100.0% 100.0% ##########
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, 9) 0 0.0% 100.0%
+[ 9, inf) 0 0.0% 100.0%
+Benchmark__per_chunk___1KB-2 30000 248721 ns/op 8.04 MB/s
+Histogram (unit: s)
+Count: 1 Min: 7 Max: 7 Avg: 7.00
+------------------------------------------------------------
+[ 7, 8) 1 100.0% 100.0% ##########
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, inf) 0 0.0% 100.0%
+Benchmark__per_chunk__10KB 10000 631536 ns/op 31.67 MB/s
+Histogram (unit: s)
+Count: 1 Min: 6 Max: 6 Avg: 6.00
+------------------------------------------------------------
+[ 6, 7) 1 100.0% 100.0% ##########
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, inf) 0 0.0% 100.0%
+Benchmark__per_chunk__10KB-2 20000 346868 ns/op 57.66 MB/s
+Histogram (unit: s)
+Count: 1 Min: 6 Max: 6 Avg: 6.00
+------------------------------------------------------------
+[ 6, 7) 1 100.0% 100.0% ##########
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, inf) 0 0.0% 100.0%
+Benchmark__per_chunk_100KB 3000 2613430 ns/op 76.53 MB/s
+Histogram (unit: s)
+Count: 1 Min: 7 Max: 7 Avg: 7.00
+------------------------------------------------------------
+[ 7, 8) 1 100.0% 100.0% ##########
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, 8) 0 0.0% 100.0%
+[ 8, inf) 0 0.0% 100.0%
+Benchmark__per_chunk_100KB-2 5000 1369809 ns/op 146.01 MB/s
+Histogram (unit: s)
+Count: 1 Min: 6 Max: 6 Avg: 6.00
+------------------------------------------------------------
+[ 6, 7) 1 100.0% 100.0% ##########
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, 7) 0 0.0% 100.0%
+[ 7, inf) 0 0.0% 100.0%
================================================================================
Echo RPC when multiplexing with Echo streaming RPC
================================================================================
-Benchmark___10B_mux__100_chunks___10B 1000 8940566 ns/op 0.00 MB/s
+Benchmark___10B_mux__100_chunks___10B 500 18817141 ns/op 0.00 MB/s
Histogram (unit: ms)
-Count: 1000 Min: 3 Max: 11 Avg: 8.50
+Count: 500 Min: 7 Max: 26 Avg: 18.28
------------------------------------------------------------
-[ 3, 4) 68 6.8% 6.8% #
-[ 4, 5) 23 2.3% 9.1%
-[ 5, 6) 3 0.3% 9.4%
-[ 6, 7) 3 0.3% 9.7%
-[ 7, 8) 35 3.5% 13.2%
-[ 8, 10) 526 52.6% 65.8% #####
-[ 10, 12) 342 34.2% 100.0% ###
-[ 12, 14) 0 0.0% 100.0%
+[ 7, 8) 41 8.2% 8.2% #
+[ 8, 9) 5 1.0% 9.2%
+[ 9, 10) 1 0.2% 9.4%
+[ 10, 11) 0 0.0% 9.4%
+[ 11, 13) 5 1.0% 10.4%
+[ 13, 15) 0 0.0% 10.4%
+[ 15, 18) 52 10.4% 20.8% #
+[ 18, 21) 329 65.8% 86.6% #######
+[ 21, 25) 66 13.2% 99.8% #
+[ 25, 30) 1 0.2% 100.0%
+[ 30, 37) 0 0.0% 100.0%
+[ 37, 45) 0 0.0% 100.0%
+[ 45, 55) 0 0.0% 100.0%
+[ 55, 67) 0 0.0% 100.0%
+[ 67, 82) 0 0.0% 100.0%
+[ 82, 100) 0 0.0% 100.0%
+[100, inf) 0 0.0% 100.0%
+Benchmark___10B_mux__100_chunks___10B-2 1000 7104449 ns/op 0.00 MB/s
+Histogram (unit: ms)
+Count: 1000 Min: 2 Max: 13 Avg: 6.62
+------------------------------------------------------------
+[ 2, 3) 89 8.9% 8.9% #
+[ 3, 4) 110 11.0% 19.9% #
+[ 4, 5) 108 10.8% 30.7% #
+[ 5, 6) 112 11.2% 41.9% #
+[ 6, 7) 77 7.7% 49.6% #
+[ 7, 9) 165 16.5% 66.1% ##
+[ 9, 11) 230 23.0% 89.1% ##
+[ 11, 14) 109 10.9% 100.0% #
[ 14, 17) 0 0.0% 100.0%
-[ 17, 20) 0 0.0% 100.0%
-[ 20, 24) 0 0.0% 100.0%
-[ 24, 28) 0 0.0% 100.0%
-[ 28, 33) 0 0.0% 100.0%
-[ 33, 39) 0 0.0% 100.0%
-[ 39, 45) 0 0.0% 100.0%
-[ 45, 53) 0 0.0% 100.0%
-[ 53, inf) 0 0.0% 100.0%
-Benchmark___10B_mux__100_chunks___10B-2 5000 3061921 ns/op 0.01 MB/s
+[ 17, 21) 0 0.0% 100.0%
+[ 21, 25) 0 0.0% 100.0%
+[ 25, 30) 0 0.0% 100.0%
+[ 30, 36) 0 0.0% 100.0%
+[ 36, 43) 0 0.0% 100.0%
+[ 43, 52) 0 0.0% 100.0%
+[ 52, 63) 0 0.0% 100.0%
+[ 63, inf) 0 0.0% 100.0%
+Benchmark___10B_mux__100_chunks__100B 300 21167617 ns/op 0.00 MB/s
Histogram (unit: ms)
-Count: 5000 Min: 1 Max: 8 Avg: 2.55
+Count: 300 Min: 6 Max: 26 Avg: 20.68
------------------------------------------------------------
-[ 1, 2) 1029 20.6% 20.6% ##
-[ 2, 3) 1860 37.2% 57.8% ####
-[ 3, 4) 1083 21.7% 79.4% ##
-[ 4, 5) 577 11.5% 91.0% #
-[ 5, 6) 303 6.1% 97.0% #
-[ 6, 7) 118 2.4% 99.4%
-[ 7, 9) 30 0.6% 100.0%
-[ 9, 11) 0 0.0% 100.0%
-[ 11, 13) 0 0.0% 100.0%
-[ 13, 16) 0 0.0% 100.0%
-[ 16, 19) 0 0.0% 100.0%
-[ 19, 23) 0 0.0% 100.0%
-[ 23, 27) 0 0.0% 100.0%
-[ 27, 32) 0 0.0% 100.0%
-[ 32, 38) 0 0.0% 100.0%
-[ 38, 44) 0 0.0% 100.0%
-[ 44, inf) 0 0.0% 100.0%
-Benchmark___10B_mux__100_chunks__100B 1000 10060243 ns/op 0.00 MB/s
+[ 6, 7) 13 4.3% 4.3%
+[ 7, 8) 7 2.3% 6.7%
+[ 8, 9) 9 3.0% 9.7%
+[ 9, 10) 0 0.0% 9.7%
+[ 10, 12) 0 0.0% 9.7%
+[ 12, 14) 0 0.0% 9.7%
+[ 14, 17) 0 0.0% 9.7%
+[ 17, 21) 29 9.7% 19.3% #
+[ 21, 25) 237 79.0% 98.3% ########
+[ 25, 31) 5 1.7% 100.0%
+[ 31, 38) 0 0.0% 100.0%
+[ 38, 46) 0 0.0% 100.0%
+[ 46, 56) 0 0.0% 100.0%
+[ 56, 69) 0 0.0% 100.0%
+[ 69, 85) 0 0.0% 100.0%
+[ 85, 104) 0 0.0% 100.0%
+[104, inf) 0 0.0% 100.0%
+Benchmark___10B_mux__100_chunks__100B-2 1000 8372251 ns/op 0.00 MB/s
Histogram (unit: ms)
-Count: 1000 Min: 3 Max: 14 Avg: 9.46
+Count: 1000 Min: 2 Max: 15 Avg: 7.88
------------------------------------------------------------
-[ 3, 4) 25 2.5% 2.5%
-[ 4, 5) 44 4.4% 6.9%
-[ 5, 6) 3 0.3% 7.2%
-[ 6, 7) 6 0.6% 7.8%
-[ 7, 8) 10 1.0% 8.8%
-[ 8, 10) 585 58.5% 67.3% ######
-[ 10, 12) 104 10.4% 77.7% #
-[ 12, 15) 223 22.3% 100.0% ##
-[ 15, 18) 0 0.0% 100.0%
-[ 18, 22) 0 0.0% 100.0%
-[ 22, 26) 0 0.0% 100.0%
-[ 26, 31) 0 0.0% 100.0%
-[ 31, 37) 0 0.0% 100.0%
-[ 37, 44) 0 0.0% 100.0%
-[ 44, 53) 0 0.0% 100.0%
-[ 53, 64) 0 0.0% 100.0%
-[ 64, inf) 0 0.0% 100.0%
-Benchmark___10B_mux__100_chunks__100B-2 2000 4415919 ns/op 0.00 MB/s
-Histogram (unit: ms)
-Count: 2000 Min: 1 Max: 10 Avg: 3.92
-------------------------------------------------------------
-[ 1, 2) 169 8.5% 8.5% #
-[ 2, 3) 315 15.8% 24.2% ##
-[ 3, 4) 500 25.0% 49.2% ###
-[ 4, 5) 320 16.0% 65.2% ##
-[ 5, 6) 314 15.7% 80.9% ##
-[ 6, 8) 257 12.9% 93.8% #
-[ 8, 10) 121 6.1% 99.8% #
-[ 10, 12) 4 0.2% 100.0%
-[ 12, 15) 0 0.0% 100.0%
-[ 15, 18) 0 0.0% 100.0%
-[ 18, 22) 0 0.0% 100.0%
-[ 22, 27) 0 0.0% 100.0%
-[ 27, 32) 0 0.0% 100.0%
-[ 32, 38) 0 0.0% 100.0%
-[ 38, 45) 0 0.0% 100.0%
-[ 45, 54) 0 0.0% 100.0%
-[ 54, inf) 0 0.0% 100.0%
-Benchmark___10B_mux__100_chunks___1KB 1000 11654085 ns/op 0.00 MB/s
-Histogram (unit: ms)
-Count: 1000 Min: 3 Max: 18 Avg: 11.22
-------------------------------------------------------------
-[ 3, 4) 67 6.7% 6.7% #
-[ 4, 5) 32 3.2% 9.9%
-[ 5, 6) 3 0.3% 10.2%
-[ 6, 7) 1 0.1% 10.3%
-[ 7, 9) 8 0.8% 11.1%
-[ 9, 11) 148 14.8% 25.9% #
-[ 11, 13) 424 42.4% 68.3% ####
-[ 13, 16) 284 28.4% 96.7% ###
-[ 16, 20) 33 3.3% 100.0%
-[ 20, 25) 0 0.0% 100.0%
-[ 25, 31) 0 0.0% 100.0%
-[ 31, 38) 0 0.0% 100.0%
-[ 38, 46) 0 0.0% 100.0%
-[ 46, 56) 0 0.0% 100.0%
-[ 56, 68) 0 0.0% 100.0%
-[ 68, 82) 0 0.0% 100.0%
-[ 82, inf) 0 0.0% 100.0%
-Benchmark___10B_mux__100_chunks___1KB-2 2000 4707737 ns/op 0.00 MB/s
-Histogram (unit: us)
-Count: 2000 Min: 964 Max: 11881 Avg: 4706.78
-------------------------------------------------------------
-[ 964, 965) 1 0.1% 0.1%
-[ 965, 966) 0 0.0% 0.1%
-[ 966, 969) 0 0.0% 0.1%
-[ 969, 975) 0 0.0% 0.1%
-[ 975, 986) 0 0.0% 0.1%
-[ 986, 1008) 0 0.0% 0.1%
-[ 1008, 1049) 3 0.2% 0.2%
-[ 1049, 1125) 53 2.7% 2.9%
-[ 1125, 1267) 141 7.1% 9.9% #
-[ 1267, 1531) 137 6.9% 16.8% #
-[ 1531, 2023) 103 5.2% 21.9% #
-[ 2023, 2937) 161 8.1% 30.0% #
-[ 2937, 4637) 503 25.2% 55.1% ###
-[ 4637, 7797) 631 31.6% 86.7% ###
-[ 7797, 13670) 267 13.4% 100.0% #
-[13670, 24586) 0 0.0% 100.0%
-[24586, inf) 0 0.0% 100.0%
-Benchmark___10B_mux___1K_chunks___10B 100 62531874 ns/op 0.00 MB/s
-Histogram (unit: ms)
-Count: 100 Min: 9 Max: 88 Avg: 62.03
-------------------------------------------------------------
-[ 9, 10) 1 1.0% 1.0%
-[ 10, 11) 1 1.0% 2.0%
-[ 11, 12) 0 0.0% 2.0%
-[ 12, 14) 0 0.0% 2.0%
-[ 14, 17) 0 0.0% 2.0%
-[ 17, 21) 0 0.0% 2.0%
-[ 21, 26) 3 3.0% 5.0%
-[ 26, 33) 3 3.0% 8.0%
-[ 33, 43) 10 10.0% 18.0% #
-[ 43, 56) 12 12.0% 30.0% #
-[ 56, 74) 34 34.0% 64.0% ###
-[ 74, 98) 36 36.0% 100.0% ####
-[ 98, 130) 0 0.0% 100.0%
-[130, 174) 0 0.0% 100.0%
-[174, 233) 0 0.0% 100.0%
-[233, 312) 0 0.0% 100.0%
-[312, inf) 0 0.0% 100.0%
-Benchmark___10B_mux___1K_chunks___10B-2 500 17551728 ns/op 0.00 MB/s
-Histogram (unit: ms)
-Count: 500 Min: 1 Max: 44 Avg: 17.05
-------------------------------------------------------------
-[ 1, 2) 6 1.2% 1.2%
-[ 2, 3) 27 5.4% 6.6% #
-[ 3, 4) 27 5.4% 12.0% #
-[ 4, 6) 45 9.0% 21.0% #
-[ 6, 8) 39 7.8% 28.8% #
-[ 8, 11) 41 8.2% 37.0% #
-[ 11, 15) 54 10.8% 47.8% #
-[ 15, 20) 52 10.4% 58.2% #
-[ 20, 27) 86 17.2% 75.4% ##
-[ 27, 36) 93 18.6% 94.0% ##
-[ 36, 48) 30 6.0% 100.0% #
-[ 48, 63) 0 0.0% 100.0%
-[ 63, 83) 0 0.0% 100.0%
-[ 83, 109) 0 0.0% 100.0%
-[109, 142) 0 0.0% 100.0%
-[142, 185) 0 0.0% 100.0%
-[185, inf) 0 0.0% 100.0%
-Benchmark___10B_mux___1K_chunks__100B 100 75553069 ns/op 0.00 MB/s
-Histogram (unit: ms)
-Count: 100 Min: 31 Max: 97 Avg: 75.03
-------------------------------------------------------------
-[ 31, 32) 6 6.0% 6.0% #
-[ 32, 33) 1 1.0% 7.0%
-[ 33, 34) 0 0.0% 7.0%
-[ 34, 36) 5 5.0% 12.0% #
-[ 36, 39) 1 1.0% 13.0%
-[ 39, 43) 1 1.0% 14.0%
-[ 43, 48) 2 2.0% 16.0%
-[ 48, 55) 4 4.0% 20.0%
-[ 55, 64) 6 6.0% 26.0% #
-[ 64, 76) 9 9.0% 35.0% #
-[ 76, 92) 32 32.0% 67.0% ###
-[ 92, 113) 33 33.0% 100.0% ###
-[113, 141) 0 0.0% 100.0%
-[141, 178) 0 0.0% 100.0%
-[178, 227) 0 0.0% 100.0%
-[227, 292) 0 0.0% 100.0%
-[292, inf) 0 0.0% 100.0%
-Benchmark___10B_mux___1K_chunks__100B-2 500 24959801 ns/op 0.00 MB/s
-Histogram (unit: ms)
-Count: 500 Min: 1 Max: 58 Avg: 24.46
-------------------------------------------------------------
-[ 1, 2) 21 4.2% 4.2%
-[ 2, 3) 29 5.8% 10.0% #
-[ 3, 4) 19 3.8% 13.8%
-[ 4, 6) 39 7.8% 21.6% #
-[ 6, 8) 34 6.8% 28.4% #
-[ 8, 11) 39 7.8% 36.2% #
-[ 11, 16) 42 8.4% 44.6% #
-[ 16, 22) 30 6.0% 50.6% #
-[ 22, 30) 35 7.0% 57.6% #
-[ 30, 41) 63 12.6% 70.2% #
-[ 41, 55) 142 28.4% 98.6% ###
-[ 55, 74) 7 1.4% 100.0%
-[ 74, 99) 0 0.0% 100.0%
-[ 99, 132) 0 0.0% 100.0%
-[132, 175) 0 0.0% 100.0%
-[175, 232) 0 0.0% 100.0%
-[232, inf) 0 0.0% 100.0%
-Benchmark___10B_mux___1K_chunks___1KB 100 79070593 ns/op 0.00 MB/s
-Histogram (unit: ms)
-Count: 100 Min: 31 Max: 122 Avg: 78.61
-------------------------------------------------------------
-[ 31, 32) 1 1.0% 1.0%
-[ 32, 33) 0 0.0% 1.0%
-[ 33, 34) 0 0.0% 1.0%
-[ 34, 36) 0 0.0% 1.0%
-[ 36, 39) 0 0.0% 1.0%
-[ 39, 43) 1 1.0% 2.0%
-[ 43, 49) 8 8.0% 10.0% #
-[ 49, 57) 6 6.0% 16.0% #
-[ 57, 68) 17 17.0% 33.0% ##
-[ 68, 82) 26 26.0% 59.0% ###
-[ 82, 102) 14 14.0% 73.0% #
-[102, 129) 27 27.0% 100.0% ###
-[129, 165) 0 0.0% 100.0%
-[165, 214) 0 0.0% 100.0%
-[214, 281) 0 0.0% 100.0%
-[281, 371) 0 0.0% 100.0%
-[371, inf) 0 0.0% 100.0%
-Benchmark___10B_mux___1K_chunks___1KB-2 500 20596205 ns/op 0.00 MB/s
-Histogram (unit: ms)
-Count: 500 Min: 1 Max: 59 Avg: 20.11
-------------------------------------------------------------
-[ 1, 2) 60 12.0% 12.0% #
-[ 2, 3) 10 2.0% 14.0%
-[ 3, 4) 8 1.6% 15.6%
-[ 4, 6) 28 5.6% 21.2% #
-[ 6, 8) 18 3.6% 24.8%
-[ 8, 11) 33 6.6% 31.4% #
-[ 11, 16) 40 8.0% 39.4% #
-[ 16, 22) 58 11.6% 51.0% #
-[ 22, 30) 103 20.6% 71.6% ##
-[ 30, 41) 112 22.4% 94.0% ##
-[ 41, 55) 29 5.8% 99.8% #
-[ 55, 74) 1 0.2% 100.0%
-[ 74, 99) 0 0.0% 100.0%
-[ 99, 132) 0 0.0% 100.0%
-[132, 176) 0 0.0% 100.0%
-[176, 233) 0 0.0% 100.0%
-[233, inf) 0 0.0% 100.0%
-Benchmark__100B_mux__100_chunks___10B 2000 10355660 ns/op 0.02 MB/s
-Histogram (unit: ms)
-Count: 2000 Min: 3 Max: 21 Avg: 9.76
-------------------------------------------------------------
-[ 3, 4) 109 5.5% 5.5% #
-[ 4, 5) 23 1.2% 6.6%
-[ 5, 6) 5 0.2% 6.9%
-[ 6, 7) 1 0.1% 6.9%
-[ 7, 9) 187 9.3% 16.2% #
-[ 9, 11) 1358 67.9% 84.2% #######
-[ 11, 14) 34 1.7% 85.9%
-[ 14, 17) 59 3.0% 88.8%
-[ 17, 21) 221 11.1% 99.9% #
-[ 21, 26) 3 0.2% 100.0%
+[ 2, 3) 67 6.7% 6.7% #
+[ 3, 4) 62 6.2% 12.9% #
+[ 4, 5) 83 8.3% 21.2% #
+[ 5, 6) 85 8.5% 29.7% #
+[ 6, 7) 92 9.2% 38.9% #
+[ 7, 9) 150 15.0% 53.9% ##
+[ 9, 11) 144 14.4% 68.3% #
+[ 11, 14) 307 30.7% 99.0% ###
+[ 14, 17) 10 1.0% 100.0%
+[ 17, 21) 0 0.0% 100.0%
+[ 21, 26) 0 0.0% 100.0%
[ 26, 32) 0 0.0% 100.0%
-[ 32, 40) 0 0.0% 100.0%
-[ 40, 50) 0 0.0% 100.0%
-[ 50, 62) 0 0.0% 100.0%
-[ 62, 76) 0 0.0% 100.0%
-[ 76, 93) 0 0.0% 100.0%
-[ 93, inf) 0 0.0% 100.0%
-Benchmark__100B_mux__100_chunks___10B-2 5000 3570382 ns/op 0.06 MB/s
+[ 32, 39) 0 0.0% 100.0%
+[ 39, 48) 0 0.0% 100.0%
+[ 48, 58) 0 0.0% 100.0%
+[ 58, 70) 0 0.0% 100.0%
+[ 70, inf) 0 0.0% 100.0%
+Benchmark___10B_mux__100_chunks___1KB 300 22817830 ns/op 0.00 MB/s
Histogram (unit: ms)
-Count: 5000 Min: 1 Max: 14 Avg: 3.06
+Count: 300 Min: 6 Max: 28 Avg: 22.30
------------------------------------------------------------
-[ 1, 2) 505 10.1% 10.1% #
-[ 2, 3) 2329 46.6% 56.7% #####
-[ 3, 4) 1243 24.9% 81.5% ##
-[ 4, 5) 337 6.7% 88.3% #
-[ 5, 6) 81 1.6% 89.9%
-[ 6, 8) 92 1.8% 91.7%
-[ 8, 10) 183 3.7% 95.4%
-[ 10, 13) 210 4.2% 99.6%
-[ 13, 16) 20 0.4% 100.0%
-[ 16, 20) 0 0.0% 100.0%
+[ 6, 7) 15 5.0% 5.0% #
+[ 7, 8) 4 1.3% 6.3%
+[ 8, 9) 9 3.0% 9.3%
+[ 9, 10) 0 0.0% 9.3%
+[ 10, 12) 0 0.0% 9.3%
+[ 12, 14) 0 0.0% 9.3%
+[ 14, 17) 2 0.7% 10.0%
+[ 17, 21) 24 8.0% 18.0% #
+[ 21, 26) 207 69.0% 87.0% #######
+[ 26, 32) 39 13.0% 100.0% #
+[ 32, 39) 0 0.0% 100.0%
+[ 39, 48) 0 0.0% 100.0%
+[ 48, 59) 0 0.0% 100.0%
+[ 59, 73) 0 0.0% 100.0%
+[ 73, 90) 0 0.0% 100.0%
+[ 90, 111) 0 0.0% 100.0%
+[111, inf) 0 0.0% 100.0%
+Benchmark___10B_mux__100_chunks___1KB-2 1000 8831943 ns/op 0.00 MB/s
+Histogram (unit: ms)
+Count: 1000 Min: 1 Max: 17 Avg: 8.35
+------------------------------------------------------------
+[ 1, 2) 12 1.2% 1.2%
+[ 2, 3) 155 15.5% 16.7% ##
+[ 3, 4) 59 5.9% 22.6% #
+[ 4, 5) 48 4.8% 27.4%
+[ 5, 7) 134 13.4% 40.8% #
+[ 7, 9) 91 9.1% 49.9% #
+[ 9, 12) 132 13.2% 63.1% #
+[ 12, 15) 328 32.8% 95.9% ###
+[ 15, 19) 41 4.1% 100.0%
+[ 19, 24) 0 0.0% 100.0%
+[ 24, 30) 0 0.0% 100.0%
+[ 30, 37) 0 0.0% 100.0%
+[ 37, 46) 0 0.0% 100.0%
+[ 46, 57) 0 0.0% 100.0%
+[ 57, 70) 0 0.0% 100.0%
+[ 70, 86) 0 0.0% 100.0%
+[ 86, inf) 0 0.0% 100.0%
+Benchmark___10B_mux___1K_chunks___10B 100 123136622 ns/op 0.00 MB/s
+Histogram (unit: ms)
+Count: 100 Min: 5 Max: 173 Avg: 122.60
+------------------------------------------------------------
+[ 5, 6) 1 1.0% 1.0%
+[ 6, 7) 0 0.0% 1.0%
+[ 7, 8) 0 0.0% 1.0%
+[ 8, 10) 1 1.0% 2.0%
+[ 10, 13) 0 0.0% 2.0%
+[ 13, 18) 1 1.0% 3.0%
+[ 18, 25) 0 0.0% 3.0%
+[ 25, 35) 1 1.0% 4.0%
+[ 35, 50) 2 2.0% 6.0%
+[ 50, 71) 11 11.0% 17.0% #
+[ 71, 101) 22 22.0% 39.0% ##
+[101, 143) 14 14.0% 53.0% #
+[143, 203) 47 47.0% 100.0% #####
+[203, 287) 0 0.0% 100.0%
+[287, 406) 0 0.0% 100.0%
+[406, 574) 0 0.0% 100.0%
+[574, inf) 0 0.0% 100.0%
+Benchmark___10B_mux___1K_chunks___10B-2 300 22274569 ns/op 0.00 MB/s
+Histogram (unit: ms)
+Count: 300 Min: 2 Max: 96 Avg: 21.75
+------------------------------------------------------------
+[ 2, 3) 8 2.7% 2.7%
+[ 3, 4) 23 7.7% 10.3% #
+[ 4, 5) 31 10.3% 20.7% #
+[ 5, 7) 47 15.7% 36.3% ##
+[ 7, 10) 74 24.7% 61.0% ##
+[ 10, 14) 33 11.0% 72.0% #
+[ 14, 20) 12 4.0% 76.0%
+[ 20, 28) 7 2.3% 78.3%
+[ 28, 39) 1 0.3% 78.7%
+[ 39, 54) 4 1.3% 80.0%
+[ 54, 74) 20 6.7% 86.7% #
+[ 74, 101) 40 13.3% 100.0% #
+[101, 138) 0 0.0% 100.0%
+[138, 189) 0 0.0% 100.0%
+[189, 258) 0 0.0% 100.0%
+[258, 352) 0 0.0% 100.0%
+[352, inf) 0 0.0% 100.0%
+Benchmark___10B_mux___1K_chunks__100B 100 143814971 ns/op 0.00 MB/s
+Histogram (unit: ms)
+Count: 100 Min: 14 Max: 204 Avg: 143.32
+------------------------------------------------------------
+[ 14, 15) 1 1.0% 1.0%
+[ 15, 16) 0 0.0% 1.0%
+[ 16, 18) 0 0.0% 1.0%
+[ 18, 20) 0 0.0% 1.0%
+[ 20, 24) 0 0.0% 1.0%
+[ 24, 29) 0 0.0% 1.0%
+[ 29, 37) 0 0.0% 1.0%
+[ 37, 48) 0 0.0% 1.0%
+[ 48, 64) 11 11.0% 12.0% #
+[ 64, 87) 15 15.0% 27.0% ##
+[ 87, 120) 2 2.0% 29.0%
+[120, 166) 26 26.0% 55.0% ###
+[166, 232) 45 45.0% 100.0% #####
+[232, 326) 0 0.0% 100.0%
+[326, 459) 0 0.0% 100.0%
+[459, 649) 0 0.0% 100.0%
+[649, inf) 0 0.0% 100.0%
+Benchmark___10B_mux___1K_chunks__100B-2 200 34125016 ns/op 0.00 MB/s
+Histogram (unit: ms)
+Count: 200 Min: 2 Max: 114 Avg: 33.62
+------------------------------------------------------------
+[ 2, 3) 10 5.0% 5.0% #
+[ 3, 4) 6 3.0% 8.0%
+[ 4, 5) 10 5.0% 13.0% #
+[ 5, 7) 21 10.5% 23.5% #
+[ 7, 10) 26 13.0% 36.5% #
+[ 10, 14) 34 17.0% 53.5% ##
+[ 14, 20) 27 13.5% 67.0% #
+[ 20, 29) 7 3.5% 70.5%
+[ 29, 41) 1 0.5% 71.0%
+[ 41, 57) 2 1.0% 72.0%
+[ 57, 80) 7 3.5% 75.5%
+[ 80, 111) 45 22.5% 98.0% ##
+[111, 154) 4 2.0% 100.0%
+[154, 213) 0 0.0% 100.0%
+[213, 294) 0 0.0% 100.0%
+[294, 405) 0 0.0% 100.0%
+[405, inf) 0 0.0% 100.0%
+Benchmark___10B_mux___1K_chunks___1KB 100 136987808 ns/op 0.00 MB/s
+Histogram (unit: ms)
+Count: 100 Min: 5 Max: 233 Avg: 136.46
+------------------------------------------------------------
+[ 5, 6) 1 1.0% 1.0%
+[ 6, 7) 0 0.0% 1.0%
+[ 7, 9) 1 1.0% 2.0%
+[ 9, 11) 1 1.0% 3.0%
+[ 11, 15) 1 1.0% 4.0%
+[ 15, 21) 3 3.0% 7.0%
+[ 21, 29) 0 0.0% 7.0%
+[ 29, 41) 0 0.0% 7.0%
+[ 41, 59) 3 3.0% 10.0%
+[ 59, 84) 11 11.0% 21.0% #
+[ 84, 121) 24 24.0% 45.0% ##
+[121, 174) 25 25.0% 70.0% ###
+[174, 250) 30 30.0% 100.0% ###
+[250, 360) 0 0.0% 100.0%
+[360, 518) 0 0.0% 100.0%
+[518, 746) 0 0.0% 100.0%
+[746, inf) 0 0.0% 100.0%
+Benchmark___10B_mux___1K_chunks___1KB-2 200 35831221 ns/op 0.00 MB/s
+Histogram (unit: ms)
+Count: 200 Min: 2 Max: 123 Avg: 35.40
+------------------------------------------------------------
+[ 2, 3) 21 10.5% 10.5% #
+[ 3, 4) 12 6.0% 16.5% #
+[ 4, 5) 4 2.0% 18.5%
+[ 5, 7) 8 4.0% 22.5%
+[ 7, 10) 18 9.0% 31.5% #
+[ 10, 14) 21 10.5% 42.0% #
+[ 14, 20) 21 10.5% 52.5% #
+[ 20, 29) 7 3.5% 56.0%
+[ 29, 41) 11 5.5% 61.5% #
+[ 41, 58) 23 11.5% 73.0% #
+[ 58, 82) 28 14.0% 87.0% #
+[ 82, 115) 25 12.5% 99.5% #
+[115, 161) 1 0.5% 100.0%
+[161, 224) 0 0.0% 100.0%
+[224, 311) 0 0.0% 100.0%
+[311, 432) 0 0.0% 100.0%
+[432, inf) 0 0.0% 100.0%
+Benchmark__100B_mux__100_chunks___10B 500 20748811 ns/op 0.01 MB/s
+Histogram (unit: ms)
+Count: 500 Min: 6 Max: 27 Avg: 20.33
+------------------------------------------------------------
+[ 6, 7) 1 0.2% 0.2%
+[ 7, 8) 16 3.2% 3.4%
+[ 8, 9) 3 0.6% 4.0%
+[ 9, 10) 6 1.2% 5.2%
+[ 10, 12) 4 0.8% 6.0%
+[ 12, 14) 0 0.0% 6.0%
+[ 14, 17) 7 1.4% 7.4%
+[ 17, 21) 181 36.2% 43.6% ####
+[ 21, 26) 278 55.6% 99.2% ######
+[ 26, 32) 4 0.8% 100.0%
+[ 32, 39) 0 0.0% 100.0%
+[ 39, 48) 0 0.0% 100.0%
+[ 48, 59) 0 0.0% 100.0%
+[ 59, 72) 0 0.0% 100.0%
+[ 72, 89) 0 0.0% 100.0%
+[ 89, 109) 0 0.0% 100.0%
+[109, inf) 0 0.0% 100.0%
+Benchmark__100B_mux__100_chunks___10B-2 1000 7604070 ns/op 0.03 MB/s
+Histogram (unit: ms)
+Count: 1000 Min: 2 Max: 15 Avg: 7.10
+------------------------------------------------------------
+[ 2, 3) 49 4.9% 4.9%
+[ 3, 4) 90 9.0% 13.9% #
+[ 4, 5) 124 12.4% 26.3% #
+[ 5, 6) 117 11.7% 38.0% #
+[ 6, 7) 100 10.0% 48.0% #
+[ 7, 9) 185 18.5% 66.5% ##
+[ 9, 11) 169 16.9% 83.4% ##
+[ 11, 14) 141 14.1% 97.5% #
+[ 14, 17) 25 2.5% 100.0%
+[ 17, 21) 0 0.0% 100.0%
+[ 21, 26) 0 0.0% 100.0%
+[ 26, 32) 0 0.0% 100.0%
+[ 32, 39) 0 0.0% 100.0%
+[ 39, 48) 0 0.0% 100.0%
+[ 48, 58) 0 0.0% 100.0%
+[ 58, 70) 0 0.0% 100.0%
+[ 70, inf) 0 0.0% 100.0%
+Benchmark__100B_mux__100_chunks__100B 300 21922577 ns/op 0.01 MB/s
+Histogram (unit: ms)
+Count: 300 Min: 6 Max: 30 Avg: 21.45
+------------------------------------------------------------
+[ 6, 7) 17 5.7% 5.7% #
+[ 7, 8) 2 0.7% 6.3%
+[ 8, 9) 4 1.3% 7.7%
+[ 9, 10) 0 0.0% 7.7%
+[ 10, 12) 9 3.0% 10.7%
+[ 12, 14) 2 0.7% 11.3%
+[ 14, 17) 1 0.3% 11.7%
+[ 17, 21) 26 8.7% 20.3% #
+[ 21, 26) 144 48.0% 68.3% #####
+[ 26, 32) 95 31.7% 100.0% ###
+[ 32, 40) 0 0.0% 100.0%
+[ 40, 50) 0 0.0% 100.0%
+[ 50, 62) 0 0.0% 100.0%
+[ 62, 77) 0 0.0% 100.0%
+[ 77, 96) 0 0.0% 100.0%
+[ 96, 120) 0 0.0% 100.0%
+[120, inf) 0 0.0% 100.0%
+Benchmark__100B_mux__100_chunks__100B-2 1000 9164254 ns/op 0.02 MB/s
+Histogram (unit: ms)
+Count: 1000 Min: 2 Max: 18 Avg: 8.66
+------------------------------------------------------------
+[ 2, 3) 35 3.5% 3.5%
+[ 3, 4) 44 4.4% 7.9%
+[ 4, 5) 78 7.8% 15.7% #
+[ 5, 6) 102 10.2% 25.9% #
+[ 6, 8) 168 16.8% 42.7% ##
+[ 8, 10) 155 15.5% 58.2% ##
+[ 10, 13) 236 23.6% 81.8% ##
+[ 13, 16) 137 13.7% 95.5% #
+[ 16, 20) 45 4.5% 100.0%
[ 20, 25) 0 0.0% 100.0%
[ 25, 31) 0 0.0% 100.0%
[ 31, 38) 0 0.0% 100.0%
[ 38, 47) 0 0.0% 100.0%
-[ 47, 57) 0 0.0% 100.0%
-[ 57, 69) 0 0.0% 100.0%
-[ 69, inf) 0 0.0% 100.0%
-Benchmark__100B_mux__100_chunks__100B 1000 12339288 ns/op 0.02 MB/s
+[ 47, 58) 0 0.0% 100.0%
+[ 58, 71) 0 0.0% 100.0%
+[ 71, 87) 0 0.0% 100.0%
+[ 87, inf) 0 0.0% 100.0%
+Benchmark__100B_mux__100_chunks___1KB 300 23892634 ns/op 0.01 MB/s
Histogram (unit: ms)
-Count: 1000 Min: 3 Max: 29 Avg: 11.94
+Count: 300 Min: 6 Max: 31 Avg: 23.41
------------------------------------------------------------
-[ 3, 4) 4 0.4% 0.4%
-[ 4, 5) 64 6.4% 6.8% #
-[ 5, 6) 6 0.6% 7.4%
-[ 6, 7) 0 0.0% 7.4%
-[ 7, 9) 4 0.4% 7.8%
-[ 9, 11) 197 19.7% 27.5% ##
-[ 11, 14) 596 59.6% 87.1% ######
-[ 14, 18) 6 0.6% 87.7%
-[ 18, 23) 14 1.4% 89.1%
-[ 23, 30) 109 10.9% 100.0% #
+[ 6, 7) 12 4.0% 4.0%
+[ 7, 8) 9 3.0% 7.0%
+[ 8, 9) 5 1.7% 8.7%
+[ 9, 10) 1 0.3% 9.0%
+[ 10, 12) 1 0.3% 9.3%
+[ 12, 14) 2 0.7% 10.0%
+[ 14, 17) 1 0.3% 10.3%
+[ 17, 21) 10 3.3% 13.7%
+[ 21, 26) 122 40.7% 54.3% ####
+[ 26, 32) 137 45.7% 100.0% #####
+[ 32, 40) 0 0.0% 100.0%
+[ 40, 50) 0 0.0% 100.0%
+[ 50, 63) 0 0.0% 100.0%
+[ 63, 79) 0 0.0% 100.0%
+[ 79, 99) 0 0.0% 100.0%
+[ 99, 123) 0 0.0% 100.0%
+[123, inf) 0 0.0% 100.0%
+Benchmark__100B_mux__100_chunks___1KB-2 1000 9288578 ns/op 0.02 MB/s
+Histogram (unit: ms)
+Count: 1000 Min: 1 Max: 19 Avg: 8.80
+------------------------------------------------------------
+[ 1, 2) 6 0.6% 0.6%
+[ 2, 3) 158 15.8% 16.4% ##
+[ 3, 4) 70 7.0% 23.4% #
+[ 4, 5) 54 5.4% 28.8% #
+[ 5, 7) 110 11.0% 39.8% #
+[ 7, 9) 83 8.3% 48.1% #
+[ 9, 12) 183 18.3% 66.4% ##
+[ 12, 15) 142 14.2% 80.6% #
+[ 15, 19) 193 19.3% 99.9% ##
+[ 19, 24) 1 0.1% 100.0%
+[ 24, 30) 0 0.0% 100.0%
[ 30, 38) 0 0.0% 100.0%
[ 38, 48) 0 0.0% 100.0%
-[ 48, 61) 0 0.0% 100.0%
-[ 61, 77) 0 0.0% 100.0%
-[ 77, 97) 0 0.0% 100.0%
-[ 97, 122) 0 0.0% 100.0%
-[122, inf) 0 0.0% 100.0%
-Benchmark__100B_mux__100_chunks__100B-2 2000 5116350 ns/op 0.04 MB/s
+[ 48, 60) 0 0.0% 100.0%
+[ 60, 74) 0 0.0% 100.0%
+[ 74, 91) 0 0.0% 100.0%
+[ 91, inf) 0 0.0% 100.0%
+Benchmark__100B_mux___1K_chunks___10B 100 120357166 ns/op 0.00 MB/s
Histogram (unit: ms)
-Count: 2000 Min: 1 Max: 16 Avg: 4.61
+Count: 100 Min: 4 Max: 186 Avg: 119.88
------------------------------------------------------------
-[ 1, 2) 71 3.6% 3.6%
-[ 2, 3) 252 12.6% 16.2% #
-[ 3, 4) 497 24.9% 41.0% ##
-[ 4, 5) 468 23.4% 64.4% ##
-[ 5, 7) 512 25.6% 90.0% ###
-[ 7, 9) 24 1.2% 91.2%
-[ 9, 11) 30 1.5% 92.7%
-[ 11, 14) 66 3.3% 96.0%
-[ 14, 18) 80 4.0% 100.0%
-[ 18, 23) 0 0.0% 100.0%
-[ 23, 29) 0 0.0% 100.0%
-[ 29, 36) 0 0.0% 100.0%
-[ 36, 44) 0 0.0% 100.0%
-[ 44, 54) 0 0.0% 100.0%
-[ 54, 66) 0 0.0% 100.0%
-[ 66, 80) 0 0.0% 100.0%
-[ 80, inf) 0 0.0% 100.0%
-Benchmark__100B_mux__100_chunks___1KB 1000 14696248 ns/op 0.01 MB/s
+[ 4, 5) 1 1.0% 1.0%
+[ 5, 6) 0 0.0% 1.0%
+[ 6, 8) 0 0.0% 1.0%
+[ 8, 10) 0 0.0% 1.0%
+[ 10, 14) 0 0.0% 1.0%
+[ 14, 19) 1 1.0% 2.0%
+[ 19, 27) 0 0.0% 2.0%
+[ 27, 38) 0 0.0% 2.0%
+[ 38, 54) 3 3.0% 5.0%
+[ 54, 76) 22 22.0% 27.0% ##
+[ 76, 108) 16 16.0% 43.0% ##
+[108, 153) 18 18.0% 61.0% ##
+[153, 217) 39 39.0% 100.0% ####
+[217, 307) 0 0.0% 100.0%
+[307, 435) 0 0.0% 100.0%
+[435, 616) 0 0.0% 100.0%
+[616, inf) 0 0.0% 100.0%
+Benchmark__100B_mux___1K_chunks___10B-2 300 23110788 ns/op 0.01 MB/s
Histogram (unit: ms)
-Count: 1000 Min: 3 Max: 32 Avg: 14.10
+Count: 300 Min: 2 Max: 97 Avg: 22.60
------------------------------------------------------------
-[ 3, 4) 18 1.8% 1.8%
-[ 4, 5) 39 3.9% 5.7%
-[ 5, 6) 6 0.6% 6.3%
-[ 6, 7) 1 0.1% 6.4%
-[ 7, 9) 1 0.1% 6.5%
-[ 9, 12) 112 11.2% 17.7% #
-[ 12, 15) 643 64.3% 82.0% ######
-[ 15, 19) 13 1.3% 83.3%
-[ 19, 25) 10 1.0% 84.3%
-[ 25, 32) 155 15.5% 99.8% ##
-[ 32, 41) 2 0.2% 100.0%
-[ 41, 52) 0 0.0% 100.0%
-[ 52, 66) 0 0.0% 100.0%
-[ 66, 84) 0 0.0% 100.0%
-[ 84, 107) 0 0.0% 100.0%
-[107, 135) 0 0.0% 100.0%
-[135, inf) 0 0.0% 100.0%
-Benchmark__100B_mux__100_chunks___1KB-2 2000 5375339 ns/op 0.04 MB/s
-Histogram (unit: us)
-Count: 2000 Min: 990 Max: 20242 Avg: 5374.31
-------------------------------------------------------------
-[ 990, 991) 1 0.1% 0.1%
-[ 991, 992) 0 0.0% 0.1%
-[ 992, 995) 0 0.0% 0.1%
-[ 995, 1002) 0 0.0% 0.1%
-[ 1002, 1015) 0 0.0% 0.1%
-[ 1015, 1041) 2 0.1% 0.2%
-[ 1041, 1092) 5 0.2% 0.4%
-[ 1092, 1191) 72 3.6% 4.0%
-[ 1191, 1383) 215 10.8% 14.8% #
-[ 1383, 1755) 108 5.4% 20.2% #
-[ 1755, 2473) 117 5.9% 26.0% #
-[ 2473, 3859) 280 14.0% 40.0% #
-[ 3859, 6535) 609 30.5% 70.5% ###
-[ 6535, 11701) 392 19.6% 90.1% ##
-[11701, 21674) 199 10.0% 100.0% #
-[21674, 40926) 0 0.0% 100.0%
-[40926, inf) 0 0.0% 100.0%
-Benchmark__100B_mux___1K_chunks___10B 100 70735100 ns/op 0.00 MB/s
-Histogram (unit: ms)
-Count: 100 Min: 9 Max: 102 Avg: 70.26
-------------------------------------------------------------
-[ 9, 10) 1 1.0% 1.0%
-[ 10, 11) 0 0.0% 1.0%
-[ 11, 12) 0 0.0% 1.0%
-[ 12, 14) 0 0.0% 1.0%
-[ 14, 17) 0 0.0% 1.0%
-[ 17, 21) 2 2.0% 3.0%
-[ 21, 27) 1 1.0% 4.0%
-[ 27, 35) 2 2.0% 6.0%
-[ 35, 46) 12 12.0% 18.0% #
-[ 46, 61) 12 12.0% 30.0% #
-[ 61, 81) 39 39.0% 69.0% ####
-[ 81, 108) 31 31.0% 100.0% ###
-[108, 145) 0 0.0% 100.0%
-[145, 195) 0 0.0% 100.0%
-[195, 263) 0 0.0% 100.0%
-[263, 355) 0 0.0% 100.0%
+[ 2, 3) 7 2.3% 2.3%
+[ 3, 4) 26 8.7% 11.0% #
+[ 4, 5) 33 11.0% 22.0% #
+[ 5, 7) 45 15.0% 37.0% ##
+[ 7, 10) 46 15.3% 52.3% ##
+[ 10, 14) 48 16.0% 68.3% ##
+[ 14, 20) 19 6.3% 74.7% #
+[ 20, 28) 8 2.7% 77.3%
+[ 28, 39) 3 1.0% 78.3%
+[ 39, 54) 2 0.7% 79.0%
+[ 54, 74) 32 10.7% 89.7% #
+[ 74, 102) 31 10.3% 100.0% #
+[102, 140) 0 0.0% 100.0%
+[140, 191) 0 0.0% 100.0%
+[191, 261) 0 0.0% 100.0%
+[261, 355) 0 0.0% 100.0%
[355, inf) 0 0.0% 100.0%
-Benchmark__100B_mux___1K_chunks___10B-2 500 17267283 ns/op 0.01 MB/s
+Benchmark__100B_mux___1K_chunks__100B 100 146211502 ns/op 0.00 MB/s
Histogram (unit: ms)
-Count: 500 Min: 1 Max: 49 Avg: 16.74
+Count: 100 Min: 11 Max: 220 Avg: 145.68
------------------------------------------------------------
-[ 1, 2) 8 1.6% 1.6%
-[ 2, 3) 40 8.0% 9.6% #
-[ 3, 4) 33 6.6% 16.2% #
-[ 4, 6) 56 11.2% 27.4% #
-[ 6, 8) 33 6.6% 34.0% #
-[ 8, 11) 44 8.8% 42.8% #
-[ 11, 15) 42 8.4% 51.2% #
-[ 15, 21) 57 11.4% 62.6% #
-[ 21, 28) 79 15.8% 78.4% ##
-[ 28, 38) 67 13.4% 91.8% #
-[ 38, 51) 41 8.2% 100.0% #
-[ 51, 68) 0 0.0% 100.0%
-[ 68, 90) 0 0.0% 100.0%
-[ 90, 118) 0 0.0% 100.0%
-[118, 155) 0 0.0% 100.0%
-[155, 202) 0 0.0% 100.0%
-[202, inf) 0 0.0% 100.0%
-Benchmark__100B_mux___1K_chunks__100B 100 72232967 ns/op 0.00 MB/s
+[ 11, 12) 1 1.0% 1.0%
+[ 12, 13) 1 1.0% 2.0%
+[ 13, 15) 0 0.0% 2.0%
+[ 15, 17) 0 0.0% 2.0%
+[ 17, 21) 0 0.0% 2.0%
+[ 21, 26) 0 0.0% 2.0%
+[ 26, 34) 1 1.0% 3.0%
+[ 34, 46) 1 1.0% 4.0%
+[ 46, 63) 10 10.0% 14.0% #
+[ 63, 87) 12 12.0% 26.0% #
+[ 87, 122) 9 9.0% 35.0% #
+[122, 172) 19 19.0% 54.0% ##
+[172, 243) 46 46.0% 100.0% #####
+[243, 345) 0 0.0% 100.0%
+[345, 491) 0 0.0% 100.0%
+[491, 700) 0 0.0% 100.0%
+[700, inf) 0 0.0% 100.0%
+Benchmark__100B_mux___1K_chunks__100B-2 200 36485527 ns/op 0.01 MB/s
Histogram (unit: ms)
-Count: 100 Min: 18 Max: 107 Avg: 71.73
+Count: 200 Min: 2 Max: 114 Avg: 36.01
------------------------------------------------------------
-[ 18, 19) 1 1.0% 1.0%
-[ 19, 20) 0 0.0% 1.0%
-[ 20, 21) 0 0.0% 1.0%
-[ 21, 23) 0 0.0% 1.0%
-[ 23, 26) 0 0.0% 1.0%
-[ 26, 30) 0 0.0% 1.0%
-[ 30, 36) 2 2.0% 3.0%
-[ 36, 44) 6 6.0% 9.0% #
-[ 44, 54) 15 15.0% 24.0% ##
-[ 54, 68) 16 16.0% 40.0% ##
-[ 68, 87) 30 30.0% 70.0% ###
-[ 87, 113) 30 30.0% 100.0% ###
-[113, 149) 0 0.0% 100.0%
-[149, 197) 0 0.0% 100.0%
-[197, 262) 0 0.0% 100.0%
-[262, 350) 0 0.0% 100.0%
-[350, inf) 0 0.0% 100.0%
-Benchmark__100B_mux___1K_chunks__100B-2 500 25789652 ns/op 0.01 MB/s
+[ 2, 3) 12 6.0% 6.0% #
+[ 3, 4) 7 3.5% 9.5%
+[ 4, 5) 3 1.5% 11.0%
+[ 5, 7) 17 8.5% 19.5% #
+[ 7, 10) 28 14.0% 33.5% #
+[ 10, 14) 29 14.5% 48.0% #
+[ 14, 20) 25 12.5% 60.5% #
+[ 20, 29) 13 6.5% 67.0% #
+[ 29, 41) 5 2.5% 69.5%
+[ 41, 57) 0 0.0% 69.5%
+[ 57, 80) 6 3.0% 72.5%
+[ 80, 111) 53 26.5% 99.0% ###
+[111, 154) 2 1.0% 100.0%
+[154, 213) 0 0.0% 100.0%
+[213, 294) 0 0.0% 100.0%
+[294, 405) 0 0.0% 100.0%
+[405, inf) 0 0.0% 100.0%
+Benchmark__100B_mux___1K_chunks___1KB 100 145242261 ns/op 0.00 MB/s
Histogram (unit: ms)
-Count: 500 Min: 1 Max: 63 Avg: 25.29
+Count: 100 Min: 7 Max: 235 Avg: 144.71
------------------------------------------------------------
-[ 1, 2) 12 2.4% 2.4%
-[ 2, 3) 18 3.6% 6.0%
-[ 3, 4) 26 5.2% 11.2% #
-[ 4, 6) 42 8.4% 19.6% #
-[ 6, 9) 52 10.4% 30.0% #
-[ 9, 12) 38 7.6% 37.6% #
-[ 12, 17) 32 6.4% 44.0% #
-[ 17, 23) 28 5.6% 49.6% #
-[ 23, 32) 45 9.0% 58.6% #
-[ 32, 43) 90 18.0% 76.6% ##
-[ 43, 58) 101 20.2% 96.8% ##
-[ 58, 78) 16 3.2% 100.0%
-[ 78, 105) 0 0.0% 100.0%
-[105, 140) 0 0.0% 100.0%
-[140, 187) 0 0.0% 100.0%
-[187, 249) 0 0.0% 100.0%
-[249, inf) 0 0.0% 100.0%
-Benchmark__100B_mux___1K_chunks___1KB 100 87959533 ns/op 0.00 MB/s
+[ 7, 8) 1 1.0% 1.0%
+[ 8, 9) 2 2.0% 3.0%
+[ 9, 11) 1 1.0% 4.0%
+[ 11, 13) 1 1.0% 5.0%
+[ 13, 17) 0 0.0% 5.0%
+[ 17, 23) 2 2.0% 7.0%
+[ 23, 31) 1 1.0% 8.0%
+[ 31, 43) 0 0.0% 8.0%
+[ 43, 61) 1 1.0% 9.0%
+[ 61, 86) 10 10.0% 19.0% #
+[ 86, 123) 24 24.0% 43.0% ##
+[123, 176) 24 24.0% 67.0% ##
+[176, 252) 33 33.0% 100.0% ###
+[252, 362) 0 0.0% 100.0%
+[362, 520) 0 0.0% 100.0%
+[520, 748) 0 0.0% 100.0%
+[748, inf) 0 0.0% 100.0%
+Benchmark__100B_mux___1K_chunks___1KB-2 200 37420006 ns/op 0.01 MB/s
Histogram (unit: ms)
-Count: 100 Min: 35 Max: 144 Avg: 87.48
+Count: 200 Min: 2 Max: 125 Avg: 36.95
------------------------------------------------------------
-[ 35, 36) 1 1.0% 1.0%
-[ 36, 37) 3 3.0% 4.0%
-[ 37, 38) 1 1.0% 5.0%
-[ 38, 40) 0 0.0% 5.0%
-[ 40, 43) 1 1.0% 6.0%
-[ 43, 47) 0 0.0% 6.0%
-[ 47, 53) 0 0.0% 6.0%
-[ 53, 61) 7 7.0% 13.0% #
-[ 61, 73) 22 22.0% 35.0% ##
-[ 73, 89) 19 19.0% 54.0% ##
-[ 89, 111) 14 14.0% 68.0% #
-[111, 142) 31 31.0% 99.0% ###
-[142, 184) 1 1.0% 100.0%
-[184, 242) 0 0.0% 100.0%
-[242, 321) 0 0.0% 100.0%
-[321, 430) 0 0.0% 100.0%
-[430, inf) 0 0.0% 100.0%
-Benchmark__100B_mux___1K_chunks___1KB-2 500 22515508 ns/op 0.01 MB/s
-Histogram (unit: ms)
-Count: 500 Min: 1 Max: 58 Avg: 22.02
-------------------------------------------------------------
-[ 1, 2) 71 14.2% 14.2% #
-[ 2, 3) 12 2.4% 16.6%
-[ 3, 4) 11 2.2% 18.8%
-[ 4, 6) 27 5.4% 24.2% #
-[ 6, 8) 14 2.8% 27.0%
-[ 8, 11) 23 4.6% 31.6%
-[ 11, 16) 31 6.2% 37.8% #
-[ 16, 22) 57 11.4% 49.2% #
-[ 22, 30) 85 17.0% 66.2% ##
-[ 30, 41) 92 18.4% 84.6% ##
-[ 41, 55) 68 13.6% 98.2% #
-[ 55, 74) 9 1.8% 100.0%
-[ 74, 99) 0 0.0% 100.0%
-[ 99, 132) 0 0.0% 100.0%
-[132, 175) 0 0.0% 100.0%
-[175, 232) 0 0.0% 100.0%
-[232, inf) 0 0.0% 100.0%
+[ 2, 3) 37 18.5% 18.5% ##
+[ 3, 4) 6 3.0% 21.5%
+[ 4, 5) 2 1.0% 22.5%
+[ 5, 7) 16 8.0% 30.5% #
+[ 7, 10) 8 4.0% 34.5%
+[ 10, 14) 16 8.0% 42.5% #
+[ 14, 20) 14 7.0% 49.5% #
+[ 20, 29) 12 6.0% 55.5% #
+[ 29, 42) 13 6.5% 62.0% #
+[ 42, 59) 20 10.0% 72.0% #
+[ 59, 83) 22 11.0% 83.0% #
+[ 83, 117) 30 15.0% 98.0% ##
+[117, 163) 4 2.0% 100.0%
+[163, 227) 0 0.0% 100.0%
+[227, 316) 0 0.0% 100.0%
+[316, 438) 0 0.0% 100.0%
+[438, inf) 0 0.0% 100.0%
diff --git a/runtimes/google/ipc/benchmarks/bm/main.go b/runtimes/google/ipc/benchmarks/bm/main.go
index c769a7d..d28cc33 100644
--- a/runtimes/google/ipc/benchmarks/bm/main.go
+++ b/runtimes/google/ipc/benchmarks/bm/main.go
@@ -176,6 +176,8 @@
var stop func()
address, stop = benchmarks.StartServer(vrt, profiles.LocalListenSpec)
+ benchmarks.CallEcho(&testing.B{}, vrt.NewContext(), address, 1, 0, nil) // Create VC.
+
runBenchmarkEcho()
runBenchmarkEchoStream()
runBenchmarkEchoStreamPerChunk()
diff --git a/runtimes/google/ipc/benchmarks/bmclient/main.go b/runtimes/google/ipc/benchmarks/bmclient/main.go
index 5ad7c0f..c213ad4 100644
--- a/runtimes/google/ipc/benchmarks/bmclient/main.go
+++ b/runtimes/google/ipc/benchmarks/bmclient/main.go
@@ -1,33 +1,59 @@
-// a simple command-line tool to run the benchmark client.
+// A simple command-line tool to run the benchmark client.
package main
import (
"flag"
+ "fmt"
+ "os"
+ "testing"
+ "time"
"veyron.io/veyron/veyron2/rt"
+ "veyron.io/veyron/veyron2/vlog"
+
+ "veyron.io/veyron/veyron/lib/testutil"
+ _ "veyron.io/veyron/veyron/profiles"
+ "veyron.io/veyron/veyron/runtimes/google/ipc/benchmarks"
)
var (
- server = flag.String("server", "", "object name of the server to connect to")
- count = flag.Int("count", 1, "number of RPCs to send")
- chunkCount = flag.Int("chunk_count", 0, "number of stream chunks to send")
- payloadSize = flag.Int("payload_size", 32, "the size of the payload")
+ server = flag.String("server", "", "address of the server to connect to")
+
+ iterations = flag.Int("iterations", 100, "number of iterations to run")
+
+ chunkCnt = flag.Int("chunk_count", 0, "number of chunks to send per streaming RPC (if zero, use non-streaming RPC)")
+ payloadSize = flag.Int("payload_size", 0, "size of payload in bytes")
+ chunkCntMux = flag.Int("mux_chunk_count", 0, "number of chunks to send in background")
+ payloadSizeMux = flag.Int("mux_payload_size", 0, "size of payload to send in background")
)
func main() {
- runtime, err := rt.New()
+ vrt, err := rt.New()
if err != nil {
- panic(err)
+ vlog.Fatalf("Could not initialize runtime: %s", err)
}
- defer runtime.Cleanup()
+ defer vrt.Cleanup()
- // TODO(jhahn): Fix this.
- /*
- ctx := runtime.NewContext()
- if *chunkCount == 0 {
- benchmarks.CallEcho(ctx, *server, *count, *payloadSize, os.Stdout)
- } else {
- benchmarks.CallEchoStream(runtime, *server, *count, *chunkCount, *payloadSize, os.Stdout)
- }
- */
+ if *chunkCntMux > 0 && *payloadSizeMux > 0 {
+ dummyB := testing.B{}
+ _, stop := benchmarks.StartEchoStream(&dummyB, vrt.NewContext(), *server, 0, *chunkCntMux, *payloadSizeMux, nil)
+ defer stop()
+ vlog.Infof("Started background streaming (chunk_size=%d, payload_size=%d)", *chunkCntMux, *payloadSizeMux)
+ }
+
+ dummyB := testing.B{}
+ stats := testutil.NewBenchStats(16)
+
+ now := time.Now()
+ ctx := vrt.NewContext()
+ if *chunkCnt == 0 {
+ benchmarks.CallEcho(&dummyB, ctx, *server, *iterations, *payloadSize, stats)
+ } else {
+ benchmarks.CallEchoStream(&dummyB, ctx, *server, *iterations, *chunkCnt, *payloadSize, stats)
+ }
+ elapsed := time.Since(now)
+
+ fmt.Printf("iterations: %d chunk_count: %d payload_size: %d\n", *iterations, *chunkCnt, *payloadSize)
+ fmt.Printf("elapsed time: %v\n", elapsed)
+ stats.Print(os.Stdout)
}
diff --git a/runtimes/google/ipc/benchmarks/bmserver/main.go b/runtimes/google/ipc/benchmarks/bmserver/main.go
index b9c3c05..ea3ba2e 100644
--- a/runtimes/google/ipc/benchmarks/bmserver/main.go
+++ b/runtimes/google/ipc/benchmarks/bmserver/main.go
@@ -1,4 +1,4 @@
-// a simple command-line tool to run the benchmark server.
+// A simple command-line tool to run the benchmark server.
package main
import (
@@ -11,14 +11,14 @@
)
func main() {
- r, err := rt.New()
+ vrt, err := rt.New()
if err != nil {
vlog.Fatalf("Could not initialize runtime: %s", err)
}
- defer r.Cleanup()
+ defer vrt.Cleanup()
- addr, stop := benchmarks.StartServer(r, roaming.ListenSpec)
+ addr, stop := benchmarks.StartServer(vrt, roaming.ListenSpec)
vlog.Infof("Listening on %s", addr)
defer stop()
- <-signals.ShutdownOnSignals(r)
+ <-signals.ShutdownOnSignals(vrt)
}
diff --git a/runtimes/google/ipc/benchmarks/client.go b/runtimes/google/ipc/benchmarks/client.go
index bad7225..3e5399e 100644
--- a/runtimes/google/ipc/benchmarks/client.go
+++ b/runtimes/google/ipc/benchmarks/client.go
@@ -16,11 +16,6 @@
// size, and optionally updates the stats.
func CallEcho(b *testing.B, ctx context.T, address string, iterations, payloadSize int, stats *testutil.BenchStats) {
stub := BenchmarkClient(address)
- _, err := stub.Echo(ctx, make([]byte, 0)) // Create VC.
- if err != nil {
- vlog.Fatalf("Echo failed: %v", err)
- }
-
payload := make([]byte, payloadSize)
for i := range payload {
payload[i] = byte(i & 0xff)
@@ -71,11 +66,6 @@
// Optionally updates the stats. Zero 'iterations' means unlimited.
func StartEchoStream(b *testing.B, ctx context.T, address string, iterations, chunkCnt, payloadSize int, stats *testutil.BenchStats) (<-chan int, func()) {
stub := BenchmarkClient(address)
- _, err := stub.Echo(ctx, make([]byte, 0)) // Create VC.
- if err != nil {
- vlog.Fatalf("Echo failed: %v", err)
- }
-
payload := make([]byte, payloadSize)
for i := range payload {
payload[i] = byte(i & 0xff)
diff --git a/runtimes/google/ipc/benchmarks/ipc_test.go b/runtimes/google/ipc/benchmarks/ipc_test.go
index 947c972..8fafc56 100644
--- a/runtimes/google/ipc/benchmarks/ipc_test.go
+++ b/runtimes/google/ipc/benchmarks/ipc_test.go
@@ -24,21 +24,19 @@
}
func runBenchmarkEcho(b *testing.B, payloadSize int) {
+ benchmarks.CallEcho(&testing.B{}, vrt.NewContext(), address, 1, 0, nil) // Create VC.
benchmarks.CallEcho(b, vrt.NewContext(), address, b.N, payloadSize, nil)
}
func runBenchmarkEchoStream(b *testing.B, iterations, chunkCnt, payloadSize int) {
+ benchmarks.CallEcho(&testing.B{}, vrt.NewContext(), address, 1, 0, nil) // Create VC.
benchmarks.CallEchoStream(b, vrt.NewContext(), address, iterations, chunkCnt, payloadSize, nil)
}
func runBenchmarkMux(b *testing.B, payloadSize, chunkCntB, payloadSizeB int) {
- dummyB := testing.B{}
- _, stop := benchmarks.StartEchoStream(&dummyB, vrt.NewContext(), address, 0, chunkCntB, payloadSizeB, nil)
-
- b.ResetTimer()
+ benchmarks.CallEcho(&testing.B{}, vrt.NewContext(), address, 1, 0, nil) // Create VC.
+ _, stop := benchmarks.StartEchoStream(&testing.B{}, vrt.NewContext(), address, 0, chunkCntB, payloadSizeB, nil)
benchmarks.CallEcho(b, vrt.NewContext(), address, b.N, payloadSize, nil)
- b.StopTimer()
-
stop()
}
diff --git a/runtimes/google/ipc/benchmarks/server.go b/runtimes/google/ipc/benchmarks/server.go
index 392ed19..879ca54 100644
--- a/runtimes/google/ipc/benchmarks/server.go
+++ b/runtimes/google/ipc/benchmarks/server.go
@@ -1,8 +1,6 @@
package benchmarks
import (
- "io"
-
sflag "veyron.io/veyron/veyron/security/flag"
"veyron.io/veyron/veyron2"
@@ -18,18 +16,14 @@
return payload, nil
}
-func (i *impl) EchoStream(ctx ipc.ServerCall) error {
- for {
- var chunk []byte
- if err := ctx.Recv(&chunk); err != nil {
- if err == io.EOF {
- break
- }
- return err
- }
- if err := ctx.Send(chunk); err != nil {
- return err
- }
+func (i *impl) EchoStream(ctx BenchmarkEchoStreamContext) error {
+ rStream := ctx.RecvStream()
+ sStream := ctx.SendStream()
+ for rStream.Advance() {
+ sStream.Send(rStream.Value())
+ }
+ if err := rStream.Err(); err != nil {
+ return err
}
return nil
}
@@ -42,14 +36,15 @@
if err != nil {
vlog.Fatalf("NewServer failed: %v", err)
}
- ep, err := server.Listen(listenSpec)
+ eps, err := server.Listen(listenSpec)
if err != nil {
vlog.Fatalf("Listen failed: %v", err)
}
- if err := server.Serve("", &impl{}, sflag.NewAuthorizerOrDie()); err != nil {
+
+ if err := server.Serve("", BenchmarkServer(&impl{}), sflag.NewAuthorizerOrDie()); err != nil {
vlog.Fatalf("Serve failed: %v", err)
}
- return naming.JoinAddressName(ep.String(), ""), func() {
+ return naming.JoinAddressName(eps[0].String(), ""), func() {
if err := server.Stop(); err != nil {
vlog.Fatalf("Stop() failed: %v", err)
}
diff --git a/runtimes/google/ipc/benchmarks/service.vdl b/runtimes/google/ipc/benchmarks/service.vdl
index ad0afcf..c50df79 100644
--- a/runtimes/google/ipc/benchmarks/service.vdl
+++ b/runtimes/google/ipc/benchmarks/service.vdl
@@ -2,9 +2,13 @@
// IPC system.
package benchmarks
+import (
+ "veyron.io/veyron/veyron2/services/security/access"
+)
+
type Benchmark interface {
// Echo returns the payload that it receives.
- Echo(Payload []byte) ([]byte, error)
+ Echo(Payload []byte) ([]byte | error) {access.Read}
// EchoStream returns the payload that it receives via the stream.
- EchoStream() stream<[]byte,[]byte> error
+ EchoStream() stream<[]byte,[]byte> error {access.Read}
}
diff --git a/runtimes/google/ipc/benchmarks/service.vdl.go b/runtimes/google/ipc/benchmarks/service.vdl.go
index 117bb1e..6fac31d 100644
--- a/runtimes/google/ipc/benchmarks/service.vdl.go
+++ b/runtimes/google/ipc/benchmarks/service.vdl.go
@@ -6,6 +6,8 @@
package benchmarks
import (
+ "veyron.io/veyron/veyron2/services/security/access"
+
// The non-user imports are prefixed with "__" to prevent collisions.
__io "io"
__veyron2 "veyron.io/veyron/veyron2"
@@ -280,6 +282,7 @@
{"", ``}, // []byte
{"", ``}, // error
},
+ Tags: []__vdlutil.Any{access.Tag("Read")},
},
{
Name: "EchoStream",
@@ -287,6 +290,7 @@
OutArgs: []__ipc.ArgDesc{
{"", ``}, // error
},
+ Tags: []__vdlutil.Any{access.Tag("Read")},
},
},
}
diff --git a/runtimes/google/ipc/cancel_test.go b/runtimes/google/ipc/cancel_test.go
index 0ece305..f7cf101 100644
--- a/runtimes/google/ipc/cancel_test.go
+++ b/runtimes/google/ipc/cancel_test.go
@@ -59,7 +59,7 @@
if err != nil {
return nil, err
}
- if _, err := s.Listen(ipc.ListenSpec{Protocol: "tcp", Address: "127.0.0.1:0"}); err != nil {
+ if _, err := s.Listen(listenSpec); err != nil {
return nil, err
}
diff --git a/runtimes/google/ipc/client.go b/runtimes/google/ipc/client.go
index 544ed1c..4891254 100644
--- a/runtimes/google/ipc/client.go
+++ b/runtimes/google/ipc/client.go
@@ -354,7 +354,7 @@
span.Annotatef("address:%v", server)
defer span.Finish()
if status.flow, status.suffix, err = c.connectFlow(ctx, server, noDischarges); err != nil {
- vlog.VI(2).Infof("ipc: err: %s", err)
+ vlog.VI(2).Infof("ipc: connect to %s: %s", server, err)
status.err = err
status.flow = nil
}
@@ -712,7 +712,7 @@
TraceRequest: ivtrace.Request(fc.ctx),
}
if err := fc.enc.Encode(req); err != nil {
- berr := verror.Make(verror.BadProtocol, fc.ctx, verror.Make(errRequestEncoding, fc.ctx, req, err))
+ berr := verror.Make(verror.BadProtocol, fc.ctx, verror.Make(errRequestEncoding, fc.ctx, fmt.Sprintf("%#v", req), err))
return fc.close(berr)
}
for _, d := range fc.discharges {
@@ -861,7 +861,6 @@
// always return an error. But this isn't a "real" error; the client should
// read the rest of the results and succeed.
_ = fc.closeSend()
-
// Decode the response header, if it hasn't already been decoded by Recv.
if fc.response.Error == nil && !fc.response.EndStreamResults {
if err := fc.dec.Decode(&fc.response); err != nil {
@@ -874,10 +873,8 @@
return fc.close(berr)
}
}
-
// Incorporate any VTrace info that was returned.
ivtrace.MergeResponse(fc.ctx, &fc.response.TraceResponse)
-
if fc.response.Error != nil {
// TODO(cnicolaou): remove verror.NoAccess with verror version
// when ipc.Server is converted.
diff --git a/runtimes/google/ipc/client_test.go b/runtimes/google/ipc/client_test.go
index e6e6b2e..2499915 100644
--- a/runtimes/google/ipc/client_test.go
+++ b/runtimes/google/ipc/client_test.go
@@ -10,7 +10,6 @@
"time"
"veyron.io/veyron/veyron2"
- "veyron.io/veyron/veyron2/ipc"
"veyron.io/veyron/veyron2/naming"
"veyron.io/veyron/veyron2/rt"
verror "veyron.io/veyron/veyron2/verror2"
@@ -52,6 +51,7 @@
sh.Forget(root)
rootSession := expect.NewSession(t, root.Stdout(), time.Minute)
+ rootSession.ExpectVar("PID")
rootName := rootSession.ExpectVar("MT_NAME")
if t.Failed() {
t.Fatalf("%s", rootSession.Error())
@@ -106,8 +106,14 @@
t.Fatalf("unexpected error: %s", err)
}
s := expect.NewSession(t, srv.Stdout(), time.Minute)
+ s.ExpectVar("PID")
s.ExpectVar("NAME")
+ // Verify that there are 1 entries for echoServer in the mount table.
+ if got, want := numServers(t, "echoServer"), 1; got != want {
+ t.Fatalf("got: %q, want: %q", got, want)
+ }
+
runClient(t, sh)
// Create a fake set of 100 entries in the mount table
@@ -121,9 +127,9 @@
}
}
- // Verify that there are 102 entries for echoServer in the mount table.
- if got, want := numServers(t, "echoServer"), 102; got != want {
- t.Fatalf("got: %d, want: %d", got, want)
+ // Verify that there are 101 entries for echoServer in the mount table.
+ if got, want := numServers(t, "echoServer"), 101; got != want {
+ t.Fatalf("got: %q, want: %q", got, want)
}
// TODO(cnicolaou): ok, so it works, but I'm not sure how
@@ -152,46 +158,6 @@
}
}
-type sleeper struct {
- done <-chan struct{}
-}
-
-func (s *sleeper) Sleep(call ipc.ServerContext) error {
- select {
- case <-s.done:
- case <-time.After(time.Hour):
- }
- return nil
-}
-
-func (s *sleeper) Ping(call ipc.ServerContext) (string, error) {
- return "pong", nil
-}
-
-func (s *sleeper) Source(call ipc.ServerCall, start int) error {
- i := start
- backoff := 25 * time.Millisecond
- for {
- select {
- case <-s.done:
- return nil
- case <-time.After(backoff):
- call.Send(i)
- i++
- }
- backoff *= 2
- }
-}
-
-func (s *sleeper) Sink(call ipc.ServerCall) (int, error) {
- i := 0
- for {
- if err := call.Recv(&i); err != nil {
- return i, verror.Convert(verror.Internal, call, err)
- }
- }
-}
-
func childPing(stdin io.Reader, stdout, stderr io.Writer, env map[string]string, args ...string) error {
name := args[1]
call, err := r.Client().StartCall(r.NewContext(), name, "Ping", nil)
@@ -210,7 +176,7 @@
return nil
}
-func initServer(t *testing.T, r veyron2.Runtime) (string, ipc.Server, func()) {
+func initServer(t *testing.T, r veyron2.Runtime) (string, func()) {
server, err := r.NewServer()
if err != nil {
t.Fatalf("unexpected error: %s", err)
@@ -218,13 +184,13 @@
done := make(chan struct{})
deferFn := func() { close(done); server.Stop() }
- ep, err := server.Listen(profiles.LocalListenSpec)
+ eps, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
t.Fatalf("unexpected error: %s", err)
}
- server.Serve("", &sleeper{done}, nil)
- name := naming.JoinAddressName(ep.String(), "")
- return name, server, deferFn
+ server.Serve("", &simple{done}, nil)
+ name := naming.JoinAddressName(eps[0].String(), "")
+ return name, deferFn
}
func testForVerror(t *testing.T, err error, verr ...verror.IDAction) {
@@ -250,12 +216,12 @@
}
func TestTimeoutResponse(t *testing.T) {
- name, _, fn := initServer(t, r)
+ name, fn := initServer(t, r)
defer fn()
ctx, _ := r.NewContext().WithTimeout(100 * time.Millisecond)
call, err := r.Client().StartCall(ctx, name, "Sleep", nil)
if err != nil {
- testForVerror(t, err, verror.Timeout)
+ testForVerror(t, err, verror.Timeout, verror.BadProtocol)
return
}
verr := call.Finish(&err)
@@ -264,7 +230,7 @@
}
func TestArgsAndResponses(t *testing.T) {
- name, _, fn := initServer(t, r)
+ name, fn := initServer(t, r)
defer fn()
call, err := r.Client().StartCall(r.NewContext(), name, "Sleep", []interface{}{"too many args"})
@@ -291,7 +257,7 @@
// The server and client use different runtimes and hence different
// principals and without any shared blessings the server will deny
// access to the client
- name, _, fn := initServer(t, r1)
+ name, fn := initServer(t, r1)
defer fn()
client := r2.Client()
@@ -304,7 +270,7 @@
}
func TestCancelledBeforeFinish(t *testing.T) {
- name, _, fn := initServer(t, r)
+ name, fn := initServer(t, r)
defer fn()
ctx, cancel := r.NewContext().WithCancel()
@@ -320,7 +286,7 @@
}
func TestCancelledDuringFinish(t *testing.T) {
- name, _, fn := initServer(t, r)
+ name, fn := initServer(t, r)
defer fn()
ctx, cancel := r.NewContext().WithCancel()
@@ -351,6 +317,7 @@
time.Sleep(10 * time.Millisecond)
srv, _ := sh.Start(core.EchoServerCommand, nil, testArgs("message", name)...)
s := expect.NewSession(t, srv.Stdout(), time.Minute)
+ s.ExpectVar("PID")
s.ExpectVar("NAME")
}
go startServer()
@@ -375,7 +342,7 @@
sh, fn := runMountTable(t, r)
defer fn()
- name, _, fn := initServer(t, r)
+ name, fn := initServer(t, r)
defer fn()
srv, err := sh.Start("ping", nil, name)
@@ -389,7 +356,7 @@
}
func TestStreamTimeout(t *testing.T) {
- name, _, fn := initServer(t, r)
+ name, fn := initServer(t, r)
defer fn()
want := 10
@@ -422,7 +389,7 @@
}
func TestStreamAbort(t *testing.T) {
- name, _, fn := initServer(t, r)
+ name, fn := initServer(t, r)
defer fn()
ctx := r.NewContext()
@@ -446,9 +413,14 @@
if verr != nil {
t.Fatalf("unexpected error: %s", verr)
}
- if !verror.Is(err, "veyron.io/veyron/veyron2/verror.Internal") || err.Error() != `ipc.test:"".Sink: Internal error: EOF` {
+ if !verror.Is(err, verror.Unknown.ID) || err.Error() != `veyron.io/veyron/veyron2/verror.Unknown: EOF` {
t.Errorf("wrong error: %#v", err)
}
+ /* TODO(cnicolaou): use this when verror2/vom transition is done.
+ if err != nil && !verror.Is(err, verror.EOF.ID) {
+ t.Fatalf("unexpected error: %#v", err)
+ }
+ */
if got := result; got != want {
t.Errorf("got %d, want %d", got, want)
}
diff --git a/runtimes/google/ipc/debug_test.go b/runtimes/google/ipc/debug_test.go
index 8b2cacf..966952f 100644
--- a/runtimes/google/ipc/debug_test.go
+++ b/runtimes/google/ipc/debug_test.go
@@ -43,7 +43,7 @@
}
defer server.Stop()
server.Serve("", &testObject{}, nil)
- ep, err := server.Listen(listenSpec)
+ eps, err := server.Listen(listenSpec)
if err != nil {
t.Fatalf("server.Listen failed: %v", err)
}
@@ -53,6 +53,7 @@
}
defer client.Close()
ctx := testContext()
+ ep := eps[0]
// Call the Foo method on ""
{
addr := naming.JoinAddressName(ep.String(), "")
diff --git a/runtimes/google/ipc/full_test.go b/runtimes/google/ipc/full_test.go
index e7a680c..746b578 100644
--- a/runtimes/google/ipc/full_test.go
+++ b/runtimes/google/ipc/full_test.go
@@ -40,9 +40,12 @@
)
var (
- errMethod = verror.Make(verror.Aborted, nil)
- clock = new(fakeClock)
- listenSpec = ipc.ListenSpec{Protocol: "tcp", Address: "127.0.0.1:0"}
+ errMethod = verror.Make(verror.Aborted, nil)
+ clock = new(fakeClock)
+ listenAddrs = ipc.ListenAddrs{{"tcp", "127.0.0.1:0"}}
+ listenWSAddrs = ipc.ListenAddrs{{"ws", "127.0.0.1:0"}, {"tcp", "127.0.0.1:0"}}
+ listenSpec = ipc.ListenSpec{Addrs: listenAddrs}
+ listenWSSpec = ipc.ListenSpec{Addrs: listenWSAddrs}
)
type fakeClock struct {
@@ -173,6 +176,10 @@
}
func startServer(t *testing.T, principal security.Principal, sm stream.Manager, ns naming.Namespace, name string, disp ipc.Dispatcher, opts ...ipc.ServerOpt) (naming.Endpoint, ipc.Server) {
+ return startServerWS(t, principal, sm, ns, name, disp, noWebsocket, opts...)
+}
+
+func startServerWS(t *testing.T, principal security.Principal, sm stream.Manager, ns naming.Namespace, name string, disp ipc.Dispatcher, shouldUseWebsocket websocketMode, opts ...ipc.ServerOpt) (naming.Endpoint, ipc.Server) {
vlog.VI(1).Info("InternalNewServer")
opts = append(opts, vc.LocalPrincipal{principal})
server, err := InternalNewServer(testContext(), sm, ns, nil, opts...)
@@ -180,7 +187,11 @@
t.Errorf("InternalNewServer failed: %v", err)
}
vlog.VI(1).Info("server.Listen")
- ep, err := server.Listen(listenSpec)
+ spec := listenSpec
+ if shouldUseWebsocket {
+ spec = listenWSSpec
+ }
+ ep, err := server.Listen(spec)
if err != nil {
t.Errorf("server.Listen failed: %v", err)
}
@@ -191,7 +202,7 @@
if err := server.AddName(name); err != nil {
t.Errorf("server.AddName for discharger failed: %v", err)
}
- return ep, server
+ return ep[0], server
}
func loc(d int) string {
@@ -234,7 +245,7 @@
// Check that we can no longer serve after Stop.
err := server.AddName("name doesn't matter")
- if err == nil || err.Error() != "ipc: server is stopped" {
+ if err == nil || !verror.Is(err, verror.BadState.ID) {
t.Errorf("either no error, or a wrong error was returned: %v", err)
}
vlog.VI(1).Info("server.Stop DONE")
@@ -273,11 +284,15 @@
}
func createBundle(t *testing.T, client, server security.Principal, ts interface{}) (b bundle) {
+ return createBundleWS(t, client, server, ts, noWebsocket)
+}
+
+func createBundleWS(t *testing.T, client, server security.Principal, ts interface{}, shouldUseWebsocket websocketMode) (b bundle) {
b.sm = imanager.InternalNew(naming.FixedRoutingID(0x555555555))
b.ns = tnaming.NewSimpleNamespace()
b.name = "mountpoint/server"
if server != nil {
- b.ep, b.server = startServer(t, server, b.sm, b.ns, b.name, testServerDisp{ts})
+ b.ep, b.server = startServerWS(t, server, b.sm, b.ns, b.name, testServerDisp{ts}, shouldUseWebsocket)
}
if client != nil {
var err error
@@ -536,7 +551,7 @@
pserver = tsecurity.NewPrincipal("server")
pclient = tsecurity.NewPrincipal("client")
- b = createBundle(t, pclient, pserver, &testServer{})
+ b = createBundleWS(t, pclient, pserver, &testServer{}, shouldUseWebsocket)
)
defer b.cleanup(t)
// The server needs to recognize the client's root certificate.
@@ -757,7 +772,7 @@
t.Fatal(err)
}
defer appServer.Stop()
- ep, err := appServer.Listen(listenSpec)
+ eps, err := appServer.Listen(listenSpec)
if err != nil {
t.Fatal(err)
}
@@ -776,7 +791,7 @@
// can go away, but till then, this workaround allows the test to be
// more predictable by ensuring there is only one VIF/VC/Flow to the
// server.
- object := naming.JoinAddressName(ep.String(), "object") // instead of "mountpoint/object"
+ object := naming.JoinAddressName(eps[0].String(), "object") // instead of "mountpoint/object"
if err := appServer.Serve("mountpoint/object", &testServer{}, &testServerAuthorizer{}); err != nil {
t.Fatal(err)
}
@@ -1216,11 +1231,16 @@
t.Errorf("InternalNewServer failed: %v", err)
}
defer server.Stop()
- spec := listenSpec
- spec.Address = ":0"
- spec.AddressChooser = pa
- ep, err := server.Listen(spec)
- iep := ep.(*inaming.Endpoint)
+
+ spec := ipc.ListenSpec{
+ Addrs: ipc.ListenAddrs{{"tcp", ":0"}},
+ AddressChooser: pa,
+ }
+ eps, err := server.Listen(spec)
+ if err != nil {
+ t.Errorf("unexpected error: %s", err)
+ }
+ iep := eps[0].(*inaming.Endpoint)
host, _, err := net.SplitHostPort(iep.Address)
if err != nil {
t.Errorf("unexpected error: %s", err)
@@ -1229,8 +1249,8 @@
t.Errorf("got %q, want %q", got, want)
}
// Won't override the specified address.
- ep, err = server.Listen(listenSpec)
- iep = ep.(*inaming.Endpoint)
+ eps, err = server.Listen(listenSpec)
+ iep = eps[0].(*inaming.Endpoint)
host, _, err = net.SplitHostPort(iep.Address)
if err != nil {
t.Errorf("unexpected error: %s", err)
@@ -1252,11 +1272,12 @@
t.Errorf("InternalNewServer failed: %v", err)
}
defer server.Stop()
- spec := listenSpec
- spec.Address = ":0"
- spec.AddressChooser = paerr
- ep, err := server.Listen(spec)
- iep := ep.(*inaming.Endpoint)
+ spec := ipc.ListenSpec{
+ Addrs: ipc.ListenAddrs{{"tcp", ":0"}},
+ AddressChooser: paerr,
+ }
+ eps, err := server.Listen(spec)
+ iep := eps[0].(*inaming.Endpoint)
host, _, err := net.SplitHostPort(iep.Address)
if err != nil {
t.Errorf("unexpected error: %s", err)
diff --git a/runtimes/google/ipc/glob_test.go b/runtimes/google/ipc/glob_test.go
index cf2c0e4..3800b49 100644
--- a/runtimes/google/ipc/glob_test.go
+++ b/runtimes/google/ipc/glob_test.go
@@ -22,14 +22,14 @@
if err != nil {
return "", nil, fmt.Errorf("failed to start debug server: %v", err)
}
- endpoint, err := server.Listen(profiles.LocalListenSpec)
+ endpoints, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
return "", nil, fmt.Errorf("failed to listen: %v", err)
}
if err := server.ServeDispatcher("", &disp{tree}); err != nil {
return "", nil, err
}
- ep := endpoint.String()
+ ep := endpoints[0].String()
return ep, func() { server.Stop() }, nil
}
diff --git a/runtimes/google/ipc/resolve_internal_test.go b/runtimes/google/ipc/resolve_internal_test.go
new file mode 100644
index 0000000..86ac229
--- /dev/null
+++ b/runtimes/google/ipc/resolve_internal_test.go
@@ -0,0 +1,9 @@
+package ipc
+
+import (
+ "veyron.io/veyron/veyron2/ipc"
+)
+
+func InternalServerResolveToEndpoint(s ipc.Server, name string) (string, error) {
+ return s.(*server).resolveToEndpoint(name)
+}
diff --git a/runtimes/google/ipc/resolve_test.go b/runtimes/google/ipc/resolve_test.go
new file mode 100644
index 0000000..6d97e6a
--- /dev/null
+++ b/runtimes/google/ipc/resolve_test.go
@@ -0,0 +1,83 @@
+package ipc_test
+
+import (
+ "fmt"
+ "testing"
+ "time"
+
+ "veyron.io/veyron/veyron2/naming"
+ "veyron.io/veyron/veyron2/rt"
+
+ "veyron.io/veyron/veyron/lib/expect"
+ "veyron.io/veyron/veyron/lib/modules"
+ "veyron.io/veyron/veyron/lib/modules/core"
+ iipc "veyron.io/veyron/veyron/runtimes/google/ipc"
+ inaming "veyron.io/veyron/veyron/runtimes/google/naming"
+)
+
+func startMT(t *testing.T, sh *modules.Shell) string {
+ h, err := sh.Start(core.RootMTCommand, nil, "--", "--veyron.tcp.address=127.0.0.1:0")
+ if err != nil {
+ t.Fatalf("unexpected error for root mt: %s", err)
+ }
+ s := expect.NewSession(t, h.Stdout(), time.Minute)
+ s.ExpectVar("PID")
+ return s.ExpectVar("MT_NAME")
+}
+
+func TestResolveToEndpoint(t *testing.T) {
+ sh, err := modules.NewShell(nil)
+ if err != nil {
+ t.Fatalf("modules.NewShell failed: %s", err)
+ }
+ defer sh.Cleanup(nil, nil)
+ root := startMT(t, sh)
+
+ runtime, err := rt.New()
+ if err != nil {
+ t.Fatalf("rt.New failed: %s", err)
+ }
+ defer runtime.Cleanup()
+ ns := runtime.Namespace()
+ ns.SetRoots(root)
+
+ proxyEp, _ := inaming.NewEndpoint("proxy.v.io:123")
+ proxyEpStr := proxyEp.String()
+ proxyAddr := naming.JoinAddressName(proxyEpStr, "")
+ if err := ns.Mount(runtime.NewContext(), "proxy", proxyAddr, time.Hour); err != nil {
+ t.Fatalf("ns.Mount failed: %s", err)
+ }
+
+ server, err := runtime.NewServer()
+ if err != nil {
+ t.Fatalf("runtime.NewServer failed: %s", err)
+ }
+
+ notfound := fmt.Errorf("not found")
+ testcases := []struct {
+ address string
+ result string
+ err error
+ }{
+ {"/proxy.v.io:123", proxyEpStr, nil},
+ {"proxy.v.io:123", "", notfound},
+ {"proxy", proxyEpStr, nil},
+ {naming.JoinAddressName(root, "proxy"), proxyEpStr, nil},
+ {proxyAddr, proxyEpStr, nil},
+ {proxyEpStr, "", notfound},
+ {"unknown", "", notfound},
+ }
+ for _, tc := range testcases {
+ result, err := iipc.InternalServerResolveToEndpoint(server, tc.address)
+ if (err == nil) != (tc.err == nil) {
+ t.Errorf("Unexpected err for %q. Got %v, expected %v", tc.address, err, tc.err)
+ }
+ if result != tc.result {
+ t.Errorf("Unexpected result for %q. Got %q, expected %q", tc.address, result, tc.result)
+ }
+ }
+ if t.Failed() {
+ t.Logf("proxyEpStr: %v", proxyEpStr)
+ t.Logf("proxyAddr: %v", proxyAddr)
+ }
+}
diff --git a/runtimes/google/ipc/server.go b/runtimes/google/ipc/server.go
index 2368644..6fbdd4e 100644
--- a/runtimes/google/ipc/server.go
+++ b/runtimes/google/ipc/server.go
@@ -17,7 +17,8 @@
"veyron.io/veyron/veyron2/options"
"veyron.io/veyron/veyron2/security"
"veyron.io/veyron/veyron2/services/security/access"
- "veyron.io/veyron/veyron2/verror"
+ old_verror "veyron.io/veyron/veyron2/verror"
+ verror "veyron.io/veyron/veyron2/verror2"
"veyron.io/veyron/veyron2/vlog"
"veyron.io/veyron/veyron2/vom"
"veyron.io/veyron/veyron2/vom2"
@@ -29,26 +30,32 @@
"veyron.io/veyron/veyron/runtimes/google/lib/publisher"
inaming "veyron.io/veyron/veyron/runtimes/google/naming"
ivtrace "veyron.io/veyron/veyron/runtimes/google/vtrace"
+
+ // TODO(cnicolaou): finish verror -> verror2 transition, in particular
+ // for communicating from server to client.
+ // TODO(cnicolaou): remove the vom1 code now that vom2 is in place.
)
var (
// TODO(cnicolaou): this should be BadState in verror2.
- errServerStopped = verror.Abortedf("ipc: server is stopped")
+ errServerStopped = old_verror.Abortedf("ipc: server is stopped")
)
type server struct {
sync.Mutex
- ctx context.T // context used by the server to make internal RPCs.
- streamMgr stream.Manager // stream manager to listen for new flows.
- publisher publisher.Publisher // publisher to publish mounttable mounts.
- listenerOpts []stream.ListenerOpt // listener opts passed to Listen.
- listeners map[stream.Listener]*dhcpListener // listeners created by Listen.
- disp ipc.Dispatcher // dispatcher to serve RPCs
- dispReserved ipc.Dispatcher // dispatcher for reserved methods
- active sync.WaitGroup // active goroutines we've spawned.
- stopped bool // whether the server has been stopped.
- stoppedChan chan struct{} // closed when the server has been stopped.
- preferredProtocols []string // protocols to use when resolving proxy name to endpoint.
+ ctx context.T // context used by the server to make internal RPCs.
+ streamMgr stream.Manager // stream manager to listen for new flows.
+ publisher publisher.Publisher // publisher to publish mounttable mounts.
+ listenerOpts []stream.ListenerOpt // listener opts passed to Listen.
+ listeners map[stream.Listener]struct{} // listeners created by Listen.
+ dhcpListeners map[*dhcpListener]struct{} // dhcpListeners created by Listen.
+
+ disp ipc.Dispatcher // dispatcher to serve RPCs
+ dispReserved ipc.Dispatcher // dispatcher for reserved methods
+ active sync.WaitGroup // active goroutines we've spawned.
+ stopped bool // whether the server has been stopped.
+ stoppedChan chan struct{} // closed when the server has been stopped.
+ preferredProtocols []string // protocols to use when resolving proxy name to endpoint.
ns naming.Namespace
servesMountTable bool
// TODO(cnicolaou): remove this when the publisher tracks published names
@@ -66,7 +73,7 @@
sync.Mutex
publisher *config.Publisher // publisher used to fork the stream
name string // name of the publisher stream
- ep *inaming.Endpoint // endpoint returned after listening
+ eps []*inaming.Endpoint // endpoint returned after listening
pubAddrs []ipc.Address // addresses to publish
pubPort string // port to use with the publish addresses
ch chan config.Setting // channel to receive settings over
@@ -82,14 +89,15 @@
ctx, _ = ivtrace.WithNewSpan(ctx, "NewServer")
statsPrefix := naming.Join("ipc", "server", "routing-id", streamMgr.RoutingID().String())
s := &server{
- ctx: ctx,
- streamMgr: streamMgr,
- publisher: publisher.New(ctx, ns, publishPeriod),
- listeners: make(map[stream.Listener]*dhcpListener),
- stoppedChan: make(chan struct{}),
- ns: ns,
- stats: newIPCStats(statsPrefix),
- traceStore: store,
+ ctx: ctx,
+ streamMgr: streamMgr,
+ publisher: publisher.New(ctx, ns, publishPeriod),
+ listeners: make(map[stream.Listener]struct{}),
+ dhcpListeners: make(map[*dhcpListener]struct{}),
+ stoppedChan: make(chan struct{}),
+ ns: ns,
+ stats: newIPCStats(statsPrefix),
+ traceStore: store,
}
var (
principal security.Principal
@@ -132,17 +140,13 @@
s.Lock()
defer s.Unlock()
if s.stopped {
- return nil, errServerStopped
+ return nil, s.newBadState("ipc.Server.Stop already called")
}
return s.publisher.Published(), nil
}
-// resolveToAddress will try to resolve the input to an address using the
-// mount table, if the input is not already an address.
-func (s *server) resolveToAddress(address string) (string, error) {
- if _, err := inaming.NewEndpoint(address); err == nil {
- return address, nil
- }
+// resolveToEndpoint resolves an object name or address to an endpoint.
+func (s *server) resolveToEndpoint(address string) (string, error) {
var names []string
if s.ns != nil {
var entry *naming.MountEntry
@@ -177,6 +181,7 @@
}
}
+/*
// getIPRoamingAddrs finds an appropriate set of addresss to publish
// externally and also determines if it's sensible to allow roaming.
// It returns the host address of the first suitable address that
@@ -208,108 +213,160 @@
// roaming is not desired.
return []ipc.Address{addrFromIP(ip)}, host, port, false, nil
}
+*/
-// configureEPAndRoaming configures the endpoint and roaming. In particular,
-// it fills in the Address portion of the endpoint with the appropriately
-// selected network address and creates a dhcpListener struct if roaming
-// is enabled.
-func (s *server) configureEPAndRoaming(spec ipc.ListenSpec, ep naming.Endpoint) (*dhcpListener, *inaming.Endpoint, error) {
+// getPossbileAddrs returns an appropriate set of addresses that could be used
+// to contact the supplied protocol, host, port parameters using the supplied
+// chooser function. It returns an indication of whether the supplied address
+// was fully specified or not, returning false if the address was fully
+// specified, and true if it was not.
+func getPossibleAddrs(protocol, host, port string, chooser ipc.AddressChooser) ([]ipc.Address, bool, error) {
+ ip := net.ParseIP(host)
+ if ip == nil {
+ return nil, false, fmt.Errorf("failed to parse %q as an IP host", host)
+ }
+ if ip.IsUnspecified() {
+ if chooser != nil {
+ // Need to find a usable IP address since the call to listen
+ // didn't specify one.
+ if addrs, err := netstate.GetAccessibleIPs(); err == nil {
+ a, err := chooser(protocol, addrs)
+ if err == nil && len(a) > 0 {
+ return a, true, nil
+ }
+ }
+ }
+ // We don't have a chooser, so we just return the address the
+ // underlying system has chosen.
+ return []ipc.Address{addrFromIP(ip)}, true, nil
+ }
+ return []ipc.Address{addrFromIP(ip)}, false, nil
+}
+
+// createEndpoints creates appropriate inaming.Endpoint instances for
+// all of the externally accessible networrk addresses that can be used
+// to reach this server.
+func (s *server) createEndpoints(lep naming.Endpoint, chooser ipc.AddressChooser) ([]*inaming.Endpoint, bool, error) {
+ iep, ok := lep.(*inaming.Endpoint)
+ if !ok {
+ return nil, false, fmt.Errorf("internal type conversion error for %T", lep)
+ }
+ if !strings.HasPrefix(iep.Protocol, "tcp") &&
+ !strings.HasPrefix(iep.Protocol, "ws") {
+ // If not tcp or ws, just return the endpoint we were given.
+ return []*inaming.Endpoint{iep}, false, nil
+ }
+
+ host, port, err := net.SplitHostPort(iep.Address)
+ if err != nil {
+ return nil, false, err
+ }
+ addrs, unspecified, err := getPossibleAddrs(iep.Protocol, host, port, chooser)
+ if err != nil {
+ return nil, false, err
+ }
+ ieps := make([]*inaming.Endpoint, 0, len(addrs))
+ for _, addr := range addrs {
+ n, err := inaming.NewEndpoint(lep.String())
+ if err != nil {
+ return nil, false, err
+ }
+ n.IsMountTable = s.servesMountTable
+ //n.Protocol = addr.Address().Network()
+ n.Address = net.JoinHostPort(addr.Address().String(), port)
+ ieps = append(ieps, n)
+ }
+ return ieps, unspecified, nil
+}
+
+/*
+// configureEPAndRoaming configures the endpoint by filling in its Address
+// portion with the appropriately selected network address, it also
+// returns an indication of whether this endpoint is appropriate for
+// roaming and the set of addresses that should be published.
+func (s *server) configureEPAndRoaming(spec ipc.ListenSpec, ep naming.Endpoint) (bool, []ipc.Address, *inaming.Endpoint, error) {
iep, ok := ep.(*inaming.Endpoint)
if !ok {
- return nil, nil, fmt.Errorf("internal type conversion error for %T", ep)
+ return false, nil, nil, fmt.Errorf("internal type conversion error for %T", ep)
}
- if !strings.HasPrefix(spec.Protocol, "tcp") {
- return nil, iep, nil
+ if !strings.HasPrefix(spec.Addrs[0].Protocol, "tcp") &&
+ !strings.HasPrefix(spec.Addrs[0].Protocol, "ws") {
+ return false, nil, iep, nil
}
pubAddrs, pubHost, pubPort, roaming, err := s.getIPRoamingAddrs(spec.AddressChooser, iep)
if err != nil {
- return nil, iep, err
+ return false, nil, iep, err
}
iep.Address = net.JoinHostPort(pubHost, pubPort)
- if !roaming {
- vlog.VI(2).Infof("the address %q requested for listening contained a fixed IP address which disables roaming, use :0 instead", spec.Address)
- }
- publisher := spec.StreamPublisher
- if roaming && publisher != nil {
- streamName := spec.StreamName
- ch := make(chan config.Setting)
- if _, err := publisher.ForkStream(streamName, ch); err != nil {
- return nil, iep, fmt.Errorf("failed to fork stream %q: %s", streamName, err)
- }
- return &dhcpListener{ep: iep, pubAddrs: pubAddrs, pubPort: pubPort, ch: ch, name: streamName, publisher: publisher}, iep, nil
- }
- return nil, iep, nil
+ return roaming, pubAddrs, iep, nil
+}
+*/
+
+type listenError struct {
+ err verror.E
+ errors map[struct{ Protocol, Address string }]error
}
-func (s *server) Listen(listenSpec ipc.ListenSpec) (naming.Endpoint, error) {
+func newError() *listenError {
+ return &listenError{errors: make(map[struct{ Protocol, Address string }]error)}
+}
+
+func ErrorDetails(le *listenError) map[struct{ Protocol, Address string }]error {
+ return le.errors
+}
+
+// Implements error
+func (le *listenError) Error() string {
+ s := le.err.Error()
+ for k, v := range le.errors {
+ s += fmt.Sprintf("(%s,%s:%s) ", k.Protocol, k.Address, v)
+ }
+ return strings.TrimRight(s, " ")
+}
+
+func (le *listenError) ErrorID() old_verror.ID {
+ return le.err.ErrorID()
+}
+
+func (le *listenError) Action() verror.ActionCode {
+ return le.err.Action()
+}
+
+func (le *listenError) Params() []interface{} {
+ return le.err.Params()
+}
+
+func (le *listenError) HasMessage() bool {
+ return le.err.HasMessage()
+}
+
+func (le *listenError) Stack() verror.PCs {
+ return le.err.Stack()
+}
+
+func (s *server) newBadState(m string) *listenError {
+ return &listenError{err: verror.Make(verror.BadState, s.ctx, m)}
+}
+
+func (s *server) newBadArg(m string) *listenError {
+ return &listenError{err: verror.Make(verror.BadArg, s.ctx, m)}
+}
+
+func (s *server) Listen(listenSpec ipc.ListenSpec) ([]naming.Endpoint, error) {
defer vlog.LogCall()()
s.Lock()
+
// Shortcut if the server is stopped, to avoid needlessly creating a
// listener.
if s.stopped {
s.Unlock()
- return nil, errServerStopped
- }
- s.Unlock()
-
- var iep *inaming.Endpoint
- var dhcpl *dhcpListener
- var ln stream.Listener
-
- if len(listenSpec.Address) > 0 {
- // Listen if we have a local address to listen on. Some situations
- // just need a proxy (e.g. a browser extension).
- tmpln, lep, err := s.streamMgr.Listen(listenSpec.Protocol, listenSpec.Address, s.listenerOpts...)
- if err != nil {
- vlog.Errorf("ipc: Listen on %s failed: %s", listenSpec, err)
- return nil, err
- }
- ln = tmpln
- if tmpdhcpl, tmpiep, err := s.configureEPAndRoaming(listenSpec, lep); err != nil {
- ln.Close()
- return nil, err
- } else {
- dhcpl = tmpdhcpl
- iep = tmpiep
- }
+ return nil, s.newBadState("ipc.Server.Stop already called")
}
- s.Lock()
- defer s.Unlock()
- if s.stopped {
- ln.Close()
- return nil, errServerStopped
- }
+ useProxy := len(listenSpec.Proxy) > 0
- if dhcpl != nil {
- // We have a goroutine to listen for dhcp changes.
- s.active.Add(1)
- go func() {
- s.dhcpLoop(dhcpl)
- s.active.Done()
- }()
- s.listeners[ln] = dhcpl
- } else if ln != nil {
- s.listeners[ln] = nil
- }
-
- if iep != nil {
- // We have a goroutine per listener to accept new flows.
- // Each flow is served from its own goroutine.
- s.active.Add(1)
- go func() {
- s.listenLoop(ln, iep)
- s.active.Done()
- }()
- s.publisher.AddServer(s.publishEP(iep, s.servesMountTable), s.servesMountTable)
- if strings.HasPrefix(iep.Protocol, "tcp") {
- epCopy := *iep
- epCopy.Protocol = "ws"
- s.publisher.AddServer(s.publishEP(&epCopy, s.servesMountTable), s.servesMountTable)
- }
- }
-
- if len(listenSpec.Proxy) > 0 {
+ // Start the proxy as early as possible.
+ if useProxy {
// We have a goroutine for listening on proxy connections.
s.active.Add(1)
go func() {
@@ -317,18 +374,105 @@
s.active.Done()
}()
}
- return iep, nil
-}
+ s.Unlock()
-// TODO(cnicolaou): Take this out or make the ServesMountTable bit work in the endpoint.
-func (s *server) publishEP(ep *inaming.Endpoint, servesMountTable bool) string {
- var name string
- ep.IsMountTable = servesMountTable
- return naming.JoinAddressName(ep.String(), name)
+ var ieps []*inaming.Endpoint
+
+ type lnInfo struct {
+ ln stream.Listener
+ ep naming.Endpoint
+ }
+ linfo := []lnInfo{}
+ closeAll := func(lni []lnInfo) {
+ for _, li := range lni {
+ li.ln.Close()
+ }
+ }
+
+ roaming := false
+ for _, addr := range listenSpec.Addrs {
+ if len(addr.Address) > 0 {
+ // Listen if we have a local address to listen on. Some situations
+ // just need a proxy (e.g. a browser extension).
+ tmpln, lep, err := s.streamMgr.Listen(addr.Protocol, addr.Address, s.listenerOpts...)
+ if err != nil {
+ closeAll(linfo)
+ vlog.Errorf("ipc: Listen on %s failed: %s", addr, err)
+ return nil, err
+ }
+ linfo = append(linfo, lnInfo{tmpln, lep})
+ tmpieps, tmpRoaming, err := s.createEndpoints(lep, listenSpec.AddressChooser)
+ if err != nil {
+ closeAll(linfo)
+ return nil, err
+ }
+ ieps = append(ieps, tmpieps...)
+ if tmpRoaming {
+ roaming = true
+ }
+ }
+ }
+
+ // TODO(cnicolaou): write a test for all of these error cases.
+ if len(ieps) == 0 {
+ if useProxy {
+ return nil, nil
+ }
+ // no proxy.
+ if len(listenSpec.Addrs) > 0 {
+ return nil, fmt.Errorf("no endpoints")
+ }
+ return nil, fmt.Errorf("no proxy and no addresses requested")
+ }
+
+ // TODO(cnicolaou): return all of the eps and their errors....
+ s.Lock()
+ defer s.Unlock()
+ if s.stopped {
+ closeAll(linfo)
+ return nil, errServerStopped
+ }
+
+ if roaming && listenSpec.StreamPublisher != nil {
+ // TODO(cnicolaou): renable roaming in a followup CL.
+ /*
+ var dhcpl *dhcpListener
+ streamName := listenSpec.StreamName
+ ch := make(chan config.Setting)
+ if _, err := publisher.ForkStream(streamName, ch); err != nil {
+ return ieps[0], fmt.Errorf("failed to fork stream %q: %s", streamName, err)
+ }
+ dhcpl = &dhcpListener{eps: ieps, pubAddrs: pubAddrs, ch: ch, name: streamName, publisher: publisher}, iep, nil
+ // We have a goroutine to listen for dhcp changes.
+ s.active.Add(1)
+ go func() {
+ s.dhcpLoop(dhcpl)
+ s.active.Done()
+ }()
+ s.dhcpListeners[dhcpl] = struct{}{}
+ */
+ }
+
+ for _, li := range linfo {
+ s.listeners[li.ln] = struct{}{}
+ // We have a goroutine per listener to accept new flows.
+ // Each flow is served from its own goroutine.
+ s.active.Add(1)
+ go func(ln stream.Listener, ep naming.Endpoint) {
+ s.listenLoop(ln, ep)
+ s.active.Done()
+ }(li.ln, li.ep)
+ }
+ eps := make([]naming.Endpoint, len(ieps))
+ for i, iep := range ieps {
+ s.publisher.AddServer(naming.JoinAddressName(iep.String(), ""), s.servesMountTable)
+ eps[i] = iep
+ }
+ return eps, nil
}
func (s *server) reconnectAndPublishProxy(proxy string) (*inaming.Endpoint, stream.Listener, error) {
- resolved, err := s.resolveToAddress(proxy)
+ resolved, err := s.resolveToEndpoint(proxy)
if err != nil {
return nil, nil, fmt.Errorf("Failed to resolve proxy %q (%v)", proxy, err)
}
@@ -342,16 +486,9 @@
return nil, nil, fmt.Errorf("internal type conversion error for %T", ep)
}
s.Lock()
- s.listeners[ln] = nil
+ s.listeners[ln] = struct{}{}
s.Unlock()
- s.publisher.AddServer(s.publishEP(iep, s.servesMountTable), s.servesMountTable)
-
- if strings.HasPrefix(iep.Protocol, "tcp") {
- epCopy := *iep
- epCopy.Protocol = "ws"
- s.publisher.AddServer(s.publishEP(&epCopy, s.servesMountTable), s.servesMountTable)
- }
-
+ s.publisher.AddServer(naming.JoinAddressName(iep.String(), ""), s.servesMountTable)
return iep, ln, nil
}
@@ -368,7 +505,6 @@
// the initial connection maybe have failed, but we enter the retry
// loop anyway so that we will continue to try and connect to the
// proxy.
-
s.Lock()
if s.stopped {
s.Unlock()
@@ -381,12 +517,7 @@
s.listenLoop(ln, iep)
// The listener is done, so:
// (1) Unpublish its name
- s.publisher.RemoveServer(s.publishEP(iep, s.servesMountTable))
- if strings.HasPrefix(iep.Protocol, "tcp") {
- iepCopy := *iep
- iepCopy.Protocol = "ws"
- s.publisher.RemoveServer(s.publishEP(&iepCopy, s.servesMountTable))
- }
+ s.publisher.RemoveServer(naming.JoinAddressName(iep.String(), ""))
}
s.Lock()
@@ -420,7 +551,7 @@
}
func (s *server) listenLoop(ln stream.Listener, ep naming.Endpoint) {
- defer vlog.VI(1).Infof("ipc: Stopped listening on %v", ep)
+ defer vlog.VI(1).Infof("ipc: Stopped listening on %s", ep)
var calls sync.WaitGroup
defer func() {
calls.Wait()
@@ -453,13 +584,14 @@
}
}
+/*
func (s *server) applyChange(dhcpl *dhcpListener, addrs []net.Addr, fn func(string)) {
dhcpl.Lock()
defer dhcpl.Unlock()
for _, a := range addrs {
if ip := netstate.AsIP(a); ip != nil {
dhcpl.ep.Address = net.JoinHostPort(ip.String(), dhcpl.pubPort)
- fn(s.publishEP(dhcpl.ep, s.servesMountTable))
+ fn(dhcpl.ep.String())
}
}
}
@@ -472,7 +604,7 @@
// Publish all of the addresses
for _, pubAddr := range dhcpl.pubAddrs {
ep.Address = net.JoinHostPort(pubAddr.Address().String(), dhcpl.pubPort)
- s.publisher.AddServer(s.publishEP(&ep, s.servesMountTable), s.servesMountTable)
+ s.publisher.AddServer(naming.JoinAddressName(ep.String(), ""), s.servesMountTable)
}
for setting := range dhcpl.ch {
@@ -501,12 +633,13 @@
}
}
}
+*/
func (s *server) Serve(name string, obj interface{}, authorizer security.Authorizer) error {
if obj == nil {
// The ReflectInvoker inside the LeafDispatcher will panic
// if called for a nil value.
- return fmt.Errorf("A nil object is not allowed")
+ return s.newBadArg("nil object")
}
return s.ServeDispatcher(name, ipc.LeafDispatcher(obj, authorizer))
}
@@ -517,13 +650,13 @@
ivtrace.FromContext(s.ctx).Annotate("Serving under name: " + name)
if s.stopped {
- return errServerStopped
+ return s.newBadState("ipc.Server.Stop already called")
}
if disp == nil {
- return fmt.Errorf("A nil dispacther is not allowed")
+ return s.newBadArg("nil dispatcher")
}
if s.disp != nil {
- return fmt.Errorf("Serve or ServeDispatcher has already been called")
+ return s.newBadState("ipc.Server.Serve/ServeDispatcher already called")
}
s.disp = disp
s.names = make(map[string]struct{})
@@ -539,13 +672,13 @@
defer s.Unlock()
ivtrace.FromContext(s.ctx).Annotate("Serving under name: " + name)
if len(name) == 0 {
- return fmt.Errorf("empty name")
+ return s.newBadArg("name is empty")
}
if s.stopped {
- return errServerStopped
+ return s.newBadState("ipc.Server.Stop already called")
}
if s.disp == nil {
- return fmt.Errorf("Adding name before calling Serve or ServeDispatcher is not allowed")
+ return s.newBadState("adding a name before calling Serve or ServeDispatcher is not allowed")
}
s.publisher.AddName(name)
// TODO(cnicolaou): remove this map when the publisher's RemoveName
@@ -559,13 +692,13 @@
defer s.Unlock()
ivtrace.FromContext(s.ctx).Annotate("Removed name: " + name)
if s.stopped {
- return errServerStopped
+ return s.newBadState("ipc.Server.Stop already called")
}
if s.disp == nil {
- return fmt.Errorf("Removing name before calling Serve or ServeDispatcher is not allowed")
+ return s.newBadState("removing name before calling Serve or ServeDispatcher is not allowed")
}
if _, present := s.names[name]; !present {
- return fmt.Errorf("%q has not been previously used for this server", name)
+ return s.newBadArg(fmt.Sprintf("%q has not been previously used for this server", name))
}
s.publisher.RemoveName(name)
delete(s.names, name)
@@ -607,16 +740,16 @@
nListeners := len(s.listeners)
errCh := make(chan error, nListeners)
- for ln, dhcpl := range s.listeners {
+ for ln, _ := range s.listeners {
go func(ln stream.Listener) {
errCh <- ln.Close()
}(ln)
- if dhcpl != nil {
- dhcpl.Lock()
- dhcpl.publisher.CloseFork(dhcpl.name, dhcpl.ch)
- dhcpl.ch <- config.NewBool("EOF", "stop", true)
- dhcpl.Unlock()
- }
+ }
+ for dhcpl, _ := range s.dhcpListeners {
+ dhcpl.Lock()
+ dhcpl.publisher.CloseFork(dhcpl.name, dhcpl.ch)
+ dhcpl.ch <- config.NewBool("EOF", "stop", true)
+ dhcpl.Unlock()
}
s.Unlock()
@@ -633,9 +766,12 @@
s.active.Wait()
s.Lock()
+ defer s.Unlock()
s.disp = nil
- s.Unlock()
- return firstErr
+ if firstErr != nil {
+ return verror.Make(verror.Internal, s.ctx, firstErr)
+ }
+ return nil
}
// TODO(toddw): Remove these interfaces after the vom2 transition.
@@ -713,14 +849,14 @@
v := vom.ValueOf(res)
if !v.IsValid() {
// Untyped nils are assumed to be nil-errors.
- var boxed verror.E
+ var boxed old_verror.E
return vom.ValueOf(&boxed).Elem()
}
if err, iserr := res.(error); iserr {
// Convert errors to verror since errors are often not
// serializable via vom/gob (errors.New and fmt.Errorf return a
// type with no exported fields).
- return vom.ValueOf(verror.Convert(err))
+ return vom.ValueOf(old_verror.Convert(err))
}
return v
}
@@ -764,8 +900,7 @@
if err == io.EOF {
return err
}
- // We'll close the flow 2x.
- return verror.BadProtocolf("ipc: response encoding failed: %v", err)
+ return old_verror.BadProtocolf("ipc: response encoding failed: %v", err)
}
if response.Error != nil {
return response.Error
@@ -775,7 +910,7 @@
if err == io.EOF {
return err
}
- return verror.BadProtocolf("ipc: result #%d [%T=%v] encoding failed: %v", ix, res, res, err)
+ return old_verror.BadProtocolf("ipc: result #%d [%T=%v] encoding failed: %v", ix, res, res, err)
}
}
// TODO(ashankar): Should unread data from the flow be drained?
@@ -794,7 +929,7 @@
return nil
}
-func (fs *flowServer) readIPCRequest() (*ipc.Request, verror.E) {
+func (fs *flowServer) readIPCRequest() (*ipc.Request, old_verror.E) {
// Set a default timeout before reading from the flow. Without this timeout,
// a client that sends no request or a partial request will retain the flow
// indefinitely (and lock up server resources).
@@ -805,12 +940,12 @@
// Decode the initial request.
var req ipc.Request
if err := fs.dec.Decode(&req); err != nil {
- return nil, verror.BadProtocolf("ipc: request decoding failed: %v", err)
+ return nil, old_verror.BadProtocolf("ipc: request decoding failed: %v", err)
}
return &req, nil
}
-func (fs *flowServer) processRequest() ([]interface{}, verror.E) {
+func (fs *flowServer) processRequest() ([]interface{}, old_verror.E) {
fs.starttime = time.Now()
req, verr := fs.readIPCRequest()
if verr != nil {
@@ -851,14 +986,14 @@
argptrs, tags, err := invoker.Prepare(fs.method, numArgs)
fs.tags = tags
if err != nil {
- return nil, verror.Makef(verror.ErrorID(err), "%s: name: %q", err, fs.suffix)
+ return nil, old_verror.Makef(old_verror.ErrorID(err), "%s: name: %q", err, fs.suffix)
}
if len(argptrs) != numArgs {
- return nil, verror.BadProtocolf(fmt.Sprintf("ipc: wrong number of input arguments for method %q, name %q (called with %d args, expected %d)", fs.method, fs.suffix, numArgs, len(argptrs)))
+ return nil, old_verror.BadProtocolf(fmt.Sprintf("ipc: wrong number of input arguments for method %q, name %q (called with %d args, expected %d)", fs.method, fs.suffix, numArgs, len(argptrs)))
}
for ix, argptr := range argptrs {
if err := fs.dec.Decode(argptr); err != nil {
- return nil, verror.BadProtocolf("ipc: arg %d decoding failed: %v", ix, err)
+ return nil, old_verror.BadProtocolf("ipc: arg %d decoding failed: %v", ix, err)
}
}
// Check application's authorization policy.
@@ -871,7 +1006,7 @@
// Invoke the method.
results, err := invoker.Invoke(fs.method, fs, argptrs)
fs.server.stats.record(fs.method, time.Since(fs.starttime))
- return results, verror.Convert(err)
+ return results, old_verror.Convert(err)
}
func (fs *flowServer) cancelContextOnClose(cancel context.CancelFunc) {
@@ -894,7 +1029,7 @@
// with ipc.DebugKeyword, we use the internal debug dispatcher to look up the
// invoker. Otherwise, and we use the server's dispatcher. The suffix and method
// value may be modified to match the actual suffix and method to use.
-func (fs *flowServer) lookup(suffix string, method *string) (ipc.Invoker, security.Authorizer, verror.E) {
+func (fs *flowServer) lookup(suffix string, method *string) (ipc.Invoker, security.Authorizer, old_verror.E) {
if naming.IsReserved(*method) {
// All reserved methods are trapped and handled here, by removing the
// reserved prefix and invoking them on reservedMethods. E.g. "__Glob"
@@ -910,12 +1045,12 @@
obj, auth, err := disp.Lookup(suffix)
switch {
case err != nil:
- return nil, nil, verror.Convert(err)
+ return nil, nil, old_verror.Convert(err)
case obj != nil:
return objectToInvoker(obj), auth, nil
}
}
- return nil, nil, verror.NoExistf("ipc: invoker not found for %q", suffix)
+ return nil, nil, old_verror.NoExistf("ipc: invoker not found for %q", suffix)
}
func objectToInvoker(obj interface{}) ipc.Invoker {
@@ -928,11 +1063,11 @@
return ipc.ReflectInvoker(obj)
}
-func (fs *flowServer) initSecurity(req *ipc.Request) verror.E {
+func (fs *flowServer) initSecurity(req *ipc.Request) old_verror.E {
// If additional credentials are provided, make them available in the context
blessings, err := security.NewBlessings(req.GrantedBlessings)
if err != nil {
- return verror.BadProtocolf("ipc: failed to decode granted blessings: %v", err)
+ return old_verror.BadProtocolf("ipc: failed to decode granted blessings: %v", err)
}
fs.blessings = blessings
// Detect unusable blessings now, rather then discovering they are unusable on
@@ -943,13 +1078,13 @@
// this - should servers be able to assume that a blessing is something that
// does not have the authorizations that the server's own identity has?
if blessings != nil && !reflect.DeepEqual(blessings.PublicKey(), fs.flow.LocalPrincipal().PublicKey()) {
- return verror.NoAccessf("ipc: blessing granted not bound to this server(%v vs %v)", blessings.PublicKey(), fs.flow.LocalPrincipal().PublicKey())
+ return old_verror.NoAccessf("ipc: blessing granted not bound to this server(%v vs %v)", blessings.PublicKey(), fs.flow.LocalPrincipal().PublicKey())
}
// Receive third party caveat discharges the client sent
for i := uint64(0); i < req.NumDischarges; i++ {
var d security.Discharge
if err := fs.dec.Decode(&d); err != nil {
- return verror.BadProtocolf("ipc: decoding discharge %d of %d failed: %v", i, req.NumDischarges, err)
+ return old_verror.BadProtocolf("ipc: decoding discharge %d of %d failed: %v", i, req.NumDischarges, err)
}
fs.discharges[d.ID()] = d
}
@@ -962,7 +1097,7 @@
return nil
}
-func authorize(ctx security.Context, auth security.Authorizer) verror.E {
+func authorize(ctx security.Context, auth security.Authorizer) old_verror.E {
if ctx.LocalPrincipal() == nil {
// LocalPrincipal is nil means that the server wanted to avoid
// authentication, and thus wanted to skip authorization as well.
@@ -973,7 +1108,7 @@
}
if err := auth.Authorize(ctx); err != nil {
// TODO(ataly, ashankar): For privacy reasons, should we hide the authorizer error?
- return verror.NoAccessf("ipc: not authorized to call %q.%q (%v)", ctx.Suffix(), ctx.Method(), err)
+ return old_verror.NoAccessf("ipc: not authorized to call %q.%q (%v)", ctx.Suffix(), ctx.Method(), err)
}
return nil
}
diff --git a/runtimes/google/ipc/server_test.go b/runtimes/google/ipc/server_test.go
index 98cacab..4c7cc05 100644
--- a/runtimes/google/ipc/server_test.go
+++ b/runtimes/google/ipc/server_test.go
@@ -2,7 +2,6 @@
import (
"fmt"
- "io"
"os"
"reflect"
"sort"
@@ -15,9 +14,10 @@
"veyron.io/veyron/veyron/lib/expect"
"veyron.io/veyron/veyron/lib/modules"
+ "veyron.io/veyron/veyron/lib/modules/core"
tsecurity "veyron.io/veyron/veyron/lib/testutil/security"
+ _ "veyron.io/veyron/veyron/lib/websocket"
imanager "veyron.io/veyron/veyron/runtimes/google/ipc/stream/manager"
- "veyron.io/veyron/veyron/runtimes/google/ipc/stream/proxy"
"veyron.io/veyron/veyron/runtimes/google/ipc/stream/vc"
inaming "veyron.io/veyron/veyron/runtimes/google/naming"
tnaming "veyron.io/veyron/veyron/runtimes/google/testing/mocks/naming"
@@ -27,24 +27,23 @@
// connection to the server if the server dies and comes back (on the same
// endpoint).
func TestReconnect(t *testing.T) {
- b := createBundle(t, tsecurity.NewPrincipal("client"), nil, nil) // We only need the client from the bundle.
+ principal := tsecurity.NewPrincipal("client")
+ b := createBundle(t, principal, nil, nil) // We only need the client from the bundle.
defer b.cleanup(t)
- sh, err := modules.NewShell(nil)
+ sh, err := modules.NewShell(principal)
if err != nil {
t.Fatalf("unexpected error: %s", err)
}
defer sh.Cleanup(os.Stderr, os.Stderr)
- server, err := sh.Start("runServer", nil, "127.0.0.1:0")
+ server, err := sh.Start(core.EchoServerCommand, nil, "--", "--veyron.tcp.address=127.0.0.1:0", "mymessage", "")
if err != nil {
t.Fatalf("unexpected error: %s", err)
}
session := expect.NewSession(t, server.Stdout(), time.Minute)
- addr := session.ReadLine()
- ep, err := inaming.NewEndpoint(addr)
- if err != nil {
- t.Fatalf("inaming.NewEndpoint(%q): %v", addr, err)
- }
- serverName := naming.JoinAddressName(ep.String(), "suffix")
+ session.ReadLine()
+ serverName := session.ExpectVar("NAME")
+ serverEP := session.ExpectVar("ADDR")
+ ep, _ := inaming.NewEndpoint(serverEP)
makeCall := func() (string, error) {
ctx, _ := testContext().WithDeadline(time.Now().Add(5 * time.Second))
call, err := b.client.StartCall(ctx, serverName, "Echo", []interface{}{"bratman"})
@@ -52,12 +51,13 @@
return "", fmt.Errorf("START: %s", err)
}
var result string
- if err = call.Finish(&result); err != nil {
+ var rerr error
+ if err = call.Finish(&result, &rerr); err != nil {
return "", err
}
return result, nil
}
- expected := `method:"Echo",suffix:"suffix",arg:"bratman"`
+ expected := "mymessage: bratman\n"
if result, err := makeCall(); err != nil || result != expected {
t.Errorf("Got (%q, %v) want (%q, nil)", result, err, expected)
}
@@ -72,82 +72,80 @@
}
// Resurrect the server with the same address, verify client
- // re-establishes the connection.
- server, err = sh.Start("runServer", nil, addr)
+ // re-establishes the connection. This is racy if another
+ // process grabs the port.
+ server, err = sh.Start(core.EchoServerCommand, nil, "--", "--veyron.tcp.address="+ep.Address, "mymessage again", "")
if err != nil {
t.Fatalf("unexpected error: %s", err)
}
session = expect.NewSession(t, server.Stdout(), time.Minute)
- defer server.Shutdown(nil, nil)
- session.Expect(addr)
+ defer server.Shutdown(os.Stderr, os.Stderr)
+ expected = "mymessage again: bratman\n"
if result, err := makeCall(); err != nil || result != expected {
t.Errorf("Got (%q, %v) want (%q, nil)", result, err, expected)
}
+
}
type proxyHandle struct {
- ns naming.Namespace
- process modules.Handle
- session *expect.Session
- mount string
- sh *modules.Shell
+ ns naming.Namespace
+ sh *modules.Shell
+ proxy modules.Handle
+ name string
}
-func (h *proxyHandle) Start(t *testing.T) error {
+func (h *proxyHandle) Start(t *testing.T, args ...string) error {
sh, err := modules.NewShell(nil)
if err != nil {
t.Fatalf("unexpected error: %s", err)
}
- server, err := sh.Start("runProxy", nil)
+ h.sh = sh
+ p, err := sh.Start(core.ProxyServerCommand, nil, args...)
if err != nil {
+ p.Shutdown(os.Stderr, os.Stderr)
t.Fatalf("unexpected error: %s", err)
}
- h.process = server
- h.session = expect.NewSession(t, server.Stdout(), time.Minute)
- h.mount = h.session.ReadLine()
- h.sh = sh
- if err := h.session.Error(); err != nil {
- return err
+ h.proxy = p
+ s := expect.NewSession(t, p.Stdout(), time.Minute)
+ s.ReadLine()
+ s.ReadLine()
+ h.name = s.ExpectVar("PROXY_NAME")
+ if len(h.name) == 0 {
+ t.Fatalf("failed to get PROXY_NAME from proxyd")
}
- if err := h.ns.Mount(testContext(), "proxy", h.mount, time.Hour); err != nil {
- return err
- }
- return nil
+ return h.ns.Mount(testContext(), "proxy", h.name, time.Hour)
}
func (h *proxyHandle) Stop() error {
- if h.process == nil {
+ defer h.sh.Cleanup(os.Stderr, os.Stderr)
+ if err := h.proxy.Shutdown(os.Stderr, os.Stderr); err != nil {
+ return err
+ }
+ if len(h.name) == 0 {
return nil
}
- h.process.Shutdown(os.Stderr, os.Stderr)
- h.process = nil
- if len(h.mount) == 0 {
- return nil
- }
- h.sh.Cleanup(nil, nil)
- return h.ns.Unmount(testContext(), "proxy", h.mount)
+ return h.ns.Unmount(testContext(), "proxy", h.name)
}
func TestProxyOnly(t *testing.T) {
listenSpec := ipc.ListenSpec{Proxy: "proxy"}
- testProxy(t, listenSpec)
+ testProxy(t, listenSpec, "--", "--veyron.tcp.address=127.0.0.1:0")
}
func TestProxy(t *testing.T) {
- listenSpec := ipc.ListenSpec{Protocol: "tcp", Address: "127.0.0.1:0", Proxy: "proxy"}
- testProxy(t, listenSpec)
+ proxyListenSpec := listenSpec
+ proxyListenSpec.Proxy = "proxy"
+ testProxy(t, proxyListenSpec, "--", "--veyron.tcp.address=127.0.0.1:0")
}
-func addrOnly(name string) string {
- addr, _ := naming.SplitAddressName(name)
- return addr
+func TestWSProxy(t *testing.T) {
+ proxyListenSpec := listenSpec
+ proxyListenSpec.Proxy = "proxy"
+ // The proxy uses websockets only, but the server is using tcp.
+ testProxy(t, proxyListenSpec, "--", "--veyron.tcp.protocol=ws", "--veyron.tcp.address=127.0.0.1:0")
}
-func addWSName(name string) []string {
- return []string{name, strings.Replace(name, "@tcp@", "@ws@", 1)}
-}
-
-func testProxy(t *testing.T, spec ipc.ListenSpec) {
+func testProxy(t *testing.T, spec ipc.ListenSpec, args ...string) {
sm := imanager.InternalNew(naming.FixedRoutingID(0x555555555))
ns := tnaming.NewSimpleNamespace()
client, err := InternalNewClient(sm, ns, vc.LocalPrincipal{tsecurity.NewPrincipal("client")})
@@ -163,7 +161,7 @@
// If no address is specified then we'll only 'listen' via
// the proxy.
- hasLocalListener := len(spec.Address) != 0
+ hasLocalListener := len(spec.Addrs) > 0 && len(spec.Addrs[0].Address) != 0
name := "mountpoint/server/suffix"
makeCall := func() (string, error) {
@@ -182,7 +180,7 @@
return result, nil
}
proxy := &proxyHandle{ns: ns}
- if err := proxy.Start(t); err != nil {
+ if err := proxy.Start(t, args...); err != nil {
t.Fatal(err)
}
defer proxy.Stop()
@@ -190,9 +188,9 @@
if len(addrs) != 1 {
t.Fatalf("failed to lookup proxy")
}
- proxyEP := addrOnly(addrs[0])
+ proxyEP, _ := naming.SplitAddressName(addrs[0])
- ep, err := server.Listen(spec)
+ eps, err := server.Listen(spec)
if err != nil {
t.Fatal(err)
}
@@ -203,24 +201,28 @@
ch := make(chan struct{})
// Proxy connections are started asynchronously, so we need to wait..
waitfor := func(expect int) {
+ then := time.Now().Add(time.Minute)
for {
addrs, _ := ns.Resolve(testContext(), name)
if len(addrs) == expect {
close(ch)
return
}
+ if time.Now().After(then) {
+ t.Fatalf("timed out")
+ }
time.Sleep(100 * time.Millisecond)
}
}
proxiedEP, err := inaming.NewEndpoint(proxyEP)
if err != nil {
- t.Fatalf("unexpected error: %s", err)
+ t.Fatalf("unexpected error for %q: %s", proxyEP, err)
}
proxiedEP.RID = naming.FixedRoutingID(0x555555555)
- expectedEndpoints := addWSName(proxiedEP.String())
+ expectedEndpoints := []string{proxiedEP.String()}
if hasLocalListener {
- expectedEndpoints = append(expectedEndpoints, addWSName(ep.String())...)
+ expectedEndpoints = append(expectedEndpoints, eps[0].String())
}
// Proxy connetions are created asynchronously, so we wait for the
@@ -234,7 +236,8 @@
got := []string{}
for _, s := range verifyMount(t, ns, name) {
- got = append(got, addrOnly(s))
+ addr, _ := naming.SplitAddressName(s)
+ got = append(got, addr)
}
sort.Strings(got)
sort.Strings(expectedEndpoints)
@@ -247,10 +250,14 @@
// mount table, given that we're trying to test the proxy, we remove
// the local endpoint from the mount table entry! We have to remove both
// the tcp and the websocket address.
- sep := ep.String()
- wsep := strings.Replace(sep, "@tcp@", "@ws@", 1)
+ sep := eps[0].String()
+ //wsep := strings.Replace(sep, "@tcp@", "@ws@", 1)
ns.Unmount(testContext(), "mountpoint/server", naming.JoinAddressName(sep, ""))
- ns.Unmount(testContext(), "mountpoint/server", naming.JoinAddressName(wsep, ""))
+ }
+
+ addrs = verifyMount(t, ns, name)
+ if len(addrs) != 1 {
+ t.Fatalf("failed to lookup proxy")
}
// Proxied endpoint should be published and RPC should succeed (through proxy)
@@ -265,6 +272,7 @@
if result, err := makeCall(); err == nil || (!strings.HasPrefix(err.Error(), "RESOLVE") && !strings.Contains(err.Error(), "EOF")) {
t.Fatalf(`Got (%v, %v) want ("", "RESOLVE: <err>" or "EOF") as proxy is down`, result, err)
}
+
for {
if _, err := ns.Resolve(testContext(), name); err != nil {
break
@@ -274,64 +282,27 @@
verifyMountMissing(t, ns, name)
// Proxy restarts, calls should eventually start succeeding.
- if err := proxy.Start(t); err != nil {
+ if err := proxy.Start(t, args...); err != nil {
t.Fatal(err)
}
+ retries := 0
for {
if result, err := makeCall(); err == nil {
if result != expected {
t.Errorf("Got (%v, %v) want (%v, nil)", result, err, expected)
}
break
+ } else {
+ retries++
+ if retries > 10 {
+ t.Fatalf("Failed after 10 attempts: err: %s", err)
+ }
}
}
}
-func runServer(stdin io.Reader, stdout, stderr io.Writer, env map[string]string, args ...string) error {
- mgr := imanager.InternalNew(naming.FixedRoutingID(0x1111111))
- ns := tnaming.NewSimpleNamespace()
- server, err := InternalNewServer(testContext(), mgr, ns, nil, vc.LocalPrincipal{tsecurity.NewPrincipal("server")})
- if err != nil {
- return fmt.Errorf("InternalNewServer failed: %v", err)
- }
- disp := testServerDisp{new(testServer)}
- if err := server.ServeDispatcher("server", disp); err != nil {
- return fmt.Errorf("server.Register failed: %v", err)
- }
- spec := listenSpec
- spec.Address = args[1]
- ep, err := server.Listen(spec)
- if err != nil {
- return fmt.Errorf("server.Listen failed: %v", err)
- }
- fmt.Fprintf(stdout, "%s\n", ep.Addr())
- // parent process should explicitly shut us down by closing stdin.
- modules.WaitForEOF(stdin)
- return nil
-}
-
-func runProxy(stdin io.Reader, stdout, stderr io.Writer, env map[string]string, args ...string) error {
- rid, err := naming.NewRoutingID()
- if err != nil {
- return err
- }
- proxy, err := proxy.New(rid, tsecurity.NewPrincipal("proxy"), "tcp", "127.0.0.1:0", "")
- if err != nil {
- return err
- }
- fmt.Fprintf(stdout, "/%s\n", proxy.Endpoint().String())
- // parent process should explicitly shut us down by closing stdin.
- modules.WaitForEOF(stdin)
- return nil
-}
-
// Required by modules framework.
func TestHelperProcess(t *testing.T) {
modules.DispatchInTest()
}
-
-func init() {
- modules.RegisterChild("runServer", "[address]", runServer)
- modules.RegisterChild("runProxy", "", runProxy)
-}
diff --git a/runtimes/google/ipc/signature_test.go b/runtimes/google/ipc/signature_test.go
index 0f5c5ac..59a54ad 100644
--- a/runtimes/google/ipc/signature_test.go
+++ b/runtimes/google/ipc/signature_test.go
@@ -24,14 +24,14 @@
if err != nil {
return "", nil, fmt.Errorf("failed to start sig server: %v", err)
}
- ep, err := server.Listen(profiles.LocalListenSpec)
+ eps, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
return "", nil, fmt.Errorf("failed to listen: %v", err)
}
if err := server.Serve("", sig, nil); err != nil {
return "", nil, err
}
- return ep.String(), func() { server.Stop() }, nil
+ return eps[0].String(), func() { server.Stop() }, nil
}
type sigImpl struct{}
diff --git a/runtimes/google/ipc/simple_test.go b/runtimes/google/ipc/simple_test.go
new file mode 100644
index 0000000..f2853c5
--- /dev/null
+++ b/runtimes/google/ipc/simple_test.go
@@ -0,0 +1,130 @@
+package ipc_test
+
+import (
+ "io"
+ "testing"
+ "time"
+
+ "veyron.io/veyron/veyron2/ipc"
+ verror "veyron.io/veyron/veyron2/verror2"
+)
+
+type simple struct {
+ done <-chan struct{}
+}
+
+func (s *simple) Sleep(call ipc.ServerContext) error {
+ select {
+ case <-s.done:
+ case <-time.After(time.Hour):
+ }
+ return nil
+}
+
+func (s *simple) Ping(call ipc.ServerContext) (string, error) {
+ return "pong", nil
+}
+
+func (s *simple) Source(call ipc.ServerCall, start int) error {
+ i := start
+ backoff := 25 * time.Millisecond
+ for {
+ select {
+ case <-s.done:
+ return nil
+ case <-time.After(backoff):
+ call.Send(i)
+ i++
+ }
+ backoff *= 2
+ }
+}
+
+func (s *simple) Sink(call ipc.ServerCall) (int, error) {
+ i := 0
+ for {
+ if err := call.Recv(&i); err != nil {
+ return i, err
+ }
+ }
+}
+
+func (s *simple) Inc(call ipc.ServerCall, inc int) (int, error) {
+ i := 0
+ for {
+ if err := call.Recv(&i); err != nil {
+ if err == io.EOF {
+ // TODO(cnicolaou): this should return a verror, i.e.
+ // verror.Make(verror.EOF, call), but for now we
+ // return an io.EOF
+ return i, io.EOF
+ }
+ return i, err
+ }
+ call.Send(i + inc)
+ }
+}
+
+func TestSimpleRPC(t *testing.T) {
+ name, fn := initServer(t, r)
+ defer fn()
+
+ client := r.Client()
+ call, err := client.StartCall(r.NewContext(), name, "Ping", nil)
+ if err != nil {
+ t.Fatalf("unexpected error: %s", err)
+ }
+ response := ""
+ var verr error
+ err = call.Finish(&response, &verr)
+ if err != nil {
+ t.Fatalf("unexpected error: %s", err)
+ }
+ if got, want := response, "pong"; got != want {
+ t.Fatalf("got %q, want %q", got, want)
+ }
+}
+
+func TestSimpleStreaming(t *testing.T) {
+ name, fn := initServer(t, r)
+ defer fn()
+
+ ctx := r.NewContext()
+ inc := 1
+ call, err := r.Client().StartCall(ctx, name, "Inc", []interface{}{inc})
+ if err != nil {
+ t.Fatalf("unexpected error: %s", err)
+ }
+
+ want := 10
+ for i := 0; i <= want; i++ {
+ if err := call.Send(i); err != nil {
+ t.Fatalf("unexpected error: %s", err)
+ }
+ got := -1
+ if err = call.Recv(&got); err != nil {
+ t.Fatalf("unexpected error: %s", err)
+ }
+ if want := i + inc; got != want {
+ t.Fatalf("got %d, want %d")
+ }
+ }
+ call.CloseSend()
+ final := -1
+ verr := call.Finish(&final, &err)
+ if verr != nil {
+ t.Fatalf("unexpected error: %s", verr)
+
+ }
+ if !verror.Is(err, verror.Unknown.ID) || err.Error() != `veyron.io/veyron/veyron2/verror.Unknown: EOF` {
+ t.Errorf("wrong error: %#v", err)
+ }
+ /* TODO(cnicolaou): use this when verror2/vom transition is done.
+ if err != nil && !verror.Is(err, verror.EOF.ID) {
+ t.Fatalf("unexpected error: %#v", err)
+ }
+ */
+ if got := final; got != want {
+ t.Fatalf("got %d, want %d")
+ }
+}
diff --git a/runtimes/google/ipc/sort_endpoints.go b/runtimes/google/ipc/sort_endpoints.go
index 48bcd88..312be8c 100644
--- a/runtimes/google/ipc/sort_endpoints.go
+++ b/runtimes/google/ipc/sort_endpoints.go
@@ -55,12 +55,13 @@
name := server
address, suffix := naming.SplitAddressName(name)
if len(address) == 0 {
- errs.add(fmt.Errorf("%q is not a rooted name", name))
- continue
+ // Maybe it's not a rooted endpoint, just a bare one.
+ address = name
+ suffix = ""
}
iep, err := inaming.NewEndpoint(address)
if err != nil {
- errs.add(fmt.Errorf("%q: %s", name, err))
+ errs.add(fmt.Errorf("failed to parse %q: %s", name, err))
continue
}
if err = version.CheckCompatibility(iep); err != nil {
diff --git a/runtimes/google/ipc/stream/benchmark/RESULTS.txt b/runtimes/google/ipc/stream/benchmark/RESULTS.txt
index 4fde7c1..d217956 100644
--- a/runtimes/google/ipc/stream/benchmark/RESULTS.txt
+++ b/runtimes/google/ipc/stream/benchmark/RESULTS.txt
@@ -1,100 +1,96 @@
-Date: 10/12/2014
+Date: 12/14/2014
Platform: Intel(R) Xeon(R) CPU E5-2689 0 @ 2.60GHz, 66114888KB Memory
-$ veyron go test -test.bench=throughput -test.cpu=1 -test.benchtime=5s \
+$ veyron go test -test.bench=. -test.cpu=1 -test.benchtime=5s \
veyron.io/veyron/veyron/runtimes/google/ipc/stream/benchmark
-Benchmark_throughput_TCP_1Conn 1000000 9844 ns/op 5201.13 MB/s
-Benchmark_throughput_TCP_2Conns 1000000 9551 ns/op 5360.43 MB/s
-Benchmark_throughput_TCP_4Conns 1000000 9864 ns/op 5190.41 MB/s
-Benchmark_throughput_TCP_8Conns 1000000 13138 ns/op 3897.01 MB/s
-Benchmark_throughput_Pipe_1Conn 1000000 22645 ns/op 2260.95 MB/s
-Benchmark_throughput_Pipe_2Conns 500000 21327 ns/op 2400.68 MB/s
-Benchmark_throughput_Pipe_4Conns 500000 24004 ns/op 2132.91 MB/s
-Benchmark_throughput_Pipe_8Conns 500000 21196 ns/op 2415.48 MB/s
-Benchmark_throughput_Flow_1VIF_1VC_1Flow 500000 28979 ns/op 1766.77 MB/s
-Benchmark_throughput_Flow_1VIF_1VC_2Flow 500000 30328 ns/op 1688.16 MB/s
-Benchmark_throughput_Flow_1VIF_1VC_8Flow 500000 37314 ns/op 1372.11 MB/s
-Benchmark_throughput_Flow_1VIF_2VC_2Flow 500000 30521 ns/op 1677.52 MB/s
-Benchmark_throughput_Flow_1VIF_2VC_8Flow 200000 38013 ns/op 1346.89 MB/s
-Benchmark_throughput_Flow_2VIF_4VC_8Flow 200000 39768 ns/op 1287.46 MB/s
-Benchmark_throughput_TLS_1Conn 20000 418920 ns/op 122.22 MB/s
-Benchmark_throughput_TLS_2Conns 20000 416965 ns/op 122.79 MB/s
-Benchmark_throughput_TLS_4Conns 20000 418513 ns/op 122.34 MB/s
-Benchmark_throughput_TLS_8Conns 20000 424970 ns/op 120.48 MB/s
-Benchmark_throughput_Flow_1VIF_1VC_1FlowTLS 20000 466126 ns/op 109.84 MB/s
-Benchmark_throughput_Flow_1VIF_1VC_2FlowTLS 20000 464239 ns/op 110.29 MB/s
-Benchmark_throughput_Flow_1VIF_1VC_8FlowTLS 20000 476913 ns/op 107.36 MB/s
-Benchmark_throughput_Flow_1VIF_2VC_2FlowTLS 20000 468779 ns/op 109.22 MB/s
-Benchmark_throughput_Flow_1VIF_2VC_8FlowTLS 20000 482487 ns/op 106.12 MB/s
-Benchmark_throughput_Flow_2VIF_4VC_8FlowTLS 20000 482328 ns/op 106.15 MB/s
+Benchmark_throughput_TCP_1Conn 1000000 9874 ns/op 5184.85 MB/s
+Benchmark_throughput_TCP_2Conns 1000000 9815 ns/op 5216.01 MB/s
+Benchmark_throughput_TCP_4Conns 1000000 10088 ns/op 5074.94 MB/s
+Benchmark_throughput_TCP_8Conns 500000 12228 ns/op 4186.82 MB/s
+Benchmark_throughput_Pipe_1Conn 500000 24337 ns/op 2103.72 MB/s
+Benchmark_throughput_Pipe_2Conns 500000 28723 ns/op 1782.52 MB/s
+Benchmark_throughput_Pipe_4Conns 500000 28823 ns/op 1776.32 MB/s
+Benchmark_throughput_Pipe_8Conns 500000 27081 ns/op 1890.57 MB/s
+Benchmark_throughput_Flow_1VIF_1VC_1Flow 200000 31567 ns/op 1621.93 MB/s
+Benchmark_throughput_Flow_1VIF_1VC_2Flow 200000 31626 ns/op 1618.90 MB/s
+Benchmark_throughput_Flow_1VIF_1VC_8Flow 200000 36366 ns/op 1407.88 MB/s
+Benchmark_throughput_Flow_1VIF_2VC_2Flow 200000 32417 ns/op 1579.41 MB/s
+Benchmark_throughput_Flow_1VIF_2VC_8Flow 200000 35595 ns/op 1438.37 MB/s
+Benchmark_throughput_Flow_2VIF_4VC_8Flow 200000 38216 ns/op 1339.73 MB/s
+Benchmark_throughput_TLS_1Conn 20000 426727 ns/op 119.98 MB/s
+Benchmark_throughput_TLS_2Conns 20000 419540 ns/op 122.04 MB/s
+Benchmark_throughput_TLS_4Conns 20000 428137 ns/op 119.59 MB/s
+Benchmark_throughput_TLS_8Conns 20000 426041 ns/op 120.18 MB/s
+Benchmark_throughput_Flow_1VIF_1VC_1FlowTLS 20000 470284 ns/op 108.87 MB/s
+Benchmark_throughput_Flow_1VIF_1VC_2FlowTLS 20000 473181 ns/op 108.20 MB/s
+Benchmark_throughput_Flow_1VIF_1VC_8FlowTLS 20000 482533 ns/op 106.11 MB/s
+Benchmark_throughput_Flow_1VIF_2VC_2FlowTLS 20000 472181 ns/op 108.43 MB/s
+Benchmark_throughput_Flow_1VIF_2VC_8FlowTLS 20000 480154 ns/op 106.63 MB/s
+Benchmark_throughput_Flow_2VIF_4VC_8FlowTLS 20000 481803 ns/op 106.27 MB/s
-
-$ veyron go test -test.bench=dial -test.cpu=1 -test.benchtime=5s \
- veyron.io/veyron/veyron/runtimes/google/ipc/stream/benchmark
-
-Benchmark_dial_VIF 1000000 9825 ns/op
-Histogram (unit: us)
-Count: 1000000 Min: 3 Max: 8034 Avg: 9.15
+Benchmark_dial_VIF 500000 15965 ns/op
+Histogram (unit: µs)
+Count: 500000 Min: 4 Max: 19523 Avg: 15.31
------------------------------------------------------------
-[ 3, 4) 404648 40.5% 40.5% ####
-[ 4, 5) 416958 41.7% 82.2% ####
-[ 5, 8) 124339 12.4% 94.6% #
-[ 8, 14) 30884 3.1% 97.7%
-[ 14, 24) 15604 1.6% 99.2%
-[ 24, 44) 3720 0.4% 99.6%
-[ 44, 80) 1132 0.1% 99.7%
-[ 80, 146) 304 0.0% 99.8%
-[ 146, 266) 183 0.0% 99.8%
-[ 266, 486) 75 0.0% 99.8%
-[ 486, 887) 160 0.0% 99.8%
-[ 887, 1617) 312 0.0% 99.8%
-[ 1617, 2946) 1459 0.1% 100.0%
-[ 2946, 5367) 221 0.0% 100.0%
-[ 5367, 9777) 1 0.0% 100.0%
-[ 9777, 17807) 0 0.0% 100.0%
-[17807, inf) 0 0.0% 100.0%
+[ 4, 5) 9404 1.9% 1.9%
+[ 5, 6) 320133 64.0% 65.9% ######
+[ 6, 9) 157038 31.4% 97.3% ###
+[ 9, 16) 8766 1.8% 99.1%
+[ 16, 29) 3348 0.7% 99.7%
+[ 29, 55) 134 0.0% 99.8%
+[ 55, 107) 50 0.0% 99.8%
+[ 107, 207) 7 0.0% 99.8%
+[ 207, 401) 0 0.0% 99.8%
+[ 401, 776) 1 0.0% 99.8%
+[ 776, 1500) 120 0.0% 99.8%
+[ 1500, 2900) 138 0.0% 99.8%
+[ 2900, 5606) 681 0.1% 100.0%
+[ 5606, 10834) 167 0.0% 100.0%
+[10834, 20936) 13 0.0% 100.0%
+[20936, 40454) 0 0.0% 100.0%
+[40454, inf) 0 0.0% 100.0%
-Benchmark_dial_VIF_TLS 1000 11816193 ns/op
+Benchmark_dial_VIF_TLS 500 12015788 ns/op
Histogram (unit: ms)
-Count: 1000 Min: 11 Max: 14 Avg: 11.25
+Count: 500 Min: 11 Max: 13 Avg: 11.34
------------------------------------------------------------
-[ 11, 12) 766 76.6% 76.6% ########
-[ 12, 13) 217 21.7% 98.3% ##
-[ 13, 14) 15 1.5% 99.8%
-[ 14, 15) 2 0.2% 100.0%
-[ 15, 16) 0 0.0% 100.0%
-[ 16, 17) 0 0.0% 100.0%
-[ 17, 18) 0 0.0% 100.0%
-[ 18, 19) 0 0.0% 100.0%
-[ 19, 20) 0 0.0% 100.0%
-[ 20, 21) 0 0.0% 100.0%
-[ 21, 23) 0 0.0% 100.0%
-[ 23, 25) 0 0.0% 100.0%
-[ 25, 27) 0 0.0% 100.0%
-[ 27, 29) 0 0.0% 100.0%
-[ 29, 31) 0 0.0% 100.0%
-[ 31, 33) 0 0.0% 100.0%
-[ 33, inf) 0 0.0% 100.0%
+[ 11, 12) 350 70.0% 70.0% #######
+[ 12, 13) 132 26.4% 96.4% ###
+[ 13, 14) 18 3.6% 100.0%
+[ 14, 15) 0 0.0% 100.0%
+[ 15, 16) 0 0.0% 100.0%
+[ 16, 17) 0 0.0% 100.0%
+[ 17, 18) 0 0.0% 100.0%
+[ 18, 19) 0 0.0% 100.0%
+[ 19, 20) 0 0.0% 100.0%
+[ 20, 21) 0 0.0% 100.0%
+[ 21, 22) 0 0.0% 100.0%
+[ 22, 23) 0 0.0% 100.0%
+[ 23, 24) 0 0.0% 100.0%
+[ 24, 25) 0 0.0% 100.0%
+[ 25, 26) 0 0.0% 100.0%
+[ 26, 27) 0 0.0% 100.0%
+[ 27, inf) 0 0.0% 100.0%
-Benchmark_dial_VC_TLS 500 15534331 ns/op
+Benchmark_dial_VC_TLS 500 15909783 ns/op
Histogram (unit: ms)
-Count: 500 Min: 15 Max: 21 Avg: 15.26
+Count: 500 Min: 15 Max: 20 Avg: 15.41
------------------------------------------------------------
-[ 15, 16) 402 80.4% 80.4% ########
-[ 16, 17) 69 13.8% 94.2% #
-[ 17, 18) 28 5.6% 99.8% #
-[ 18, 19) 0 0.0% 99.8%
+[ 15, 16) 356 71.2% 71.2% #######
+[ 16, 17) 92 18.4% 89.6% ##
+[ 17, 18) 47 9.4% 99.0% #
+[ 18, 19) 4 0.8% 99.8%
[ 19, 20) 0 0.0% 99.8%
-[ 20, 21) 0 0.0% 99.8%
-[ 21, 23) 1 0.2% 100.0%
-[ 23, 25) 0 0.0% 100.0%
-[ 25, 27) 0 0.0% 100.0%
-[ 27, 29) 0 0.0% 100.0%
-[ 29, 32) 0 0.0% 100.0%
-[ 32, 35) 0 0.0% 100.0%
-[ 35, 39) 0 0.0% 100.0%
-[ 39, 43) 0 0.0% 100.0%
-[ 43, 48) 0 0.0% 100.0%
-[ 48, 54) 0 0.0% 100.0%
-[ 54, inf) 0 0.0% 100.0%
+[ 20, 21) 1 0.2% 100.0%
+[ 21, 22) 0 0.0% 100.0%
+[ 22, 24) 0 0.0% 100.0%
+[ 24, 26) 0 0.0% 100.0%
+[ 26, 28) 0 0.0% 100.0%
+[ 28, 30) 0 0.0% 100.0%
+[ 30, 33) 0 0.0% 100.0%
+[ 33, 36) 0 0.0% 100.0%
+[ 36, 40) 0 0.0% 100.0%
+[ 40, 44) 0 0.0% 100.0%
+[ 44, 48) 0 0.0% 100.0%
+[ 48, inf) 0 0.0% 100.0%
diff --git a/runtimes/google/ipc/stream/benchmark/throughput_tls.go b/runtimes/google/ipc/stream/benchmark/throughput_tls.go
index 630ae8c..3bcc779 100644
--- a/runtimes/google/ipc/stream/benchmark/throughput_tls.go
+++ b/runtimes/google/ipc/stream/benchmark/throughput_tls.go
@@ -1,17 +1,12 @@
-// +build !go1.4
-
-// TODO(ashankar): Remove the build tag and replace the tls import with crypto/tls
-// when go1.4 is released.
-
package benchmark
import (
+ "crypto/tls"
"io"
"net"
"testing"
"veyron.io/veyron/veyron/runtimes/google/ipc/stream/crypto"
- tls "veyron.io/veyron/veyron/runtimes/google/ipc/stream/crypto/tlsfork"
)
func benchmarkTLS(b *testing.B, nConns int) {
diff --git a/runtimes/google/ipc/stream/crypto/box.go b/runtimes/google/ipc/stream/crypto/box.go
index 24e6328..ff9a377 100644
--- a/runtimes/google/ipc/stream/crypto/box.go
+++ b/runtimes/google/ipc/stream/crypto/box.go
@@ -2,12 +2,14 @@
import (
"bytes"
- "code.google.com/p/go.crypto/nacl/box"
"crypto/rand"
"encoding/binary"
"fmt"
"io"
"net"
+
+ "golang.org/x/crypto/nacl/box"
+
"veyron.io/veyron/veyron/runtimes/google/lib/iobuf"
)
diff --git a/runtimes/google/ipc/stream/crypto/box_cipher.go b/runtimes/google/ipc/stream/crypto/box_cipher.go
index d1e4987..6174213 100644
--- a/runtimes/google/ipc/stream/crypto/box_cipher.go
+++ b/runtimes/google/ipc/stream/crypto/box_cipher.go
@@ -4,8 +4,8 @@
"encoding/binary"
"errors"
- "code.google.com/p/go.crypto/nacl/box"
- "code.google.com/p/go.crypto/salsa20/salsa"
+ "golang.org/x/crypto/nacl/box"
+ "golang.org/x/crypto/salsa20/salsa"
)
// cbox implements a ControlCipher using go.crypto/nacl/box.
diff --git a/runtimes/google/ipc/stream/crypto/box_cipher_test.go b/runtimes/google/ipc/stream/crypto/box_cipher_test.go
index 795c9c3..acd26ae 100644
--- a/runtimes/google/ipc/stream/crypto/box_cipher_test.go
+++ b/runtimes/google/ipc/stream/crypto/box_cipher_test.go
@@ -5,7 +5,7 @@
"crypto/rand"
"testing"
- "code.google.com/p/go.crypto/nacl/box"
+ "golang.org/x/crypto/nacl/box"
"veyron.io/veyron/veyron/runtimes/google/ipc/stream/crypto"
)
diff --git a/runtimes/google/ipc/stream/crypto/test.sh b/runtimes/google/ipc/stream/crypto/test.sh
deleted file mode 100755
index 5ce4020..0000000
--- a/runtimes/google/ipc/stream/crypto/test.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-
-# Ensure that tls_old.go is in sync with tls.go
-
-source "${VEYRON_ROOT}/scripts/lib/shell_test.sh"
-
-readonly WORKDIR="${shell_test_WORK_DIR}"
-
-main() {
- local -r DIR="$(dirname $0)"
- local -r OUTFILE="${WORKDIR}/latest.go"
- "${DIR}/tls_generate_old.sh" "${OUTFILE}" || shell_test::fail "failed to generate tls_old.go"
- if diff "${OUTFILE}" "${DIR}/tls_old.go"; then
- shell_test::pass
- fi
- shell_test::fail "tls_old.go is not in sync with tls.go, re-run tls_generate_old.sh?"
-}
-
-main "$@"
diff --git a/runtimes/google/ipc/stream/crypto/tls_generate_old.sh b/runtimes/google/ipc/stream/crypto/tls_generate_old.sh
deleted file mode 100755
index b940345..0000000
--- a/runtimes/google/ipc/stream/crypto/tls_generate_old.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/bash
-
-# This script generates a version of tls.go that can be built with Go compilers
-# prior to version 1.4.
-
-source "${VEYRON_ROOT}/scripts/lib/shell.sh"
-
-main() {
- local -r DIR="$(dirname "$0")"
- local -r INFILE="${DIR}/tls.go"
- local OUTFILE="${DIR}/tls_old.go"
- [[ "$#" -gt 0 ]] && OUTFILE="$1"
- readonly OUTFILE
-
- cat <<EOF >$OUTFILE
-// THIS IS NOT THE FILE YOU WANT.
-// DO NOT EDIT THIS FILE.
-//
-// This file has been generated using the tls_generate_old.sh script.
-// Please do NOT make edits to this file. Instead edit tls.go and
-// use the script to regenerate this file
-
-EOF
- cat "${INFILE}" |
- sed -e 's|// +build go1.4|// +build !go1.4|' |
- sed -e 's|"crypto/tls"|tls "veyron.io/veyron/veyron/runtimes/google/ipc/stream/crypto/tlsfork"|' >>$OUTFILE
-
- veyron go fmt "${OUTFILE}"
-}
-
-main "$@"
diff --git a/runtimes/google/ipc/stream/crypto/tls_old.go b/runtimes/google/ipc/stream/crypto/tls_old.go
deleted file mode 100644
index 73a60f5..0000000
--- a/runtimes/google/ipc/stream/crypto/tls_old.go
+++ /dev/null
@@ -1,261 +0,0 @@
-// THIS IS NOT THE FILE YOU WANT.
-// DO NOT EDIT THIS FILE.
-//
-// This file has been generated using the tls_generate_old.sh script.
-// Please do NOT make edits to this file. Instead edit tls.go and
-// use the script to regenerate this file
-
-// +build !go1.4
-
-package crypto
-
-import (
- "bytes"
- "errors"
- "fmt"
- "io"
- "net"
- "sync"
- "time"
- tls "veyron.io/veyron/veyron/runtimes/google/ipc/stream/crypto/tlsfork"
-
- "veyron.io/veyron/veyron/runtimes/google/lib/iobuf"
-)
-
-var errDeadlinesNotSupported = errors.New("deadlines not supported")
-
-// TLSClientSessionCacheOpt specifies the ClientSessionCache used to resume TLS sessions.
-// It adapts tls.ClientSessionCache to the veyron2/ipc/stream.VCOpt interface.
-type TLSClientSessionCache struct{ tls.ClientSessionCache }
-
-func (TLSClientSessionCache) IPCStreamVCOpt() {}
-
-// NewTLSClientSessionCache creates a new session cache.
-// TODO(ashankar): Remove this once go1.4 is released and tlsfork can be release, at that
-// point use crypto/tls.NewLRUClientSessionCache directly.
-func NewTLSClientSessionCache() TLSClientSessionCache {
- return TLSClientSessionCache{tls.NewLRUClientSessionCache(-1)}
-}
-
-// NewTLSClient returns a Crypter implementation that uses TLS, assuming
-// handshaker was initiated by a client.
-func NewTLSClient(handshaker io.ReadWriteCloser, local, remote net.Addr, sessionCache TLSClientSessionCache, pool *iobuf.Pool) (Crypter, error) {
- var config tls.Config
- // TLS + resumption + channel bindings is broken: <https://secure-resumption.com/#channelbindings>.
- config.SessionTicketsDisabled = true
- config.InsecureSkipVerify = true
- config.ClientSessionCache = sessionCache.ClientSessionCache
- return newTLSCrypter(handshaker, local, remote, &config, pool, false)
-}
-
-// NewTLSServer returns a Crypter implementation that uses TLS, assuming
-// handshaker was accepted by a server.
-func NewTLSServer(handshaker io.ReadWriteCloser, local, remote net.Addr, pool *iobuf.Pool) (Crypter, error) {
- return newTLSCrypter(handshaker, local, remote, ServerTLSConfig(), pool, true)
-}
-
-type fakeConn struct {
- handshakeConn io.ReadWriteCloser
- out bytes.Buffer
- in []byte
- laddr, raddr net.Addr
-}
-
-func (c *fakeConn) Read(b []byte) (n int, err error) {
- if c.handshakeConn != nil {
- return c.handshakeConn.Read(b)
- }
- if len(c.in) == 0 {
- return 0, tempError{}
- }
- n = copy(b, c.in)
- c.in = c.in[n:]
- return
-}
-
-func (c *fakeConn) Write(b []byte) (int, error) {
- if c.handshakeConn != nil {
- return c.handshakeConn.Write(b)
- }
- return c.out.Write(b)
-}
-
-func (*fakeConn) Close() error { return nil }
-func (c *fakeConn) LocalAddr() net.Addr { return c.laddr }
-func (c *fakeConn) RemoteAddr() net.Addr { return c.raddr }
-func (*fakeConn) SetDeadline(t time.Time) error { return errDeadlinesNotSupported }
-func (*fakeConn) SetReadDeadline(t time.Time) error { return errDeadlinesNotSupported }
-func (*fakeConn) SetWriteDeadline(t time.Time) error { return errDeadlinesNotSupported }
-
-// tempError implements net.Error and returns true for Temporary.
-// Providing this error in fakeConn.Read allows tls.Conn.Read to return with an
-// error without changing underlying state.
-type tempError struct{}
-
-func (tempError) Error() string { return "end of encrypted slice" }
-func (tempError) Timeout() bool { return false }
-func (tempError) Temporary() bool { return true }
-
-// tlsCrypter implements the Crypter interface using crypto/tls.
-//
-// crypto/tls provides a net.Conn, while the Crypter interface operates on
-// iobuf.Slice objects. In order to adapt to the Crypter interface, the
-// strategy is as follows:
-//
-// - netTLSCrypter wraps a net.Conn with an alternative implementation
-// (fakeConn) for the TLS handshake protocol.
-// - Once the TLS handshake is complete, fakeConn switches to a mode where all
-// Write calls add to a bytes.Buffer and all Read calls read from a
-// bytes.Buffer.
-// - Encrypt uses tls.Conn.Write, which in-turn invokes fakeConn.Write and then
-// it extracts the contents of the underlying bytes.Buffer.
-// - Decrypt adds to the read buffer and then invokes tls.Conn.Read, which
-// in-turn invokes fakeConn.Read, which reads from that buffer.
-type tlsCrypter struct {
- mu sync.Mutex
- alloc *iobuf.Allocator
- tls *tls.Conn
- fc *fakeConn
-}
-
-func newTLSCrypter(handshaker io.ReadWriteCloser, local, remote net.Addr, config *tls.Config, pool *iobuf.Pool, server bool) (Crypter, error) {
- fc := &fakeConn{handshakeConn: handshaker, laddr: local, raddr: remote}
- var t *tls.Conn
- if server {
- t = tls.Server(fc, config)
- } else {
- // The TLS handshake protocol ends with a message received by the client.
- // handshaker should be closed only after the handshake protocol completes.
- // So, the client closes the handshaker.
- defer handshaker.Close()
- t = tls.Client(fc, config)
- }
- if err := t.Handshake(); err != nil {
- return nil, err
- }
- // Must have used Diffie-Hellman to exchange keys (so that the key
- // selection is independent of any TLS certificates used).
- // This helps ensure that identities exchanged during the veyron
- // authentication protocol
- // (http://goto.google.com/veyron:authentication) cannot be stolen and
- // are bound to the session key established during the TLS handshake.
- switch cs := t.ConnectionState().CipherSuite; cs {
- case tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA:
- case tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA:
- case tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA:
- case tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA:
- case tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA:
- case tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA:
- case tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA:
- case tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256:
- case tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256:
- default:
- t.Close()
- return nil, fmt.Errorf("CipherSuite 0x%04x is not recognized. Must use one that uses Diffie-Hellman as the key exchange algorithm", cs)
- }
- fc.handshakeConn = nil
- return &tlsCrypter{
- alloc: iobuf.NewAllocator(pool, 0),
- tls: t,
- fc: fc,
- }, nil
-}
-
-func (c *tlsCrypter) Encrypt(plaintext *iobuf.Slice) (*iobuf.Slice, error) {
- defer plaintext.Release()
- c.mu.Lock()
- defer c.mu.Unlock()
- defer c.fc.out.Reset()
- if _, err := c.tls.Write(plaintext.Contents); err != nil {
- return nil, err
- }
- return c.alloc.Copy(c.fc.out.Bytes()), nil
-}
-
-func (c *tlsCrypter) Decrypt(ciphertext *iobuf.Slice) (*iobuf.Slice, error) {
- if ciphertext.Size() == 0 {
- return ciphertext, nil
- }
- c.mu.Lock()
- defer c.mu.Unlock()
- c.fc.in = ciphertext.Contents
- // Given the cipher suites used, len(plaintext) < len(ciphertext)
- // (ciphertext includes TLS record headers). Allocating space for
- // plaintext based on ciphertext.Size should suffice.
- plaintext := c.alloc.Alloc(uint(ciphertext.Size()))
- out := plaintext.Contents
- for {
- n, err := c.tls.Read(out)
- if err != nil {
- if _, exit := err.(tempError); exit {
- break
- }
- plaintext.Release()
- return nil, err
- }
- out = out[n:]
- }
- plaintext.Contents = plaintext.Contents[:plaintext.Size()-len(out)]
- return plaintext, nil
-}
-
-func (c *tlsCrypter) String() string {
- state := c.tls.ConnectionState()
- return fmt.Sprintf("TLS CipherSuite:0x%04x Resumed:%v", state.CipherSuite, state.DidResume)
-}
-
-// ServerTLSConfig returns the tls.Config used by NewTLSServer.
-func ServerTLSConfig() *tls.Config {
- c, err := tls.X509KeyPair([]byte(serverCert), []byte(serverKey))
- if err != nil {
- panic(err)
- }
- return &tls.Config{
- // TLS + resumption + channel bindings is broken: <https://secure-resumption.com/#channelbindings>.
- SessionTicketsDisabled: true,
- Certificates: []tls.Certificate{c},
- InsecureSkipVerify: true,
- // RC4_128_SHA is 4-5X faster compared to the other cipher suites.
- // There are concerns with its security (see http://en.wikipedia.org/wiki/RC4 and
- // https://www.usenix.org/conference/usenixsecurity13/technical-sessions/paper/alFardan),
- // so this decision will be revisted.
- // TODO(ashankar,ataly): Figure out what cipher to use and how to
- // have a speedy Go implementation of it.
- CipherSuites: []uint16{tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA},
- }
-}
-
-func (c *tlsCrypter) ChannelBinding() []byte {
- return c.tls.ConnectionState().TLSUnique
-}
-
-// TODO(ashankar): Get rid of TLS certificates completely after implementing an
-// anonymous key-exchange mechanism. See F.1.1.1 in RFC 5246.
-//
-// PEM-encoded certificates and keys used in the tests.
-// One way to generate them is:
-// go run $GOROOT/src/pkg/crypto/tls/generate_cert.go --host=localhost --duration=87600h --ecdsa-curve=P256
-// (This generates a self-signed certificate valid for 10 years)
-// (The --ecdsa-curve flag has not yet been submitted back to the Go repository)
-// which will create cert.pem and key.pem files.
-const (
- serverCert = `
------BEGIN CERTIFICATE-----
-MIIBbTCCAROgAwIBAgIQMD+Kzawjvhij1B/BmvHxLDAKBggqhkjOPQQDAjASMRAw
-DgYDVQQKEwdBY21lIENvMB4XDTE0MDcxODIzMTYxMloXDTI0MDcxNTIzMTYxMlow
-EjEQMA4GA1UEChMHQWNtZSBDbzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABLiz
-Ajsly1DS8NJF2KE195V83TgidfgGEB7nudscdKWH3+5uQHgCc+2BV/7AGGj3yePR
-ZZLzYD95goJ/a7eet/2jSzBJMA4GA1UdDwEB/wQEAwIAoDATBgNVHSUEDDAKBggr
-BgEFBQcDATAMBgNVHRMBAf8EAjAAMBQGA1UdEQQNMAuCCWxvY2FsaG9zdDAKBggq
-hkjOPQQDAgNIADBFAiAb4tBxggEpnKdxv66TBVFxAUn3EBWX25XlL1G2GF8RkAIh
-AOAwys3mvzM4Td/2kV9QNyQPZ9kLLQr9A9ryB0H3N9Yz
------END CERTIFICATE-----
-`
- serverKey = `
------BEGIN ECDSA PRIVATE KEY-----
-MHcCAQEEIPLfwg+SVC2/xUcKq0bI9y2+SDEEdCeGuxuBz22BhAw1oAoGCCqGSM49
-AwEHoUQDQgAEuLMCOyXLUNLw0kXYoTX3lXzdOCJ1+AYQHue52xx0pYff7m5AeAJz
-7YFX/sAYaPfJ49FlkvNgP3mCgn9rt563/Q==
------END ECDSA PRIVATE KEY-----
-`
-)
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/LICENSE b/runtimes/google/ipc/stream/crypto/tlsfork/LICENSE
deleted file mode 100644
index 8c792f4..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/LICENSE
+++ /dev/null
@@ -1,29 +0,0 @@
-// Source code from the Go project: http://golang.org
-
-Copyright (c) 2012 The Go Authors. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with the
-distribution.
- * Neither the name of Google Inc. nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/alert.go b/runtimes/google/ipc/stream/crypto/tlsfork/alert.go
deleted file mode 100644
index 252e455..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/alert.go
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.4
-
-package tls
-
-import "strconv"
-
-type alert uint8
-
-const (
- // alert level
- alertLevelWarning = 1
- alertLevelError = 2
-)
-
-const (
- alertCloseNotify alert = 0
- alertUnexpectedMessage alert = 10
- alertBadRecordMAC alert = 20
- alertDecryptionFailed alert = 21
- alertRecordOverflow alert = 22
- alertDecompressionFailure alert = 30
- alertHandshakeFailure alert = 40
- alertBadCertificate alert = 42
- alertUnsupportedCertificate alert = 43
- alertCertificateRevoked alert = 44
- alertCertificateExpired alert = 45
- alertCertificateUnknown alert = 46
- alertIllegalParameter alert = 47
- alertUnknownCA alert = 48
- alertAccessDenied alert = 49
- alertDecodeError alert = 50
- alertDecryptError alert = 51
- alertProtocolVersion alert = 70
- alertInsufficientSecurity alert = 71
- alertInternalError alert = 80
- alertUserCanceled alert = 90
- alertNoRenegotiation alert = 100
-)
-
-var alertText = map[alert]string{
- alertCloseNotify: "close notify",
- alertUnexpectedMessage: "unexpected message",
- alertBadRecordMAC: "bad record MAC",
- alertDecryptionFailed: "decryption failed",
- alertRecordOverflow: "record overflow",
- alertDecompressionFailure: "decompression failure",
- alertHandshakeFailure: "handshake failure",
- alertBadCertificate: "bad certificate",
- alertUnsupportedCertificate: "unsupported certificate",
- alertCertificateRevoked: "revoked certificate",
- alertCertificateExpired: "expired certificate",
- alertCertificateUnknown: "unknown certificate",
- alertIllegalParameter: "illegal parameter",
- alertUnknownCA: "unknown certificate authority",
- alertAccessDenied: "access denied",
- alertDecodeError: "error decoding message",
- alertDecryptError: "error decrypting message",
- alertProtocolVersion: "protocol version not supported",
- alertInsufficientSecurity: "insufficient security level",
- alertInternalError: "internal error",
- alertUserCanceled: "user canceled",
- alertNoRenegotiation: "no renegotiation",
-}
-
-func (e alert) String() string {
- s, ok := alertText[e]
- if ok {
- return s
- }
- return "alert(" + strconv.Itoa(int(e)) + ")"
-}
-
-func (e alert) Error() string {
- return e.String()
-}
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/cipher_suites.go b/runtimes/google/ipc/stream/crypto/tlsfork/cipher_suites.go
deleted file mode 100644
index bfa083b..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/cipher_suites.go
+++ /dev/null
@@ -1,272 +0,0 @@
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.4
-
-package tls
-
-import (
- "crypto/aes"
- "crypto/cipher"
- "crypto/des"
- "crypto/hmac"
- "crypto/rc4"
- "crypto/sha1"
- "crypto/x509"
- "hash"
-)
-
-// a keyAgreement implements the client and server side of a TLS key agreement
-// protocol by generating and processing key exchange messages.
-type keyAgreement interface {
- // On the server side, the first two methods are called in order.
-
- // In the case that the key agreement protocol doesn't use a
- // ServerKeyExchange message, generateServerKeyExchange can return nil,
- // nil.
- generateServerKeyExchange(*Config, *Certificate, *clientHelloMsg, *serverHelloMsg) (*serverKeyExchangeMsg, error)
- processClientKeyExchange(*Config, *Certificate, *clientKeyExchangeMsg, uint16) ([]byte, error)
-
- // On the client side, the next two methods are called in order.
-
- // This method may not be called if the server doesn't send a
- // ServerKeyExchange message.
- processServerKeyExchange(*Config, *clientHelloMsg, *serverHelloMsg, *x509.Certificate, *serverKeyExchangeMsg) error
- generateClientKeyExchange(*Config, *clientHelloMsg, *x509.Certificate) ([]byte, *clientKeyExchangeMsg, error)
-}
-
-const (
- // suiteECDH indicates that the cipher suite involves elliptic curve
- // Diffie-Hellman. This means that it should only be selected when the
- // client indicates that it supports ECC with a curve and point format
- // that we're happy with.
- suiteECDHE = 1 << iota
- // suiteECDSA indicates that the cipher suite involves an ECDSA
- // signature and therefore may only be selected when the server's
- // certificate is ECDSA. If this is not set then the cipher suite is
- // RSA based.
- suiteECDSA
- // suiteTLS12 indicates that the cipher suite should only be advertised
- // and accepted when using TLS 1.2.
- suiteTLS12
-)
-
-// A cipherSuite is a specific combination of key agreement, cipher and MAC
-// function. All cipher suites currently assume RSA key agreement.
-type cipherSuite struct {
- id uint16
- // the lengths, in bytes, of the key material needed for each component.
- keyLen int
- macLen int
- ivLen int
- ka func(version uint16) keyAgreement
- // flags is a bitmask of the suite* values, above.
- flags int
- cipher func(key, iv []byte, isRead bool) interface{}
- mac func(version uint16, macKey []byte) macFunction
- aead func(key, fixedNonce []byte) cipher.AEAD
-}
-
-var cipherSuites = []*cipherSuite{
- // Ciphersuite order is chosen so that ECDHE comes before plain RSA
- // and RC4 comes before AES (because of the Lucky13 attack).
- {TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, 16, 0, 4, ecdheRSAKA, suiteECDHE | suiteTLS12, nil, nil, aeadAESGCM},
- {TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, 16, 0, 4, ecdheECDSAKA, suiteECDHE | suiteECDSA | suiteTLS12, nil, nil, aeadAESGCM},
- {TLS_ECDHE_RSA_WITH_RC4_128_SHA, 16, 20, 0, ecdheRSAKA, suiteECDHE, cipherRC4, macSHA1, nil},
- {TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, 16, 20, 0, ecdheECDSAKA, suiteECDHE | suiteECDSA, cipherRC4, macSHA1, nil},
- {TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, 16, 20, 16, ecdheRSAKA, suiteECDHE, cipherAES, macSHA1, nil},
- {TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, 16, 20, 16, ecdheECDSAKA, suiteECDHE | suiteECDSA, cipherAES, macSHA1, nil},
- {TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, 32, 20, 16, ecdheRSAKA, suiteECDHE, cipherAES, macSHA1, nil},
- {TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, 32, 20, 16, ecdheECDSAKA, suiteECDHE | suiteECDSA, cipherAES, macSHA1, nil},
- {TLS_RSA_WITH_RC4_128_SHA, 16, 20, 0, rsaKA, 0, cipherRC4, macSHA1, nil},
- {TLS_RSA_WITH_AES_128_CBC_SHA, 16, 20, 16, rsaKA, 0, cipherAES, macSHA1, nil},
- {TLS_RSA_WITH_AES_256_CBC_SHA, 32, 20, 16, rsaKA, 0, cipherAES, macSHA1, nil},
- {TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, 24, 20, 8, ecdheRSAKA, suiteECDHE, cipher3DES, macSHA1, nil},
- {TLS_RSA_WITH_3DES_EDE_CBC_SHA, 24, 20, 8, rsaKA, 0, cipher3DES, macSHA1, nil},
-}
-
-func cipherRC4(key, iv []byte, isRead bool) interface{} {
- cipher, _ := rc4.NewCipher(key)
- return cipher
-}
-
-func cipher3DES(key, iv []byte, isRead bool) interface{} {
- block, _ := des.NewTripleDESCipher(key)
- if isRead {
- return cipher.NewCBCDecrypter(block, iv)
- }
- return cipher.NewCBCEncrypter(block, iv)
-}
-
-func cipherAES(key, iv []byte, isRead bool) interface{} {
- block, _ := aes.NewCipher(key)
- if isRead {
- return cipher.NewCBCDecrypter(block, iv)
- }
- return cipher.NewCBCEncrypter(block, iv)
-}
-
-// macSHA1 returns a macFunction for the given protocol version.
-func macSHA1(version uint16, key []byte) macFunction {
- if version == VersionSSL30 {
- mac := ssl30MAC{
- h: sha1.New(),
- key: make([]byte, len(key)),
- }
- copy(mac.key, key)
- return mac
- }
- return tls10MAC{hmac.New(sha1.New, key)}
-}
-
-type macFunction interface {
- Size() int
- MAC(digestBuf, seq, header, data []byte) []byte
-}
-
-// fixedNonceAEAD wraps an AEAD and prefixes a fixed portion of the nonce to
-// each call.
-type fixedNonceAEAD struct {
- // sealNonce and openNonce are buffers where the larger nonce will be
- // constructed. Since a seal and open operation may be running
- // concurrently, there is a separate buffer for each.
- sealNonce, openNonce []byte
- aead cipher.AEAD
-}
-
-func (f *fixedNonceAEAD) NonceSize() int { return 8 }
-func (f *fixedNonceAEAD) Overhead() int { return f.aead.Overhead() }
-
-func (f *fixedNonceAEAD) Seal(out, nonce, plaintext, additionalData []byte) []byte {
- copy(f.sealNonce[len(f.sealNonce)-8:], nonce)
- return f.aead.Seal(out, f.sealNonce, plaintext, additionalData)
-}
-
-func (f *fixedNonceAEAD) Open(out, nonce, plaintext, additionalData []byte) ([]byte, error) {
- copy(f.openNonce[len(f.openNonce)-8:], nonce)
- return f.aead.Open(out, f.openNonce, plaintext, additionalData)
-}
-
-func aeadAESGCM(key, fixedNonce []byte) cipher.AEAD {
- aes, err := aes.NewCipher(key)
- if err != nil {
- panic(err)
- }
- aead, err := cipher.NewGCM(aes)
- if err != nil {
- panic(err)
- }
-
- nonce1, nonce2 := make([]byte, 12), make([]byte, 12)
- copy(nonce1, fixedNonce)
- copy(nonce2, fixedNonce)
-
- return &fixedNonceAEAD{nonce1, nonce2, aead}
-}
-
-// ssl30MAC implements the SSLv3 MAC function, as defined in
-// www.mozilla.org/projects/security/pki/nss/ssl/draft302.txt section 5.2.3.1
-type ssl30MAC struct {
- h hash.Hash
- key []byte
-}
-
-func (s ssl30MAC) Size() int {
- return s.h.Size()
-}
-
-var ssl30Pad1 = [48]byte{0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36}
-
-var ssl30Pad2 = [48]byte{0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c}
-
-func (s ssl30MAC) MAC(digestBuf, seq, header, data []byte) []byte {
- padLength := 48
- if s.h.Size() == 20 {
- padLength = 40
- }
-
- s.h.Reset()
- s.h.Write(s.key)
- s.h.Write(ssl30Pad1[:padLength])
- s.h.Write(seq)
- s.h.Write(header[:1])
- s.h.Write(header[3:5])
- s.h.Write(data)
- digestBuf = s.h.Sum(digestBuf[:0])
-
- s.h.Reset()
- s.h.Write(s.key)
- s.h.Write(ssl30Pad2[:padLength])
- s.h.Write(digestBuf)
- return s.h.Sum(digestBuf[:0])
-}
-
-// tls10MAC implements the TLS 1.0 MAC function. RFC 2246, section 6.2.3.
-type tls10MAC struct {
- h hash.Hash
-}
-
-func (s tls10MAC) Size() int {
- return s.h.Size()
-}
-
-func (s tls10MAC) MAC(digestBuf, seq, header, data []byte) []byte {
- s.h.Reset()
- s.h.Write(seq)
- s.h.Write(header)
- s.h.Write(data)
- return s.h.Sum(digestBuf[:0])
-}
-
-func rsaKA(version uint16) keyAgreement {
- return rsaKeyAgreement{}
-}
-
-func ecdheECDSAKA(version uint16) keyAgreement {
- return &ecdheKeyAgreement{
- sigType: signatureECDSA,
- version: version,
- }
-}
-
-func ecdheRSAKA(version uint16) keyAgreement {
- return &ecdheKeyAgreement{
- sigType: signatureRSA,
- version: version,
- }
-}
-
-// mutualCipherSuite returns a cipherSuite given a list of supported
-// ciphersuites and the id requested by the peer.
-func mutualCipherSuite(have []uint16, want uint16) *cipherSuite {
- for _, id := range have {
- if id == want {
- for _, suite := range cipherSuites {
- if suite.id == want {
- return suite
- }
- }
- return nil
- }
- }
- return nil
-}
-
-// A list of the possible cipher suite ids. Taken from
-// http://www.iana.org/assignments/tls-parameters/tls-parameters.xml
-const (
- TLS_RSA_WITH_RC4_128_SHA uint16 = 0x0005
- TLS_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0x000a
- TLS_RSA_WITH_AES_128_CBC_SHA uint16 = 0x002f
- TLS_RSA_WITH_AES_256_CBC_SHA uint16 = 0x0035
- TLS_ECDHE_ECDSA_WITH_RC4_128_SHA uint16 = 0xc007
- TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA uint16 = 0xc009
- TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA uint16 = 0xc00a
- TLS_ECDHE_RSA_WITH_RC4_128_SHA uint16 = 0xc011
- TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0xc012
- TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA uint16 = 0xc013
- TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA uint16 = 0xc014
- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 uint16 = 0xc02f
- TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 uint16 = 0xc02b
-)
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/common.go b/runtimes/google/ipc/stream/crypto/tlsfork/common.go
deleted file mode 100644
index 54b958b..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/common.go
+++ /dev/null
@@ -1,618 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.4
-
-package tls
-
-import (
- "container/list"
- "crypto"
- "crypto/rand"
- "crypto/x509"
- "fmt"
- "io"
- "math/big"
- "strings"
- "sync"
- "time"
-)
-
-const (
- VersionSSL30 = 0x0300
- VersionTLS10 = 0x0301
- VersionTLS11 = 0x0302
- VersionTLS12 = 0x0303
-)
-
-const (
- maxPlaintext = 16384 // maximum plaintext payload length
- maxCiphertext = 16384 + 2048 // maximum ciphertext payload length
- recordHeaderLen = 5 // record header length
- maxHandshake = 65536 // maximum handshake we support (protocol max is 16 MB)
-
- minVersion = VersionSSL30
- maxVersion = VersionTLS12
-)
-
-// TLS record types.
-type recordType uint8
-
-const (
- recordTypeChangeCipherSpec recordType = 20
- recordTypeAlert recordType = 21
- recordTypeHandshake recordType = 22
- recordTypeApplicationData recordType = 23
-)
-
-// TLS handshake message types.
-const (
- typeClientHello uint8 = 1
- typeServerHello uint8 = 2
- typeNewSessionTicket uint8 = 4
- typeCertificate uint8 = 11
- typeServerKeyExchange uint8 = 12
- typeCertificateRequest uint8 = 13
- typeServerHelloDone uint8 = 14
- typeCertificateVerify uint8 = 15
- typeClientKeyExchange uint8 = 16
- typeFinished uint8 = 20
- typeCertificateStatus uint8 = 22
- typeNextProtocol uint8 = 67 // Not IANA assigned
-)
-
-// TLS compression types.
-const (
- compressionNone uint8 = 0
-)
-
-// TLS extension numbers
-const (
- extensionServerName uint16 = 0
- extensionStatusRequest uint16 = 5
- extensionSupportedCurves uint16 = 10
- extensionSupportedPoints uint16 = 11
- extensionSignatureAlgorithms uint16 = 13
- extensionALPN uint16 = 16
- extensionSessionTicket uint16 = 35
- extensionNextProtoNeg uint16 = 13172 // not IANA assigned
- extensionRenegotiationInfo uint16 = 0xff01
-)
-
-// TLS signaling cipher suite values
-const (
- scsvRenegotiation uint16 = 0x00ff
-)
-
-// CurveID is the type of a TLS identifier for an elliptic curve. See
-// http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-8
-type CurveID uint16
-
-const (
- CurveP256 CurveID = 23
- CurveP384 CurveID = 24
- CurveP521 CurveID = 25
-)
-
-// TLS Elliptic Curve Point Formats
-// http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-9
-const (
- pointFormatUncompressed uint8 = 0
-)
-
-// TLS CertificateStatusType (RFC 3546)
-const (
- statusTypeOCSP uint8 = 1
-)
-
-// Certificate types (for certificateRequestMsg)
-const (
- certTypeRSASign = 1 // A certificate containing an RSA key
- certTypeDSSSign = 2 // A certificate containing a DSA key
- certTypeRSAFixedDH = 3 // A certificate containing a static DH key
- certTypeDSSFixedDH = 4 // A certificate containing a static DH key
-
- // See RFC4492 sections 3 and 5.5.
- certTypeECDSASign = 64 // A certificate containing an ECDSA-capable public key, signed with ECDSA.
- certTypeRSAFixedECDH = 65 // A certificate containing an ECDH-capable public key, signed with RSA.
- certTypeECDSAFixedECDH = 66 // A certificate containing an ECDH-capable public key, signed with ECDSA.
-
- // Rest of these are reserved by the TLS spec
-)
-
-// Hash functions for TLS 1.2 (See RFC 5246, section A.4.1)
-const (
- hashSHA1 uint8 = 2
- hashSHA256 uint8 = 4
-)
-
-// Signature algorithms for TLS 1.2 (See RFC 5246, section A.4.1)
-const (
- signatureRSA uint8 = 1
- signatureECDSA uint8 = 3
-)
-
-// signatureAndHash mirrors the TLS 1.2, SignatureAndHashAlgorithm struct. See
-// RFC 5246, section A.4.1.
-type signatureAndHash struct {
- hash, signature uint8
-}
-
-// supportedSKXSignatureAlgorithms contains the signature and hash algorithms
-// that the code advertises as supported in a TLS 1.2 ClientHello.
-var supportedSKXSignatureAlgorithms = []signatureAndHash{
- {hashSHA256, signatureRSA},
- {hashSHA256, signatureECDSA},
- {hashSHA1, signatureRSA},
- {hashSHA1, signatureECDSA},
-}
-
-// supportedClientCertSignatureAlgorithms contains the signature and hash
-// algorithms that the code advertises as supported in a TLS 1.2
-// CertificateRequest.
-var supportedClientCertSignatureAlgorithms = []signatureAndHash{
- {hashSHA256, signatureRSA},
- {hashSHA256, signatureECDSA},
-}
-
-// ConnectionState records basic TLS details about the connection.
-type ConnectionState struct {
- Version uint16 // TLS version used by the connection (e.g. VersionTLS12)
- HandshakeComplete bool // TLS handshake is complete
- DidResume bool // connection resumes a previous TLS connection
- CipherSuite uint16 // cipher suite in use (TLS_RSA_WITH_RC4_128_SHA, ...)
- NegotiatedProtocol string // negotiated next protocol (from Config.NextProtos)
- NegotiatedProtocolIsMutual bool // negotiated protocol was advertised by server
- ServerName string // server name requested by client, if any (server side only)
- PeerCertificates []*x509.Certificate // certificate chain presented by remote peer
- VerifiedChains [][]*x509.Certificate // verified chains built from PeerCertificates
-
- // TLSUnique contains the "tls-unique" channel binding value (see RFC
- // 5929, section 3). For resumed sessions this value will be nil
- // because resumption does not include enough context (see
- // https://secure-resumption.com/#channelbindings). This will change in
- // future versions of Go once the TLS master-secret fix has been
- // standardized and implemented.
- TLSUnique []byte
-}
-
-// ClientAuthType declares the policy the server will follow for
-// TLS Client Authentication.
-type ClientAuthType int
-
-const (
- NoClientCert ClientAuthType = iota
- RequestClientCert
- RequireAnyClientCert
- VerifyClientCertIfGiven
- RequireAndVerifyClientCert
-)
-
-// ClientSessionState contains the state needed by clients to resume TLS
-// sessions.
-type ClientSessionState struct {
- sessionTicket []uint8 // Encrypted ticket used for session resumption with server
- vers uint16 // SSL/TLS version negotiated for the session
- cipherSuite uint16 // Ciphersuite negotiated for the session
- masterSecret []byte // MasterSecret generated by client on a full handshake
- serverCertificates []*x509.Certificate // Certificate chain presented by the server
-}
-
-// ClientSessionCache is a cache of ClientSessionState objects that can be used
-// by a client to resume a TLS session with a given server. ClientSessionCache
-// implementations should expect to be called concurrently from different
-// goroutines.
-type ClientSessionCache interface {
- // Get searches for a ClientSessionState associated with the given key.
- // On return, ok is true if one was found.
- Get(sessionKey string) (session *ClientSessionState, ok bool)
-
- // Put adds the ClientSessionState to the cache with the given key.
- Put(sessionKey string, cs *ClientSessionState)
-}
-
-// ClientHelloInfo contains information from a ClientHello message in order to
-// guide certificate selection in the GetCertificate callback.
-type ClientHelloInfo struct {
- // CipherSuites lists the CipherSuites supported by the client (e.g.
- // TLS_RSA_WITH_RC4_128_SHA).
- CipherSuites []uint16
-
- // ServerName indicates the name of the server requested by the client
- // in order to support virtual hosting. ServerName is only set if the
- // client is using SNI (see
- // http://tools.ietf.org/html/rfc4366#section-3.1).
- ServerName string
-
- // SupportedCurves lists the elliptic curves supported by the client.
- // SupportedCurves is set only if the Supported Elliptic Curves
- // Extension is being used (see
- // http://tools.ietf.org/html/rfc4492#section-5.1.1).
- SupportedCurves []CurveID
-
- // SupportedPoints lists the point formats supported by the client.
- // SupportedPoints is set only if the Supported Point Formats Extension
- // is being used (see
- // http://tools.ietf.org/html/rfc4492#section-5.1.2).
- SupportedPoints []uint8
-}
-
-// A Config structure is used to configure a TLS client or server.
-// After one has been passed to a TLS function it must not be
-// modified. A Config may be reused; the tls package will also not
-// modify it.
-type Config struct {
- // Rand provides the source of entropy for nonces and RSA blinding.
- // If Rand is nil, TLS uses the cryptographic random reader in package
- // crypto/rand.
- // The Reader must be safe for use by multiple goroutines.
- Rand io.Reader
-
- // Time returns the current time as the number of seconds since the epoch.
- // If Time is nil, TLS uses time.Now.
- Time func() time.Time
-
- // Certificates contains one or more certificate chains
- // to present to the other side of the connection.
- // Server configurations must include at least one certificate.
- Certificates []Certificate
-
- // NameToCertificate maps from a certificate name to an element of
- // Certificates. Note that a certificate name can be of the form
- // '*.example.com' and so doesn't have to be a domain name as such.
- // See Config.BuildNameToCertificate
- // The nil value causes the first element of Certificates to be used
- // for all connections.
- NameToCertificate map[string]*Certificate
-
- // GetCertificate returns a Certificate based on the given
- // ClientHelloInfo. If GetCertificate is nil or returns nil, then the
- // certificate is retrieved from NameToCertificate. If
- // NameToCertificate is nil, the first element of Certificates will be
- // used.
- GetCertificate func(clientHello *ClientHelloInfo) (*Certificate, error)
-
- // RootCAs defines the set of root certificate authorities
- // that clients use when verifying server certificates.
- // If RootCAs is nil, TLS uses the host's root CA set.
- RootCAs *x509.CertPool
-
- // NextProtos is a list of supported, application level protocols.
- NextProtos []string
-
- // ServerName is used to verify the hostname on the returned
- // certificates unless InsecureSkipVerify is given. It is also included
- // in the client's handshake to support virtual hosting.
- ServerName string
-
- // ClientAuth determines the server's policy for
- // TLS Client Authentication. The default is NoClientCert.
- ClientAuth ClientAuthType
-
- // ClientCAs defines the set of root certificate authorities
- // that servers use if required to verify a client certificate
- // by the policy in ClientAuth.
- ClientCAs *x509.CertPool
-
- // InsecureSkipVerify controls whether a client verifies the
- // server's certificate chain and host name.
- // If InsecureSkipVerify is true, TLS accepts any certificate
- // presented by the server and any host name in that certificate.
- // In this mode, TLS is susceptible to man-in-the-middle attacks.
- // This should be used only for testing.
- InsecureSkipVerify bool
-
- // CipherSuites is a list of supported cipher suites. If CipherSuites
- // is nil, TLS uses a list of suites supported by the implementation.
- CipherSuites []uint16
-
- // PreferServerCipherSuites controls whether the server selects the
- // client's most preferred ciphersuite, or the server's most preferred
- // ciphersuite. If true then the server's preference, as expressed in
- // the order of elements in CipherSuites, is used.
- PreferServerCipherSuites bool
-
- // SessionTicketsDisabled may be set to true to disable session ticket
- // (resumption) support.
- SessionTicketsDisabled bool
-
- // SessionTicketKey is used by TLS servers to provide session
- // resumption. See RFC 5077. If zero, it will be filled with
- // random data before the first server handshake.
- //
- // If multiple servers are terminating connections for the same host
- // they should all have the same SessionTicketKey. If the
- // SessionTicketKey leaks, previously recorded and future TLS
- // connections using that key are compromised.
- SessionTicketKey [32]byte
-
- // SessionCache is a cache of ClientSessionState entries for TLS session
- // resumption.
- ClientSessionCache ClientSessionCache
-
- // MinVersion contains the minimum SSL/TLS version that is acceptable.
- // If zero, then SSLv3 is taken as the minimum.
- MinVersion uint16
-
- // MaxVersion contains the maximum SSL/TLS version that is acceptable.
- // If zero, then the maximum version supported by this package is used,
- // which is currently TLS 1.2.
- MaxVersion uint16
-
- // CurvePreferences contains the elliptic curves that will be used in
- // an ECDHE handshake, in preference order. If empty, the default will
- // be used.
- CurvePreferences []CurveID
-
- serverInitOnce sync.Once // guards calling (*Config).serverInit
-}
-
-func (c *Config) serverInit() {
- if c.SessionTicketsDisabled {
- return
- }
-
- // If the key has already been set then we have nothing to do.
- for _, b := range c.SessionTicketKey {
- if b != 0 {
- return
- }
- }
-
- if _, err := io.ReadFull(c.rand(), c.SessionTicketKey[:]); err != nil {
- c.SessionTicketsDisabled = true
- }
-}
-
-func (c *Config) rand() io.Reader {
- r := c.Rand
- if r == nil {
- return rand.Reader
- }
- return r
-}
-
-func (c *Config) time() time.Time {
- t := c.Time
- if t == nil {
- t = time.Now
- }
- return t()
-}
-
-func (c *Config) cipherSuites() []uint16 {
- s := c.CipherSuites
- if s == nil {
- s = defaultCipherSuites()
- }
- return s
-}
-
-func (c *Config) minVersion() uint16 {
- if c == nil || c.MinVersion == 0 {
- return minVersion
- }
- return c.MinVersion
-}
-
-func (c *Config) maxVersion() uint16 {
- if c == nil || c.MaxVersion == 0 {
- return maxVersion
- }
- return c.MaxVersion
-}
-
-var defaultCurvePreferences = []CurveID{CurveP256, CurveP384, CurveP521}
-
-func (c *Config) curvePreferences() []CurveID {
- if c == nil || len(c.CurvePreferences) == 0 {
- return defaultCurvePreferences
- }
- return c.CurvePreferences
-}
-
-// mutualVersion returns the protocol version to use given the advertised
-// version of the peer.
-func (c *Config) mutualVersion(vers uint16) (uint16, bool) {
- minVersion := c.minVersion()
- maxVersion := c.maxVersion()
-
- if vers < minVersion {
- return 0, false
- }
- if vers > maxVersion {
- vers = maxVersion
- }
- return vers, true
-}
-
-// getCertificate returns the best certificate for the given ClientHelloInfo,
-// defaulting to the first element of c.Certificates.
-func (c *Config) getCertificate(clientHello *ClientHelloInfo) (*Certificate, error) {
- if c.GetCertificate != nil {
- cert, err := c.GetCertificate(clientHello)
- if cert != nil || err != nil {
- return cert, err
- }
- }
-
- if len(c.Certificates) == 1 || c.NameToCertificate == nil {
- // There's only one choice, so no point doing any work.
- return &c.Certificates[0], nil
- }
-
- name := strings.ToLower(clientHello.ServerName)
- for len(name) > 0 && name[len(name)-1] == '.' {
- name = name[:len(name)-1]
- }
-
- if cert, ok := c.NameToCertificate[name]; ok {
- return cert, nil
- }
-
- // try replacing labels in the name with wildcards until we get a
- // match.
- labels := strings.Split(name, ".")
- for i := range labels {
- labels[i] = "*"
- candidate := strings.Join(labels, ".")
- if cert, ok := c.NameToCertificate[candidate]; ok {
- return cert, nil
- }
- }
-
- // If nothing matches, return the first certificate.
- return &c.Certificates[0], nil
-}
-
-// BuildNameToCertificate parses c.Certificates and builds c.NameToCertificate
-// from the CommonName and SubjectAlternateName fields of each of the leaf
-// certificates.
-func (c *Config) BuildNameToCertificate() {
- c.NameToCertificate = make(map[string]*Certificate)
- for i := range c.Certificates {
- cert := &c.Certificates[i]
- x509Cert, err := x509.ParseCertificate(cert.Certificate[0])
- if err != nil {
- continue
- }
- if len(x509Cert.Subject.CommonName) > 0 {
- c.NameToCertificate[x509Cert.Subject.CommonName] = cert
- }
- for _, san := range x509Cert.DNSNames {
- c.NameToCertificate[san] = cert
- }
- }
-}
-
-// A Certificate is a chain of one or more certificates, leaf first.
-type Certificate struct {
- Certificate [][]byte
- PrivateKey crypto.PrivateKey // supported types: *rsa.PrivateKey, *ecdsa.PrivateKey
- // OCSPStaple contains an optional OCSP response which will be served
- // to clients that request it.
- OCSPStaple []byte
- // Leaf is the parsed form of the leaf certificate, which may be
- // initialized using x509.ParseCertificate to reduce per-handshake
- // processing for TLS clients doing client authentication. If nil, the
- // leaf certificate will be parsed as needed.
- Leaf *x509.Certificate
-}
-
-// A TLS record.
-type record struct {
- contentType recordType
- major, minor uint8
- payload []byte
-}
-
-type handshakeMessage interface {
- marshal() []byte
- unmarshal([]byte) bool
-}
-
-// lruSessionCache is a ClientSessionCache implementation that uses an LRU
-// caching strategy.
-type lruSessionCache struct {
- sync.Mutex
-
- m map[string]*list.Element
- q *list.List
- capacity int
-}
-
-type lruSessionCacheEntry struct {
- sessionKey string
- state *ClientSessionState
-}
-
-// NewLRUClientSessionCache returns a ClientSessionCache with the given
-// capacity that uses an LRU strategy. If capacity is < 1, a default capacity
-// is used instead.
-func NewLRUClientSessionCache(capacity int) ClientSessionCache {
- const defaultSessionCacheCapacity = 64
-
- if capacity < 1 {
- capacity = defaultSessionCacheCapacity
- }
- return &lruSessionCache{
- m: make(map[string]*list.Element),
- q: list.New(),
- capacity: capacity,
- }
-}
-
-// Put adds the provided (sessionKey, cs) pair to the cache.
-func (c *lruSessionCache) Put(sessionKey string, cs *ClientSessionState) {
- c.Lock()
- defer c.Unlock()
-
- if elem, ok := c.m[sessionKey]; ok {
- entry := elem.Value.(*lruSessionCacheEntry)
- entry.state = cs
- c.q.MoveToFront(elem)
- return
- }
-
- if c.q.Len() < c.capacity {
- entry := &lruSessionCacheEntry{sessionKey, cs}
- c.m[sessionKey] = c.q.PushFront(entry)
- return
- }
-
- elem := c.q.Back()
- entry := elem.Value.(*lruSessionCacheEntry)
- delete(c.m, entry.sessionKey)
- entry.sessionKey = sessionKey
- entry.state = cs
- c.q.MoveToFront(elem)
- c.m[sessionKey] = elem
-}
-
-// Get returns the ClientSessionState value associated with a given key. It
-// returns (nil, false) if no value is found.
-func (c *lruSessionCache) Get(sessionKey string) (*ClientSessionState, bool) {
- c.Lock()
- defer c.Unlock()
-
- if elem, ok := c.m[sessionKey]; ok {
- c.q.MoveToFront(elem)
- return elem.Value.(*lruSessionCacheEntry).state, true
- }
- return nil, false
-}
-
-// TODO(jsing): Make these available to both crypto/x509 and crypto/tls.
-type dsaSignature struct {
- R, S *big.Int
-}
-
-type ecdsaSignature dsaSignature
-
-var emptyConfig Config
-
-func defaultConfig() *Config {
- return &emptyConfig
-}
-
-var (
- once sync.Once
- varDefaultCipherSuites []uint16
-)
-
-func defaultCipherSuites() []uint16 {
- once.Do(initDefaultCipherSuites)
- return varDefaultCipherSuites
-}
-
-func initDefaultCipherSuites() {
- varDefaultCipherSuites = make([]uint16, len(cipherSuites))
- for i, suite := range cipherSuites {
- varDefaultCipherSuites[i] = suite.id
- }
-}
-
-func unexpectedMessageError(wanted, got interface{}) error {
- return fmt.Errorf("tls: received unexpected handshake message of type %T when waiting for %T", got, wanted)
-}
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/conn.go b/runtimes/google/ipc/stream/crypto/tlsfork/conn.go
deleted file mode 100644
index d9a7c50..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/conn.go
+++ /dev/null
@@ -1,1032 +0,0 @@
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// TLS low level connection and record layer
-
-// +build !go1.4
-
-package tls
-
-import (
- "bytes"
- "crypto/cipher"
- "crypto/subtle"
- "crypto/x509"
- "errors"
- "fmt"
- "io"
- "net"
- "sync"
- "time"
-)
-
-// A Conn represents a secured connection.
-// It implements the net.Conn interface.
-type Conn struct {
- // constant
- conn net.Conn
- isClient bool
-
- // constant after handshake; protected by handshakeMutex
- handshakeMutex sync.Mutex // handshakeMutex < in.Mutex, out.Mutex, errMutex
- handshakeErr error // error resulting from handshake
- vers uint16 // TLS version
- haveVers bool // version has been negotiated
- config *Config // configuration passed to constructor
- handshakeComplete bool
- didResume bool // whether this connection was a session resumption
- cipherSuite uint16
- ocspResponse []byte // stapled OCSP response
- peerCertificates []*x509.Certificate
- // verifiedChains contains the certificate chains that we built, as
- // opposed to the ones presented by the server.
- verifiedChains [][]*x509.Certificate
- // serverName contains the server name indicated by the client, if any.
- serverName string
- // firstFinished contains the first Finished hash sent during the
- // handshake. This is the "tls-unique" channel binding value.
- firstFinished [12]byte
-
- clientProtocol string
- clientProtocolFallback bool
-
- // input/output
- in, out halfConn // in.Mutex < out.Mutex
- rawInput *block // raw input, right off the wire
- input *block // application data waiting to be read
- hand bytes.Buffer // handshake data waiting to be read
-
- tmp [16]byte
-}
-
-// Access to net.Conn methods.
-// Cannot just embed net.Conn because that would
-// export the struct field too.
-
-// LocalAddr returns the local network address.
-func (c *Conn) LocalAddr() net.Addr {
- return c.conn.LocalAddr()
-}
-
-// RemoteAddr returns the remote network address.
-func (c *Conn) RemoteAddr() net.Addr {
- return c.conn.RemoteAddr()
-}
-
-// SetDeadline sets the read and write deadlines associated with the connection.
-// A zero value for t means Read and Write will not time out.
-// After a Write has timed out, the TLS state is corrupt and all future writes will return the same error.
-func (c *Conn) SetDeadline(t time.Time) error {
- return c.conn.SetDeadline(t)
-}
-
-// SetReadDeadline sets the read deadline on the underlying connection.
-// A zero value for t means Read will not time out.
-func (c *Conn) SetReadDeadline(t time.Time) error {
- return c.conn.SetReadDeadline(t)
-}
-
-// SetWriteDeadline sets the write deadline on the underlying connection.
-// A zero value for t means Write will not time out.
-// After a Write has timed out, the TLS state is corrupt and all future writes will return the same error.
-func (c *Conn) SetWriteDeadline(t time.Time) error {
- return c.conn.SetWriteDeadline(t)
-}
-
-// A halfConn represents one direction of the record layer
-// connection, either sending or receiving.
-type halfConn struct {
- sync.Mutex
-
- err error // first permanent error
- version uint16 // protocol version
- cipher interface{} // cipher algorithm
- mac macFunction
- seq [8]byte // 64-bit sequence number
- bfree *block // list of free blocks
-
- nextCipher interface{} // next encryption state
- nextMac macFunction // next MAC algorithm
-
- // used to save allocating a new buffer for each MAC.
- inDigestBuf, outDigestBuf []byte
-}
-
-func (hc *halfConn) setErrorLocked(err error) error {
- hc.err = err
- return err
-}
-
-func (hc *halfConn) error() error {
- hc.Lock()
- err := hc.err
- hc.Unlock()
- return err
-}
-
-// prepareCipherSpec sets the encryption and MAC states
-// that a subsequent changeCipherSpec will use.
-func (hc *halfConn) prepareCipherSpec(version uint16, cipher interface{}, mac macFunction) {
- hc.version = version
- hc.nextCipher = cipher
- hc.nextMac = mac
-}
-
-// changeCipherSpec changes the encryption and MAC states
-// to the ones previously passed to prepareCipherSpec.
-func (hc *halfConn) changeCipherSpec() error {
- if hc.nextCipher == nil {
- return alertInternalError
- }
- hc.cipher = hc.nextCipher
- hc.mac = hc.nextMac
- hc.nextCipher = nil
- hc.nextMac = nil
- for i := range hc.seq {
- hc.seq[i] = 0
- }
- return nil
-}
-
-// incSeq increments the sequence number.
-func (hc *halfConn) incSeq() {
- for i := 7; i >= 0; i-- {
- hc.seq[i]++
- if hc.seq[i] != 0 {
- return
- }
- }
-
- // Not allowed to let sequence number wrap.
- // Instead, must renegotiate before it does.
- // Not likely enough to bother.
- panic("TLS: sequence number wraparound")
-}
-
-// resetSeq resets the sequence number to zero.
-func (hc *halfConn) resetSeq() {
- for i := range hc.seq {
- hc.seq[i] = 0
- }
-}
-
-// removePadding returns an unpadded slice, in constant time, which is a prefix
-// of the input. It also returns a byte which is equal to 255 if the padding
-// was valid and 0 otherwise. See RFC 2246, section 6.2.3.2
-func removePadding(payload []byte) ([]byte, byte) {
- if len(payload) < 1 {
- return payload, 0
- }
-
- paddingLen := payload[len(payload)-1]
- t := uint(len(payload)-1) - uint(paddingLen)
- // if len(payload) >= (paddingLen - 1) then the MSB of t is zero
- good := byte(int32(^t) >> 31)
-
- toCheck := 255 // the maximum possible padding length
- // The length of the padded data is public, so we can use an if here
- if toCheck+1 > len(payload) {
- toCheck = len(payload) - 1
- }
-
- for i := 0; i < toCheck; i++ {
- t := uint(paddingLen) - uint(i)
- // if i <= paddingLen then the MSB of t is zero
- mask := byte(int32(^t) >> 31)
- b := payload[len(payload)-1-i]
- good &^= mask&paddingLen ^ mask&b
- }
-
- // We AND together the bits of good and replicate the result across
- // all the bits.
- good &= good << 4
- good &= good << 2
- good &= good << 1
- good = uint8(int8(good) >> 7)
-
- toRemove := good&paddingLen + 1
- return payload[:len(payload)-int(toRemove)], good
-}
-
-// removePaddingSSL30 is a replacement for removePadding in the case that the
-// protocol version is SSLv3. In this version, the contents of the padding
-// are random and cannot be checked.
-func removePaddingSSL30(payload []byte) ([]byte, byte) {
- if len(payload) < 1 {
- return payload, 0
- }
-
- paddingLen := int(payload[len(payload)-1]) + 1
- if paddingLen > len(payload) {
- return payload, 0
- }
-
- return payload[:len(payload)-paddingLen], 255
-}
-
-func roundUp(a, b int) int {
- return a + (b-a%b)%b
-}
-
-// cbcMode is an interface for block ciphers using cipher block chaining.
-type cbcMode interface {
- cipher.BlockMode
- SetIV([]byte)
-}
-
-// decrypt checks and strips the mac and decrypts the data in b. Returns a
-// success boolean, the number of bytes to skip from the start of the record in
-// order to get the application payload, and an optional alert value.
-func (hc *halfConn) decrypt(b *block) (ok bool, prefixLen int, alertValue alert) {
- // pull out payload
- payload := b.data[recordHeaderLen:]
-
- macSize := 0
- if hc.mac != nil {
- macSize = hc.mac.Size()
- }
-
- paddingGood := byte(255)
- explicitIVLen := 0
-
- // decrypt
- if hc.cipher != nil {
- switch c := hc.cipher.(type) {
- case cipher.Stream:
- c.XORKeyStream(payload, payload)
- case cipher.AEAD:
- explicitIVLen = 8
- if len(payload) < explicitIVLen {
- return false, 0, alertBadRecordMAC
- }
- nonce := payload[:8]
- payload = payload[8:]
-
- var additionalData [13]byte
- copy(additionalData[:], hc.seq[:])
- copy(additionalData[8:], b.data[:3])
- n := len(payload) - c.Overhead()
- additionalData[11] = byte(n >> 8)
- additionalData[12] = byte(n)
- var err error
- payload, err = c.Open(payload[:0], nonce, payload, additionalData[:])
- if err != nil {
- return false, 0, alertBadRecordMAC
- }
- b.resize(recordHeaderLen + explicitIVLen + len(payload))
- case cbcMode:
- blockSize := c.BlockSize()
- if hc.version >= VersionTLS11 {
- explicitIVLen = blockSize
- }
-
- if len(payload)%blockSize != 0 || len(payload) < roundUp(explicitIVLen+macSize+1, blockSize) {
- return false, 0, alertBadRecordMAC
- }
-
- if explicitIVLen > 0 {
- c.SetIV(payload[:explicitIVLen])
- payload = payload[explicitIVLen:]
- }
- c.CryptBlocks(payload, payload)
- if hc.version == VersionSSL30 {
- payload, paddingGood = removePaddingSSL30(payload)
- } else {
- payload, paddingGood = removePadding(payload)
- }
- b.resize(recordHeaderLen + explicitIVLen + len(payload))
-
- // note that we still have a timing side-channel in the
- // MAC check, below. An attacker can align the record
- // so that a correct padding will cause one less hash
- // block to be calculated. Then they can iteratively
- // decrypt a record by breaking each byte. See
- // "Password Interception in a SSL/TLS Channel", Brice
- // Canvel et al.
- //
- // However, our behavior matches OpenSSL, so we leak
- // only as much as they do.
- default:
- panic("unknown cipher type")
- }
- }
-
- // check, strip mac
- if hc.mac != nil {
- if len(payload) < macSize {
- return false, 0, alertBadRecordMAC
- }
-
- // strip mac off payload, b.data
- n := len(payload) - macSize
- b.data[3] = byte(n >> 8)
- b.data[4] = byte(n)
- b.resize(recordHeaderLen + explicitIVLen + n)
- remoteMAC := payload[n:]
- localMAC := hc.mac.MAC(hc.inDigestBuf, hc.seq[0:], b.data[:recordHeaderLen], payload[:n])
-
- if subtle.ConstantTimeCompare(localMAC, remoteMAC) != 1 || paddingGood != 255 {
- return false, 0, alertBadRecordMAC
- }
- hc.inDigestBuf = localMAC
- }
- hc.incSeq()
-
- return true, recordHeaderLen + explicitIVLen, 0
-}
-
-// padToBlockSize calculates the needed padding block, if any, for a payload.
-// On exit, prefix aliases payload and extends to the end of the last full
-// block of payload. finalBlock is a fresh slice which contains the contents of
-// any suffix of payload as well as the needed padding to make finalBlock a
-// full block.
-func padToBlockSize(payload []byte, blockSize int) (prefix, finalBlock []byte) {
- overrun := len(payload) % blockSize
- paddingLen := blockSize - overrun
- prefix = payload[:len(payload)-overrun]
- finalBlock = make([]byte, blockSize)
- copy(finalBlock, payload[len(payload)-overrun:])
- for i := overrun; i < blockSize; i++ {
- finalBlock[i] = byte(paddingLen - 1)
- }
- return
-}
-
-// encrypt encrypts and macs the data in b.
-func (hc *halfConn) encrypt(b *block, explicitIVLen int) (bool, alert) {
- // mac
- if hc.mac != nil {
- mac := hc.mac.MAC(hc.outDigestBuf, hc.seq[0:], b.data[:recordHeaderLen], b.data[recordHeaderLen+explicitIVLen:])
-
- n := len(b.data)
- b.resize(n + len(mac))
- copy(b.data[n:], mac)
- hc.outDigestBuf = mac
- }
-
- payload := b.data[recordHeaderLen:]
-
- // encrypt
- if hc.cipher != nil {
- switch c := hc.cipher.(type) {
- case cipher.Stream:
- c.XORKeyStream(payload, payload)
- case cipher.AEAD:
- payloadLen := len(b.data) - recordHeaderLen - explicitIVLen
- b.resize(len(b.data) + c.Overhead())
- nonce := b.data[recordHeaderLen : recordHeaderLen+explicitIVLen]
- payload := b.data[recordHeaderLen+explicitIVLen:]
- payload = payload[:payloadLen]
-
- var additionalData [13]byte
- copy(additionalData[:], hc.seq[:])
- copy(additionalData[8:], b.data[:3])
- additionalData[11] = byte(payloadLen >> 8)
- additionalData[12] = byte(payloadLen)
-
- c.Seal(payload[:0], nonce, payload, additionalData[:])
- case cbcMode:
- blockSize := c.BlockSize()
- if explicitIVLen > 0 {
- c.SetIV(payload[:explicitIVLen])
- payload = payload[explicitIVLen:]
- }
- prefix, finalBlock := padToBlockSize(payload, blockSize)
- b.resize(recordHeaderLen + explicitIVLen + len(prefix) + len(finalBlock))
- c.CryptBlocks(b.data[recordHeaderLen+explicitIVLen:], prefix)
- c.CryptBlocks(b.data[recordHeaderLen+explicitIVLen+len(prefix):], finalBlock)
- default:
- panic("unknown cipher type")
- }
- }
-
- // update length to include MAC and any block padding needed.
- n := len(b.data) - recordHeaderLen
- b.data[3] = byte(n >> 8)
- b.data[4] = byte(n)
- hc.incSeq()
-
- return true, 0
-}
-
-// A block is a simple data buffer.
-type block struct {
- data []byte
- off int // index for Read
- link *block
-}
-
-// resize resizes block to be n bytes, growing if necessary.
-func (b *block) resize(n int) {
- if n > cap(b.data) {
- b.reserve(n)
- }
- b.data = b.data[0:n]
-}
-
-// reserve makes sure that block contains a capacity of at least n bytes.
-func (b *block) reserve(n int) {
- if cap(b.data) >= n {
- return
- }
- m := cap(b.data)
- if m == 0 {
- m = 1024
- }
- for m < n {
- m *= 2
- }
- data := make([]byte, len(b.data), m)
- copy(data, b.data)
- b.data = data
-}
-
-// readFromUntil reads from r into b until b contains at least n bytes
-// or else returns an error.
-func (b *block) readFromUntil(r io.Reader, n int) error {
- // quick case
- if len(b.data) >= n {
- return nil
- }
-
- // read until have enough.
- b.reserve(n)
- for {
- m, err := r.Read(b.data[len(b.data):cap(b.data)])
- b.data = b.data[0 : len(b.data)+m]
- if len(b.data) >= n {
- // TODO(bradfitz,agl): slightly suspicious
- // that we're throwing away r.Read's err here.
- break
- }
- if err != nil {
- return err
- }
- }
- return nil
-}
-
-func (b *block) Read(p []byte) (n int, err error) {
- n = copy(p, b.data[b.off:])
- b.off += n
- return
-}
-
-// newBlock allocates a new block, from hc's free list if possible.
-func (hc *halfConn) newBlock() *block {
- b := hc.bfree
- if b == nil {
- return new(block)
- }
- hc.bfree = b.link
- b.link = nil
- b.resize(0)
- return b
-}
-
-// freeBlock returns a block to hc's free list.
-// The protocol is such that each side only has a block or two on
-// its free list at a time, so there's no need to worry about
-// trimming the list, etc.
-func (hc *halfConn) freeBlock(b *block) {
- b.link = hc.bfree
- hc.bfree = b
-}
-
-// splitBlock splits a block after the first n bytes,
-// returning a block with those n bytes and a
-// block with the remainder. the latter may be nil.
-func (hc *halfConn) splitBlock(b *block, n int) (*block, *block) {
- if len(b.data) <= n {
- return b, nil
- }
- bb := hc.newBlock()
- bb.resize(len(b.data) - n)
- copy(bb.data, b.data[n:])
- b.data = b.data[0:n]
- return b, bb
-}
-
-// readRecord reads the next TLS record from the connection
-// and updates the record layer state.
-// c.in.Mutex <= L; c.input == nil.
-func (c *Conn) readRecord(want recordType) error {
- // Caller must be in sync with connection:
- // handshake data if handshake not yet completed,
- // else application data. (We don't support renegotiation.)
- switch want {
- default:
- c.sendAlert(alertInternalError)
- return c.in.setErrorLocked(errors.New("tls: unknown record type requested"))
- case recordTypeHandshake, recordTypeChangeCipherSpec:
- if c.handshakeComplete {
- c.sendAlert(alertInternalError)
- return c.in.setErrorLocked(errors.New("tls: handshake or ChangeCipherSpec requested after handshake complete"))
- }
- case recordTypeApplicationData:
- if !c.handshakeComplete {
- c.sendAlert(alertInternalError)
- return c.in.setErrorLocked(errors.New("tls: application data record requested before handshake complete"))
- }
- }
-
-Again:
- if c.rawInput == nil {
- c.rawInput = c.in.newBlock()
- }
- b := c.rawInput
-
- // Read header, payload.
- if err := b.readFromUntil(c.conn, recordHeaderLen); err != nil {
- // RFC suggests that EOF without an alertCloseNotify is
- // an error, but popular web sites seem to do this,
- // so we can't make it an error.
- // if err == io.EOF {
- // err = io.ErrUnexpectedEOF
- // }
- if e, ok := err.(net.Error); !ok || !e.Temporary() {
- c.in.setErrorLocked(err)
- }
- return err
- }
- typ := recordType(b.data[0])
-
- // No valid TLS record has a type of 0x80, however SSLv2 handshakes
- // start with a uint16 length where the MSB is set and the first record
- // is always < 256 bytes long. Therefore typ == 0x80 strongly suggests
- // an SSLv2 client.
- if want == recordTypeHandshake && typ == 0x80 {
- c.sendAlert(alertProtocolVersion)
- return c.in.setErrorLocked(errors.New("tls: unsupported SSLv2 handshake received"))
- }
-
- vers := uint16(b.data[1])<<8 | uint16(b.data[2])
- n := int(b.data[3])<<8 | int(b.data[4])
- if c.haveVers && vers != c.vers {
- c.sendAlert(alertProtocolVersion)
- return c.in.setErrorLocked(fmt.Errorf("tls: received record with version %x when expecting version %x", vers, c.vers))
- }
- if n > maxCiphertext {
- c.sendAlert(alertRecordOverflow)
- return c.in.setErrorLocked(fmt.Errorf("tls: oversized record received with length %d", n))
- }
- if !c.haveVers {
- // First message, be extra suspicious:
- // this might not be a TLS client.
- // Bail out before reading a full 'body', if possible.
- // The current max version is 3.1.
- // If the version is >= 16.0, it's probably not real.
- // Similarly, a clientHello message encodes in
- // well under a kilobyte. If the length is >= 12 kB,
- // it's probably not real.
- if (typ != recordTypeAlert && typ != want) || vers >= 0x1000 || n >= 0x3000 {
- c.sendAlert(alertUnexpectedMessage)
- return c.in.setErrorLocked(fmt.Errorf("tls: first record does not look like a TLS handshake"))
- }
- }
- if err := b.readFromUntil(c.conn, recordHeaderLen+n); err != nil {
- if err == io.EOF {
- err = io.ErrUnexpectedEOF
- }
- if e, ok := err.(net.Error); !ok || !e.Temporary() {
- c.in.setErrorLocked(err)
- }
- return err
- }
-
- // Process message.
- b, c.rawInput = c.in.splitBlock(b, recordHeaderLen+n)
- ok, off, err := c.in.decrypt(b)
- if !ok {
- c.in.setErrorLocked(c.sendAlert(err))
- }
- b.off = off
- data := b.data[b.off:]
- if len(data) > maxPlaintext {
- err := c.sendAlert(alertRecordOverflow)
- c.in.freeBlock(b)
- return c.in.setErrorLocked(err)
- }
-
- switch typ {
- default:
- c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage))
-
- case recordTypeAlert:
- if len(data) != 2 {
- c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage))
- break
- }
- if alert(data[1]) == alertCloseNotify {
- c.in.setErrorLocked(io.EOF)
- break
- }
- switch data[0] {
- case alertLevelWarning:
- // drop on the floor
- c.in.freeBlock(b)
- goto Again
- case alertLevelError:
- c.in.setErrorLocked(&net.OpError{Op: "remote error", Err: alert(data[1])})
- default:
- c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage))
- }
-
- case recordTypeChangeCipherSpec:
- if typ != want || len(data) != 1 || data[0] != 1 {
- c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage))
- break
- }
- err := c.in.changeCipherSpec()
- if err != nil {
- c.in.setErrorLocked(c.sendAlert(err.(alert)))
- }
-
- case recordTypeApplicationData:
- if typ != want {
- c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage))
- break
- }
- c.input = b
- b = nil
-
- case recordTypeHandshake:
- // TODO(rsc): Should at least pick off connection close.
- if typ != want {
- return c.in.setErrorLocked(c.sendAlert(alertNoRenegotiation))
- }
- c.hand.Write(data)
- }
-
- if b != nil {
- c.in.freeBlock(b)
- }
- return c.in.err
-}
-
-// sendAlert sends a TLS alert message.
-// c.out.Mutex <= L.
-func (c *Conn) sendAlertLocked(err alert) error {
- switch err {
- case alertNoRenegotiation, alertCloseNotify:
- c.tmp[0] = alertLevelWarning
- default:
- c.tmp[0] = alertLevelError
- }
- c.tmp[1] = byte(err)
- c.writeRecord(recordTypeAlert, c.tmp[0:2])
- // closeNotify is a special case in that it isn't an error:
- if err != alertCloseNotify {
- return c.out.setErrorLocked(&net.OpError{Op: "local error", Err: err})
- }
- return nil
-}
-
-// sendAlert sends a TLS alert message.
-// L < c.out.Mutex.
-func (c *Conn) sendAlert(err alert) error {
- c.out.Lock()
- defer c.out.Unlock()
- return c.sendAlertLocked(err)
-}
-
-// writeRecord writes a TLS record with the given type and payload
-// to the connection and updates the record layer state.
-// c.out.Mutex <= L.
-func (c *Conn) writeRecord(typ recordType, data []byte) (n int, err error) {
- b := c.out.newBlock()
- for len(data) > 0 {
- m := len(data)
- if m > maxPlaintext {
- m = maxPlaintext
- }
- explicitIVLen := 0
- explicitIVIsSeq := false
-
- var cbc cbcMode
- if c.out.version >= VersionTLS11 {
- var ok bool
- if cbc, ok = c.out.cipher.(cbcMode); ok {
- explicitIVLen = cbc.BlockSize()
- }
- }
- if explicitIVLen == 0 {
- if _, ok := c.out.cipher.(cipher.AEAD); ok {
- explicitIVLen = 8
- // The AES-GCM construction in TLS has an
- // explicit nonce so that the nonce can be
- // random. However, the nonce is only 8 bytes
- // which is too small for a secure, random
- // nonce. Therefore we use the sequence number
- // as the nonce.
- explicitIVIsSeq = true
- }
- }
- b.resize(recordHeaderLen + explicitIVLen + m)
- b.data[0] = byte(typ)
- vers := c.vers
- if vers == 0 {
- // Some TLS servers fail if the record version is
- // greater than TLS 1.0 for the initial ClientHello.
- vers = VersionTLS10
- }
- b.data[1] = byte(vers >> 8)
- b.data[2] = byte(vers)
- b.data[3] = byte(m >> 8)
- b.data[4] = byte(m)
- if explicitIVLen > 0 {
- explicitIV := b.data[recordHeaderLen : recordHeaderLen+explicitIVLen]
- if explicitIVIsSeq {
- copy(explicitIV, c.out.seq[:])
- } else {
- if _, err = io.ReadFull(c.config.rand(), explicitIV); err != nil {
- break
- }
- }
- }
- copy(b.data[recordHeaderLen+explicitIVLen:], data)
- c.out.encrypt(b, explicitIVLen)
- _, err = c.conn.Write(b.data)
- if err != nil {
- break
- }
- n += m
- data = data[m:]
- }
- c.out.freeBlock(b)
-
- if typ == recordTypeChangeCipherSpec {
- err = c.out.changeCipherSpec()
- if err != nil {
- // Cannot call sendAlert directly,
- // because we already hold c.out.Mutex.
- c.tmp[0] = alertLevelError
- c.tmp[1] = byte(err.(alert))
- c.writeRecord(recordTypeAlert, c.tmp[0:2])
- return n, c.out.setErrorLocked(&net.OpError{Op: "local error", Err: err})
- }
- }
- return
-}
-
-// readHandshake reads the next handshake message from
-// the record layer.
-// c.in.Mutex < L; c.out.Mutex < L.
-func (c *Conn) readHandshake() (interface{}, error) {
- for c.hand.Len() < 4 {
- if err := c.in.err; err != nil {
- return nil, err
- }
- if err := c.readRecord(recordTypeHandshake); err != nil {
- return nil, err
- }
- }
-
- data := c.hand.Bytes()
- n := int(data[1])<<16 | int(data[2])<<8 | int(data[3])
- if n > maxHandshake {
- return nil, c.in.setErrorLocked(c.sendAlert(alertInternalError))
- }
- for c.hand.Len() < 4+n {
- if err := c.in.err; err != nil {
- return nil, err
- }
- if err := c.readRecord(recordTypeHandshake); err != nil {
- return nil, err
- }
- }
- data = c.hand.Next(4 + n)
- var m handshakeMessage
- switch data[0] {
- case typeClientHello:
- m = new(clientHelloMsg)
- case typeServerHello:
- m = new(serverHelloMsg)
- case typeNewSessionTicket:
- m = new(newSessionTicketMsg)
- case typeCertificate:
- m = new(certificateMsg)
- case typeCertificateRequest:
- m = &certificateRequestMsg{
- hasSignatureAndHash: c.vers >= VersionTLS12,
- }
- case typeCertificateStatus:
- m = new(certificateStatusMsg)
- case typeServerKeyExchange:
- m = new(serverKeyExchangeMsg)
- case typeServerHelloDone:
- m = new(serverHelloDoneMsg)
- case typeClientKeyExchange:
- m = new(clientKeyExchangeMsg)
- case typeCertificateVerify:
- m = &certificateVerifyMsg{
- hasSignatureAndHash: c.vers >= VersionTLS12,
- }
- case typeNextProtocol:
- m = new(nextProtoMsg)
- case typeFinished:
- m = new(finishedMsg)
- default:
- return nil, c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage))
- }
-
- // The handshake message unmarshallers
- // expect to be able to keep references to data,
- // so pass in a fresh copy that won't be overwritten.
- data = append([]byte(nil), data...)
-
- if !m.unmarshal(data) {
- return nil, c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage))
- }
- return m, nil
-}
-
-// Write writes data to the connection.
-func (c *Conn) Write(b []byte) (int, error) {
- if err := c.Handshake(); err != nil {
- return 0, err
- }
-
- c.out.Lock()
- defer c.out.Unlock()
-
- if err := c.out.err; err != nil {
- return 0, err
- }
-
- if !c.handshakeComplete {
- return 0, alertInternalError
- }
-
- // SSL 3.0 and TLS 1.0 are susceptible to a chosen-plaintext
- // attack when using block mode ciphers due to predictable IVs.
- // This can be prevented by splitting each Application Data
- // record into two records, effectively randomizing the IV.
- //
- // http://www.openssl.org/~bodo/tls-cbc.txt
- // https://bugzilla.mozilla.org/show_bug.cgi?id=665814
- // http://www.imperialviolet.org/2012/01/15/beastfollowup.html
-
- var m int
- if len(b) > 1 && c.vers <= VersionTLS10 {
- if _, ok := c.out.cipher.(cipher.BlockMode); ok {
- n, err := c.writeRecord(recordTypeApplicationData, b[:1])
- if err != nil {
- return n, c.out.setErrorLocked(err)
- }
- m, b = 1, b[1:]
- }
- }
-
- n, err := c.writeRecord(recordTypeApplicationData, b)
- return n + m, c.out.setErrorLocked(err)
-}
-
-// Read can be made to time out and return a net.Error with Timeout() == true
-// after a fixed time limit; see SetDeadline and SetReadDeadline.
-func (c *Conn) Read(b []byte) (n int, err error) {
- if err = c.Handshake(); err != nil {
- return
- }
- if len(b) == 0 {
- // Put this after Handshake, in case people were calling
- // Read(nil) for the side effect of the Handshake.
- return
- }
-
- c.in.Lock()
- defer c.in.Unlock()
-
- // Some OpenSSL servers send empty records in order to randomize the
- // CBC IV. So this loop ignores a limited number of empty records.
- const maxConsecutiveEmptyRecords = 100
- for emptyRecordCount := 0; emptyRecordCount <= maxConsecutiveEmptyRecords; emptyRecordCount++ {
- for c.input == nil && c.in.err == nil {
- if err := c.readRecord(recordTypeApplicationData); err != nil {
- // Soft error, like EAGAIN
- return 0, err
- }
- }
- if err := c.in.err; err != nil {
- return 0, err
- }
-
- n, err = c.input.Read(b)
- if c.input.off >= len(c.input.data) {
- c.in.freeBlock(c.input)
- c.input = nil
- }
-
- // If a close-notify alert is waiting, read it so that
- // we can return (n, EOF) instead of (n, nil), to signal
- // to the HTTP response reading goroutine that the
- // connection is now closed. This eliminates a race
- // where the HTTP response reading goroutine would
- // otherwise not observe the EOF until its next read,
- // by which time a client goroutine might have already
- // tried to reuse the HTTP connection for a new
- // request.
- // See https://codereview.appspot.com/76400046
- // and http://golang.org/issue/3514
- if ri := c.rawInput; ri != nil &&
- n != 0 && err == nil &&
- c.input == nil && len(ri.data) > 0 && recordType(ri.data[0]) == recordTypeAlert {
- if recErr := c.readRecord(recordTypeApplicationData); recErr != nil {
- err = recErr // will be io.EOF on closeNotify
- }
- }
-
- if n != 0 || err != nil {
- return n, err
- }
- }
-
- return 0, io.ErrNoProgress
-}
-
-// Close closes the connection.
-func (c *Conn) Close() error {
- var alertErr error
-
- c.handshakeMutex.Lock()
- defer c.handshakeMutex.Unlock()
- if c.handshakeComplete {
- alertErr = c.sendAlert(alertCloseNotify)
- }
-
- if err := c.conn.Close(); err != nil {
- return err
- }
- return alertErr
-}
-
-// Handshake runs the client or server handshake
-// protocol if it has not yet been run.
-// Most uses of this package need not call Handshake
-// explicitly: the first Read or Write will call it automatically.
-func (c *Conn) Handshake() error {
- c.handshakeMutex.Lock()
- defer c.handshakeMutex.Unlock()
- if err := c.handshakeErr; err != nil {
- return err
- }
- if c.handshakeComplete {
- return nil
- }
-
- if c.isClient {
- c.handshakeErr = c.clientHandshake()
- } else {
- c.handshakeErr = c.serverHandshake()
- }
- return c.handshakeErr
-}
-
-// ConnectionState returns basic TLS details about the connection.
-func (c *Conn) ConnectionState() ConnectionState {
- c.handshakeMutex.Lock()
- defer c.handshakeMutex.Unlock()
-
- var state ConnectionState
- state.HandshakeComplete = c.handshakeComplete
- if c.handshakeComplete {
- state.Version = c.vers
- state.NegotiatedProtocol = c.clientProtocol
- state.DidResume = c.didResume
- state.NegotiatedProtocolIsMutual = !c.clientProtocolFallback
- state.CipherSuite = c.cipherSuite
- state.PeerCertificates = c.peerCertificates
- state.VerifiedChains = c.verifiedChains
- state.ServerName = c.serverName
- if !c.didResume {
- state.TLSUnique = c.firstFinished[:]
- }
- }
-
- return state
-}
-
-// OCSPResponse returns the stapled OCSP response from the TLS server, if
-// any. (Only valid for client connections.)
-func (c *Conn) OCSPResponse() []byte {
- c.handshakeMutex.Lock()
- defer c.handshakeMutex.Unlock()
-
- return c.ocspResponse
-}
-
-// VerifyHostname checks that the peer certificate chain is valid for
-// connecting to host. If so, it returns nil; if not, it returns an error
-// describing the problem.
-func (c *Conn) VerifyHostname(host string) error {
- c.handshakeMutex.Lock()
- defer c.handshakeMutex.Unlock()
- if !c.isClient {
- return errors.New("tls: VerifyHostname called on TLS server connection")
- }
- if !c.handshakeComplete {
- return errors.New("tls: handshake has not yet been performed")
- }
- return c.peerCertificates[0].VerifyHostname(host)
-}
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/conn_test.go b/runtimes/google/ipc/stream/crypto/tlsfork/conn_test.go
deleted file mode 100644
index fd28a6c..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/conn_test.go
+++ /dev/null
@@ -1,120 +0,0 @@
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.4
-
-package tls
-
-import (
- "testing"
-)
-
-func TestRoundUp(t *testing.T) {
- if roundUp(0, 16) != 0 ||
- roundUp(1, 16) != 16 ||
- roundUp(15, 16) != 16 ||
- roundUp(16, 16) != 16 ||
- roundUp(17, 16) != 32 {
- t.Error("roundUp broken")
- }
-}
-
-var paddingTests = []struct {
- in []byte
- good bool
- expectedLen int
-}{
- {[]byte{1, 2, 3, 4, 0}, true, 4},
- {[]byte{1, 2, 3, 4, 0, 1}, false, 0},
- {[]byte{1, 2, 3, 4, 99, 99}, false, 0},
- {[]byte{1, 2, 3, 4, 1, 1}, true, 4},
- {[]byte{1, 2, 3, 2, 2, 2}, true, 3},
- {[]byte{1, 2, 3, 3, 3, 3}, true, 2},
- {[]byte{1, 2, 3, 4, 3, 3}, false, 0},
- {[]byte{1, 4, 4, 4, 4, 4}, true, 1},
- {[]byte{5, 5, 5, 5, 5, 5}, true, 0},
- {[]byte{6, 6, 6, 6, 6, 6}, false, 0},
-}
-
-func TestRemovePadding(t *testing.T) {
- for i, test := range paddingTests {
- payload, good := removePadding(test.in)
- expectedGood := byte(255)
- if !test.good {
- expectedGood = 0
- }
- if good != expectedGood {
- t.Errorf("#%d: wrong validity, want:%d got:%d", i, expectedGood, good)
- }
- if good == 255 && len(payload) != test.expectedLen {
- t.Errorf("#%d: got %d, want %d", i, len(payload), test.expectedLen)
- }
- }
-}
-
-var certExampleCom = `308201403081eda003020102020101300b06092a864886f70d010105301e311c301a060355040a131354657374696e67204365727469666963617465301e170d3131313030313138353835325a170d3132303933303138353835325a301e311c301a060355040a131354657374696e67204365727469666963617465305a300b06092a864886f70d010101034b003048024100bced6e32368599eeddf18796bfd03958a154f87e5b084f96e85136a56b886733592f493f0fc68b0d6b3551781cb95e13c5de458b28d6fb60d20a9129313261410203010001a31a301830160603551d11040f300d820b6578616d706c652e636f6d300b06092a864886f70d0101050341001a0b419d2c74474c6450654e5f10b32bf426ffdf55cad1c52602e7a9151513a3424c70f5960dcd682db0c33769cc1daa3fcdd3db10809d2392ed4a1bf50ced18`
-
-var certWildcardExampleCom = `308201423081efa003020102020101300b06092a864886f70d010105301e311c301a060355040a131354657374696e67204365727469666963617465301e170d3131313030313139303034365a170d3132303933303139303034365a301e311c301a060355040a131354657374696e67204365727469666963617465305a300b06092a864886f70d010101034b003048024100bced6e32368599eeddf18796bfd03958a154f87e5b084f96e85136a56b886733592f493f0fc68b0d6b3551781cb95e13c5de458b28d6fb60d20a9129313261410203010001a31c301a30180603551d110411300f820d2a2e6578616d706c652e636f6d300b06092a864886f70d0101050341001676f0c9e7c33c1b656ed5a6476c4e2ee9ec8e62df7407accb1875272b2edd0a22096cb2c22598d11604104d604f810eb4b5987ca6bb319c7e6ce48725c54059`
-
-var certFooExampleCom = `308201443081f1a003020102020101300b06092a864886f70d010105301e311c301a060355040a131354657374696e67204365727469666963617465301e170d3131313030313139303131345a170d3132303933303139303131345a301e311c301a060355040a131354657374696e67204365727469666963617465305a300b06092a864886f70d010101034b003048024100bced6e32368599eeddf18796bfd03958a154f87e5b084f96e85136a56b886733592f493f0fc68b0d6b3551781cb95e13c5de458b28d6fb60d20a9129313261410203010001a31e301c301a0603551d1104133011820f666f6f2e6578616d706c652e636f6d300b06092a864886f70d010105034100646a2a51f2aa2477add854b462cf5207ba16d3213ffb5d3d0eed473fbf09935019192d1d5b8ca6a2407b424cf04d97c4cd9197c83ecf81f0eab9464a1109d09f`
-
-var certDoubleWildcardExampleCom = `308201443081f1a003020102020101300b06092a864886f70d010105301e311c301a060355040a131354657374696e67204365727469666963617465301e170d3131313030313139303134315a170d3132303933303139303134315a301e311c301a060355040a131354657374696e67204365727469666963617465305a300b06092a864886f70d010101034b003048024100bced6e32368599eeddf18796bfd03958a154f87e5b084f96e85136a56b886733592f493f0fc68b0d6b3551781cb95e13c5de458b28d6fb60d20a9129313261410203010001a31e301c301a0603551d1104133011820f2a2e2a2e6578616d706c652e636f6d300b06092a864886f70d0101050341001c3de267975f56ef57771c6218ef95ecc65102e57bd1defe6f7efea90d9b26cf40de5bd7ad75e46201c7f2a92aaa3e907451e9409f65e28ddb6db80d726290f6`
-
-func TestCertificateSelection(t *testing.T) {
- config := Config{
- Certificates: []Certificate{
- {
- Certificate: [][]byte{fromHex(certExampleCom)},
- },
- {
- Certificate: [][]byte{fromHex(certWildcardExampleCom)},
- },
- {
- Certificate: [][]byte{fromHex(certFooExampleCom)},
- },
- {
- Certificate: [][]byte{fromHex(certDoubleWildcardExampleCom)},
- },
- },
- }
-
- config.BuildNameToCertificate()
-
- pointerToIndex := func(c *Certificate) int {
- for i := range config.Certificates {
- if c == &config.Certificates[i] {
- return i
- }
- }
- return -1
- }
-
- certificateForName := func(name string) *Certificate {
- clientHello := &ClientHelloInfo{
- ServerName: name,
- }
- if cert, err := config.getCertificate(clientHello); err != nil {
- t.Errorf("unable to get certificate for name '%s': %s", name, err)
- return nil
- } else {
- return cert
- }
- }
-
- if n := pointerToIndex(certificateForName("example.com")); n != 0 {
- t.Errorf("example.com returned certificate %d, not 0", n)
- }
- if n := pointerToIndex(certificateForName("bar.example.com")); n != 1 {
- t.Errorf("bar.example.com returned certificate %d, not 1", n)
- }
- if n := pointerToIndex(certificateForName("foo.example.com")); n != 2 {
- t.Errorf("foo.example.com returned certificate %d, not 2", n)
- }
- if n := pointerToIndex(certificateForName("foo.bar.example.com")); n != 3 {
- t.Errorf("foo.bar.example.com returned certificate %d, not 3", n)
- }
- if n := pointerToIndex(certificateForName("foo.bar.baz.example.com")); n != 0 {
- t.Errorf("foo.bar.baz.example.com returned certificate %d, not 0", n)
- }
-}
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/example_test.go b/runtimes/google/ipc/stream/crypto/tlsfork/example_test.go
deleted file mode 100644
index 7628e43..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/example_test.go
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2014 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package tls_test
-
-import (
- "crypto/tls"
- "crypto/x509"
-)
-
-func ExampleDial() {
- // Connecting with a custom root-certificate set.
-
- const rootPEM = `
------BEGIN CERTIFICATE-----
-MIIEBDCCAuygAwIBAgIDAjppMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT
-MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i
-YWwgQ0EwHhcNMTMwNDA1MTUxNTU1WhcNMTUwNDA0MTUxNTU1WjBJMQswCQYDVQQG
-EwJVUzETMBEGA1UEChMKR29vZ2xlIEluYzElMCMGA1UEAxMcR29vZ2xlIEludGVy
-bmV0IEF1dGhvcml0eSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
-AJwqBHdc2FCROgajguDYUEi8iT/xGXAaiEZ+4I/F8YnOIe5a/mENtzJEiaB0C1NP
-VaTOgmKV7utZX8bhBYASxF6UP7xbSDj0U/ck5vuR6RXEz/RTDfRK/J9U3n2+oGtv
-h8DQUB8oMANA2ghzUWx//zo8pzcGjr1LEQTrfSTe5vn8MXH7lNVg8y5Kr0LSy+rE
-ahqyzFPdFUuLH8gZYR/Nnag+YyuENWllhMgZxUYi+FOVvuOAShDGKuy6lyARxzmZ
-EASg8GF6lSWMTlJ14rbtCMoU/M4iarNOz0YDl5cDfsCx3nuvRTPPuj5xt970JSXC
-DTWJnZ37DhF5iR43xa+OcmkCAwEAAaOB+zCB+DAfBgNVHSMEGDAWgBTAephojYn7
-qwVkDBF9qn1luMrMTjAdBgNVHQ4EFgQUSt0GFhu89mi1dvWBtrtiGrpagS8wEgYD
-VR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAQYwOgYDVR0fBDMwMTAvoC2g
-K4YpaHR0cDovL2NybC5nZW90cnVzdC5jb20vY3Jscy9ndGdsb2JhbC5jcmwwPQYI
-KwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwOi8vZ3RnbG9iYWwtb2NzcC5n
-ZW90cnVzdC5jb20wFwYDVR0gBBAwDjAMBgorBgEEAdZ5AgUBMA0GCSqGSIb3DQEB
-BQUAA4IBAQA21waAESetKhSbOHezI6B1WLuxfoNCunLaHtiONgaX4PCVOzf9G0JY
-/iLIa704XtE7JW4S615ndkZAkNoUyHgN7ZVm2o6Gb4ChulYylYbc3GrKBIxbf/a/
-zG+FA1jDaFETzf3I93k9mTXwVqO94FntT0QJo544evZG0R0SnU++0ED8Vf4GXjza
-HFa9llF7b1cq26KqltyMdMKVvvBulRP/F/A8rLIQjcxz++iPAsbw+zOzlTvjwsto
-WHPbqCRiOwY1nQ2pM714A5AuTHhdUDqB1O6gyHA43LL5Z/qHQF1hwFGPa4NrzQU6
-yuGnBXj8ytqU0CwIPX4WecigUCAkVDNx
------END CERTIFICATE-----`
-
- // First, create the set of root certificates. For this example we only
- // have one. It's also possible to omit this in order to use the
- // default root set of the current operating system.
- roots := x509.NewCertPool()
- ok := roots.AppendCertsFromPEM([]byte(rootPEM))
- if !ok {
- panic("failed to parse root certificate")
- }
-
- conn, err := tls.Dial("tcp", "mail.google.com:443", &tls.Config{
- RootCAs: roots,
- })
- if err != nil {
- panic("failed to connect: " + err.Error())
- }
- conn.Close()
-}
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/generate_cert.go b/runtimes/google/ipc/stream/crypto/tlsfork/generate_cert.go
deleted file mode 100644
index 83f9916..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/generate_cert.go
+++ /dev/null
@@ -1,161 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-// Generate a self-signed X.509 certificate for a TLS server. Outputs to
-// 'cert.pem' and 'key.pem' and will overwrite existing files.
-
-package main
-
-import (
- "crypto/ecdsa"
- "crypto/elliptic"
- "crypto/rand"
- "crypto/rsa"
- "crypto/x509"
- "crypto/x509/pkix"
- "encoding/pem"
- "flag"
- "fmt"
- "log"
- "math/big"
- "net"
- "os"
- "strings"
- "time"
-)
-
-var (
- host = flag.String("host", "", "Comma-separated hostnames and IPs to generate a certificate for")
- validFrom = flag.String("start-date", "", "Creation date formatted as Jan 1 15:04:05 2011")
- validFor = flag.Duration("duration", 365*24*time.Hour, "Duration that certificate is valid for")
- isCA = flag.Bool("ca", false, "whether this cert should be its own Certificate Authority")
- rsaBits = flag.Int("rsa-bits", 2048, "Size of RSA key to generate. Ignored if --ecdsa-curve is set")
- ecdsaCurve = flag.String("ecdsa-curve", "", "ECDSA curve to use to generate a key. Valid values are P224, P256, P384, P521")
-)
-
-func publicKey(priv interface{}) interface{} {
- switch k := priv.(type) {
- case *rsa.PrivateKey:
- return &k.PublicKey
- case *ecdsa.PrivateKey:
- return &k.PublicKey
- default:
- return nil
- }
-}
-
-func pemBlockForKey(priv interface{}) *pem.Block {
- switch k := priv.(type) {
- case *rsa.PrivateKey:
- return &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(k)}
- case *ecdsa.PrivateKey:
- b, err := x509.MarshalECPrivateKey(k)
- if err != nil {
- fmt.Fprintf(os.Stderr, "Unable to marshal ECDSA private key: %v", err)
- os.Exit(2)
- }
- return &pem.Block{Type: "EC PRIVATE KEY", Bytes: b}
- default:
- return nil
- }
-}
-
-func main() {
- flag.Parse()
-
- if len(*host) == 0 {
- log.Fatalf("Missing required --host parameter")
- }
-
- var priv interface{}
- var err error
- switch *ecdsaCurve {
- case "":
- priv, err = rsa.GenerateKey(rand.Reader, *rsaBits)
- case "P224":
- priv, err = ecdsa.GenerateKey(elliptic.P224(), rand.Reader)
- case "P256":
- priv, err = ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
- case "P384":
- priv, err = ecdsa.GenerateKey(elliptic.P384(), rand.Reader)
- case "P521":
- priv, err = ecdsa.GenerateKey(elliptic.P521(), rand.Reader)
- default:
- fmt.Fprintf(os.Stderr, "Unrecognized elliptic curve: %q", *ecdsaCurve)
- os.Exit(1)
- }
- if err != nil {
- log.Fatalf("failed to generate private key: %s", err)
- }
-
- var notBefore time.Time
- if len(*validFrom) == 0 {
- notBefore = time.Now()
- } else {
- notBefore, err = time.Parse("Jan 2 15:04:05 2006", *validFrom)
- if err != nil {
- fmt.Fprintf(os.Stderr, "Failed to parse creation date: %s\n", err)
- os.Exit(1)
- }
- }
-
- notAfter := notBefore.Add(*validFor)
-
- serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
- serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
- if err != nil {
- log.Fatalf("failed to generate serial number: %s", err)
- }
-
- template := x509.Certificate{
- SerialNumber: serialNumber,
- Subject: pkix.Name{
- Organization: []string{"Acme Co"},
- },
- NotBefore: notBefore,
- NotAfter: notAfter,
-
- KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature,
- ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
- BasicConstraintsValid: true,
- }
-
- hosts := strings.Split(*host, ",")
- for _, h := range hosts {
- if ip := net.ParseIP(h); ip != nil {
- template.IPAddresses = append(template.IPAddresses, ip)
- } else {
- template.DNSNames = append(template.DNSNames, h)
- }
- }
-
- if *isCA {
- template.IsCA = true
- template.KeyUsage |= x509.KeyUsageCertSign
- }
-
- derBytes, err := x509.CreateCertificate(rand.Reader, &template, &template, publicKey(priv), priv)
- if err != nil {
- log.Fatalf("Failed to create certificate: %s", err)
- }
-
- certOut, err := os.Create("cert.pem")
- if err != nil {
- log.Fatalf("failed to open cert.pem for writing: %s", err)
- }
- pem.Encode(certOut, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes})
- certOut.Close()
- log.Print("written cert.pem\n")
-
- keyOut, err := os.OpenFile("key.pem", os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
- if err != nil {
- log.Print("failed to open key.pem for writing:", err)
- return
- }
- pem.Encode(keyOut, pemBlockForKey(priv))
- keyOut.Close()
- log.Print("written key.pem\n")
-}
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/handshake_client.go b/runtimes/google/ipc/stream/crypto/tlsfork/handshake_client.go
deleted file mode 100644
index ae20c23..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/handshake_client.go
+++ /dev/null
@@ -1,638 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.4
-
-package tls
-
-import (
- "bytes"
- "crypto/ecdsa"
- "crypto/rsa"
- "crypto/subtle"
- "crypto/x509"
- "encoding/asn1"
- "errors"
- "fmt"
- "io"
- "net"
- "strconv"
-)
-
-type clientHandshakeState struct {
- c *Conn
- serverHello *serverHelloMsg
- hello *clientHelloMsg
- suite *cipherSuite
- finishedHash finishedHash
- masterSecret []byte
- session *ClientSessionState
-}
-
-func (c *Conn) clientHandshake() error {
- if c.config == nil {
- c.config = defaultConfig()
- }
-
- if len(c.config.ServerName) == 0 && !c.config.InsecureSkipVerify {
- return errors.New("tls: either ServerName or InsecureSkipVerify must be specified in the tls.Config")
- }
-
- nextProtosLength := 0
- for _, proto := range c.config.NextProtos {
- if l := len(proto); l == 0 || l > 255 {
- return errors.New("tls: invalid NextProtos value")
- } else {
- nextProtosLength += 1 + l
- }
- }
- if nextProtosLength > 0xffff {
- return errors.New("tls: NextProtos values too large")
- }
-
- hello := &clientHelloMsg{
- vers: c.config.maxVersion(),
- compressionMethods: []uint8{compressionNone},
- random: make([]byte, 32),
- ocspStapling: true,
- serverName: c.config.ServerName,
- supportedCurves: c.config.curvePreferences(),
- supportedPoints: []uint8{pointFormatUncompressed},
- nextProtoNeg: len(c.config.NextProtos) > 0,
- secureRenegotiation: true,
- alpnProtocols: c.config.NextProtos,
- }
-
- possibleCipherSuites := c.config.cipherSuites()
- hello.cipherSuites = make([]uint16, 0, len(possibleCipherSuites))
-
-NextCipherSuite:
- for _, suiteId := range possibleCipherSuites {
- for _, suite := range cipherSuites {
- if suite.id != suiteId {
- continue
- }
- // Don't advertise TLS 1.2-only cipher suites unless
- // we're attempting TLS 1.2.
- if hello.vers < VersionTLS12 && suite.flags&suiteTLS12 != 0 {
- continue
- }
- hello.cipherSuites = append(hello.cipherSuites, suiteId)
- continue NextCipherSuite
- }
- }
-
- _, err := io.ReadFull(c.config.rand(), hello.random)
- if err != nil {
- c.sendAlert(alertInternalError)
- return errors.New("tls: short read from Rand: " + err.Error())
- }
-
- if hello.vers >= VersionTLS12 {
- hello.signatureAndHashes = supportedSKXSignatureAlgorithms
- }
-
- var session *ClientSessionState
- var cacheKey string
- sessionCache := c.config.ClientSessionCache
- if c.config.SessionTicketsDisabled {
- sessionCache = nil
- }
-
- if sessionCache != nil {
- hello.ticketSupported = true
-
- // Try to resume a previously negotiated TLS session, if
- // available.
- cacheKey = clientSessionCacheKey(c.conn.RemoteAddr(), c.config)
- candidateSession, ok := sessionCache.Get(cacheKey)
- if ok {
- // Check that the ciphersuite/version used for the
- // previous session are still valid.
- cipherSuiteOk := false
- for _, id := range hello.cipherSuites {
- if id == candidateSession.cipherSuite {
- cipherSuiteOk = true
- break
- }
- }
-
- versOk := candidateSession.vers >= c.config.minVersion() &&
- candidateSession.vers <= c.config.maxVersion()
- if versOk && cipherSuiteOk {
- session = candidateSession
- }
- }
- }
-
- if session != nil {
- hello.sessionTicket = session.sessionTicket
- // A random session ID is used to detect when the
- // server accepted the ticket and is resuming a session
- // (see RFC 5077).
- hello.sessionId = make([]byte, 16)
- if _, err := io.ReadFull(c.config.rand(), hello.sessionId); err != nil {
- c.sendAlert(alertInternalError)
- return errors.New("tls: short read from Rand: " + err.Error())
- }
- }
-
- c.writeRecord(recordTypeHandshake, hello.marshal())
-
- msg, err := c.readHandshake()
- if err != nil {
- return err
- }
- serverHello, ok := msg.(*serverHelloMsg)
- if !ok {
- c.sendAlert(alertUnexpectedMessage)
- return unexpectedMessageError(serverHello, msg)
- }
-
- vers, ok := c.config.mutualVersion(serverHello.vers)
- if !ok || vers < VersionTLS10 {
- // TLS 1.0 is the minimum version supported as a client.
- c.sendAlert(alertProtocolVersion)
- return fmt.Errorf("tls: server selected unsupported protocol version %x", serverHello.vers)
- }
- c.vers = vers
- c.haveVers = true
-
- suite := mutualCipherSuite(c.config.cipherSuites(), serverHello.cipherSuite)
- if suite == nil {
- c.sendAlert(alertHandshakeFailure)
- return fmt.Errorf("tls: server selected an unsupported cipher suite")
- }
-
- hs := &clientHandshakeState{
- c: c,
- serverHello: serverHello,
- hello: hello,
- suite: suite,
- finishedHash: newFinishedHash(c.vers),
- session: session,
- }
-
- hs.finishedHash.Write(hs.hello.marshal())
- hs.finishedHash.Write(hs.serverHello.marshal())
-
- isResume, err := hs.processServerHello()
- if err != nil {
- return err
- }
-
- if isResume {
- if err := hs.establishKeys(); err != nil {
- return err
- }
- if err := hs.readSessionTicket(); err != nil {
- return err
- }
- if err := hs.readFinished(c.firstFinished[:]); err != nil {
- return err
- }
- if err := hs.sendFinished(nil); err != nil {
- return err
- }
- } else {
- if err := hs.doFullHandshake(); err != nil {
- return err
- }
- if err := hs.establishKeys(); err != nil {
- return err
- }
- if err := hs.sendFinished(c.firstFinished[:]); err != nil {
- return err
- }
- if err := hs.readSessionTicket(); err != nil {
- return err
- }
- if err := hs.readFinished(nil); err != nil {
- return err
- }
- }
-
- if sessionCache != nil && hs.session != nil && session != hs.session {
- sessionCache.Put(cacheKey, hs.session)
- }
-
- c.didResume = isResume
- c.handshakeComplete = true
- c.cipherSuite = suite.id
- return nil
-}
-
-func (hs *clientHandshakeState) doFullHandshake() error {
- c := hs.c
-
- msg, err := c.readHandshake()
- if err != nil {
- return err
- }
- certMsg, ok := msg.(*certificateMsg)
- if !ok || len(certMsg.certificates) == 0 {
- c.sendAlert(alertUnexpectedMessage)
- return unexpectedMessageError(certMsg, msg)
- }
- hs.finishedHash.Write(certMsg.marshal())
-
- certs := make([]*x509.Certificate, len(certMsg.certificates))
- for i, asn1Data := range certMsg.certificates {
- cert, err := x509.ParseCertificate(asn1Data)
- if err != nil {
- c.sendAlert(alertBadCertificate)
- return errors.New("tls: failed to parse certificate from server: " + err.Error())
- }
- certs[i] = cert
- }
-
- if !c.config.InsecureSkipVerify {
- opts := x509.VerifyOptions{
- Roots: c.config.RootCAs,
- CurrentTime: c.config.time(),
- DNSName: c.config.ServerName,
- Intermediates: x509.NewCertPool(),
- }
-
- for i, cert := range certs {
- if i == 0 {
- continue
- }
- opts.Intermediates.AddCert(cert)
- }
- c.verifiedChains, err = certs[0].Verify(opts)
- if err != nil {
- c.sendAlert(alertBadCertificate)
- return err
- }
- }
-
- switch certs[0].PublicKey.(type) {
- case *rsa.PublicKey, *ecdsa.PublicKey:
- break
- default:
- c.sendAlert(alertUnsupportedCertificate)
- return fmt.Errorf("tls: server's certificate contains an unsupported type of public key: %T", certs[0].PublicKey)
- }
-
- c.peerCertificates = certs
-
- if hs.serverHello.ocspStapling {
- msg, err = c.readHandshake()
- if err != nil {
- return err
- }
- cs, ok := msg.(*certificateStatusMsg)
- if !ok {
- c.sendAlert(alertUnexpectedMessage)
- return unexpectedMessageError(cs, msg)
- }
- hs.finishedHash.Write(cs.marshal())
-
- if cs.statusType == statusTypeOCSP {
- c.ocspResponse = cs.response
- }
- }
-
- msg, err = c.readHandshake()
- if err != nil {
- return err
- }
-
- keyAgreement := hs.suite.ka(c.vers)
-
- skx, ok := msg.(*serverKeyExchangeMsg)
- if ok {
- hs.finishedHash.Write(skx.marshal())
- err = keyAgreement.processServerKeyExchange(c.config, hs.hello, hs.serverHello, certs[0], skx)
- if err != nil {
- c.sendAlert(alertUnexpectedMessage)
- return err
- }
-
- msg, err = c.readHandshake()
- if err != nil {
- return err
- }
- }
-
- var chainToSend *Certificate
- var certRequested bool
- certReq, ok := msg.(*certificateRequestMsg)
- if ok {
- certRequested = true
-
- // RFC 4346 on the certificateAuthorities field:
- // A list of the distinguished names of acceptable certificate
- // authorities. These distinguished names may specify a desired
- // distinguished name for a root CA or for a subordinate CA;
- // thus, this message can be used to describe both known roots
- // and a desired authorization space. If the
- // certificate_authorities list is empty then the client MAY
- // send any certificate of the appropriate
- // ClientCertificateType, unless there is some external
- // arrangement to the contrary.
-
- hs.finishedHash.Write(certReq.marshal())
-
- var rsaAvail, ecdsaAvail bool
- for _, certType := range certReq.certificateTypes {
- switch certType {
- case certTypeRSASign:
- rsaAvail = true
- case certTypeECDSASign:
- ecdsaAvail = true
- }
- }
-
- // We need to search our list of client certs for one
- // where SignatureAlgorithm is RSA and the Issuer is in
- // certReq.certificateAuthorities
- findCert:
- for i, chain := range c.config.Certificates {
- if !rsaAvail && !ecdsaAvail {
- continue
- }
-
- for j, cert := range chain.Certificate {
- x509Cert := chain.Leaf
- // parse the certificate if this isn't the leaf
- // node, or if chain.Leaf was nil
- if j != 0 || x509Cert == nil {
- if x509Cert, err = x509.ParseCertificate(cert); err != nil {
- c.sendAlert(alertInternalError)
- return errors.New("tls: failed to parse client certificate #" + strconv.Itoa(i) + ": " + err.Error())
- }
- }
-
- switch {
- case rsaAvail && x509Cert.PublicKeyAlgorithm == x509.RSA:
- case ecdsaAvail && x509Cert.PublicKeyAlgorithm == x509.ECDSA:
- default:
- continue findCert
- }
-
- if len(certReq.certificateAuthorities) == 0 {
- // they gave us an empty list, so just take the
- // first RSA cert from c.config.Certificates
- chainToSend = &chain
- break findCert
- }
-
- for _, ca := range certReq.certificateAuthorities {
- if bytes.Equal(x509Cert.RawIssuer, ca) {
- chainToSend = &chain
- break findCert
- }
- }
- }
- }
-
- msg, err = c.readHandshake()
- if err != nil {
- return err
- }
- }
-
- shd, ok := msg.(*serverHelloDoneMsg)
- if !ok {
- c.sendAlert(alertUnexpectedMessage)
- return unexpectedMessageError(shd, msg)
- }
- hs.finishedHash.Write(shd.marshal())
-
- // If the server requested a certificate then we have to send a
- // Certificate message, even if it's empty because we don't have a
- // certificate to send.
- if certRequested {
- certMsg = new(certificateMsg)
- if chainToSend != nil {
- certMsg.certificates = chainToSend.Certificate
- }
- hs.finishedHash.Write(certMsg.marshal())
- c.writeRecord(recordTypeHandshake, certMsg.marshal())
- }
-
- preMasterSecret, ckx, err := keyAgreement.generateClientKeyExchange(c.config, hs.hello, certs[0])
- if err != nil {
- c.sendAlert(alertInternalError)
- return err
- }
- if ckx != nil {
- hs.finishedHash.Write(ckx.marshal())
- c.writeRecord(recordTypeHandshake, ckx.marshal())
- }
-
- if chainToSend != nil {
- var signed []byte
- certVerify := &certificateVerifyMsg{
- hasSignatureAndHash: c.vers >= VersionTLS12,
- }
-
- switch key := c.config.Certificates[0].PrivateKey.(type) {
- case *ecdsa.PrivateKey:
- digest, _, hashId := hs.finishedHash.hashForClientCertificate(signatureECDSA)
- r, s, err := ecdsa.Sign(c.config.rand(), key, digest)
- if err == nil {
- signed, err = asn1.Marshal(ecdsaSignature{r, s})
- }
- certVerify.signatureAndHash.signature = signatureECDSA
- certVerify.signatureAndHash.hash = hashId
- case *rsa.PrivateKey:
- digest, hashFunc, hashId := hs.finishedHash.hashForClientCertificate(signatureRSA)
- signed, err = rsa.SignPKCS1v15(c.config.rand(), key, hashFunc, digest)
- certVerify.signatureAndHash.signature = signatureRSA
- certVerify.signatureAndHash.hash = hashId
- default:
- err = errors.New("unknown private key type")
- }
- if err != nil {
- c.sendAlert(alertInternalError)
- return errors.New("tls: failed to sign handshake with client certificate: " + err.Error())
- }
- certVerify.signature = signed
-
- hs.finishedHash.Write(certVerify.marshal())
- c.writeRecord(recordTypeHandshake, certVerify.marshal())
- }
-
- hs.masterSecret = masterFromPreMasterSecret(c.vers, preMasterSecret, hs.hello.random, hs.serverHello.random)
- return nil
-}
-
-func (hs *clientHandshakeState) establishKeys() error {
- c := hs.c
-
- clientMAC, serverMAC, clientKey, serverKey, clientIV, serverIV :=
- keysFromMasterSecret(c.vers, hs.masterSecret, hs.hello.random, hs.serverHello.random, hs.suite.macLen, hs.suite.keyLen, hs.suite.ivLen)
- var clientCipher, serverCipher interface{}
- var clientHash, serverHash macFunction
- if hs.suite.cipher != nil {
- clientCipher = hs.suite.cipher(clientKey, clientIV, false /* not for reading */)
- clientHash = hs.suite.mac(c.vers, clientMAC)
- serverCipher = hs.suite.cipher(serverKey, serverIV, true /* for reading */)
- serverHash = hs.suite.mac(c.vers, serverMAC)
- } else {
- clientCipher = hs.suite.aead(clientKey, clientIV)
- serverCipher = hs.suite.aead(serverKey, serverIV)
- }
-
- c.in.prepareCipherSpec(c.vers, serverCipher, serverHash)
- c.out.prepareCipherSpec(c.vers, clientCipher, clientHash)
- return nil
-}
-
-func (hs *clientHandshakeState) serverResumedSession() bool {
- // If the server responded with the same sessionId then it means the
- // sessionTicket is being used to resume a TLS session.
- return hs.session != nil && hs.hello.sessionId != nil &&
- bytes.Equal(hs.serverHello.sessionId, hs.hello.sessionId)
-}
-
-func (hs *clientHandshakeState) processServerHello() (bool, error) {
- c := hs.c
-
- if hs.serverHello.compressionMethod != compressionNone {
- c.sendAlert(alertUnexpectedMessage)
- return false, errors.New("tls: server selected unsupported compression format")
- }
-
- clientDidNPN := hs.hello.nextProtoNeg
- clientDidALPN := len(hs.hello.alpnProtocols) > 0
- serverHasNPN := hs.serverHello.nextProtoNeg
- serverHasALPN := len(hs.serverHello.alpnProtocol) > 0
-
- if !clientDidNPN && serverHasNPN {
- c.sendAlert(alertHandshakeFailure)
- return false, errors.New("server advertised unrequested NPN extension")
- }
-
- if !clientDidALPN && serverHasALPN {
- c.sendAlert(alertHandshakeFailure)
- return false, errors.New("server advertised unrequested ALPN extension")
- }
-
- if serverHasNPN && serverHasALPN {
- c.sendAlert(alertHandshakeFailure)
- return false, errors.New("server advertised both NPN and ALPN extensions")
- }
-
- if serverHasALPN {
- c.clientProtocol = hs.serverHello.alpnProtocol
- c.clientProtocolFallback = false
- }
-
- if hs.serverResumedSession() {
- // Restore masterSecret and peerCerts from previous state
- hs.masterSecret = hs.session.masterSecret
- c.peerCertificates = hs.session.serverCertificates
- return true, nil
- }
- return false, nil
-}
-
-func (hs *clientHandshakeState) readFinished(out []byte) error {
- c := hs.c
-
- c.readRecord(recordTypeChangeCipherSpec)
- if err := c.in.error(); err != nil {
- return err
- }
-
- msg, err := c.readHandshake()
- if err != nil {
- return err
- }
- serverFinished, ok := msg.(*finishedMsg)
- if !ok {
- c.sendAlert(alertUnexpectedMessage)
- return unexpectedMessageError(serverFinished, msg)
- }
-
- verify := hs.finishedHash.serverSum(hs.masterSecret)
- if len(verify) != len(serverFinished.verifyData) ||
- subtle.ConstantTimeCompare(verify, serverFinished.verifyData) != 1 {
- c.sendAlert(alertHandshakeFailure)
- return errors.New("tls: server's Finished message was incorrect")
- }
- hs.finishedHash.Write(serverFinished.marshal())
- copy(out, verify)
- return nil
-}
-
-func (hs *clientHandshakeState) readSessionTicket() error {
- if !hs.serverHello.ticketSupported {
- return nil
- }
-
- c := hs.c
- msg, err := c.readHandshake()
- if err != nil {
- return err
- }
- sessionTicketMsg, ok := msg.(*newSessionTicketMsg)
- if !ok {
- c.sendAlert(alertUnexpectedMessage)
- return unexpectedMessageError(sessionTicketMsg, msg)
- }
- hs.finishedHash.Write(sessionTicketMsg.marshal())
-
- hs.session = &ClientSessionState{
- sessionTicket: sessionTicketMsg.ticket,
- vers: c.vers,
- cipherSuite: hs.suite.id,
- masterSecret: hs.masterSecret,
- serverCertificates: c.peerCertificates,
- }
-
- return nil
-}
-
-func (hs *clientHandshakeState) sendFinished(out []byte) error {
- c := hs.c
-
- c.writeRecord(recordTypeChangeCipherSpec, []byte{1})
- if hs.serverHello.nextProtoNeg {
- nextProto := new(nextProtoMsg)
- proto, fallback := mutualProtocol(c.config.NextProtos, hs.serverHello.nextProtos)
- nextProto.proto = proto
- c.clientProtocol = proto
- c.clientProtocolFallback = fallback
-
- hs.finishedHash.Write(nextProto.marshal())
- c.writeRecord(recordTypeHandshake, nextProto.marshal())
- }
-
- finished := new(finishedMsg)
- finished.verifyData = hs.finishedHash.clientSum(hs.masterSecret)
- hs.finishedHash.Write(finished.marshal())
- c.writeRecord(recordTypeHandshake, finished.marshal())
- copy(out, finished.verifyData)
- return nil
-}
-
-// clientSessionCacheKey returns a key used to cache sessionTickets that could
-// be used to resume previously negotiated TLS sessions with a server.
-func clientSessionCacheKey(serverAddr net.Addr, config *Config) string {
- if len(config.ServerName) > 0 {
- return config.ServerName
- }
- return serverAddr.String()
-}
-
-// mutualProtocol finds the mutual Next Protocol Negotiation or ALPN protocol
-// given list of possible protocols and a list of the preference order. The
-// first list must not be empty. It returns the resulting protocol and flag
-// indicating if the fallback case was reached.
-func mutualProtocol(protos, preferenceProtos []string) (string, bool) {
- for _, s := range preferenceProtos {
- for _, c := range protos {
- if s == c {
- return s, false
- }
- }
- }
-
- return protos[0], true
-}
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/handshake_client_test.go b/runtimes/google/ipc/stream/crypto/tlsfork/handshake_client_test.go
deleted file mode 100644
index 5521d08..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/handshake_client_test.go
+++ /dev/null
@@ -1,492 +0,0 @@
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.4
-
-package tls
-
-import (
- "bytes"
- "crypto/ecdsa"
- "crypto/rsa"
- "crypto/x509"
- "encoding/pem"
- "fmt"
- "io"
- "net"
- "os"
- "os/exec"
- "path/filepath"
- "strconv"
- "testing"
- "time"
-)
-
-// Note: see comment in handshake_test.go for details of how the reference
-// tests work.
-
-// blockingSource is an io.Reader that blocks a Read call until it's closed.
-type blockingSource chan bool
-
-func (b blockingSource) Read([]byte) (n int, err error) {
- <-b
- return 0, io.EOF
-}
-
-// clientTest represents a test of the TLS client handshake against a reference
-// implementation.
-type clientTest struct {
- // name is a freeform string identifying the test and the file in which
- // the expected results will be stored.
- name string
- // command, if not empty, contains a series of arguments for the
- // command to run for the reference server.
- command []string
- // config, if not nil, contains a custom Config to use for this test.
- config *Config
- // cert, if not empty, contains a DER-encoded certificate for the
- // reference server.
- cert []byte
- // key, if not nil, contains either a *rsa.PrivateKey or
- // *ecdsa.PrivateKey which is the private key for the reference server.
- key interface{}
- // validate, if not nil, is a function that will be called with the
- // ConnectionState of the resulting connection. It returns a non-nil
- // error if the ConnectionState is unacceptable.
- validate func(ConnectionState) error
-}
-
-var defaultServerCommand = []string{"openssl", "s_server"}
-
-// connFromCommand starts the reference server process, connects to it and
-// returns a recordingConn for the connection. The stdin return value is a
-// blockingSource for the stdin of the child process. It must be closed before
-// Waiting for child.
-func (test *clientTest) connFromCommand() (conn *recordingConn, child *exec.Cmd, stdin blockingSource, err error) {
- cert := testRSACertificate
- if len(test.cert) > 0 {
- cert = test.cert
- }
- certPath := tempFile(string(cert))
- defer os.Remove(certPath)
-
- var key interface{} = testRSAPrivateKey
- if test.key != nil {
- key = test.key
- }
- var pemType string
- var derBytes []byte
- switch key := key.(type) {
- case *rsa.PrivateKey:
- pemType = "RSA"
- derBytes = x509.MarshalPKCS1PrivateKey(key)
- case *ecdsa.PrivateKey:
- pemType = "EC"
- var err error
- derBytes, err = x509.MarshalECPrivateKey(key)
- if err != nil {
- panic(err)
- }
- default:
- panic("unknown key type")
- }
-
- var pemOut bytes.Buffer
- pem.Encode(&pemOut, &pem.Block{Type: pemType + " PRIVATE KEY", Bytes: derBytes})
-
- keyPath := tempFile(string(pemOut.Bytes()))
- defer os.Remove(keyPath)
-
- var command []string
- if len(test.command) > 0 {
- command = append(command, test.command...)
- } else {
- command = append(command, defaultServerCommand...)
- }
- command = append(command, "-cert", certPath, "-certform", "DER", "-key", keyPath)
- // serverPort contains the port that OpenSSL will listen on. OpenSSL
- // can't take "0" as an argument here so we have to pick a number and
- // hope that it's not in use on the machine. Since this only occurs
- // when -update is given and thus when there's a human watching the
- // test, this isn't too bad.
- const serverPort = 24323
- command = append(command, "-accept", strconv.Itoa(serverPort))
-
- cmd := exec.Command(command[0], command[1:]...)
- stdin = blockingSource(make(chan bool))
- cmd.Stdin = stdin
- var out bytes.Buffer
- cmd.Stdout = &out
- cmd.Stderr = &out
- if err := cmd.Start(); err != nil {
- return nil, nil, nil, err
- }
-
- // OpenSSL does print an "ACCEPT" banner, but it does so *before*
- // opening the listening socket, so we can't use that to wait until it
- // has started listening. Thus we are forced to poll until we get a
- // connection.
- var tcpConn net.Conn
- for i := uint(0); i < 5; i++ {
- var err error
- tcpConn, err = net.DialTCP("tcp", nil, &net.TCPAddr{
- IP: net.IPv4(127, 0, 0, 1),
- Port: serverPort,
- })
- if err == nil {
- break
- }
- time.Sleep((1 << i) * 5 * time.Millisecond)
- }
- if tcpConn == nil {
- close(stdin)
- out.WriteTo(os.Stdout)
- cmd.Process.Kill()
- return nil, nil, nil, cmd.Wait()
- }
-
- record := &recordingConn{
- Conn: tcpConn,
- }
-
- return record, cmd, stdin, nil
-}
-
-func (test *clientTest) dataPath() string {
- return filepath.Join("testdata", "Client-"+test.name)
-}
-
-func (test *clientTest) loadData() (flows [][]byte, err error) {
- in, err := os.Open(test.dataPath())
- if err != nil {
- return nil, err
- }
- defer in.Close()
- return parseTestData(in)
-}
-
-func (test *clientTest) run(t *testing.T, write bool) {
- var clientConn, serverConn net.Conn
- var recordingConn *recordingConn
- var childProcess *exec.Cmd
- var stdin blockingSource
-
- if write {
- var err error
- recordingConn, childProcess, stdin, err = test.connFromCommand()
- if err != nil {
- t.Fatalf("Failed to start subcommand: %s", err)
- }
- clientConn = recordingConn
- } else {
- clientConn, serverConn = net.Pipe()
- }
-
- config := test.config
- if config == nil {
- config = testConfig
- }
- client := Client(clientConn, config)
-
- doneChan := make(chan bool)
- go func() {
- if _, err := client.Write([]byte("hello\n")); err != nil {
- t.Logf("Client.Write failed: %s", err)
- }
- if test.validate != nil {
- if err := test.validate(client.ConnectionState()); err != nil {
- t.Logf("validate callback returned error: %s", err)
- }
- }
- client.Close()
- clientConn.Close()
- doneChan <- true
- }()
-
- if !write {
- flows, err := test.loadData()
- if err != nil {
- t.Fatalf("%s: failed to load data from %s", test.name, test.dataPath())
- }
- for i, b := range flows {
- if i%2 == 1 {
- serverConn.Write(b)
- continue
- }
- bb := make([]byte, len(b))
- _, err := io.ReadFull(serverConn, bb)
- if err != nil {
- t.Fatalf("%s #%d: %s", test.name, i, err)
- }
- if !bytes.Equal(b, bb) {
- t.Fatalf("%s #%d: mismatch on read: got:%x want:%x", test.name, i, bb, b)
- }
- }
- serverConn.Close()
- }
-
- <-doneChan
-
- if write {
- path := test.dataPath()
- out, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
- if err != nil {
- t.Fatalf("Failed to create output file: %s", err)
- }
- defer out.Close()
- recordingConn.Close()
- close(stdin)
- childProcess.Process.Kill()
- childProcess.Wait()
- if len(recordingConn.flows) < 3 {
- childProcess.Stdout.(*bytes.Buffer).WriteTo(os.Stdout)
- t.Fatalf("Client connection didn't work")
- }
- recordingConn.WriteTo(out)
- fmt.Printf("Wrote %s\n", path)
- }
-}
-
-func runClientTestForVersion(t *testing.T, template *clientTest, prefix, option string) {
- test := *template
- test.name = prefix + test.name
- if len(test.command) == 0 {
- test.command = defaultClientCommand
- }
- test.command = append([]string(nil), test.command...)
- test.command = append(test.command, option)
- test.run(t, *update)
-}
-
-func runClientTestTLS10(t *testing.T, template *clientTest) {
- runClientTestForVersion(t, template, "TLSv10-", "-tls1")
-}
-
-func runClientTestTLS11(t *testing.T, template *clientTest) {
- runClientTestForVersion(t, template, "TLSv11-", "-tls1_1")
-}
-
-func runClientTestTLS12(t *testing.T, template *clientTest) {
- runClientTestForVersion(t, template, "TLSv12-", "-tls1_2")
-}
-
-func TestHandshakeClientRSARC4(t *testing.T) {
- test := &clientTest{
- name: "RSA-RC4",
- command: []string{"openssl", "s_server", "-cipher", "RC4-SHA"},
- }
- runClientTestTLS10(t, test)
- runClientTestTLS11(t, test)
- runClientTestTLS12(t, test)
-}
-
-func TestHandshakeClientECDHERSAAES(t *testing.T) {
- test := &clientTest{
- name: "ECDHE-RSA-AES",
- command: []string{"openssl", "s_server", "-cipher", "ECDHE-RSA-AES128-SHA"},
- }
- runClientTestTLS10(t, test)
- runClientTestTLS11(t, test)
- runClientTestTLS12(t, test)
-}
-
-func TestHandshakeClientECDHEECDSAAES(t *testing.T) {
- test := &clientTest{
- name: "ECDHE-ECDSA-AES",
- command: []string{"openssl", "s_server", "-cipher", "ECDHE-ECDSA-AES128-SHA"},
- cert: testECDSACertificate,
- key: testECDSAPrivateKey,
- }
- runClientTestTLS10(t, test)
- runClientTestTLS11(t, test)
- runClientTestTLS12(t, test)
-}
-
-func TestHandshakeClientECDHEECDSAAESGCM(t *testing.T) {
- test := &clientTest{
- name: "ECDHE-ECDSA-AES-GCM",
- command: []string{"openssl", "s_server", "-cipher", "ECDHE-ECDSA-AES128-GCM-SHA256"},
- cert: testECDSACertificate,
- key: testECDSAPrivateKey,
- }
- runClientTestTLS12(t, test)
-}
-
-func TestHandshakeClientCertRSA(t *testing.T) {
- config := *testConfig
- cert, _ := X509KeyPair([]byte(clientCertificatePEM), []byte(clientKeyPEM))
- config.Certificates = []Certificate{cert}
-
- test := &clientTest{
- name: "ClientCert-RSA-RSA",
- command: []string{"openssl", "s_server", "-cipher", "RC4-SHA", "-verify", "1"},
- config: &config,
- }
-
- runClientTestTLS10(t, test)
- runClientTestTLS12(t, test)
-
- test = &clientTest{
- name: "ClientCert-RSA-ECDSA",
- command: []string{"openssl", "s_server", "-cipher", "ECDHE-ECDSA-AES128-SHA", "-verify", "1"},
- config: &config,
- cert: testECDSACertificate,
- key: testECDSAPrivateKey,
- }
-
- runClientTestTLS10(t, test)
- runClientTestTLS12(t, test)
-}
-
-func TestHandshakeClientCertECDSA(t *testing.T) {
- config := *testConfig
- cert, _ := X509KeyPair([]byte(clientECDSACertificatePEM), []byte(clientECDSAKeyPEM))
- config.Certificates = []Certificate{cert}
-
- test := &clientTest{
- name: "ClientCert-ECDSA-RSA",
- command: []string{"openssl", "s_server", "-cipher", "RC4-SHA", "-verify", "1"},
- config: &config,
- }
-
- runClientTestTLS10(t, test)
- runClientTestTLS12(t, test)
-
- test = &clientTest{
- name: "ClientCert-ECDSA-ECDSA",
- command: []string{"openssl", "s_server", "-cipher", "ECDHE-ECDSA-AES128-SHA", "-verify", "1"},
- config: &config,
- cert: testECDSACertificate,
- key: testECDSAPrivateKey,
- }
-
- runClientTestTLS10(t, test)
- runClientTestTLS12(t, test)
-}
-
-func TestClientResumption(t *testing.T) {
- serverConfig := &Config{
- CipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA, TLS_ECDHE_RSA_WITH_RC4_128_SHA},
- Certificates: testConfig.Certificates,
- }
- clientConfig := &Config{
- CipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA},
- InsecureSkipVerify: true,
- ClientSessionCache: NewLRUClientSessionCache(32),
- }
-
- testResumeState := func(test string, didResume bool) {
- hs, err := testHandshake(clientConfig, serverConfig)
- if err != nil {
- t.Fatalf("%s: handshake failed: %s", test, err)
- }
- if hs.DidResume != didResume {
- t.Fatalf("%s resumed: %v, expected: %v", test, hs.DidResume, didResume)
- }
- }
-
- testResumeState("Handshake", false)
- testResumeState("Resume", true)
-
- if _, err := io.ReadFull(serverConfig.rand(), serverConfig.SessionTicketKey[:]); err != nil {
- t.Fatalf("Failed to invalidate SessionTicketKey")
- }
- testResumeState("InvalidSessionTicketKey", false)
- testResumeState("ResumeAfterInvalidSessionTicketKey", true)
-
- clientConfig.CipherSuites = []uint16{TLS_ECDHE_RSA_WITH_RC4_128_SHA}
- testResumeState("DifferentCipherSuite", false)
- testResumeState("DifferentCipherSuiteRecovers", true)
-
- clientConfig.ClientSessionCache = nil
- testResumeState("WithoutSessionCache", false)
-}
-
-func TestLRUClientSessionCache(t *testing.T) {
- // Initialize cache of capacity 4.
- cache := NewLRUClientSessionCache(4)
- cs := make([]ClientSessionState, 6)
- keys := []string{"0", "1", "2", "3", "4", "5", "6"}
-
- // Add 4 entries to the cache and look them up.
- for i := 0; i < 4; i++ {
- cache.Put(keys[i], &cs[i])
- }
- for i := 0; i < 4; i++ {
- if s, ok := cache.Get(keys[i]); !ok || s != &cs[i] {
- t.Fatalf("session cache failed lookup for added key: %s", keys[i])
- }
- }
-
- // Add 2 more entries to the cache. First 2 should be evicted.
- for i := 4; i < 6; i++ {
- cache.Put(keys[i], &cs[i])
- }
- for i := 0; i < 2; i++ {
- if s, ok := cache.Get(keys[i]); ok || s != nil {
- t.Fatalf("session cache should have evicted key: %s", keys[i])
- }
- }
-
- // Touch entry 2. LRU should evict 3 next.
- cache.Get(keys[2])
- cache.Put(keys[0], &cs[0])
- if s, ok := cache.Get(keys[3]); ok || s != nil {
- t.Fatalf("session cache should have evicted key 3")
- }
-
- // Update entry 0 in place.
- cache.Put(keys[0], &cs[3])
- if s, ok := cache.Get(keys[0]); !ok || s != &cs[3] {
- t.Fatalf("session cache failed update for key 0")
- }
-
- // Adding a nil entry is valid.
- cache.Put(keys[0], nil)
- if s, ok := cache.Get(keys[0]); !ok || s != nil {
- t.Fatalf("failed to add nil entry to cache")
- }
-}
-
-func TestHandshakeClientALPNMatch(t *testing.T) {
- config := *testConfig
- config.NextProtos = []string{"proto2", "proto1"}
-
- test := &clientTest{
- name: "ALPN",
- // Note that this needs OpenSSL 1.0.2 because that is the first
- // version that supports the -alpn flag.
- command: []string{"openssl", "s_server", "-alpn", "proto1,proto2"},
- config: &config,
- validate: func(state ConnectionState) error {
- // The server's preferences should override the client.
- if state.NegotiatedProtocol != "proto1" {
- return fmt.Errorf("Got protocol %q, wanted proto1", state.NegotiatedProtocol)
- }
- return nil
- },
- }
- runClientTestTLS12(t, test)
-}
-
-func TestHandshakeClientALPNNoMatch(t *testing.T) {
- config := *testConfig
- config.NextProtos = []string{"proto3"}
-
- test := &clientTest{
- name: "ALPN-NoMatch",
- // Note that this needs OpenSSL 1.0.2 because that is the first
- // version that supports the -alpn flag.
- command: []string{"openssl", "s_server", "-alpn", "proto1,proto2"},
- config: &config,
- validate: func(state ConnectionState) error {
- // There's no overlap so OpenSSL will not select a protocol.
- if state.NegotiatedProtocol != "" {
- return fmt.Errorf("Got protocol %q, wanted ''", state.NegotiatedProtocol)
- }
- return nil
- },
- }
- runClientTestTLS12(t, test)
-}
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/handshake_messages.go b/runtimes/google/ipc/stream/crypto/tlsfork/handshake_messages.go
deleted file mode 100644
index 88fbb4b..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/handshake_messages.go
+++ /dev/null
@@ -1,1440 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.4
-
-package tls
-
-import "bytes"
-
-type clientHelloMsg struct {
- raw []byte
- vers uint16
- random []byte
- sessionId []byte
- cipherSuites []uint16
- compressionMethods []uint8
- nextProtoNeg bool
- serverName string
- ocspStapling bool
- supportedCurves []CurveID
- supportedPoints []uint8
- ticketSupported bool
- sessionTicket []uint8
- signatureAndHashes []signatureAndHash
- secureRenegotiation bool
- alpnProtocols []string
-}
-
-func (m *clientHelloMsg) equal(i interface{}) bool {
- m1, ok := i.(*clientHelloMsg)
- if !ok {
- return false
- }
-
- return bytes.Equal(m.raw, m1.raw) &&
- m.vers == m1.vers &&
- bytes.Equal(m.random, m1.random) &&
- bytes.Equal(m.sessionId, m1.sessionId) &&
- eqUint16s(m.cipherSuites, m1.cipherSuites) &&
- bytes.Equal(m.compressionMethods, m1.compressionMethods) &&
- m.nextProtoNeg == m1.nextProtoNeg &&
- m.serverName == m1.serverName &&
- m.ocspStapling == m1.ocspStapling &&
- eqCurveIDs(m.supportedCurves, m1.supportedCurves) &&
- bytes.Equal(m.supportedPoints, m1.supportedPoints) &&
- m.ticketSupported == m1.ticketSupported &&
- bytes.Equal(m.sessionTicket, m1.sessionTicket) &&
- eqSignatureAndHashes(m.signatureAndHashes, m1.signatureAndHashes) &&
- m.secureRenegotiation == m1.secureRenegotiation &&
- eqStrings(m.alpnProtocols, m1.alpnProtocols)
-}
-
-func (m *clientHelloMsg) marshal() []byte {
- if m.raw != nil {
- return m.raw
- }
-
- length := 2 + 32 + 1 + len(m.sessionId) + 2 + len(m.cipherSuites)*2 + 1 + len(m.compressionMethods)
- numExtensions := 0
- extensionsLength := 0
- if m.nextProtoNeg {
- numExtensions++
- }
- if m.ocspStapling {
- extensionsLength += 1 + 2 + 2
- numExtensions++
- }
- if len(m.serverName) > 0 {
- extensionsLength += 5 + len(m.serverName)
- numExtensions++
- }
- if len(m.supportedCurves) > 0 {
- extensionsLength += 2 + 2*len(m.supportedCurves)
- numExtensions++
- }
- if len(m.supportedPoints) > 0 {
- extensionsLength += 1 + len(m.supportedPoints)
- numExtensions++
- }
- if m.ticketSupported {
- extensionsLength += len(m.sessionTicket)
- numExtensions++
- }
- if len(m.signatureAndHashes) > 0 {
- extensionsLength += 2 + 2*len(m.signatureAndHashes)
- numExtensions++
- }
- if m.secureRenegotiation {
- extensionsLength += 1
- numExtensions++
- }
- if len(m.alpnProtocols) > 0 {
- extensionsLength += 2
- for _, s := range m.alpnProtocols {
- if l := len(s); l == 0 || l > 255 {
- panic("invalid ALPN protocol")
- }
- extensionsLength++
- extensionsLength += len(s)
- }
- numExtensions++
- }
- if numExtensions > 0 {
- extensionsLength += 4 * numExtensions
- length += 2 + extensionsLength
- }
-
- x := make([]byte, 4+length)
- x[0] = typeClientHello
- x[1] = uint8(length >> 16)
- x[2] = uint8(length >> 8)
- x[3] = uint8(length)
- x[4] = uint8(m.vers >> 8)
- x[5] = uint8(m.vers)
- copy(x[6:38], m.random)
- x[38] = uint8(len(m.sessionId))
- copy(x[39:39+len(m.sessionId)], m.sessionId)
- y := x[39+len(m.sessionId):]
- y[0] = uint8(len(m.cipherSuites) >> 7)
- y[1] = uint8(len(m.cipherSuites) << 1)
- for i, suite := range m.cipherSuites {
- y[2+i*2] = uint8(suite >> 8)
- y[3+i*2] = uint8(suite)
- }
- z := y[2+len(m.cipherSuites)*2:]
- z[0] = uint8(len(m.compressionMethods))
- copy(z[1:], m.compressionMethods)
-
- z = z[1+len(m.compressionMethods):]
- if numExtensions > 0 {
- z[0] = byte(extensionsLength >> 8)
- z[1] = byte(extensionsLength)
- z = z[2:]
- }
- if m.nextProtoNeg {
- z[0] = byte(extensionNextProtoNeg >> 8)
- z[1] = byte(extensionNextProtoNeg & 0xff)
- // The length is always 0
- z = z[4:]
- }
- if len(m.serverName) > 0 {
- z[0] = byte(extensionServerName >> 8)
- z[1] = byte(extensionServerName & 0xff)
- l := len(m.serverName) + 5
- z[2] = byte(l >> 8)
- z[3] = byte(l)
- z = z[4:]
-
- // RFC 3546, section 3.1
- //
- // struct {
- // NameType name_type;
- // select (name_type) {
- // case host_name: HostName;
- // } name;
- // } ServerName;
- //
- // enum {
- // host_name(0), (255)
- // } NameType;
- //
- // opaque HostName<1..2^16-1>;
- //
- // struct {
- // ServerName server_name_list<1..2^16-1>
- // } ServerNameList;
-
- z[0] = byte((len(m.serverName) + 3) >> 8)
- z[1] = byte(len(m.serverName) + 3)
- z[3] = byte(len(m.serverName) >> 8)
- z[4] = byte(len(m.serverName))
- copy(z[5:], []byte(m.serverName))
- z = z[l:]
- }
- if m.ocspStapling {
- // RFC 4366, section 3.6
- z[0] = byte(extensionStatusRequest >> 8)
- z[1] = byte(extensionStatusRequest)
- z[2] = 0
- z[3] = 5
- z[4] = 1 // OCSP type
- // Two zero valued uint16s for the two lengths.
- z = z[9:]
- }
- if len(m.supportedCurves) > 0 {
- // http://tools.ietf.org/html/rfc4492#section-5.5.1
- z[0] = byte(extensionSupportedCurves >> 8)
- z[1] = byte(extensionSupportedCurves)
- l := 2 + 2*len(m.supportedCurves)
- z[2] = byte(l >> 8)
- z[3] = byte(l)
- l -= 2
- z[4] = byte(l >> 8)
- z[5] = byte(l)
- z = z[6:]
- for _, curve := range m.supportedCurves {
- z[0] = byte(curve >> 8)
- z[1] = byte(curve)
- z = z[2:]
- }
- }
- if len(m.supportedPoints) > 0 {
- // http://tools.ietf.org/html/rfc4492#section-5.5.2
- z[0] = byte(extensionSupportedPoints >> 8)
- z[1] = byte(extensionSupportedPoints)
- l := 1 + len(m.supportedPoints)
- z[2] = byte(l >> 8)
- z[3] = byte(l)
- l--
- z[4] = byte(l)
- z = z[5:]
- for _, pointFormat := range m.supportedPoints {
- z[0] = byte(pointFormat)
- z = z[1:]
- }
- }
- if m.ticketSupported {
- // http://tools.ietf.org/html/rfc5077#section-3.2
- z[0] = byte(extensionSessionTicket >> 8)
- z[1] = byte(extensionSessionTicket)
- l := len(m.sessionTicket)
- z[2] = byte(l >> 8)
- z[3] = byte(l)
- z = z[4:]
- copy(z, m.sessionTicket)
- z = z[len(m.sessionTicket):]
- }
- if len(m.signatureAndHashes) > 0 {
- // https://tools.ietf.org/html/rfc5246#section-7.4.1.4.1
- z[0] = byte(extensionSignatureAlgorithms >> 8)
- z[1] = byte(extensionSignatureAlgorithms)
- l := 2 + 2*len(m.signatureAndHashes)
- z[2] = byte(l >> 8)
- z[3] = byte(l)
- z = z[4:]
-
- l -= 2
- z[0] = byte(l >> 8)
- z[1] = byte(l)
- z = z[2:]
- for _, sigAndHash := range m.signatureAndHashes {
- z[0] = sigAndHash.hash
- z[1] = sigAndHash.signature
- z = z[2:]
- }
- }
- if m.secureRenegotiation {
- z[0] = byte(extensionRenegotiationInfo >> 8)
- z[1] = byte(extensionRenegotiationInfo & 0xff)
- z[2] = 0
- z[3] = 1
- z = z[5:]
- }
- if len(m.alpnProtocols) > 0 {
- z[0] = byte(extensionALPN >> 8)
- z[1] = byte(extensionALPN & 0xff)
- lengths := z[2:]
- z = z[6:]
-
- stringsLength := 0
- for _, s := range m.alpnProtocols {
- l := len(s)
- z[0] = byte(l)
- copy(z[1:], s)
- z = z[1+l:]
- stringsLength += 1 + l
- }
-
- lengths[2] = byte(stringsLength >> 8)
- lengths[3] = byte(stringsLength)
- stringsLength += 2
- lengths[0] = byte(stringsLength >> 8)
- lengths[1] = byte(stringsLength)
- }
-
- m.raw = x
-
- return x
-}
-
-func (m *clientHelloMsg) unmarshal(data []byte) bool {
- if len(data) < 42 {
- return false
- }
- m.raw = data
- m.vers = uint16(data[4])<<8 | uint16(data[5])
- m.random = data[6:38]
- sessionIdLen := int(data[38])
- if sessionIdLen > 32 || len(data) < 39+sessionIdLen {
- return false
- }
- m.sessionId = data[39 : 39+sessionIdLen]
- data = data[39+sessionIdLen:]
- if len(data) < 2 {
- return false
- }
- // cipherSuiteLen is the number of bytes of cipher suite numbers. Since
- // they are uint16s, the number must be even.
- cipherSuiteLen := int(data[0])<<8 | int(data[1])
- if cipherSuiteLen%2 == 1 || len(data) < 2+cipherSuiteLen {
- return false
- }
- numCipherSuites := cipherSuiteLen / 2
- m.cipherSuites = make([]uint16, numCipherSuites)
- for i := 0; i < numCipherSuites; i++ {
- m.cipherSuites[i] = uint16(data[2+2*i])<<8 | uint16(data[3+2*i])
- if m.cipherSuites[i] == scsvRenegotiation {
- m.secureRenegotiation = true
- }
- }
- data = data[2+cipherSuiteLen:]
- if len(data) < 1 {
- return false
- }
- compressionMethodsLen := int(data[0])
- if len(data) < 1+compressionMethodsLen {
- return false
- }
- m.compressionMethods = data[1 : 1+compressionMethodsLen]
-
- data = data[1+compressionMethodsLen:]
-
- m.nextProtoNeg = false
- m.serverName = ""
- m.ocspStapling = false
- m.ticketSupported = false
- m.sessionTicket = nil
- m.signatureAndHashes = nil
- m.alpnProtocols = nil
-
- if len(data) == 0 {
- // ClientHello is optionally followed by extension data
- return true
- }
- if len(data) < 2 {
- return false
- }
-
- extensionsLength := int(data[0])<<8 | int(data[1])
- data = data[2:]
- if extensionsLength != len(data) {
- return false
- }
-
- for len(data) != 0 {
- if len(data) < 4 {
- return false
- }
- extension := uint16(data[0])<<8 | uint16(data[1])
- length := int(data[2])<<8 | int(data[3])
- data = data[4:]
- if len(data) < length {
- return false
- }
-
- switch extension {
- case extensionServerName:
- if length < 2 {
- return false
- }
- numNames := int(data[0])<<8 | int(data[1])
- d := data[2:]
- for i := 0; i < numNames; i++ {
- if len(d) < 3 {
- return false
- }
- nameType := d[0]
- nameLen := int(d[1])<<8 | int(d[2])
- d = d[3:]
- if len(d) < nameLen {
- return false
- }
- if nameType == 0 {
- m.serverName = string(d[0:nameLen])
- break
- }
- d = d[nameLen:]
- }
- case extensionNextProtoNeg:
- if length > 0 {
- return false
- }
- m.nextProtoNeg = true
- case extensionStatusRequest:
- m.ocspStapling = length > 0 && data[0] == statusTypeOCSP
- case extensionSupportedCurves:
- // http://tools.ietf.org/html/rfc4492#section-5.5.1
- if length < 2 {
- return false
- }
- l := int(data[0])<<8 | int(data[1])
- if l%2 == 1 || length != l+2 {
- return false
- }
- numCurves := l / 2
- m.supportedCurves = make([]CurveID, numCurves)
- d := data[2:]
- for i := 0; i < numCurves; i++ {
- m.supportedCurves[i] = CurveID(d[0])<<8 | CurveID(d[1])
- d = d[2:]
- }
- case extensionSupportedPoints:
- // http://tools.ietf.org/html/rfc4492#section-5.5.2
- if length < 1 {
- return false
- }
- l := int(data[0])
- if length != l+1 {
- return false
- }
- m.supportedPoints = make([]uint8, l)
- copy(m.supportedPoints, data[1:])
- case extensionSessionTicket:
- // http://tools.ietf.org/html/rfc5077#section-3.2
- m.ticketSupported = true
- m.sessionTicket = data[:length]
- case extensionSignatureAlgorithms:
- // https://tools.ietf.org/html/rfc5246#section-7.4.1.4.1
- if length < 2 || length&1 != 0 {
- return false
- }
- l := int(data[0])<<8 | int(data[1])
- if l != length-2 {
- return false
- }
- n := l / 2
- d := data[2:]
- m.signatureAndHashes = make([]signatureAndHash, n)
- for i := range m.signatureAndHashes {
- m.signatureAndHashes[i].hash = d[0]
- m.signatureAndHashes[i].signature = d[1]
- d = d[2:]
- }
- case extensionRenegotiationInfo + 1:
- if length != 1 || data[0] != 0 {
- return false
- }
- m.secureRenegotiation = true
- case extensionALPN:
- if length < 2 {
- return false
- }
- l := int(data[0])<<8 | int(data[1])
- if l != length-2 {
- return false
- }
- d := data[2:length]
- for len(d) != 0 {
- stringLen := int(d[0])
- d = d[1:]
- if stringLen == 0 || stringLen > len(d) {
- return false
- }
- m.alpnProtocols = append(m.alpnProtocols, string(d[:stringLen]))
- d = d[stringLen:]
- }
- }
- data = data[length:]
- }
-
- return true
-}
-
-type serverHelloMsg struct {
- raw []byte
- vers uint16
- random []byte
- sessionId []byte
- cipherSuite uint16
- compressionMethod uint8
- nextProtoNeg bool
- nextProtos []string
- ocspStapling bool
- ticketSupported bool
- secureRenegotiation bool
- alpnProtocol string
-}
-
-func (m *serverHelloMsg) equal(i interface{}) bool {
- m1, ok := i.(*serverHelloMsg)
- if !ok {
- return false
- }
-
- return bytes.Equal(m.raw, m1.raw) &&
- m.vers == m1.vers &&
- bytes.Equal(m.random, m1.random) &&
- bytes.Equal(m.sessionId, m1.sessionId) &&
- m.cipherSuite == m1.cipherSuite &&
- m.compressionMethod == m1.compressionMethod &&
- m.nextProtoNeg == m1.nextProtoNeg &&
- eqStrings(m.nextProtos, m1.nextProtos) &&
- m.ocspStapling == m1.ocspStapling &&
- m.ticketSupported == m1.ticketSupported &&
- m.secureRenegotiation == m1.secureRenegotiation &&
- m.alpnProtocol == m1.alpnProtocol
-}
-
-func (m *serverHelloMsg) marshal() []byte {
- if m.raw != nil {
- return m.raw
- }
-
- length := 38 + len(m.sessionId)
- numExtensions := 0
- extensionsLength := 0
-
- nextProtoLen := 0
- if m.nextProtoNeg {
- numExtensions++
- for _, v := range m.nextProtos {
- nextProtoLen += len(v)
- }
- nextProtoLen += len(m.nextProtos)
- extensionsLength += nextProtoLen
- }
- if m.ocspStapling {
- numExtensions++
- }
- if m.ticketSupported {
- numExtensions++
- }
- if m.secureRenegotiation {
- extensionsLength += 1
- numExtensions++
- }
- if alpnLen := len(m.alpnProtocol); alpnLen > 0 {
- if alpnLen >= 256 {
- panic("invalid ALPN protocol")
- }
- extensionsLength += 2 + 1 + alpnLen
- numExtensions++
- }
-
- if numExtensions > 0 {
- extensionsLength += 4 * numExtensions
- length += 2 + extensionsLength
- }
-
- x := make([]byte, 4+length)
- x[0] = typeServerHello
- x[1] = uint8(length >> 16)
- x[2] = uint8(length >> 8)
- x[3] = uint8(length)
- x[4] = uint8(m.vers >> 8)
- x[5] = uint8(m.vers)
- copy(x[6:38], m.random)
- x[38] = uint8(len(m.sessionId))
- copy(x[39:39+len(m.sessionId)], m.sessionId)
- z := x[39+len(m.sessionId):]
- z[0] = uint8(m.cipherSuite >> 8)
- z[1] = uint8(m.cipherSuite)
- z[2] = uint8(m.compressionMethod)
-
- z = z[3:]
- if numExtensions > 0 {
- z[0] = byte(extensionsLength >> 8)
- z[1] = byte(extensionsLength)
- z = z[2:]
- }
- if m.nextProtoNeg {
- z[0] = byte(extensionNextProtoNeg >> 8)
- z[1] = byte(extensionNextProtoNeg & 0xff)
- z[2] = byte(nextProtoLen >> 8)
- z[3] = byte(nextProtoLen)
- z = z[4:]
-
- for _, v := range m.nextProtos {
- l := len(v)
- if l > 255 {
- l = 255
- }
- z[0] = byte(l)
- copy(z[1:], []byte(v[0:l]))
- z = z[1+l:]
- }
- }
- if m.ocspStapling {
- z[0] = byte(extensionStatusRequest >> 8)
- z[1] = byte(extensionStatusRequest)
- z = z[4:]
- }
- if m.ticketSupported {
- z[0] = byte(extensionSessionTicket >> 8)
- z[1] = byte(extensionSessionTicket)
- z = z[4:]
- }
- if m.secureRenegotiation {
- z[0] = byte(extensionRenegotiationInfo >> 8)
- z[1] = byte(extensionRenegotiationInfo & 0xff)
- z[2] = 0
- z[3] = 1
- z = z[5:]
- }
- if alpnLen := len(m.alpnProtocol); alpnLen > 0 {
- z[0] = byte(extensionALPN >> 8)
- z[1] = byte(extensionALPN & 0xff)
- l := 2 + 1 + alpnLen
- z[2] = byte(l >> 8)
- z[3] = byte(l)
- l -= 2
- z[4] = byte(l >> 8)
- z[5] = byte(l)
- l -= 1
- z[6] = byte(l)
- copy(z[7:], []byte(m.alpnProtocol))
- z = z[7+alpnLen:]
- }
-
- m.raw = x
-
- return x
-}
-
-func (m *serverHelloMsg) unmarshal(data []byte) bool {
- if len(data) < 42 {
- return false
- }
- m.raw = data
- m.vers = uint16(data[4])<<8 | uint16(data[5])
- m.random = data[6:38]
- sessionIdLen := int(data[38])
- if sessionIdLen > 32 || len(data) < 39+sessionIdLen {
- return false
- }
- m.sessionId = data[39 : 39+sessionIdLen]
- data = data[39+sessionIdLen:]
- if len(data) < 3 {
- return false
- }
- m.cipherSuite = uint16(data[0])<<8 | uint16(data[1])
- m.compressionMethod = data[2]
- data = data[3:]
-
- m.nextProtoNeg = false
- m.nextProtos = nil
- m.ocspStapling = false
- m.ticketSupported = false
- m.alpnProtocol = ""
-
- if len(data) == 0 {
- // ServerHello is optionally followed by extension data
- return true
- }
- if len(data) < 2 {
- return false
- }
-
- extensionsLength := int(data[0])<<8 | int(data[1])
- data = data[2:]
- if len(data) != extensionsLength {
- return false
- }
-
- for len(data) != 0 {
- if len(data) < 4 {
- return false
- }
- extension := uint16(data[0])<<8 | uint16(data[1])
- length := int(data[2])<<8 | int(data[3])
- data = data[4:]
- if len(data) < length {
- return false
- }
-
- switch extension {
- case extensionNextProtoNeg:
- m.nextProtoNeg = true
- d := data[:length]
- for len(d) > 0 {
- l := int(d[0])
- d = d[1:]
- if l == 0 || l > len(d) {
- return false
- }
- m.nextProtos = append(m.nextProtos, string(d[:l]))
- d = d[l:]
- }
- case extensionStatusRequest:
- if length > 0 {
- return false
- }
- m.ocspStapling = true
- case extensionSessionTicket:
- if length > 0 {
- return false
- }
- m.ticketSupported = true
- case extensionRenegotiationInfo:
- if length != 1 || data[0] != 0 {
- return false
- }
- m.secureRenegotiation = true
- case extensionALPN:
- d := data[:length]
- if len(d) < 3 {
- return false
- }
- l := int(d[0])<<8 | int(d[1])
- if l != len(d)-2 {
- return false
- }
- d = d[2:]
- l = int(d[0])
- if l != len(d)-1 {
- return false
- }
- d = d[1:]
- m.alpnProtocol = string(d)
- }
- data = data[length:]
- }
-
- return true
-}
-
-type certificateMsg struct {
- raw []byte
- certificates [][]byte
-}
-
-func (m *certificateMsg) equal(i interface{}) bool {
- m1, ok := i.(*certificateMsg)
- if !ok {
- return false
- }
-
- return bytes.Equal(m.raw, m1.raw) &&
- eqByteSlices(m.certificates, m1.certificates)
-}
-
-func (m *certificateMsg) marshal() (x []byte) {
- if m.raw != nil {
- return m.raw
- }
-
- var i int
- for _, slice := range m.certificates {
- i += len(slice)
- }
-
- length := 3 + 3*len(m.certificates) + i
- x = make([]byte, 4+length)
- x[0] = typeCertificate
- x[1] = uint8(length >> 16)
- x[2] = uint8(length >> 8)
- x[3] = uint8(length)
-
- certificateOctets := length - 3
- x[4] = uint8(certificateOctets >> 16)
- x[5] = uint8(certificateOctets >> 8)
- x[6] = uint8(certificateOctets)
-
- y := x[7:]
- for _, slice := range m.certificates {
- y[0] = uint8(len(slice) >> 16)
- y[1] = uint8(len(slice) >> 8)
- y[2] = uint8(len(slice))
- copy(y[3:], slice)
- y = y[3+len(slice):]
- }
-
- m.raw = x
- return
-}
-
-func (m *certificateMsg) unmarshal(data []byte) bool {
- if len(data) < 7 {
- return false
- }
-
- m.raw = data
- certsLen := uint32(data[4])<<16 | uint32(data[5])<<8 | uint32(data[6])
- if uint32(len(data)) != certsLen+7 {
- return false
- }
-
- numCerts := 0
- d := data[7:]
- for certsLen > 0 {
- if len(d) < 4 {
- return false
- }
- certLen := uint32(d[0])<<16 | uint32(d[1])<<8 | uint32(d[2])
- if uint32(len(d)) < 3+certLen {
- return false
- }
- d = d[3+certLen:]
- certsLen -= 3 + certLen
- numCerts++
- }
-
- m.certificates = make([][]byte, numCerts)
- d = data[7:]
- for i := 0; i < numCerts; i++ {
- certLen := uint32(d[0])<<16 | uint32(d[1])<<8 | uint32(d[2])
- m.certificates[i] = d[3 : 3+certLen]
- d = d[3+certLen:]
- }
-
- return true
-}
-
-type serverKeyExchangeMsg struct {
- raw []byte
- key []byte
-}
-
-func (m *serverKeyExchangeMsg) equal(i interface{}) bool {
- m1, ok := i.(*serverKeyExchangeMsg)
- if !ok {
- return false
- }
-
- return bytes.Equal(m.raw, m1.raw) &&
- bytes.Equal(m.key, m1.key)
-}
-
-func (m *serverKeyExchangeMsg) marshal() []byte {
- if m.raw != nil {
- return m.raw
- }
- length := len(m.key)
- x := make([]byte, length+4)
- x[0] = typeServerKeyExchange
- x[1] = uint8(length >> 16)
- x[2] = uint8(length >> 8)
- x[3] = uint8(length)
- copy(x[4:], m.key)
-
- m.raw = x
- return x
-}
-
-func (m *serverKeyExchangeMsg) unmarshal(data []byte) bool {
- m.raw = data
- if len(data) < 4 {
- return false
- }
- m.key = data[4:]
- return true
-}
-
-type certificateStatusMsg struct {
- raw []byte
- statusType uint8
- response []byte
-}
-
-func (m *certificateStatusMsg) equal(i interface{}) bool {
- m1, ok := i.(*certificateStatusMsg)
- if !ok {
- return false
- }
-
- return bytes.Equal(m.raw, m1.raw) &&
- m.statusType == m1.statusType &&
- bytes.Equal(m.response, m1.response)
-}
-
-func (m *certificateStatusMsg) marshal() []byte {
- if m.raw != nil {
- return m.raw
- }
-
- var x []byte
- if m.statusType == statusTypeOCSP {
- x = make([]byte, 4+4+len(m.response))
- x[0] = typeCertificateStatus
- l := len(m.response) + 4
- x[1] = byte(l >> 16)
- x[2] = byte(l >> 8)
- x[3] = byte(l)
- x[4] = statusTypeOCSP
-
- l -= 4
- x[5] = byte(l >> 16)
- x[6] = byte(l >> 8)
- x[7] = byte(l)
- copy(x[8:], m.response)
- } else {
- x = []byte{typeCertificateStatus, 0, 0, 1, m.statusType}
- }
-
- m.raw = x
- return x
-}
-
-func (m *certificateStatusMsg) unmarshal(data []byte) bool {
- m.raw = data
- if len(data) < 5 {
- return false
- }
- m.statusType = data[4]
-
- m.response = nil
- if m.statusType == statusTypeOCSP {
- if len(data) < 8 {
- return false
- }
- respLen := uint32(data[5])<<16 | uint32(data[6])<<8 | uint32(data[7])
- if uint32(len(data)) != 4+4+respLen {
- return false
- }
- m.response = data[8:]
- }
- return true
-}
-
-type serverHelloDoneMsg struct{}
-
-func (m *serverHelloDoneMsg) equal(i interface{}) bool {
- _, ok := i.(*serverHelloDoneMsg)
- return ok
-}
-
-func (m *serverHelloDoneMsg) marshal() []byte {
- x := make([]byte, 4)
- x[0] = typeServerHelloDone
- return x
-}
-
-func (m *serverHelloDoneMsg) unmarshal(data []byte) bool {
- return len(data) == 4
-}
-
-type clientKeyExchangeMsg struct {
- raw []byte
- ciphertext []byte
-}
-
-func (m *clientKeyExchangeMsg) equal(i interface{}) bool {
- m1, ok := i.(*clientKeyExchangeMsg)
- if !ok {
- return false
- }
-
- return bytes.Equal(m.raw, m1.raw) &&
- bytes.Equal(m.ciphertext, m1.ciphertext)
-}
-
-func (m *clientKeyExchangeMsg) marshal() []byte {
- if m.raw != nil {
- return m.raw
- }
- length := len(m.ciphertext)
- x := make([]byte, length+4)
- x[0] = typeClientKeyExchange
- x[1] = uint8(length >> 16)
- x[2] = uint8(length >> 8)
- x[3] = uint8(length)
- copy(x[4:], m.ciphertext)
-
- m.raw = x
- return x
-}
-
-func (m *clientKeyExchangeMsg) unmarshal(data []byte) bool {
- m.raw = data
- if len(data) < 4 {
- return false
- }
- l := int(data[1])<<16 | int(data[2])<<8 | int(data[3])
- if l != len(data)-4 {
- return false
- }
- m.ciphertext = data[4:]
- return true
-}
-
-type finishedMsg struct {
- raw []byte
- verifyData []byte
-}
-
-func (m *finishedMsg) equal(i interface{}) bool {
- m1, ok := i.(*finishedMsg)
- if !ok {
- return false
- }
-
- return bytes.Equal(m.raw, m1.raw) &&
- bytes.Equal(m.verifyData, m1.verifyData)
-}
-
-func (m *finishedMsg) marshal() (x []byte) {
- if m.raw != nil {
- return m.raw
- }
-
- x = make([]byte, 4+len(m.verifyData))
- x[0] = typeFinished
- x[3] = byte(len(m.verifyData))
- copy(x[4:], m.verifyData)
- m.raw = x
- return
-}
-
-func (m *finishedMsg) unmarshal(data []byte) bool {
- m.raw = data
- if len(data) < 4 {
- return false
- }
- m.verifyData = data[4:]
- return true
-}
-
-type nextProtoMsg struct {
- raw []byte
- proto string
-}
-
-func (m *nextProtoMsg) equal(i interface{}) bool {
- m1, ok := i.(*nextProtoMsg)
- if !ok {
- return false
- }
-
- return bytes.Equal(m.raw, m1.raw) &&
- m.proto == m1.proto
-}
-
-func (m *nextProtoMsg) marshal() []byte {
- if m.raw != nil {
- return m.raw
- }
- l := len(m.proto)
- if l > 255 {
- l = 255
- }
-
- padding := 32 - (l+2)%32
- length := l + padding + 2
- x := make([]byte, length+4)
- x[0] = typeNextProtocol
- x[1] = uint8(length >> 16)
- x[2] = uint8(length >> 8)
- x[3] = uint8(length)
-
- y := x[4:]
- y[0] = byte(l)
- copy(y[1:], []byte(m.proto[0:l]))
- y = y[1+l:]
- y[0] = byte(padding)
-
- m.raw = x
-
- return x
-}
-
-func (m *nextProtoMsg) unmarshal(data []byte) bool {
- m.raw = data
-
- if len(data) < 5 {
- return false
- }
- data = data[4:]
- protoLen := int(data[0])
- data = data[1:]
- if len(data) < protoLen {
- return false
- }
- m.proto = string(data[0:protoLen])
- data = data[protoLen:]
-
- if len(data) < 1 {
- return false
- }
- paddingLen := int(data[0])
- data = data[1:]
- if len(data) != paddingLen {
- return false
- }
-
- return true
-}
-
-type certificateRequestMsg struct {
- raw []byte
- // hasSignatureAndHash indicates whether this message includes a list
- // of signature and hash functions. This change was introduced with TLS
- // 1.2.
- hasSignatureAndHash bool
-
- certificateTypes []byte
- signatureAndHashes []signatureAndHash
- certificateAuthorities [][]byte
-}
-
-func (m *certificateRequestMsg) equal(i interface{}) bool {
- m1, ok := i.(*certificateRequestMsg)
- if !ok {
- return false
- }
-
- return bytes.Equal(m.raw, m1.raw) &&
- bytes.Equal(m.certificateTypes, m1.certificateTypes) &&
- eqByteSlices(m.certificateAuthorities, m1.certificateAuthorities) &&
- eqSignatureAndHashes(m.signatureAndHashes, m1.signatureAndHashes)
-}
-
-func (m *certificateRequestMsg) marshal() (x []byte) {
- if m.raw != nil {
- return m.raw
- }
-
- // See http://tools.ietf.org/html/rfc4346#section-7.4.4
- length := 1 + len(m.certificateTypes) + 2
- casLength := 0
- for _, ca := range m.certificateAuthorities {
- casLength += 2 + len(ca)
- }
- length += casLength
-
- if m.hasSignatureAndHash {
- length += 2 + 2*len(m.signatureAndHashes)
- }
-
- x = make([]byte, 4+length)
- x[0] = typeCertificateRequest
- x[1] = uint8(length >> 16)
- x[2] = uint8(length >> 8)
- x[3] = uint8(length)
-
- x[4] = uint8(len(m.certificateTypes))
-
- copy(x[5:], m.certificateTypes)
- y := x[5+len(m.certificateTypes):]
-
- if m.hasSignatureAndHash {
- n := len(m.signatureAndHashes) * 2
- y[0] = uint8(n >> 8)
- y[1] = uint8(n)
- y = y[2:]
- for _, sigAndHash := range m.signatureAndHashes {
- y[0] = sigAndHash.hash
- y[1] = sigAndHash.signature
- y = y[2:]
- }
- }
-
- y[0] = uint8(casLength >> 8)
- y[1] = uint8(casLength)
- y = y[2:]
- for _, ca := range m.certificateAuthorities {
- y[0] = uint8(len(ca) >> 8)
- y[1] = uint8(len(ca))
- y = y[2:]
- copy(y, ca)
- y = y[len(ca):]
- }
-
- m.raw = x
- return
-}
-
-func (m *certificateRequestMsg) unmarshal(data []byte) bool {
- m.raw = data
-
- if len(data) < 5 {
- return false
- }
-
- length := uint32(data[1])<<16 | uint32(data[2])<<8 | uint32(data[3])
- if uint32(len(data))-4 != length {
- return false
- }
-
- numCertTypes := int(data[4])
- data = data[5:]
- if numCertTypes == 0 || len(data) <= numCertTypes {
- return false
- }
-
- m.certificateTypes = make([]byte, numCertTypes)
- if copy(m.certificateTypes, data) != numCertTypes {
- return false
- }
-
- data = data[numCertTypes:]
-
- if m.hasSignatureAndHash {
- if len(data) < 2 {
- return false
- }
- sigAndHashLen := uint16(data[0])<<8 | uint16(data[1])
- data = data[2:]
- if sigAndHashLen&1 != 0 {
- return false
- }
- if len(data) < int(sigAndHashLen) {
- return false
- }
- numSigAndHash := sigAndHashLen / 2
- m.signatureAndHashes = make([]signatureAndHash, numSigAndHash)
- for i := range m.signatureAndHashes {
- m.signatureAndHashes[i].hash = data[0]
- m.signatureAndHashes[i].signature = data[1]
- data = data[2:]
- }
- }
-
- if len(data) < 2 {
- return false
- }
- casLength := uint16(data[0])<<8 | uint16(data[1])
- data = data[2:]
- if len(data) < int(casLength) {
- return false
- }
- cas := make([]byte, casLength)
- copy(cas, data)
- data = data[casLength:]
-
- m.certificateAuthorities = nil
- for len(cas) > 0 {
- if len(cas) < 2 {
- return false
- }
- caLen := uint16(cas[0])<<8 | uint16(cas[1])
- cas = cas[2:]
-
- if len(cas) < int(caLen) {
- return false
- }
-
- m.certificateAuthorities = append(m.certificateAuthorities, cas[:caLen])
- cas = cas[caLen:]
- }
- if len(data) > 0 {
- return false
- }
-
- return true
-}
-
-type certificateVerifyMsg struct {
- raw []byte
- hasSignatureAndHash bool
- signatureAndHash signatureAndHash
- signature []byte
-}
-
-func (m *certificateVerifyMsg) equal(i interface{}) bool {
- m1, ok := i.(*certificateVerifyMsg)
- if !ok {
- return false
- }
-
- return bytes.Equal(m.raw, m1.raw) &&
- m.hasSignatureAndHash == m1.hasSignatureAndHash &&
- m.signatureAndHash.hash == m1.signatureAndHash.hash &&
- m.signatureAndHash.signature == m1.signatureAndHash.signature &&
- bytes.Equal(m.signature, m1.signature)
-}
-
-func (m *certificateVerifyMsg) marshal() (x []byte) {
- if m.raw != nil {
- return m.raw
- }
-
- // See http://tools.ietf.org/html/rfc4346#section-7.4.8
- siglength := len(m.signature)
- length := 2 + siglength
- if m.hasSignatureAndHash {
- length += 2
- }
- x = make([]byte, 4+length)
- x[0] = typeCertificateVerify
- x[1] = uint8(length >> 16)
- x[2] = uint8(length >> 8)
- x[3] = uint8(length)
- y := x[4:]
- if m.hasSignatureAndHash {
- y[0] = m.signatureAndHash.hash
- y[1] = m.signatureAndHash.signature
- y = y[2:]
- }
- y[0] = uint8(siglength >> 8)
- y[1] = uint8(siglength)
- copy(y[2:], m.signature)
-
- m.raw = x
-
- return
-}
-
-func (m *certificateVerifyMsg) unmarshal(data []byte) bool {
- m.raw = data
-
- if len(data) < 6 {
- return false
- }
-
- length := uint32(data[1])<<16 | uint32(data[2])<<8 | uint32(data[3])
- if uint32(len(data))-4 != length {
- return false
- }
-
- data = data[4:]
- if m.hasSignatureAndHash {
- m.signatureAndHash.hash = data[0]
- m.signatureAndHash.signature = data[1]
- data = data[2:]
- }
-
- if len(data) < 2 {
- return false
- }
- siglength := int(data[0])<<8 + int(data[1])
- data = data[2:]
- if len(data) != siglength {
- return false
- }
-
- m.signature = data
-
- return true
-}
-
-type newSessionTicketMsg struct {
- raw []byte
- ticket []byte
-}
-
-func (m *newSessionTicketMsg) equal(i interface{}) bool {
- m1, ok := i.(*newSessionTicketMsg)
- if !ok {
- return false
- }
-
- return bytes.Equal(m.raw, m1.raw) &&
- bytes.Equal(m.ticket, m1.ticket)
-}
-
-func (m *newSessionTicketMsg) marshal() (x []byte) {
- if m.raw != nil {
- return m.raw
- }
-
- // See http://tools.ietf.org/html/rfc5077#section-3.3
- ticketLen := len(m.ticket)
- length := 2 + 4 + ticketLen
- x = make([]byte, 4+length)
- x[0] = typeNewSessionTicket
- x[1] = uint8(length >> 16)
- x[2] = uint8(length >> 8)
- x[3] = uint8(length)
- x[8] = uint8(ticketLen >> 8)
- x[9] = uint8(ticketLen)
- copy(x[10:], m.ticket)
-
- m.raw = x
-
- return
-}
-
-func (m *newSessionTicketMsg) unmarshal(data []byte) bool {
- m.raw = data
-
- if len(data) < 10 {
- return false
- }
-
- length := uint32(data[1])<<16 | uint32(data[2])<<8 | uint32(data[3])
- if uint32(len(data))-4 != length {
- return false
- }
-
- ticketLen := int(data[8])<<8 + int(data[9])
- if len(data)-10 != ticketLen {
- return false
- }
-
- m.ticket = data[10:]
-
- return true
-}
-
-func eqUint16s(x, y []uint16) bool {
- if len(x) != len(y) {
- return false
- }
- for i, v := range x {
- if y[i] != v {
- return false
- }
- }
- return true
-}
-
-func eqCurveIDs(x, y []CurveID) bool {
- if len(x) != len(y) {
- return false
- }
- for i, v := range x {
- if y[i] != v {
- return false
- }
- }
- return true
-}
-
-func eqStrings(x, y []string) bool {
- if len(x) != len(y) {
- return false
- }
- for i, v := range x {
- if y[i] != v {
- return false
- }
- }
- return true
-}
-
-func eqByteSlices(x, y [][]byte) bool {
- if len(x) != len(y) {
- return false
- }
- for i, v := range x {
- if !bytes.Equal(v, y[i]) {
- return false
- }
- }
- return true
-}
-
-func eqSignatureAndHashes(x, y []signatureAndHash) bool {
- if len(x) != len(y) {
- return false
- }
- for i, v := range x {
- v2 := y[i]
- if v.hash != v2.hash || v.signature != v2.signature {
- return false
- }
- }
- return true
-}
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/handshake_messages_test.go b/runtimes/google/ipc/stream/crypto/tlsfork/handshake_messages_test.go
deleted file mode 100644
index 6433112..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/handshake_messages_test.go
+++ /dev/null
@@ -1,253 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.4
-
-package tls
-
-import (
- "math/rand"
- "reflect"
- "testing"
- "testing/quick"
-)
-
-var tests = []interface{}{
- &clientHelloMsg{},
- &serverHelloMsg{},
- &finishedMsg{},
-
- &certificateMsg{},
- &certificateRequestMsg{},
- &certificateVerifyMsg{},
- &certificateStatusMsg{},
- &clientKeyExchangeMsg{},
- &nextProtoMsg{},
- &newSessionTicketMsg{},
- &sessionState{},
-}
-
-type testMessage interface {
- marshal() []byte
- unmarshal([]byte) bool
- equal(interface{}) bool
-}
-
-func TestMarshalUnmarshal(t *testing.T) {
- rand := rand.New(rand.NewSource(0))
-
- for i, iface := range tests {
- ty := reflect.ValueOf(iface).Type()
-
- n := 100
- if testing.Short() {
- n = 5
- }
- for j := 0; j < n; j++ {
- v, ok := quick.Value(ty, rand)
- if !ok {
- t.Errorf("#%d: failed to create value", i)
- break
- }
-
- m1 := v.Interface().(testMessage)
- marshaled := m1.marshal()
- m2 := iface.(testMessage)
- if !m2.unmarshal(marshaled) {
- t.Errorf("#%d failed to unmarshal %#v %x", i, m1, marshaled)
- break
- }
- m2.marshal() // to fill any marshal cache in the message
-
- if !m1.equal(m2) {
- t.Errorf("#%d got:%#v want:%#v %x", i, m2, m1, marshaled)
- break
- }
-
- if i >= 3 {
- // The first three message types (ClientHello,
- // ServerHello and Finished) are allowed to
- // have parsable prefixes because the extension
- // data is optional and the length of the
- // Finished varies across versions.
- for j := 0; j < len(marshaled); j++ {
- if m2.unmarshal(marshaled[0:j]) {
- t.Errorf("#%d unmarshaled a prefix of length %d of %#v", i, j, m1)
- break
- }
- }
- }
- }
- }
-}
-
-func TestFuzz(t *testing.T) {
- rand := rand.New(rand.NewSource(0))
- for _, iface := range tests {
- m := iface.(testMessage)
-
- for j := 0; j < 1000; j++ {
- len := rand.Intn(100)
- bytes := randomBytes(len, rand)
- // This just looks for crashes due to bounds errors etc.
- m.unmarshal(bytes)
- }
- }
-}
-
-func randomBytes(n int, rand *rand.Rand) []byte {
- r := make([]byte, n)
- for i := 0; i < n; i++ {
- r[i] = byte(rand.Int31())
- }
- return r
-}
-
-func randomString(n int, rand *rand.Rand) string {
- b := randomBytes(n, rand)
- return string(b)
-}
-
-func (*clientHelloMsg) Generate(rand *rand.Rand, size int) reflect.Value {
- m := &clientHelloMsg{}
- m.vers = uint16(rand.Intn(65536))
- m.random = randomBytes(32, rand)
- m.sessionId = randomBytes(rand.Intn(32), rand)
- m.cipherSuites = make([]uint16, rand.Intn(63)+1)
- for i := 0; i < len(m.cipherSuites); i++ {
- m.cipherSuites[i] = uint16(rand.Int31())
- }
- m.compressionMethods = randomBytes(rand.Intn(63)+1, rand)
- if rand.Intn(10) > 5 {
- m.nextProtoNeg = true
- }
- if rand.Intn(10) > 5 {
- m.serverName = randomString(rand.Intn(255), rand)
- }
- m.ocspStapling = rand.Intn(10) > 5
- m.supportedPoints = randomBytes(rand.Intn(5)+1, rand)
- m.supportedCurves = make([]CurveID, rand.Intn(5)+1)
- for i := range m.supportedCurves {
- m.supportedCurves[i] = CurveID(rand.Intn(30000))
- }
- if rand.Intn(10) > 5 {
- m.ticketSupported = true
- if rand.Intn(10) > 5 {
- m.sessionTicket = randomBytes(rand.Intn(300), rand)
- }
- }
- if rand.Intn(10) > 5 {
- m.signatureAndHashes = supportedSKXSignatureAlgorithms
- }
- m.alpnProtocols = make([]string, rand.Intn(5))
- for i := range m.alpnProtocols {
- m.alpnProtocols[i] = randomString(rand.Intn(20)+1, rand)
- }
-
- return reflect.ValueOf(m)
-}
-
-func (*serverHelloMsg) Generate(rand *rand.Rand, size int) reflect.Value {
- m := &serverHelloMsg{}
- m.vers = uint16(rand.Intn(65536))
- m.random = randomBytes(32, rand)
- m.sessionId = randomBytes(rand.Intn(32), rand)
- m.cipherSuite = uint16(rand.Int31())
- m.compressionMethod = uint8(rand.Intn(256))
-
- if rand.Intn(10) > 5 {
- m.nextProtoNeg = true
-
- n := rand.Intn(10)
- m.nextProtos = make([]string, n)
- for i := 0; i < n; i++ {
- m.nextProtos[i] = randomString(20, rand)
- }
- }
-
- if rand.Intn(10) > 5 {
- m.ocspStapling = true
- }
- if rand.Intn(10) > 5 {
- m.ticketSupported = true
- }
- m.alpnProtocol = randomString(rand.Intn(32)+1, rand)
-
- return reflect.ValueOf(m)
-}
-
-func (*certificateMsg) Generate(rand *rand.Rand, size int) reflect.Value {
- m := &certificateMsg{}
- numCerts := rand.Intn(20)
- m.certificates = make([][]byte, numCerts)
- for i := 0; i < numCerts; i++ {
- m.certificates[i] = randomBytes(rand.Intn(10)+1, rand)
- }
- return reflect.ValueOf(m)
-}
-
-func (*certificateRequestMsg) Generate(rand *rand.Rand, size int) reflect.Value {
- m := &certificateRequestMsg{}
- m.certificateTypes = randomBytes(rand.Intn(5)+1, rand)
- numCAs := rand.Intn(100)
- m.certificateAuthorities = make([][]byte, numCAs)
- for i := 0; i < numCAs; i++ {
- m.certificateAuthorities[i] = randomBytes(rand.Intn(15)+1, rand)
- }
- return reflect.ValueOf(m)
-}
-
-func (*certificateVerifyMsg) Generate(rand *rand.Rand, size int) reflect.Value {
- m := &certificateVerifyMsg{}
- m.signature = randomBytes(rand.Intn(15)+1, rand)
- return reflect.ValueOf(m)
-}
-
-func (*certificateStatusMsg) Generate(rand *rand.Rand, size int) reflect.Value {
- m := &certificateStatusMsg{}
- if rand.Intn(10) > 5 {
- m.statusType = statusTypeOCSP
- m.response = randomBytes(rand.Intn(10)+1, rand)
- } else {
- m.statusType = 42
- }
- return reflect.ValueOf(m)
-}
-
-func (*clientKeyExchangeMsg) Generate(rand *rand.Rand, size int) reflect.Value {
- m := &clientKeyExchangeMsg{}
- m.ciphertext = randomBytes(rand.Intn(1000)+1, rand)
- return reflect.ValueOf(m)
-}
-
-func (*finishedMsg) Generate(rand *rand.Rand, size int) reflect.Value {
- m := &finishedMsg{}
- m.verifyData = randomBytes(12, rand)
- return reflect.ValueOf(m)
-}
-
-func (*nextProtoMsg) Generate(rand *rand.Rand, size int) reflect.Value {
- m := &nextProtoMsg{}
- m.proto = randomString(rand.Intn(255), rand)
- return reflect.ValueOf(m)
-}
-
-func (*newSessionTicketMsg) Generate(rand *rand.Rand, size int) reflect.Value {
- m := &newSessionTicketMsg{}
- m.ticket = randomBytes(rand.Intn(4), rand)
- return reflect.ValueOf(m)
-}
-
-func (*sessionState) Generate(rand *rand.Rand, size int) reflect.Value {
- s := &sessionState{}
- s.vers = uint16(rand.Intn(10000))
- s.cipherSuite = uint16(rand.Intn(10000))
- s.masterSecret = randomBytes(rand.Intn(100), rand)
- numCerts := rand.Intn(20)
- s.certificates = make([][]byte, numCerts)
- for i := 0; i < numCerts; i++ {
- s.certificates[i] = randomBytes(rand.Intn(10)+1, rand)
- }
- return reflect.ValueOf(s)
-}
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/handshake_server.go b/runtimes/google/ipc/stream/crypto/tlsfork/handshake_server.go
deleted file mode 100644
index 2111db9..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/handshake_server.go
+++ /dev/null
@@ -1,671 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.4
-
-package tls
-
-import (
- "crypto"
- "crypto/ecdsa"
- "crypto/rsa"
- "crypto/subtle"
- "crypto/x509"
- "encoding/asn1"
- "errors"
- "fmt"
- "io"
-)
-
-// serverHandshakeState contains details of a server handshake in progress.
-// It's discarded once the handshake has completed.
-type serverHandshakeState struct {
- c *Conn
- clientHello *clientHelloMsg
- hello *serverHelloMsg
- suite *cipherSuite
- ellipticOk bool
- ecdsaOk bool
- sessionState *sessionState
- finishedHash finishedHash
- masterSecret []byte
- certsFromClient [][]byte
- cert *Certificate
-}
-
-// serverHandshake performs a TLS handshake as a server.
-func (c *Conn) serverHandshake() error {
- config := c.config
-
- // If this is the first server handshake, we generate a random key to
- // encrypt the tickets with.
- config.serverInitOnce.Do(config.serverInit)
-
- hs := serverHandshakeState{
- c: c,
- }
- isResume, err := hs.readClientHello()
- if err != nil {
- return err
- }
-
- // For an overview of TLS handshaking, see https://tools.ietf.org/html/rfc5246#section-7.3
- if isResume {
- // The client has included a session ticket and so we do an abbreviated handshake.
- if err := hs.doResumeHandshake(); err != nil {
- return err
- }
- if err := hs.establishKeys(); err != nil {
- return err
- }
- if err := hs.sendFinished(c.firstFinished[:]); err != nil {
- return err
- }
- if err := hs.readFinished(nil); err != nil {
- return err
- }
- c.didResume = true
- } else {
- // The client didn't include a session ticket, or it wasn't
- // valid so we do a full handshake.
- if err := hs.doFullHandshake(); err != nil {
- return err
- }
- if err := hs.establishKeys(); err != nil {
- return err
- }
- if err := hs.readFinished(c.firstFinished[:]); err != nil {
- return err
- }
- if err := hs.sendSessionTicket(); err != nil {
- return err
- }
- if err := hs.sendFinished(nil); err != nil {
- return err
- }
- }
- c.handshakeComplete = true
-
- return nil
-}
-
-// readClientHello reads a ClientHello message from the client and decides
-// whether we will perform session resumption.
-func (hs *serverHandshakeState) readClientHello() (isResume bool, err error) {
- config := hs.c.config
- c := hs.c
-
- msg, err := c.readHandshake()
- if err != nil {
- return false, err
- }
- var ok bool
- hs.clientHello, ok = msg.(*clientHelloMsg)
- if !ok {
- c.sendAlert(alertUnexpectedMessage)
- return false, unexpectedMessageError(hs.clientHello, msg)
- }
- c.vers, ok = config.mutualVersion(hs.clientHello.vers)
- if !ok {
- c.sendAlert(alertProtocolVersion)
- return false, fmt.Errorf("tls: client offered an unsupported, maximum protocol version of %x", hs.clientHello.vers)
- }
- c.haveVers = true
-
- hs.finishedHash = newFinishedHash(c.vers)
- hs.finishedHash.Write(hs.clientHello.marshal())
-
- hs.hello = new(serverHelloMsg)
-
- supportedCurve := false
- preferredCurves := config.curvePreferences()
-Curves:
- for _, curve := range hs.clientHello.supportedCurves {
- for _, supported := range preferredCurves {
- if supported == curve {
- supportedCurve = true
- break Curves
- }
- }
- }
-
- supportedPointFormat := false
- for _, pointFormat := range hs.clientHello.supportedPoints {
- if pointFormat == pointFormatUncompressed {
- supportedPointFormat = true
- break
- }
- }
- hs.ellipticOk = supportedCurve && supportedPointFormat
-
- foundCompression := false
- // We only support null compression, so check that the client offered it.
- for _, compression := range hs.clientHello.compressionMethods {
- if compression == compressionNone {
- foundCompression = true
- break
- }
- }
-
- if !foundCompression {
- c.sendAlert(alertHandshakeFailure)
- return false, errors.New("tls: client does not support uncompressed connections")
- }
-
- hs.hello.vers = c.vers
- hs.hello.random = make([]byte, 32)
- _, err = io.ReadFull(config.rand(), hs.hello.random)
- if err != nil {
- c.sendAlert(alertInternalError)
- return false, err
- }
- hs.hello.secureRenegotiation = hs.clientHello.secureRenegotiation
- hs.hello.compressionMethod = compressionNone
- if len(hs.clientHello.serverName) > 0 {
- c.serverName = hs.clientHello.serverName
- }
-
- if len(hs.clientHello.alpnProtocols) > 0 {
- if selectedProto, fallback := mutualProtocol(hs.clientHello.alpnProtocols, c.config.NextProtos); !fallback {
- hs.hello.alpnProtocol = selectedProto
- c.clientProtocol = selectedProto
- }
- } else {
- // Although sending an empty NPN extension is reasonable, Firefox has
- // had a bug around this. Best to send nothing at all if
- // config.NextProtos is empty. See
- // https://code.google.com/p/go/issues/detail?id=5445.
- if hs.clientHello.nextProtoNeg && len(config.NextProtos) > 0 {
- hs.hello.nextProtoNeg = true
- hs.hello.nextProtos = config.NextProtos
- }
- }
-
- if len(config.Certificates) == 0 {
- c.sendAlert(alertInternalError)
- return false, errors.New("tls: no certificates configured")
- }
- hs.cert = &config.Certificates[0]
- if len(hs.clientHello.serverName) > 0 {
- chi := &ClientHelloInfo{
- CipherSuites: hs.clientHello.cipherSuites,
- ServerName: hs.clientHello.serverName,
- SupportedCurves: hs.clientHello.supportedCurves,
- SupportedPoints: hs.clientHello.supportedPoints,
- }
- if hs.cert, err = config.getCertificate(chi); err != nil {
- c.sendAlert(alertInternalError)
- return false, err
- }
- }
-
- _, hs.ecdsaOk = hs.cert.PrivateKey.(*ecdsa.PrivateKey)
-
- if hs.checkForResumption() {
- return true, nil
- }
-
- var preferenceList, supportedList []uint16
- if c.config.PreferServerCipherSuites {
- preferenceList = c.config.cipherSuites()
- supportedList = hs.clientHello.cipherSuites
- } else {
- preferenceList = hs.clientHello.cipherSuites
- supportedList = c.config.cipherSuites()
- }
-
- for _, id := range preferenceList {
- if hs.suite = c.tryCipherSuite(id, supportedList, c.vers, hs.ellipticOk, hs.ecdsaOk); hs.suite != nil {
- break
- }
- }
-
- if hs.suite == nil {
- c.sendAlert(alertHandshakeFailure)
- return false, errors.New("tls: no cipher suite supported by both client and server")
- }
-
- return false, nil
-}
-
-// checkForResumption returns true if we should perform resumption on this connection.
-func (hs *serverHandshakeState) checkForResumption() bool {
- c := hs.c
-
- var ok bool
- if hs.sessionState, ok = c.decryptTicket(hs.clientHello.sessionTicket); !ok {
- return false
- }
-
- if hs.sessionState.vers > hs.clientHello.vers {
- return false
- }
- if vers, ok := c.config.mutualVersion(hs.sessionState.vers); !ok || vers != hs.sessionState.vers {
- return false
- }
-
- cipherSuiteOk := false
- // Check that the client is still offering the ciphersuite in the session.
- for _, id := range hs.clientHello.cipherSuites {
- if id == hs.sessionState.cipherSuite {
- cipherSuiteOk = true
- break
- }
- }
- if !cipherSuiteOk {
- return false
- }
-
- // Check that we also support the ciphersuite from the session.
- hs.suite = c.tryCipherSuite(hs.sessionState.cipherSuite, c.config.cipherSuites(), hs.sessionState.vers, hs.ellipticOk, hs.ecdsaOk)
- if hs.suite == nil {
- return false
- }
-
- sessionHasClientCerts := len(hs.sessionState.certificates) != 0
- needClientCerts := c.config.ClientAuth == RequireAnyClientCert || c.config.ClientAuth == RequireAndVerifyClientCert
- if needClientCerts && !sessionHasClientCerts {
- return false
- }
- if sessionHasClientCerts && c.config.ClientAuth == NoClientCert {
- return false
- }
-
- return true
-}
-
-func (hs *serverHandshakeState) doResumeHandshake() error {
- c := hs.c
-
- hs.hello.cipherSuite = hs.suite.id
- // We echo the client's session ID in the ServerHello to let it know
- // that we're doing a resumption.
- hs.hello.sessionId = hs.clientHello.sessionId
- hs.finishedHash.Write(hs.hello.marshal())
- c.writeRecord(recordTypeHandshake, hs.hello.marshal())
-
- if len(hs.sessionState.certificates) > 0 {
- if _, err := hs.processCertsFromClient(hs.sessionState.certificates); err != nil {
- return err
- }
- }
-
- hs.masterSecret = hs.sessionState.masterSecret
-
- return nil
-}
-
-func (hs *serverHandshakeState) doFullHandshake() error {
- config := hs.c.config
- c := hs.c
-
- if hs.clientHello.ocspStapling && len(hs.cert.OCSPStaple) > 0 {
- hs.hello.ocspStapling = true
- }
-
- hs.hello.ticketSupported = hs.clientHello.ticketSupported && !config.SessionTicketsDisabled
- hs.hello.cipherSuite = hs.suite.id
- hs.finishedHash.Write(hs.hello.marshal())
- c.writeRecord(recordTypeHandshake, hs.hello.marshal())
-
- certMsg := new(certificateMsg)
- certMsg.certificates = hs.cert.Certificate
- hs.finishedHash.Write(certMsg.marshal())
- c.writeRecord(recordTypeHandshake, certMsg.marshal())
-
- if hs.hello.ocspStapling {
- certStatus := new(certificateStatusMsg)
- certStatus.statusType = statusTypeOCSP
- certStatus.response = hs.cert.OCSPStaple
- hs.finishedHash.Write(certStatus.marshal())
- c.writeRecord(recordTypeHandshake, certStatus.marshal())
- }
-
- keyAgreement := hs.suite.ka(c.vers)
- skx, err := keyAgreement.generateServerKeyExchange(config, hs.cert, hs.clientHello, hs.hello)
- if err != nil {
- c.sendAlert(alertHandshakeFailure)
- return err
- }
- if skx != nil {
- hs.finishedHash.Write(skx.marshal())
- c.writeRecord(recordTypeHandshake, skx.marshal())
- }
-
- if config.ClientAuth >= RequestClientCert {
- // Request a client certificate
- certReq := new(certificateRequestMsg)
- certReq.certificateTypes = []byte{
- byte(certTypeRSASign),
- byte(certTypeECDSASign),
- }
- if c.vers >= VersionTLS12 {
- certReq.hasSignatureAndHash = true
- certReq.signatureAndHashes = supportedClientCertSignatureAlgorithms
- }
-
- // An empty list of certificateAuthorities signals to
- // the client that it may send any certificate in response
- // to our request. When we know the CAs we trust, then
- // we can send them down, so that the client can choose
- // an appropriate certificate to give to us.
- if config.ClientCAs != nil {
- certReq.certificateAuthorities = config.ClientCAs.Subjects()
- }
- hs.finishedHash.Write(certReq.marshal())
- c.writeRecord(recordTypeHandshake, certReq.marshal())
- }
-
- helloDone := new(serverHelloDoneMsg)
- hs.finishedHash.Write(helloDone.marshal())
- c.writeRecord(recordTypeHandshake, helloDone.marshal())
-
- var pub crypto.PublicKey // public key for client auth, if any
-
- msg, err := c.readHandshake()
- if err != nil {
- return err
- }
-
- var ok bool
- // If we requested a client certificate, then the client must send a
- // certificate message, even if it's empty.
- if config.ClientAuth >= RequestClientCert {
- if certMsg, ok = msg.(*certificateMsg); !ok {
- c.sendAlert(alertUnexpectedMessage)
- return unexpectedMessageError(certMsg, msg)
- }
- hs.finishedHash.Write(certMsg.marshal())
-
- if len(certMsg.certificates) == 0 {
- // The client didn't actually send a certificate
- switch config.ClientAuth {
- case RequireAnyClientCert, RequireAndVerifyClientCert:
- c.sendAlert(alertBadCertificate)
- return errors.New("tls: client didn't provide a certificate")
- }
- }
-
- pub, err = hs.processCertsFromClient(certMsg.certificates)
- if err != nil {
- return err
- }
-
- msg, err = c.readHandshake()
- if err != nil {
- return err
- }
- }
-
- // Get client key exchange
- ckx, ok := msg.(*clientKeyExchangeMsg)
- if !ok {
- c.sendAlert(alertUnexpectedMessage)
- return unexpectedMessageError(ckx, msg)
- }
- hs.finishedHash.Write(ckx.marshal())
-
- // If we received a client cert in response to our certificate request message,
- // the client will send us a certificateVerifyMsg immediately after the
- // clientKeyExchangeMsg. This message is a digest of all preceding
- // handshake-layer messages that is signed using the private key corresponding
- // to the client's certificate. This allows us to verify that the client is in
- // possession of the private key of the certificate.
- if len(c.peerCertificates) > 0 {
- msg, err = c.readHandshake()
- if err != nil {
- return err
- }
- certVerify, ok := msg.(*certificateVerifyMsg)
- if !ok {
- c.sendAlert(alertUnexpectedMessage)
- return unexpectedMessageError(certVerify, msg)
- }
-
- switch key := pub.(type) {
- case *ecdsa.PublicKey:
- ecdsaSig := new(ecdsaSignature)
- if _, err = asn1.Unmarshal(certVerify.signature, ecdsaSig); err != nil {
- break
- }
- if ecdsaSig.R.Sign() <= 0 || ecdsaSig.S.Sign() <= 0 {
- err = errors.New("ECDSA signature contained zero or negative values")
- break
- }
- digest, _, _ := hs.finishedHash.hashForClientCertificate(signatureECDSA)
- if !ecdsa.Verify(key, digest, ecdsaSig.R, ecdsaSig.S) {
- err = errors.New("ECDSA verification failure")
- break
- }
- case *rsa.PublicKey:
- digest, hashFunc, _ := hs.finishedHash.hashForClientCertificate(signatureRSA)
- err = rsa.VerifyPKCS1v15(key, hashFunc, digest, certVerify.signature)
- }
- if err != nil {
- c.sendAlert(alertBadCertificate)
- return errors.New("could not validate signature of connection nonces: " + err.Error())
- }
-
- hs.finishedHash.Write(certVerify.marshal())
- }
-
- preMasterSecret, err := keyAgreement.processClientKeyExchange(config, hs.cert, ckx, c.vers)
- if err != nil {
- c.sendAlert(alertHandshakeFailure)
- return err
- }
- hs.masterSecret = masterFromPreMasterSecret(c.vers, preMasterSecret, hs.clientHello.random, hs.hello.random)
-
- return nil
-}
-
-func (hs *serverHandshakeState) establishKeys() error {
- c := hs.c
-
- clientMAC, serverMAC, clientKey, serverKey, clientIV, serverIV :=
- keysFromMasterSecret(c.vers, hs.masterSecret, hs.clientHello.random, hs.hello.random, hs.suite.macLen, hs.suite.keyLen, hs.suite.ivLen)
-
- var clientCipher, serverCipher interface{}
- var clientHash, serverHash macFunction
-
- if hs.suite.aead == nil {
- clientCipher = hs.suite.cipher(clientKey, clientIV, true /* for reading */)
- clientHash = hs.suite.mac(c.vers, clientMAC)
- serverCipher = hs.suite.cipher(serverKey, serverIV, false /* not for reading */)
- serverHash = hs.suite.mac(c.vers, serverMAC)
- } else {
- clientCipher = hs.suite.aead(clientKey, clientIV)
- serverCipher = hs.suite.aead(serverKey, serverIV)
- }
-
- c.in.prepareCipherSpec(c.vers, clientCipher, clientHash)
- c.out.prepareCipherSpec(c.vers, serverCipher, serverHash)
-
- return nil
-}
-
-func (hs *serverHandshakeState) readFinished(out []byte) error {
- c := hs.c
-
- c.readRecord(recordTypeChangeCipherSpec)
- if err := c.in.error(); err != nil {
- return err
- }
-
- if hs.hello.nextProtoNeg {
- msg, err := c.readHandshake()
- if err != nil {
- return err
- }
- nextProto, ok := msg.(*nextProtoMsg)
- if !ok {
- c.sendAlert(alertUnexpectedMessage)
- return unexpectedMessageError(nextProto, msg)
- }
- hs.finishedHash.Write(nextProto.marshal())
- c.clientProtocol = nextProto.proto
- }
-
- msg, err := c.readHandshake()
- if err != nil {
- return err
- }
- clientFinished, ok := msg.(*finishedMsg)
- if !ok {
- c.sendAlert(alertUnexpectedMessage)
- return unexpectedMessageError(clientFinished, msg)
- }
-
- verify := hs.finishedHash.clientSum(hs.masterSecret)
- if len(verify) != len(clientFinished.verifyData) ||
- subtle.ConstantTimeCompare(verify, clientFinished.verifyData) != 1 {
- c.sendAlert(alertHandshakeFailure)
- return errors.New("tls: client's Finished message is incorrect")
- }
-
- hs.finishedHash.Write(clientFinished.marshal())
- copy(out, verify)
- return nil
-}
-
-func (hs *serverHandshakeState) sendSessionTicket() error {
- if !hs.hello.ticketSupported {
- return nil
- }
-
- c := hs.c
- m := new(newSessionTicketMsg)
-
- var err error
- state := sessionState{
- vers: c.vers,
- cipherSuite: hs.suite.id,
- masterSecret: hs.masterSecret,
- certificates: hs.certsFromClient,
- }
- m.ticket, err = c.encryptTicket(&state)
- if err != nil {
- return err
- }
-
- hs.finishedHash.Write(m.marshal())
- c.writeRecord(recordTypeHandshake, m.marshal())
-
- return nil
-}
-
-func (hs *serverHandshakeState) sendFinished(out []byte) error {
- c := hs.c
-
- c.writeRecord(recordTypeChangeCipherSpec, []byte{1})
-
- finished := new(finishedMsg)
- finished.verifyData = hs.finishedHash.serverSum(hs.masterSecret)
- hs.finishedHash.Write(finished.marshal())
- c.writeRecord(recordTypeHandshake, finished.marshal())
-
- c.cipherSuite = hs.suite.id
- copy(out, finished.verifyData)
-
- return nil
-}
-
-// processCertsFromClient takes a chain of client certificates either from a
-// Certificates message or from a sessionState and verifies them. It returns
-// the public key of the leaf certificate.
-func (hs *serverHandshakeState) processCertsFromClient(certificates [][]byte) (crypto.PublicKey, error) {
- c := hs.c
-
- hs.certsFromClient = certificates
- certs := make([]*x509.Certificate, len(certificates))
- var err error
- for i, asn1Data := range certificates {
- if certs[i], err = x509.ParseCertificate(asn1Data); err != nil {
- c.sendAlert(alertBadCertificate)
- return nil, errors.New("tls: failed to parse client certificate: " + err.Error())
- }
- }
-
- if c.config.ClientAuth >= VerifyClientCertIfGiven && len(certs) > 0 {
- opts := x509.VerifyOptions{
- Roots: c.config.ClientCAs,
- CurrentTime: c.config.time(),
- Intermediates: x509.NewCertPool(),
- KeyUsages: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth},
- }
-
- for _, cert := range certs[1:] {
- opts.Intermediates.AddCert(cert)
- }
-
- chains, err := certs[0].Verify(opts)
- if err != nil {
- c.sendAlert(alertBadCertificate)
- return nil, errors.New("tls: failed to verify client's certificate: " + err.Error())
- }
-
- ok := false
- for _, ku := range certs[0].ExtKeyUsage {
- if ku == x509.ExtKeyUsageClientAuth {
- ok = true
- break
- }
- }
- if !ok {
- c.sendAlert(alertHandshakeFailure)
- return nil, errors.New("tls: client's certificate's extended key usage doesn't permit it to be used for client authentication")
- }
-
- c.verifiedChains = chains
- }
-
- if len(certs) > 0 {
- var pub crypto.PublicKey
- switch key := certs[0].PublicKey.(type) {
- case *ecdsa.PublicKey, *rsa.PublicKey:
- pub = key
- default:
- c.sendAlert(alertUnsupportedCertificate)
- return nil, fmt.Errorf("tls: client's certificate contains an unsupported public key of type %T", certs[0].PublicKey)
- }
- c.peerCertificates = certs
- return pub, nil
- }
-
- return nil, nil
-}
-
-// tryCipherSuite returns a cipherSuite with the given id if that cipher suite
-// is acceptable to use.
-func (c *Conn) tryCipherSuite(id uint16, supportedCipherSuites []uint16, version uint16, ellipticOk, ecdsaOk bool) *cipherSuite {
- for _, supported := range supportedCipherSuites {
- if id == supported {
- var candidate *cipherSuite
-
- for _, s := range cipherSuites {
- if s.id == id {
- candidate = s
- break
- }
- }
- if candidate == nil {
- continue
- }
- // Don't select a ciphersuite which we can't
- // support for this client.
- if (candidate.flags&suiteECDHE != 0) && !ellipticOk {
- continue
- }
- if (candidate.flags&suiteECDSA != 0) != ecdsaOk {
- continue
- }
- if version < VersionTLS12 && candidate.flags&suiteTLS12 != 0 {
- continue
- }
- return candidate
- }
- }
-
- return nil
-}
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/handshake_server_test.go b/runtimes/google/ipc/stream/crypto/tlsfork/handshake_server_test.go
deleted file mode 100644
index b17b491..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/handshake_server_test.go
+++ /dev/null
@@ -1,821 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.4
-
-package tls
-
-import (
- "bytes"
- "crypto/ecdsa"
- "crypto/elliptic"
- "crypto/rsa"
- "encoding/hex"
- "encoding/pem"
- "errors"
- "fmt"
- "io"
- "math/big"
- "net"
- "os"
- "os/exec"
- "path/filepath"
- "strings"
- "testing"
- "time"
-)
-
-// zeroSource is an io.Reader that returns an unlimited number of zero bytes.
-type zeroSource struct{}
-
-func (zeroSource) Read(b []byte) (n int, err error) {
- for i := range b {
- b[i] = 0
- }
-
- return len(b), nil
-}
-
-var testConfig *Config
-
-func init() {
- testConfig = &Config{
- Time: func() time.Time { return time.Unix(0, 0) },
- Rand: zeroSource{},
- Certificates: make([]Certificate, 2),
- InsecureSkipVerify: true,
- MinVersion: VersionSSL30,
- MaxVersion: VersionTLS12,
- }
- testConfig.Certificates[0].Certificate = [][]byte{testRSACertificate}
- testConfig.Certificates[0].PrivateKey = testRSAPrivateKey
- testConfig.Certificates[1].Certificate = [][]byte{testSNICertificate}
- testConfig.Certificates[1].PrivateKey = testRSAPrivateKey
- testConfig.BuildNameToCertificate()
-}
-
-func testClientHelloFailure(t *testing.T, m handshakeMessage, expectedSubStr string) {
- // Create in-memory network connection,
- // send message to server. Should return
- // expected error.
- c, s := net.Pipe()
- go func() {
- cli := Client(c, testConfig)
- if ch, ok := m.(*clientHelloMsg); ok {
- cli.vers = ch.vers
- }
- cli.writeRecord(recordTypeHandshake, m.marshal())
- c.Close()
- }()
- err := Server(s, testConfig).Handshake()
- s.Close()
- if err == nil || !strings.Contains(err.Error(), expectedSubStr) {
- t.Errorf("Got error: %s; expected to match substring '%s'", err, expectedSubStr)
- }
-}
-
-func TestSimpleError(t *testing.T) {
- testClientHelloFailure(t, &serverHelloDoneMsg{}, "unexpected handshake message")
-}
-
-var badProtocolVersions = []uint16{0x0000, 0x0005, 0x0100, 0x0105, 0x0200, 0x0205}
-
-func TestRejectBadProtocolVersion(t *testing.T) {
- for _, v := range badProtocolVersions {
- testClientHelloFailure(t, &clientHelloMsg{vers: v}, "unsupported, maximum protocol version")
- }
-}
-
-func TestNoSuiteOverlap(t *testing.T) {
- clientHello := &clientHelloMsg{
- vers: 0x0301,
- cipherSuites: []uint16{0xff00},
- compressionMethods: []uint8{0},
- }
- testClientHelloFailure(t, clientHello, "no cipher suite supported by both client and server")
-}
-
-func TestNoCompressionOverlap(t *testing.T) {
- clientHello := &clientHelloMsg{
- vers: 0x0301,
- cipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA},
- compressionMethods: []uint8{0xff},
- }
- testClientHelloFailure(t, clientHello, "client does not support uncompressed connections")
-}
-
-func TestTLS12OnlyCipherSuites(t *testing.T) {
- // Test that a Server doesn't select a TLS 1.2-only cipher suite when
- // the client negotiates TLS 1.1.
- var zeros [32]byte
-
- clientHello := &clientHelloMsg{
- vers: VersionTLS11,
- random: zeros[:],
- cipherSuites: []uint16{
- // The Server, by default, will use the client's
- // preference order. So the GCM cipher suite
- // will be selected unless it's excluded because
- // of the version in this ClientHello.
- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
- TLS_RSA_WITH_RC4_128_SHA,
- },
- compressionMethods: []uint8{compressionNone},
- supportedCurves: []CurveID{CurveP256, CurveP384, CurveP521},
- supportedPoints: []uint8{pointFormatUncompressed},
- }
-
- c, s := net.Pipe()
- var reply interface{}
- var clientErr error
- go func() {
- cli := Client(c, testConfig)
- cli.vers = clientHello.vers
- cli.writeRecord(recordTypeHandshake, clientHello.marshal())
- reply, clientErr = cli.readHandshake()
- c.Close()
- }()
- config := *testConfig
- config.CipherSuites = clientHello.cipherSuites
- Server(s, &config).Handshake()
- s.Close()
- if clientErr != nil {
- t.Fatal(clientErr)
- }
- serverHello, ok := reply.(*serverHelloMsg)
- if !ok {
- t.Fatalf("didn't get ServerHello message in reply. Got %v\n", reply)
- }
- if s := serverHello.cipherSuite; s != TLS_RSA_WITH_RC4_128_SHA {
- t.Fatalf("bad cipher suite from server: %x", s)
- }
-}
-
-func TestAlertForwarding(t *testing.T) {
- c, s := net.Pipe()
- go func() {
- Client(c, testConfig).sendAlert(alertUnknownCA)
- c.Close()
- }()
-
- err := Server(s, testConfig).Handshake()
- s.Close()
- if e, ok := err.(*net.OpError); !ok || e.Err != error(alertUnknownCA) {
- t.Errorf("Got error: %s; expected: %s", err, error(alertUnknownCA))
- }
-}
-
-func TestClose(t *testing.T) {
- c, s := net.Pipe()
- go c.Close()
-
- err := Server(s, testConfig).Handshake()
- s.Close()
- if err != io.EOF {
- t.Errorf("Got error: %s; expected: %s", err, io.EOF)
- }
-}
-
-func testHandshake(clientConfig, serverConfig *Config) (state ConnectionState, err error) {
- c, s := net.Pipe()
- done := make(chan bool)
- go func() {
- cli := Client(c, clientConfig)
- cli.Handshake()
- c.Close()
- done <- true
- }()
- server := Server(s, serverConfig)
- err = server.Handshake()
- if err == nil {
- state = server.ConnectionState()
- }
- s.Close()
- <-done
- return
-}
-
-func TestVersion(t *testing.T) {
- serverConfig := &Config{
- Certificates: testConfig.Certificates,
- MaxVersion: VersionTLS11,
- }
- clientConfig := &Config{
- InsecureSkipVerify: true,
- }
- state, err := testHandshake(clientConfig, serverConfig)
- if err != nil {
- t.Fatalf("handshake failed: %s", err)
- }
- if state.Version != VersionTLS11 {
- t.Fatalf("Incorrect version %x, should be %x", state.Version, VersionTLS11)
- }
-}
-
-func TestCipherSuitePreference(t *testing.T) {
- serverConfig := &Config{
- CipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_RC4_128_SHA},
- Certificates: testConfig.Certificates,
- MaxVersion: VersionTLS11,
- }
- clientConfig := &Config{
- CipherSuites: []uint16{TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_RC4_128_SHA},
- InsecureSkipVerify: true,
- }
- state, err := testHandshake(clientConfig, serverConfig)
- if err != nil {
- t.Fatalf("handshake failed: %s", err)
- }
- if state.CipherSuite != TLS_RSA_WITH_AES_128_CBC_SHA {
- // By default the server should use the client's preference.
- t.Fatalf("Client's preference was not used, got %x", state.CipherSuite)
- }
-
- serverConfig.PreferServerCipherSuites = true
- state, err = testHandshake(clientConfig, serverConfig)
- if err != nil {
- t.Fatalf("handshake failed: %s", err)
- }
- if state.CipherSuite != TLS_RSA_WITH_RC4_128_SHA {
- t.Fatalf("Server's preference was not used, got %x", state.CipherSuite)
- }
-}
-
-// Note: see comment in handshake_test.go for details of how the reference
-// tests work.
-
-// serverTest represents a test of the TLS server handshake against a reference
-// implementation.
-type serverTest struct {
- // name is a freeform string identifying the test and the file in which
- // the expected results will be stored.
- name string
- // command, if not empty, contains a series of arguments for the
- // command to run for the reference server.
- command []string
- // expectedPeerCerts contains a list of PEM blocks of expected
- // certificates from the client.
- expectedPeerCerts []string
- // config, if not nil, contains a custom Config to use for this test.
- config *Config
- // expectAlert, if true, indicates that a fatal alert should be returned
- // when handshaking with the server.
- expectAlert bool
- // validate, if not nil, is a function that will be called with the
- // ConnectionState of the resulting connection. It returns false if the
- // ConnectionState is unacceptable.
- validate func(ConnectionState) error
-}
-
-var defaultClientCommand = []string{"openssl", "s_client", "-no_ticket"}
-
-// connFromCommand starts opens a listening socket and starts the reference
-// client to connect to it. It returns a recordingConn that wraps the resulting
-// connection.
-func (test *serverTest) connFromCommand() (conn *recordingConn, child *exec.Cmd, err error) {
- l, err := net.ListenTCP("tcp", &net.TCPAddr{
- IP: net.IPv4(127, 0, 0, 1),
- Port: 0,
- })
- if err != nil {
- return nil, nil, err
- }
- defer l.Close()
-
- port := l.Addr().(*net.TCPAddr).Port
-
- var command []string
- command = append(command, test.command...)
- if len(command) == 0 {
- command = defaultClientCommand
- }
- command = append(command, "-connect")
- command = append(command, fmt.Sprintf("127.0.0.1:%d", port))
- cmd := exec.Command(command[0], command[1:]...)
- cmd.Stdin = nil
- var output bytes.Buffer
- cmd.Stdout = &output
- cmd.Stderr = &output
- if err := cmd.Start(); err != nil {
- return nil, nil, err
- }
-
- connChan := make(chan interface{})
- go func() {
- tcpConn, err := l.Accept()
- if err != nil {
- connChan <- err
- }
- connChan <- tcpConn
- }()
-
- var tcpConn net.Conn
- select {
- case connOrError := <-connChan:
- if err, ok := connOrError.(error); ok {
- return nil, nil, err
- }
- tcpConn = connOrError.(net.Conn)
- case <-time.After(2 * time.Second):
- output.WriteTo(os.Stdout)
- return nil, nil, errors.New("timed out waiting for connection from child process")
- }
-
- record := &recordingConn{
- Conn: tcpConn,
- }
-
- return record, cmd, nil
-}
-
-func (test *serverTest) dataPath() string {
- return filepath.Join("testdata", "Server-"+test.name)
-}
-
-func (test *serverTest) loadData() (flows [][]byte, err error) {
- in, err := os.Open(test.dataPath())
- if err != nil {
- return nil, err
- }
- defer in.Close()
- return parseTestData(in)
-}
-
-func (test *serverTest) run(t *testing.T, write bool) {
- var clientConn, serverConn net.Conn
- var recordingConn *recordingConn
- var childProcess *exec.Cmd
-
- if write {
- var err error
- recordingConn, childProcess, err = test.connFromCommand()
- if err != nil {
- t.Fatalf("Failed to start subcommand: %s", err)
- }
- serverConn = recordingConn
- } else {
- clientConn, serverConn = net.Pipe()
- }
- config := test.config
- if config == nil {
- config = testConfig
- }
- server := Server(serverConn, config)
- connStateChan := make(chan ConnectionState, 1)
- go func() {
- if _, err := server.Write([]byte("hello, world\n")); err != nil {
- t.Logf("Error from Server.Write: %s", err)
- }
- server.Close()
- serverConn.Close()
- connStateChan <- server.ConnectionState()
- }()
-
- if !write {
- flows, err := test.loadData()
- if err != nil {
- if !test.expectAlert {
- t.Fatalf("%s: failed to load data from %s", test.name, test.dataPath())
- }
- }
- for i, b := range flows {
- if i%2 == 0 {
- clientConn.Write(b)
- continue
- }
- bb := make([]byte, len(b))
- n, err := io.ReadFull(clientConn, bb)
- if test.expectAlert {
- if err == nil {
- t.Fatal("Expected read failure but read succeeded")
- }
- } else {
- if err != nil {
- t.Fatalf("%s #%d: %s\nRead %d, wanted %d, got %x, wanted %x\n", test.name, i+1, err, n, len(bb), bb[:n], b)
- }
- if !bytes.Equal(b, bb) {
- t.Fatalf("%s #%d: mismatch on read: got:%x want:%x", test.name, i+1, bb, b)
- }
- }
- }
- clientConn.Close()
- }
-
- connState := <-connStateChan
- peerCerts := connState.PeerCertificates
- if len(peerCerts) == len(test.expectedPeerCerts) {
- for i, peerCert := range peerCerts {
- block, _ := pem.Decode([]byte(test.expectedPeerCerts[i]))
- if !bytes.Equal(block.Bytes, peerCert.Raw) {
- t.Fatalf("%s: mismatch on peer cert %d", test.name, i+1)
- }
- }
- } else {
- t.Fatalf("%s: mismatch on peer list length: %d (wanted) != %d (got)", test.name, len(test.expectedPeerCerts), len(peerCerts))
- }
-
- if test.validate != nil {
- if err := test.validate(connState); err != nil {
- t.Fatalf("validate callback returned error: %s", err)
- }
- }
-
- if write {
- path := test.dataPath()
- out, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
- if err != nil {
- t.Fatalf("Failed to create output file: %s", err)
- }
- defer out.Close()
- recordingConn.Close()
- if len(recordingConn.flows) < 3 {
- childProcess.Stdout.(*bytes.Buffer).WriteTo(os.Stdout)
- t.Fatalf("Handshake failed")
- }
- recordingConn.WriteTo(out)
- fmt.Printf("Wrote %s\n", path)
- childProcess.Wait()
- }
-}
-
-func runServerTestForVersion(t *testing.T, template *serverTest, prefix, option string) {
- test := *template
- test.name = prefix + test.name
- if len(test.command) == 0 {
- test.command = defaultClientCommand
- }
- test.command = append([]string(nil), test.command...)
- test.command = append(test.command, option)
- test.run(t, *update)
-}
-
-func runServerTestSSLv3(t *testing.T, template *serverTest) {
- runServerTestForVersion(t, template, "SSLv3-", "-ssl3")
-}
-
-func runServerTestTLS10(t *testing.T, template *serverTest) {
- runServerTestForVersion(t, template, "TLSv10-", "-tls1")
-}
-
-func runServerTestTLS11(t *testing.T, template *serverTest) {
- runServerTestForVersion(t, template, "TLSv11-", "-tls1_1")
-}
-
-func runServerTestTLS12(t *testing.T, template *serverTest) {
- runServerTestForVersion(t, template, "TLSv12-", "-tls1_2")
-}
-
-func TestHandshakeServerRSARC4(t *testing.T) {
- test := &serverTest{
- name: "RSA-RC4",
- command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "RC4-SHA"},
- }
- runServerTestSSLv3(t, test)
- runServerTestTLS10(t, test)
- runServerTestTLS11(t, test)
- runServerTestTLS12(t, test)
-}
-
-func TestHandshakeServerRSA3DES(t *testing.T) {
- test := &serverTest{
- name: "RSA-3DES",
- command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "DES-CBC3-SHA"},
- }
- runServerTestSSLv3(t, test)
- runServerTestTLS10(t, test)
- runServerTestTLS12(t, test)
-}
-
-func TestHandshakeServerRSAAES(t *testing.T) {
- test := &serverTest{
- name: "RSA-AES",
- command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA"},
- }
- runServerTestSSLv3(t, test)
- runServerTestTLS10(t, test)
- runServerTestTLS12(t, test)
-}
-
-func TestHandshakeServerAESGCM(t *testing.T) {
- test := &serverTest{
- name: "RSA-AES-GCM",
- command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "ECDHE-RSA-AES128-GCM-SHA256"},
- }
- runServerTestTLS12(t, test)
-}
-
-func TestHandshakeServerECDHEECDSAAES(t *testing.T) {
- config := *testConfig
- config.Certificates = make([]Certificate, 1)
- config.Certificates[0].Certificate = [][]byte{testECDSACertificate}
- config.Certificates[0].PrivateKey = testECDSAPrivateKey
- config.BuildNameToCertificate()
-
- test := &serverTest{
- name: "ECDHE-ECDSA-AES",
- command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "ECDHE-ECDSA-AES256-SHA"},
- config: &config,
- }
- runServerTestTLS10(t, test)
- runServerTestTLS12(t, test)
-}
-
-func TestHandshakeServerALPN(t *testing.T) {
- config := *testConfig
- config.NextProtos = []string{"proto1", "proto2"}
-
- test := &serverTest{
- name: "ALPN",
- // Note that this needs OpenSSL 1.0.2 because that is the first
- // version that supports the -alpn flag.
- command: []string{"openssl", "s_client", "-alpn", "proto2,proto1"},
- config: &config,
- validate: func(state ConnectionState) error {
- // The server's preferences should override the client.
- if state.NegotiatedProtocol != "proto1" {
- return fmt.Errorf("Got protocol %q, wanted proto1", state.NegotiatedProtocol)
- }
- return nil
- },
- }
- runServerTestTLS12(t, test)
-}
-
-func TestHandshakeServerALPNNoMatch(t *testing.T) {
- config := *testConfig
- config.NextProtos = []string{"proto3"}
-
- test := &serverTest{
- name: "ALPN-NoMatch",
- // Note that this needs OpenSSL 1.0.2 because that is the first
- // version that supports the -alpn flag.
- command: []string{"openssl", "s_client", "-alpn", "proto2,proto1"},
- config: &config,
- validate: func(state ConnectionState) error {
- // Rather than reject the connection, Go doesn't select
- // a protocol when there is no overlap.
- if state.NegotiatedProtocol != "" {
- return fmt.Errorf("Got protocol %q, wanted ''", state.NegotiatedProtocol)
- }
- return nil
- },
- }
- runServerTestTLS12(t, test)
-}
-
-// TestHandshakeServerSNI involves a client sending an SNI extension of
-// "snitest.com", which happens to match the CN of testSNICertificate. The test
-// verifies that the server correctly selects that certificate.
-func TestHandshakeServerSNI(t *testing.T) {
- test := &serverTest{
- name: "SNI",
- command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA", "-servername", "snitest.com"},
- }
- runServerTestTLS12(t, test)
-}
-
-// TestHandshakeServerSNICertForName is similar to TestHandshakeServerSNI, but
-// tests the dynamic GetCertificate method
-func TestHandshakeServerSNIGetCertificate(t *testing.T) {
- config := *testConfig
-
- // Replace the NameToCertificate map with a GetCertificate function
- nameToCert := config.NameToCertificate
- config.NameToCertificate = nil
- config.GetCertificate = func(clientHello *ClientHelloInfo) (*Certificate, error) {
- cert, _ := nameToCert[clientHello.ServerName]
- return cert, nil
- }
- test := &serverTest{
- name: "SNI",
- command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA", "-servername", "snitest.com"},
- config: &config,
- }
- runServerTestTLS12(t, test)
-}
-
-// TestHandshakeServerSNICertForNameNotFound is similar to
-// TestHandshakeServerSNICertForName, but tests to make sure that when the
-// GetCertificate method doesn't return a cert, we fall back to what's in
-// the NameToCertificate map.
-func TestHandshakeServerSNIGetCertificateNotFound(t *testing.T) {
- config := *testConfig
-
- config.GetCertificate = func(clientHello *ClientHelloInfo) (*Certificate, error) {
- return nil, nil
- }
- test := &serverTest{
- name: "SNI",
- command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA", "-servername", "snitest.com"},
- config: &config,
- }
- runServerTestTLS12(t, test)
-}
-
-// TestHandshakeServerSNICertForNameError tests to make sure that errors in
-// GetCertificate result in a tls alert.
-func TestHandshakeServerSNIGetCertificateError(t *testing.T) {
- config := *testConfig
-
- config.GetCertificate = func(clientHello *ClientHelloInfo) (*Certificate, error) {
- return nil, fmt.Errorf("Test error in GetCertificate")
- }
- test := &serverTest{
- name: "SNI",
- command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA", "-servername", "snitest.com"},
- config: &config,
- expectAlert: true,
- }
- runServerTestTLS12(t, test)
-}
-
-// TestCipherSuiteCertPreferance ensures that we select an RSA ciphersuite with
-// an RSA certificate and an ECDSA ciphersuite with an ECDSA certificate.
-func TestCipherSuiteCertPreferenceECDSA(t *testing.T) {
- config := *testConfig
- config.CipherSuites = []uint16{TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA}
- config.PreferServerCipherSuites = true
-
- test := &serverTest{
- name: "CipherSuiteCertPreferenceRSA",
- config: &config,
- }
- runServerTestTLS12(t, test)
-
- config = *testConfig
- config.CipherSuites = []uint16{TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA}
- config.Certificates = []Certificate{
- {
- Certificate: [][]byte{testECDSACertificate},
- PrivateKey: testECDSAPrivateKey,
- },
- }
- config.BuildNameToCertificate()
- config.PreferServerCipherSuites = true
-
- test = &serverTest{
- name: "CipherSuiteCertPreferenceECDSA",
- config: &config,
- }
- runServerTestTLS12(t, test)
-}
-
-func TestResumption(t *testing.T) {
- sessionFilePath := tempFile("")
- defer os.Remove(sessionFilePath)
-
- test := &serverTest{
- name: "IssueTicket",
- command: []string{"openssl", "s_client", "-cipher", "RC4-SHA", "-sess_out", sessionFilePath},
- }
- runServerTestTLS12(t, test)
-
- test = &serverTest{
- name: "Resume",
- command: []string{"openssl", "s_client", "-cipher", "RC4-SHA", "-sess_in", sessionFilePath},
- }
- runServerTestTLS12(t, test)
-}
-
-// cert.pem and key.pem were generated with generate_cert.go
-// Thus, they have no ExtKeyUsage fields and trigger an error
-// when verification is turned on.
-
-const clientCertificatePEM = `
------BEGIN CERTIFICATE-----
-MIIB7TCCAVigAwIBAgIBADALBgkqhkiG9w0BAQUwJjEQMA4GA1UEChMHQWNtZSBD
-bzESMBAGA1UEAxMJMTI3LjAuMC4xMB4XDTExMTIwODA3NTUxMloXDTEyMTIwNzA4
-MDAxMlowJjEQMA4GA1UEChMHQWNtZSBDbzESMBAGA1UEAxMJMTI3LjAuMC4xMIGc
-MAsGCSqGSIb3DQEBAQOBjAAwgYgCgYBO0Hsx44Jk2VnAwoekXh6LczPHY1PfZpIG
-hPZk1Y/kNqcdK+izIDZFI7Xjla7t4PUgnI2V339aEu+H5Fto5OkOdOwEin/ekyfE
-ARl6vfLcPRSr0FTKIQzQTW6HLlzF0rtNS0/Otiz3fojsfNcCkXSmHgwa2uNKWi7e
-E5xMQIhZkwIDAQABozIwMDAOBgNVHQ8BAf8EBAMCAKAwDQYDVR0OBAYEBAECAwQw
-DwYDVR0jBAgwBoAEAQIDBDALBgkqhkiG9w0BAQUDgYEANh+zegx1yW43RmEr1b3A
-p0vMRpqBWHyFeSnIyMZn3TJWRSt1tukkqVCavh9a+hoV2cxVlXIWg7nCto/9iIw4
-hB2rXZIxE0/9gzvGnfERYraL7KtnvshksBFQRlgXa5kc0x38BvEO5ZaoDPl4ILdE
-GFGNEH5PlGffo05wc46QkYU=
------END CERTIFICATE-----`
-
-const clientKeyPEM = `
------BEGIN RSA PRIVATE KEY-----
-MIICWgIBAAKBgE7QezHjgmTZWcDCh6ReHotzM8djU99mkgaE9mTVj+Q2px0r6LMg
-NkUjteOVru3g9SCcjZXff1oS74fkW2jk6Q507ASKf96TJ8QBGXq98tw9FKvQVMoh
-DNBNbocuXMXSu01LT862LPd+iOx81wKRdKYeDBra40paLt4TnExAiFmTAgMBAAEC
-gYBxvXd8yNteFTns8A/2yomEMC4yeosJJSpp1CsN3BJ7g8/qTnrVPxBy+RU+qr63
-t2WquaOu/cr5P8iEsa6lk20tf8pjKLNXeX0b1RTzK8rJLbS7nGzP3tvOhL096VtQ
-dAo4ROEaro0TzYpHmpciSvxVIeEIAAdFDObDJPKqcJAxyQJBAJizfYgK8Gzx9fsx
-hxp+VteCbVPg2euASH5Yv3K5LukRdKoSzHE2grUVQgN/LafC0eZibRanxHegYSr7
-7qaswKUCQQCEIWor/X4XTMdVj3Oj+vpiw75y/S9gh682+myZL+d/02IEkwnB098P
-RkKVpenBHyrGg0oeN5La7URILWKj7CPXAkBKo6F+d+phNjwIFoN1Xb/RA32w/D1I
-saG9sF+UEhRt9AxUfW/U/tIQ9V0ZHHcSg1XaCM5Nvp934brdKdvTOKnJAkBD5h/3
-Rybatlvg/fzBEaJFyq09zhngkxlZOUtBVTqzl17RVvY2orgH02U4HbCHy4phxOn7
-qTdQRYlHRftgnWK1AkANibn9PRYJ7mJyJ9Dyj2QeNcSkSTzrt0tPvUMf4+meJymN
-1Ntu5+S1DLLzfxlaljWG6ylW6DNxujCyuXIV2rvA
------END RSA PRIVATE KEY-----`
-
-const clientECDSACertificatePEM = `
------BEGIN CERTIFICATE-----
-MIIB/DCCAV4CCQCaMIRsJjXZFzAJBgcqhkjOPQQBMEUxCzAJBgNVBAYTAkFVMRMw
-EQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0
-eSBMdGQwHhcNMTIxMTE0MTMyNTUzWhcNMjIxMTEyMTMyNTUzWjBBMQswCQYDVQQG
-EwJBVTEMMAoGA1UECBMDTlNXMRAwDgYDVQQHEwdQeXJtb250MRIwEAYDVQQDEwlK
-b2VsIFNpbmcwgZswEAYHKoZIzj0CAQYFK4EEACMDgYYABACVjJF1FMBexFe01MNv
-ja5oHt1vzobhfm6ySD6B5U7ixohLZNz1MLvT/2XMW/TdtWo+PtAd3kfDdq0Z9kUs
-jLzYHQFMH3CQRnZIi4+DzEpcj0B22uCJ7B0rxE4wdihBsmKo+1vx+U56jb0JuK7q
-ixgnTy5w/hOWusPTQBbNZU6sER7m8TAJBgcqhkjOPQQBA4GMADCBiAJCAOAUxGBg
-C3JosDJdYUoCdFzCgbkWqD8pyDbHgf9stlvZcPE4O1BIKJTLCRpS8V3ujfK58PDa
-2RU6+b0DeoeiIzXsAkIBo9SKeDUcSpoj0gq+KxAxnZxfvuiRs9oa9V2jI/Umi0Vw
-jWVim34BmT0Y9hCaOGGbLlfk+syxis7iI6CH8OFnUes=
------END CERTIFICATE-----`
-
-const clientECDSAKeyPEM = `
------BEGIN EC PARAMETERS-----
-BgUrgQQAIw==
------END EC PARAMETERS-----
------BEGIN EC PRIVATE KEY-----
-MIHcAgEBBEIBkJN9X4IqZIguiEVKMqeBUP5xtRsEv4HJEtOpOGLELwO53SD78Ew8
-k+wLWoqizS3NpQyMtrU8JFdWfj+C57UNkOugBwYFK4EEACOhgYkDgYYABACVjJF1
-FMBexFe01MNvja5oHt1vzobhfm6ySD6B5U7ixohLZNz1MLvT/2XMW/TdtWo+PtAd
-3kfDdq0Z9kUsjLzYHQFMH3CQRnZIi4+DzEpcj0B22uCJ7B0rxE4wdihBsmKo+1vx
-+U56jb0JuK7qixgnTy5w/hOWusPTQBbNZU6sER7m8Q==
------END EC PRIVATE KEY-----`
-
-func TestClientAuth(t *testing.T) {
- var certPath, keyPath, ecdsaCertPath, ecdsaKeyPath string
-
- if *update {
- certPath = tempFile(clientCertificatePEM)
- defer os.Remove(certPath)
- keyPath = tempFile(clientKeyPEM)
- defer os.Remove(keyPath)
- ecdsaCertPath = tempFile(clientECDSACertificatePEM)
- defer os.Remove(ecdsaCertPath)
- ecdsaKeyPath = tempFile(clientECDSAKeyPEM)
- defer os.Remove(ecdsaKeyPath)
- }
-
- config := *testConfig
- config.ClientAuth = RequestClientCert
-
- test := &serverTest{
- name: "ClientAuthRequestedNotGiven",
- command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "RC4-SHA"},
- config: &config,
- }
- runServerTestTLS12(t, test)
-
- test = &serverTest{
- name: "ClientAuthRequestedAndGiven",
- command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "RC4-SHA", "-cert", certPath, "-key", keyPath},
- config: &config,
- expectedPeerCerts: []string{clientCertificatePEM},
- }
- runServerTestTLS12(t, test)
-
- test = &serverTest{
- name: "ClientAuthRequestedAndECDSAGiven",
- command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "RC4-SHA", "-cert", ecdsaCertPath, "-key", ecdsaKeyPath},
- config: &config,
- expectedPeerCerts: []string{clientECDSACertificatePEM},
- }
- runServerTestTLS12(t, test)
-}
-
-func bigFromString(s string) *big.Int {
- ret := new(big.Int)
- ret.SetString(s, 10)
- return ret
-}
-
-func fromHex(s string) []byte {
- b, _ := hex.DecodeString(s)
- return b
-}
-
-var testRSACertificate = fromHex("308202b030820219a00302010202090085b0bba48a7fb8ca300d06092a864886f70d01010505003045310b3009060355040613024155311330110603550408130a536f6d652d53746174653121301f060355040a1318496e7465726e6574205769646769747320507479204c7464301e170d3130303432343039303933385a170d3131303432343039303933385a3045310b3009060355040613024155311330110603550408130a536f6d652d53746174653121301f060355040a1318496e7465726e6574205769646769747320507479204c746430819f300d06092a864886f70d010101050003818d0030818902818100bb79d6f517b5e5bf4610d0dc69bee62b07435ad0032d8a7a4385b71452e7a5654c2c78b8238cb5b482e5de1f953b7e62a52ca533d6fe125c7a56fcf506bffa587b263fb5cd04d3d0c921964ac7f4549f5abfef427100fe1899077f7e887d7df10439c4a22edb51c97ce3c04c3b326601cfafb11db8719a1ddbdb896baeda2d790203010001a381a73081a4301d0603551d0e04160414b1ade2855acfcb28db69ce2369ded3268e18883930750603551d23046e306c8014b1ade2855acfcb28db69ce2369ded3268e188839a149a4473045310b3009060355040613024155311330110603550408130a536f6d652d53746174653121301f060355040a1318496e7465726e6574205769646769747320507479204c746482090085b0bba48a7fb8ca300c0603551d13040530030101ff300d06092a864886f70d010105050003818100086c4524c76bb159ab0c52ccf2b014d7879d7a6475b55a9566e4c52b8eae12661feb4f38b36e60d392fdf74108b52513b1187a24fb301dbaed98b917ece7d73159db95d31d78ea50565cd5825a2d5a5f33c4b6d8c97590968c0f5298b5cd981f89205ff2a01ca31b9694dda9fd57e970e8266d71999b266e3850296c90a7bdd9")
-
-var testECDSACertificate = fromHex("3082020030820162020900b8bf2d47a0d2ebf4300906072a8648ce3d04013045310b3009060355040613024155311330110603550408130a536f6d652d53746174653121301f060355040a1318496e7465726e6574205769646769747320507479204c7464301e170d3132313132323135303633325a170d3232313132303135303633325a3045310b3009060355040613024155311330110603550408130a536f6d652d53746174653121301f060355040a1318496e7465726e6574205769646769747320507479204c746430819b301006072a8648ce3d020106052b81040023038186000400c4a1edbe98f90b4873367ec316561122f23d53c33b4d213dcd6b75e6f6b0dc9adf26c1bcb287f072327cb3642f1c90bcea6823107efee325c0483a69e0286dd33700ef0462dd0da09c706283d881d36431aa9e9731bd96b068c09b23de76643f1a5c7fe9120e5858b65f70dd9bd8ead5d7f5d5ccb9b69f30665b669a20e227e5bffe3b300906072a8648ce3d040103818c0030818802420188a24febe245c5487d1bacf5ed989dae4770c05e1bb62fbdf1b64db76140d311a2ceee0b7e927eff769dc33b7ea53fcefa10e259ec472d7cacda4e970e15a06fd00242014dfcbe67139c2d050ebd3fa38c25c13313830d9406bbd4377af6ec7ac9862eddd711697f857c56defb31782be4c7780daecbbe9e4e3624317b6a0f399512078f2a")
-
-var testSNICertificate = fromHex("308201f23082015da003020102020100300b06092a864886f70d01010530283110300e060355040a130741636d6520436f311430120603550403130b736e69746573742e636f6d301e170d3132303431313137343033355a170d3133303431313137343533355a30283110300e060355040a130741636d6520436f311430120603550403130b736e69746573742e636f6d30819d300b06092a864886f70d01010103818d0030818902818100bb79d6f517b5e5bf4610d0dc69bee62b07435ad0032d8a7a4385b71452e7a5654c2c78b8238cb5b482e5de1f953b7e62a52ca533d6fe125c7a56fcf506bffa587b263fb5cd04d3d0c921964ac7f4549f5abfef427100fe1899077f7e887d7df10439c4a22edb51c97ce3c04c3b326601cfafb11db8719a1ddbdb896baeda2d790203010001a3323030300e0603551d0f0101ff0404030200a0300d0603551d0e0406040401020304300f0603551d2304083006800401020304300b06092a864886f70d0101050381810089c6455f1c1f5ef8eb1ab174ee2439059f5c4259bb1a8d86cdb1d056f56a717da40e95ab90f59e8deaf627c157995094db0802266eb34fc6842dea8a4b68d9c1389103ab84fb9e1f85d9b5d23ff2312c8670fbb540148245a4ebafe264d90c8a4cf4f85b0fac12ac2fc4a3154bad52462868af96c62c6525d652b6e31845bdcc")
-
-var testRSAPrivateKey = &rsa.PrivateKey{
- PublicKey: rsa.PublicKey{
- N: bigFromString("131650079503776001033793877885499001334664249354723305978524647182322416328664556247316495448366990052837680518067798333412266673813370895702118944398081598789828837447552603077848001020611640547221687072142537202428102790818451901395596882588063427854225330436740647715202971973145151161964464812406232198521"),
- E: 65537,
- },
- D: bigFromString("29354450337804273969007277378287027274721892607543397931919078829901848876371746653677097639302788129485893852488285045793268732234230875671682624082413996177431586734171663258657462237320300610850244186316880055243099640544518318093544057213190320837094958164973959123058337475052510833916491060913053867729"),
- Primes: []*big.Int{
- bigFromString("11969277782311800166562047708379380720136961987713178380670422671426759650127150688426177829077494755200794297055316163155755835813760102405344560929062149"),
- bigFromString("10998999429884441391899182616418192492905073053684657075974935218461686523870125521822756579792315215543092255516093840728890783887287417039645833477273829"),
- },
-}
-
-var testECDSAPrivateKey = &ecdsa.PrivateKey{
- PublicKey: ecdsa.PublicKey{
- Curve: elliptic.P521(),
- X: bigFromString("2636411247892461147287360222306590634450676461695221912739908880441342231985950069527906976759812296359387337367668045707086543273113073382714101597903639351"),
- Y: bigFromString("3204695818431246682253994090650952614555094516658732116404513121125038617915183037601737180082382202488628239201196033284060130040574800684774115478859677243"),
- },
- D: bigFromString("5477294338614160138026852784385529180817726002953041720191098180813046231640184669647735805135001309477695746518160084669446643325196003346204701381388769751"),
-}
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/handshake_test.go b/runtimes/google/ipc/stream/crypto/tlsfork/handshake_test.go
deleted file mode 100644
index f118e83..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/handshake_test.go
+++ /dev/null
@@ -1,169 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.4
-
-package tls
-
-import (
- "bufio"
- "encoding/hex"
- "errors"
- "flag"
- "fmt"
- "io"
- "io/ioutil"
- "net"
- "strconv"
- "strings"
- "sync"
-)
-
-// TLS reference tests run a connection against a reference implementation
-// (OpenSSL) of TLS and record the bytes of the resulting connection. The Go
-// code, during a test, is configured with deterministic randomness and so the
-// reference test can be reproduced exactly in the future.
-//
-// In order to save everyone who wishes to run the tests from needing the
-// reference implementation installed, the reference connections are saved in
-// files in the testdata directory. Thus running the tests involves nothing
-// external, but creating and updating them requires the reference
-// implementation.
-//
-// Tests can be updated by running them with the -update flag. This will cause
-// the test files. Generally one should combine the -update flag with -test.run
-// to updated a specific test. Since the reference implementation will always
-// generate fresh random numbers, large parts of the reference connection will
-// always change.
-
-var update = flag.Bool("update", false, "update golden files on disk")
-
-// recordingConn is a net.Conn that records the traffic that passes through it.
-// WriteTo can be used to produce output that can be later be loaded with
-// ParseTestData.
-type recordingConn struct {
- net.Conn
- sync.Mutex
- flows [][]byte
- reading bool
-}
-
-func (r *recordingConn) Read(b []byte) (n int, err error) {
- if n, err = r.Conn.Read(b); n == 0 {
- return
- }
- b = b[:n]
-
- r.Lock()
- defer r.Unlock()
-
- if l := len(r.flows); l == 0 || !r.reading {
- buf := make([]byte, len(b))
- copy(buf, b)
- r.flows = append(r.flows, buf)
- } else {
- r.flows[l-1] = append(r.flows[l-1], b[:n]...)
- }
- r.reading = true
- return
-}
-
-func (r *recordingConn) Write(b []byte) (n int, err error) {
- if n, err = r.Conn.Write(b); n == 0 {
- return
- }
- b = b[:n]
-
- r.Lock()
- defer r.Unlock()
-
- if l := len(r.flows); l == 0 || r.reading {
- buf := make([]byte, len(b))
- copy(buf, b)
- r.flows = append(r.flows, buf)
- } else {
- r.flows[l-1] = append(r.flows[l-1], b[:n]...)
- }
- r.reading = false
- return
-}
-
-// WriteTo writes Go source code to w that contains the recorded traffic.
-func (r *recordingConn) WriteTo(w io.Writer) {
- // TLS always starts with a client to server flow.
- clientToServer := true
-
- for i, flow := range r.flows {
- source, dest := "client", "server"
- if !clientToServer {
- source, dest = dest, source
- }
- fmt.Fprintf(w, ">>> Flow %d (%s to %s)\n", i+1, source, dest)
- dumper := hex.Dumper(w)
- dumper.Write(flow)
- dumper.Close()
- clientToServer = !clientToServer
- }
-}
-
-func parseTestData(r io.Reader) (flows [][]byte, err error) {
- var currentFlow []byte
-
- scanner := bufio.NewScanner(r)
- for scanner.Scan() {
- line := scanner.Text()
- // If the line starts with ">>> " then it marks the beginning
- // of a new flow.
- if strings.HasPrefix(line, ">>> ") {
- if len(currentFlow) > 0 || len(flows) > 0 {
- flows = append(flows, currentFlow)
- currentFlow = nil
- }
- continue
- }
-
- // Otherwise the line is a line of hex dump that looks like:
- // 00000170 fc f5 06 bf (...) |.....X{&?......!|
- // (Some bytes have been omitted from the middle section.)
-
- if i := strings.IndexByte(line, ' '); i >= 0 {
- line = line[i:]
- } else {
- return nil, errors.New("invalid test data")
- }
-
- if i := strings.IndexByte(line, '|'); i >= 0 {
- line = line[:i]
- } else {
- return nil, errors.New("invalid test data")
- }
-
- hexBytes := strings.Fields(line)
- for _, hexByte := range hexBytes {
- val, err := strconv.ParseUint(hexByte, 16, 8)
- if err != nil {
- return nil, errors.New("invalid hex byte in test data: " + err.Error())
- }
- currentFlow = append(currentFlow, byte(val))
- }
- }
-
- if len(currentFlow) > 0 {
- flows = append(flows, currentFlow)
- }
-
- return flows, nil
-}
-
-// tempFile creates a temp file containing contents and returns its path.
-func tempFile(contents string) string {
- file, err := ioutil.TempFile("", "go-tls-test")
- if err != nil {
- panic("failed to create temp file: " + err.Error())
- }
- path := file.Name()
- file.WriteString(contents)
- file.Close()
- return path
-}
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/key_agreement.go b/runtimes/google/ipc/stream/crypto/tlsfork/key_agreement.go
deleted file mode 100644
index 1387add..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/key_agreement.go
+++ /dev/null
@@ -1,415 +0,0 @@
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.4
-
-package tls
-
-import (
- "crypto"
- "crypto/ecdsa"
- "crypto/elliptic"
- "crypto/md5"
- "crypto/rsa"
- "crypto/sha1"
- "crypto/sha256"
- "crypto/x509"
- "encoding/asn1"
- "errors"
- "io"
- "math/big"
-)
-
-var errClientKeyExchange = errors.New("tls: invalid ClientKeyExchange message")
-var errServerKeyExchange = errors.New("tls: invalid ServerKeyExchange message")
-
-// rsaKeyAgreement implements the standard TLS key agreement where the client
-// encrypts the pre-master secret to the server's public key.
-type rsaKeyAgreement struct{}
-
-func (ka rsaKeyAgreement) generateServerKeyExchange(config *Config, cert *Certificate, clientHello *clientHelloMsg, hello *serverHelloMsg) (*serverKeyExchangeMsg, error) {
- return nil, nil
-}
-
-func (ka rsaKeyAgreement) processClientKeyExchange(config *Config, cert *Certificate, ckx *clientKeyExchangeMsg, version uint16) ([]byte, error) {
- preMasterSecret := make([]byte, 48)
- _, err := io.ReadFull(config.rand(), preMasterSecret[2:])
- if err != nil {
- return nil, err
- }
-
- if len(ckx.ciphertext) < 2 {
- return nil, errClientKeyExchange
- }
-
- ciphertext := ckx.ciphertext
- if version != VersionSSL30 {
- ciphertextLen := int(ckx.ciphertext[0])<<8 | int(ckx.ciphertext[1])
- if ciphertextLen != len(ckx.ciphertext)-2 {
- return nil, errClientKeyExchange
- }
- ciphertext = ckx.ciphertext[2:]
- }
-
- err = rsa.DecryptPKCS1v15SessionKey(config.rand(), cert.PrivateKey.(*rsa.PrivateKey), ciphertext, preMasterSecret)
- if err != nil {
- return nil, err
- }
- // We don't check the version number in the premaster secret. For one,
- // by checking it, we would leak information about the validity of the
- // encrypted pre-master secret. Secondly, it provides only a small
- // benefit against a downgrade attack and some implementations send the
- // wrong version anyway. See the discussion at the end of section
- // 7.4.7.1 of RFC 4346.
- return preMasterSecret, nil
-}
-
-func (ka rsaKeyAgreement) processServerKeyExchange(config *Config, clientHello *clientHelloMsg, serverHello *serverHelloMsg, cert *x509.Certificate, skx *serverKeyExchangeMsg) error {
- return errors.New("tls: unexpected ServerKeyExchange")
-}
-
-func (ka rsaKeyAgreement) generateClientKeyExchange(config *Config, clientHello *clientHelloMsg, cert *x509.Certificate) ([]byte, *clientKeyExchangeMsg, error) {
- preMasterSecret := make([]byte, 48)
- preMasterSecret[0] = byte(clientHello.vers >> 8)
- preMasterSecret[1] = byte(clientHello.vers)
- _, err := io.ReadFull(config.rand(), preMasterSecret[2:])
- if err != nil {
- return nil, nil, err
- }
-
- encrypted, err := rsa.EncryptPKCS1v15(config.rand(), cert.PublicKey.(*rsa.PublicKey), preMasterSecret)
- if err != nil {
- return nil, nil, err
- }
- ckx := new(clientKeyExchangeMsg)
- ckx.ciphertext = make([]byte, len(encrypted)+2)
- ckx.ciphertext[0] = byte(len(encrypted) >> 8)
- ckx.ciphertext[1] = byte(len(encrypted))
- copy(ckx.ciphertext[2:], encrypted)
- return preMasterSecret, ckx, nil
-}
-
-// sha1Hash calculates a SHA1 hash over the given byte slices.
-func sha1Hash(slices [][]byte) []byte {
- hsha1 := sha1.New()
- for _, slice := range slices {
- hsha1.Write(slice)
- }
- return hsha1.Sum(nil)
-}
-
-// md5SHA1Hash implements TLS 1.0's hybrid hash function which consists of the
-// concatenation of an MD5 and SHA1 hash.
-func md5SHA1Hash(slices [][]byte) []byte {
- md5sha1 := make([]byte, md5.Size+sha1.Size)
- hmd5 := md5.New()
- for _, slice := range slices {
- hmd5.Write(slice)
- }
- copy(md5sha1, hmd5.Sum(nil))
- copy(md5sha1[md5.Size:], sha1Hash(slices))
- return md5sha1
-}
-
-// sha256Hash implements TLS 1.2's hash function.
-func sha256Hash(slices [][]byte) []byte {
- h := sha256.New()
- for _, slice := range slices {
- h.Write(slice)
- }
- return h.Sum(nil)
-}
-
-// hashForServerKeyExchange hashes the given slices and returns their digest
-// and the identifier of the hash function used. The hashFunc argument is only
-// used for >= TLS 1.2 and precisely identifies the hash function to use.
-func hashForServerKeyExchange(sigType, hashFunc uint8, version uint16, slices ...[]byte) ([]byte, crypto.Hash, error) {
- if version >= VersionTLS12 {
- switch hashFunc {
- case hashSHA256:
- return sha256Hash(slices), crypto.SHA256, nil
- case hashSHA1:
- return sha1Hash(slices), crypto.SHA1, nil
- default:
- return nil, crypto.Hash(0), errors.New("tls: unknown hash function used by peer")
- }
- }
- if sigType == signatureECDSA {
- return sha1Hash(slices), crypto.SHA1, nil
- }
- return md5SHA1Hash(slices), crypto.MD5SHA1, nil
-}
-
-// pickTLS12HashForSignature returns a TLS 1.2 hash identifier for signing a
-// ServerKeyExchange given the signature type being used and the client's
-// advertised list of supported signature and hash combinations.
-func pickTLS12HashForSignature(sigType uint8, clientSignatureAndHashes []signatureAndHash) (uint8, error) {
- if len(clientSignatureAndHashes) == 0 {
- // If the client didn't specify any signature_algorithms
- // extension then we can assume that it supports SHA1. See
- // http://tools.ietf.org/html/rfc5246#section-7.4.1.4.1
- return hashSHA1, nil
- }
-
- for _, sigAndHash := range clientSignatureAndHashes {
- if sigAndHash.signature != sigType {
- continue
- }
- switch sigAndHash.hash {
- case hashSHA1, hashSHA256:
- return sigAndHash.hash, nil
- }
- }
-
- return 0, errors.New("tls: client doesn't support any common hash functions")
-}
-
-func curveForCurveID(id CurveID) (elliptic.Curve, bool) {
- switch id {
- case CurveP256:
- return elliptic.P256(), true
- case CurveP384:
- return elliptic.P384(), true
- case CurveP521:
- return elliptic.P521(), true
- default:
- return nil, false
- }
-
-}
-
-// ecdheRSAKeyAgreement implements a TLS key agreement where the server
-// generates a ephemeral EC public/private key pair and signs it. The
-// pre-master secret is then calculated using ECDH. The signature may
-// either be ECDSA or RSA.
-type ecdheKeyAgreement struct {
- version uint16
- sigType uint8
- privateKey []byte
- curve elliptic.Curve
- x, y *big.Int
-}
-
-func (ka *ecdheKeyAgreement) generateServerKeyExchange(config *Config, cert *Certificate, clientHello *clientHelloMsg, hello *serverHelloMsg) (*serverKeyExchangeMsg, error) {
- var curveid CurveID
- preferredCurves := config.curvePreferences()
-
-NextCandidate:
- for _, candidate := range preferredCurves {
- for _, c := range clientHello.supportedCurves {
- if candidate == c {
- curveid = c
- break NextCandidate
- }
- }
- }
-
- if curveid == 0 {
- return nil, errors.New("tls: no supported elliptic curves offered")
- }
-
- var ok bool
- if ka.curve, ok = curveForCurveID(curveid); !ok {
- return nil, errors.New("tls: preferredCurves includes unsupported curve")
- }
-
- var x, y *big.Int
- var err error
- ka.privateKey, x, y, err = elliptic.GenerateKey(ka.curve, config.rand())
- if err != nil {
- return nil, err
- }
- ecdhePublic := elliptic.Marshal(ka.curve, x, y)
-
- // http://tools.ietf.org/html/rfc4492#section-5.4
- serverECDHParams := make([]byte, 1+2+1+len(ecdhePublic))
- serverECDHParams[0] = 3 // named curve
- serverECDHParams[1] = byte(curveid >> 8)
- serverECDHParams[2] = byte(curveid)
- serverECDHParams[3] = byte(len(ecdhePublic))
- copy(serverECDHParams[4:], ecdhePublic)
-
- var tls12HashId uint8
- if ka.version >= VersionTLS12 {
- if tls12HashId, err = pickTLS12HashForSignature(ka.sigType, clientHello.signatureAndHashes); err != nil {
- return nil, err
- }
- }
-
- digest, hashFunc, err := hashForServerKeyExchange(ka.sigType, tls12HashId, ka.version, clientHello.random, hello.random, serverECDHParams)
- if err != nil {
- return nil, err
- }
- var sig []byte
- switch ka.sigType {
- case signatureECDSA:
- privKey, ok := cert.PrivateKey.(*ecdsa.PrivateKey)
- if !ok {
- return nil, errors.New("ECDHE ECDSA requires an ECDSA server private key")
- }
- r, s, err := ecdsa.Sign(config.rand(), privKey, digest)
- if err != nil {
- return nil, errors.New("failed to sign ECDHE parameters: " + err.Error())
- }
- sig, err = asn1.Marshal(ecdsaSignature{r, s})
- case signatureRSA:
- privKey, ok := cert.PrivateKey.(*rsa.PrivateKey)
- if !ok {
- return nil, errors.New("ECDHE RSA requires a RSA server private key")
- }
- sig, err = rsa.SignPKCS1v15(config.rand(), privKey, hashFunc, digest)
- if err != nil {
- return nil, errors.New("failed to sign ECDHE parameters: " + err.Error())
- }
- default:
- return nil, errors.New("unknown ECDHE signature algorithm")
- }
-
- skx := new(serverKeyExchangeMsg)
- sigAndHashLen := 0
- if ka.version >= VersionTLS12 {
- sigAndHashLen = 2
- }
- skx.key = make([]byte, len(serverECDHParams)+sigAndHashLen+2+len(sig))
- copy(skx.key, serverECDHParams)
- k := skx.key[len(serverECDHParams):]
- if ka.version >= VersionTLS12 {
- k[0] = tls12HashId
- k[1] = ka.sigType
- k = k[2:]
- }
- k[0] = byte(len(sig) >> 8)
- k[1] = byte(len(sig))
- copy(k[2:], sig)
-
- return skx, nil
-}
-
-func (ka *ecdheKeyAgreement) processClientKeyExchange(config *Config, cert *Certificate, ckx *clientKeyExchangeMsg, version uint16) ([]byte, error) {
- if len(ckx.ciphertext) == 0 || int(ckx.ciphertext[0]) != len(ckx.ciphertext)-1 {
- return nil, errClientKeyExchange
- }
- x, y := elliptic.Unmarshal(ka.curve, ckx.ciphertext[1:])
- if x == nil {
- return nil, errClientKeyExchange
- }
- if !ka.curve.IsOnCurve(x, y) {
- return nil, errClientKeyExchange
- }
- x, _ = ka.curve.ScalarMult(x, y, ka.privateKey)
- preMasterSecret := make([]byte, (ka.curve.Params().BitSize+7)>>3)
- xBytes := x.Bytes()
- copy(preMasterSecret[len(preMasterSecret)-len(xBytes):], xBytes)
-
- return preMasterSecret, nil
-}
-
-func (ka *ecdheKeyAgreement) processServerKeyExchange(config *Config, clientHello *clientHelloMsg, serverHello *serverHelloMsg, cert *x509.Certificate, skx *serverKeyExchangeMsg) error {
- if len(skx.key) < 4 {
- return errServerKeyExchange
- }
- if skx.key[0] != 3 { // named curve
- return errors.New("tls: server selected unsupported curve")
- }
- curveid := CurveID(skx.key[1])<<8 | CurveID(skx.key[2])
-
- var ok bool
- if ka.curve, ok = curveForCurveID(curveid); !ok {
- return errors.New("tls: server selected unsupported curve")
- }
-
- publicLen := int(skx.key[3])
- if publicLen+4 > len(skx.key) {
- return errServerKeyExchange
- }
- ka.x, ka.y = elliptic.Unmarshal(ka.curve, skx.key[4:4+publicLen])
- if ka.x == nil {
- return errServerKeyExchange
- }
- if !ka.curve.IsOnCurve(ka.x, ka.y) {
- return errServerKeyExchange
- }
- serverECDHParams := skx.key[:4+publicLen]
-
- sig := skx.key[4+publicLen:]
- if len(sig) < 2 {
- return errServerKeyExchange
- }
-
- var tls12HashId uint8
- if ka.version >= VersionTLS12 {
- // handle SignatureAndHashAlgorithm
- var sigAndHash []uint8
- sigAndHash, sig = sig[:2], sig[2:]
- if sigAndHash[1] != ka.sigType {
- return errServerKeyExchange
- }
- tls12HashId = sigAndHash[0]
- if len(sig) < 2 {
- return errServerKeyExchange
- }
- }
- sigLen := int(sig[0])<<8 | int(sig[1])
- if sigLen+2 != len(sig) {
- return errServerKeyExchange
- }
- sig = sig[2:]
-
- digest, hashFunc, err := hashForServerKeyExchange(ka.sigType, tls12HashId, ka.version, clientHello.random, serverHello.random, serverECDHParams)
- if err != nil {
- return err
- }
- switch ka.sigType {
- case signatureECDSA:
- pubKey, ok := cert.PublicKey.(*ecdsa.PublicKey)
- if !ok {
- return errors.New("ECDHE ECDSA requires a ECDSA server public key")
- }
- ecdsaSig := new(ecdsaSignature)
- if _, err := asn1.Unmarshal(sig, ecdsaSig); err != nil {
- return err
- }
- if ecdsaSig.R.Sign() <= 0 || ecdsaSig.S.Sign() <= 0 {
- return errors.New("ECDSA signature contained zero or negative values")
- }
- if !ecdsa.Verify(pubKey, digest, ecdsaSig.R, ecdsaSig.S) {
- return errors.New("ECDSA verification failure")
- }
- case signatureRSA:
- pubKey, ok := cert.PublicKey.(*rsa.PublicKey)
- if !ok {
- return errors.New("ECDHE RSA requires a RSA server public key")
- }
- if err := rsa.VerifyPKCS1v15(pubKey, hashFunc, digest, sig); err != nil {
- return err
- }
- default:
- return errors.New("unknown ECDHE signature algorithm")
- }
-
- return nil
-}
-
-func (ka *ecdheKeyAgreement) generateClientKeyExchange(config *Config, clientHello *clientHelloMsg, cert *x509.Certificate) ([]byte, *clientKeyExchangeMsg, error) {
- if ka.curve == nil {
- return nil, nil, errors.New("missing ServerKeyExchange message")
- }
- priv, mx, my, err := elliptic.GenerateKey(ka.curve, config.rand())
- if err != nil {
- return nil, nil, err
- }
- x, _ := ka.curve.ScalarMult(ka.x, ka.y, priv)
- preMasterSecret := make([]byte, (ka.curve.Params().BitSize+7)>>3)
- xBytes := x.Bytes()
- copy(preMasterSecret[len(preMasterSecret)-len(xBytes):], xBytes)
-
- serialized := elliptic.Marshal(ka.curve, mx, my)
-
- ckx := new(clientKeyExchangeMsg)
- ckx.ciphertext = make([]byte, 1+len(serialized))
- ckx.ciphertext[0] = byte(len(serialized))
- copy(ckx.ciphertext[1:], serialized)
-
- return preMasterSecret, ckx, nil
-}
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/prf.go b/runtimes/google/ipc/stream/crypto/tlsfork/prf.go
deleted file mode 100644
index 522eda3..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/prf.go
+++ /dev/null
@@ -1,293 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.4
-
-package tls
-
-import (
- "crypto"
- "crypto/hmac"
- "crypto/md5"
- "crypto/sha1"
- "crypto/sha256"
- "hash"
-)
-
-// Split a premaster secret in two as specified in RFC 4346, section 5.
-func splitPreMasterSecret(secret []byte) (s1, s2 []byte) {
- s1 = secret[0 : (len(secret)+1)/2]
- s2 = secret[len(secret)/2:]
- return
-}
-
-// pHash implements the P_hash function, as defined in RFC 4346, section 5.
-func pHash(result, secret, seed []byte, hash func() hash.Hash) {
- h := hmac.New(hash, secret)
- h.Write(seed)
- a := h.Sum(nil)
-
- j := 0
- for j < len(result) {
- h.Reset()
- h.Write(a)
- h.Write(seed)
- b := h.Sum(nil)
- todo := len(b)
- if j+todo > len(result) {
- todo = len(result) - j
- }
- copy(result[j:j+todo], b)
- j += todo
-
- h.Reset()
- h.Write(a)
- a = h.Sum(nil)
- }
-}
-
-// prf10 implements the TLS 1.0 pseudo-random function, as defined in RFC 2246, section 5.
-func prf10(result, secret, label, seed []byte) {
- hashSHA1 := sha1.New
- hashMD5 := md5.New
-
- labelAndSeed := make([]byte, len(label)+len(seed))
- copy(labelAndSeed, label)
- copy(labelAndSeed[len(label):], seed)
-
- s1, s2 := splitPreMasterSecret(secret)
- pHash(result, s1, labelAndSeed, hashMD5)
- result2 := make([]byte, len(result))
- pHash(result2, s2, labelAndSeed, hashSHA1)
-
- for i, b := range result2 {
- result[i] ^= b
- }
-}
-
-// prf12 implements the TLS 1.2 pseudo-random function, as defined in RFC 5246, section 5.
-func prf12(result, secret, label, seed []byte) {
- labelAndSeed := make([]byte, len(label)+len(seed))
- copy(labelAndSeed, label)
- copy(labelAndSeed[len(label):], seed)
-
- pHash(result, secret, labelAndSeed, sha256.New)
-}
-
-// prf30 implements the SSL 3.0 pseudo-random function, as defined in
-// www.mozilla.org/projects/security/pki/nss/ssl/draft302.txt section 6.
-func prf30(result, secret, label, seed []byte) {
- hashSHA1 := sha1.New()
- hashMD5 := md5.New()
-
- done := 0
- i := 0
- // RFC5246 section 6.3 says that the largest PRF output needed is 128
- // bytes. Since no more ciphersuites will be added to SSLv3, this will
- // remain true. Each iteration gives us 16 bytes so 10 iterations will
- // be sufficient.
- var b [11]byte
- for done < len(result) {
- for j := 0; j <= i; j++ {
- b[j] = 'A' + byte(i)
- }
-
- hashSHA1.Reset()
- hashSHA1.Write(b[:i+1])
- hashSHA1.Write(secret)
- hashSHA1.Write(seed)
- digest := hashSHA1.Sum(nil)
-
- hashMD5.Reset()
- hashMD5.Write(secret)
- hashMD5.Write(digest)
-
- done += copy(result[done:], hashMD5.Sum(nil))
- i++
- }
-}
-
-const (
- tlsRandomLength = 32 // Length of a random nonce in TLS 1.1.
- masterSecretLength = 48 // Length of a master secret in TLS 1.1.
- finishedVerifyLength = 12 // Length of verify_data in a Finished message.
-)
-
-var masterSecretLabel = []byte("master secret")
-var keyExpansionLabel = []byte("key expansion")
-var clientFinishedLabel = []byte("client finished")
-var serverFinishedLabel = []byte("server finished")
-
-func prfForVersion(version uint16) func(result, secret, label, seed []byte) {
- switch version {
- case VersionSSL30:
- return prf30
- case VersionTLS10, VersionTLS11:
- return prf10
- case VersionTLS12:
- return prf12
- default:
- panic("unknown version")
- }
-}
-
-// masterFromPreMasterSecret generates the master secret from the pre-master
-// secret. See http://tools.ietf.org/html/rfc5246#section-8.1
-func masterFromPreMasterSecret(version uint16, preMasterSecret, clientRandom, serverRandom []byte) []byte {
- var seed [tlsRandomLength * 2]byte
- copy(seed[0:len(clientRandom)], clientRandom)
- copy(seed[len(clientRandom):], serverRandom)
- masterSecret := make([]byte, masterSecretLength)
- prfForVersion(version)(masterSecret, preMasterSecret, masterSecretLabel, seed[0:])
- return masterSecret
-}
-
-// keysFromMasterSecret generates the connection keys from the master
-// secret, given the lengths of the MAC key, cipher key and IV, as defined in
-// RFC 2246, section 6.3.
-func keysFromMasterSecret(version uint16, masterSecret, clientRandom, serverRandom []byte, macLen, keyLen, ivLen int) (clientMAC, serverMAC, clientKey, serverKey, clientIV, serverIV []byte) {
- var seed [tlsRandomLength * 2]byte
- copy(seed[0:len(clientRandom)], serverRandom)
- copy(seed[len(serverRandom):], clientRandom)
-
- n := 2*macLen + 2*keyLen + 2*ivLen
- keyMaterial := make([]byte, n)
- prfForVersion(version)(keyMaterial, masterSecret, keyExpansionLabel, seed[0:])
- clientMAC = keyMaterial[:macLen]
- keyMaterial = keyMaterial[macLen:]
- serverMAC = keyMaterial[:macLen]
- keyMaterial = keyMaterial[macLen:]
- clientKey = keyMaterial[:keyLen]
- keyMaterial = keyMaterial[keyLen:]
- serverKey = keyMaterial[:keyLen]
- keyMaterial = keyMaterial[keyLen:]
- clientIV = keyMaterial[:ivLen]
- keyMaterial = keyMaterial[ivLen:]
- serverIV = keyMaterial[:ivLen]
- return
-}
-
-func newFinishedHash(version uint16) finishedHash {
- if version >= VersionTLS12 {
- return finishedHash{sha256.New(), sha256.New(), nil, nil, version}
- }
- return finishedHash{sha1.New(), sha1.New(), md5.New(), md5.New(), version}
-}
-
-// A finishedHash calculates the hash of a set of handshake messages suitable
-// for including in a Finished message.
-type finishedHash struct {
- client hash.Hash
- server hash.Hash
-
- // Prior to TLS 1.2, an additional MD5 hash is required.
- clientMD5 hash.Hash
- serverMD5 hash.Hash
-
- version uint16
-}
-
-func (h finishedHash) Write(msg []byte) (n int, err error) {
- h.client.Write(msg)
- h.server.Write(msg)
-
- if h.version < VersionTLS12 {
- h.clientMD5.Write(msg)
- h.serverMD5.Write(msg)
- }
- return len(msg), nil
-}
-
-// finishedSum30 calculates the contents of the verify_data member of a SSLv3
-// Finished message given the MD5 and SHA1 hashes of a set of handshake
-// messages.
-func finishedSum30(md5, sha1 hash.Hash, masterSecret []byte, magic [4]byte) []byte {
- md5.Write(magic[:])
- md5.Write(masterSecret)
- md5.Write(ssl30Pad1[:])
- md5Digest := md5.Sum(nil)
-
- md5.Reset()
- md5.Write(masterSecret)
- md5.Write(ssl30Pad2[:])
- md5.Write(md5Digest)
- md5Digest = md5.Sum(nil)
-
- sha1.Write(magic[:])
- sha1.Write(masterSecret)
- sha1.Write(ssl30Pad1[:40])
- sha1Digest := sha1.Sum(nil)
-
- sha1.Reset()
- sha1.Write(masterSecret)
- sha1.Write(ssl30Pad2[:40])
- sha1.Write(sha1Digest)
- sha1Digest = sha1.Sum(nil)
-
- ret := make([]byte, len(md5Digest)+len(sha1Digest))
- copy(ret, md5Digest)
- copy(ret[len(md5Digest):], sha1Digest)
- return ret
-}
-
-var ssl3ClientFinishedMagic = [4]byte{0x43, 0x4c, 0x4e, 0x54}
-var ssl3ServerFinishedMagic = [4]byte{0x53, 0x52, 0x56, 0x52}
-
-// clientSum returns the contents of the verify_data member of a client's
-// Finished message.
-func (h finishedHash) clientSum(masterSecret []byte) []byte {
- if h.version == VersionSSL30 {
- return finishedSum30(h.clientMD5, h.client, masterSecret, ssl3ClientFinishedMagic)
- }
-
- out := make([]byte, finishedVerifyLength)
- if h.version >= VersionTLS12 {
- seed := h.client.Sum(nil)
- prf12(out, masterSecret, clientFinishedLabel, seed)
- } else {
- seed := make([]byte, 0, md5.Size+sha1.Size)
- seed = h.clientMD5.Sum(seed)
- seed = h.client.Sum(seed)
- prf10(out, masterSecret, clientFinishedLabel, seed)
- }
- return out
-}
-
-// serverSum returns the contents of the verify_data member of a server's
-// Finished message.
-func (h finishedHash) serverSum(masterSecret []byte) []byte {
- if h.version == VersionSSL30 {
- return finishedSum30(h.serverMD5, h.server, masterSecret, ssl3ServerFinishedMagic)
- }
-
- out := make([]byte, finishedVerifyLength)
- if h.version >= VersionTLS12 {
- seed := h.server.Sum(nil)
- prf12(out, masterSecret, serverFinishedLabel, seed)
- } else {
- seed := make([]byte, 0, md5.Size+sha1.Size)
- seed = h.serverMD5.Sum(seed)
- seed = h.server.Sum(seed)
- prf10(out, masterSecret, serverFinishedLabel, seed)
- }
- return out
-}
-
-// hashForClientCertificate returns a digest, hash function, and TLS 1.2 hash
-// id suitable for signing by a TLS client certificate.
-func (h finishedHash) hashForClientCertificate(sigType uint8) ([]byte, crypto.Hash, uint8) {
- if h.version >= VersionTLS12 {
- digest := h.server.Sum(nil)
- return digest, crypto.SHA256, hashSHA256
- }
- if sigType == signatureECDSA {
- digest := h.server.Sum(nil)
- return digest, crypto.SHA1, hashSHA1
- }
-
- digest := make([]byte, 0, 36)
- digest = h.serverMD5.Sum(digest)
- digest = h.server.Sum(digest)
- return digest, crypto.MD5SHA1, 0 /* not specified in TLS 1.2. */
-}
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/prf_test.go b/runtimes/google/ipc/stream/crypto/tlsfork/prf_test.go
deleted file mode 100644
index 940b03d..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/prf_test.go
+++ /dev/null
@@ -1,128 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.4
-
-package tls
-
-import (
- "encoding/hex"
- "testing"
-)
-
-type testSplitPreMasterSecretTest struct {
- in, out1, out2 string
-}
-
-var testSplitPreMasterSecretTests = []testSplitPreMasterSecretTest{
- {"", "", ""},
- {"00", "00", "00"},
- {"0011", "00", "11"},
- {"001122", "0011", "1122"},
- {"00112233", "0011", "2233"},
-}
-
-func TestSplitPreMasterSecret(t *testing.T) {
- for i, test := range testSplitPreMasterSecretTests {
- in, _ := hex.DecodeString(test.in)
- out1, out2 := splitPreMasterSecret(in)
- s1 := hex.EncodeToString(out1)
- s2 := hex.EncodeToString(out2)
- if s1 != test.out1 || s2 != test.out2 {
- t.Errorf("#%d: got: (%s, %s) want: (%s, %s)", i, s1, s2, test.out1, test.out2)
- }
- }
-}
-
-type testKeysFromTest struct {
- version uint16
- preMasterSecret string
- clientRandom, serverRandom string
- masterSecret string
- clientMAC, serverMAC string
- clientKey, serverKey string
- macLen, keyLen int
-}
-
-func TestKeysFromPreMasterSecret(t *testing.T) {
- for i, test := range testKeysFromTests {
- in, _ := hex.DecodeString(test.preMasterSecret)
- clientRandom, _ := hex.DecodeString(test.clientRandom)
- serverRandom, _ := hex.DecodeString(test.serverRandom)
-
- masterSecret := masterFromPreMasterSecret(test.version, in, clientRandom, serverRandom)
- if s := hex.EncodeToString(masterSecret); s != test.masterSecret {
- t.Errorf("#%d: bad master secret %s, want %s", i, s, test.masterSecret)
- continue
- }
-
- clientMAC, serverMAC, clientKey, serverKey, _, _ := keysFromMasterSecret(test.version, masterSecret, clientRandom, serverRandom, test.macLen, test.keyLen, 0)
- clientMACString := hex.EncodeToString(clientMAC)
- serverMACString := hex.EncodeToString(serverMAC)
- clientKeyString := hex.EncodeToString(clientKey)
- serverKeyString := hex.EncodeToString(serverKey)
- if clientMACString != test.clientMAC ||
- serverMACString != test.serverMAC ||
- clientKeyString != test.clientKey ||
- serverKeyString != test.serverKey {
- t.Errorf("#%d: got: (%s, %s, %s, %s) want: (%s, %s, %s, %s)", i, clientMACString, serverMACString, clientKeyString, serverKeyString, test.clientMAC, test.serverMAC, test.clientKey, test.serverKey)
- }
- }
-}
-
-// These test vectors were generated from GnuTLS using `gnutls-cli --insecure -d 9 `
-var testKeysFromTests = []testKeysFromTest{
- {
- VersionTLS10,
- "0302cac83ad4b1db3b9ab49ad05957de2a504a634a386fc600889321e1a971f57479466830ac3e6f468e87f5385fa0c5",
- "4ae66303755184a3917fcb44880605fcc53baa01912b22ed94473fc69cebd558",
- "4ae663020ec16e6bb5130be918cfcafd4d765979a3136a5d50c593446e4e44db",
- "3d851bab6e5556e959a16bc36d66cfae32f672bfa9ecdef6096cbb1b23472df1da63dbbd9827606413221d149ed08ceb",
- "805aaa19b3d2c0a0759a4b6c9959890e08480119",
- "2d22f9fe519c075c16448305ceee209fc24ad109",
- "d50b5771244f850cd8117a9ccafe2cf1",
- "e076e33206b30507a85c32855acd0919",
- 20,
- 16,
- },
- {
- VersionTLS10,
- "03023f7527316bc12cbcd69e4b9e8275d62c028f27e65c745cfcddc7ce01bd3570a111378b63848127f1c36e5f9e4890",
- "4ae66364b5ea56b20ce4e25555aed2d7e67f42788dd03f3fee4adae0459ab106",
- "4ae66363ab815cbf6a248b87d6b556184e945e9b97fbdf247858b0bdafacfa1c",
- "7d64be7c80c59b740200b4b9c26d0baaa1c5ae56705acbcf2307fe62beb4728c19392c83f20483801cce022c77645460",
- "97742ed60a0554ca13f04f97ee193177b971e3b0",
- "37068751700400e03a8477a5c7eec0813ab9e0dc",
- "207cddbc600d2a200abac6502053ee5c",
- "df3f94f6e1eacc753b815fe16055cd43",
- 20,
- 16,
- },
- {
- VersionTLS10,
- "832d515f1d61eebb2be56ba0ef79879efb9b527504abb386fb4310ed5d0e3b1f220d3bb6b455033a2773e6d8bdf951d278a187482b400d45deb88a5d5a6bb7d6a7a1decc04eb9ef0642876cd4a82d374d3b6ff35f0351dc5d411104de431375355addc39bfb1f6329fb163b0bc298d658338930d07d313cd980a7e3d9196cac1",
- "4ae663b2ee389c0de147c509d8f18f5052afc4aaf9699efe8cb05ece883d3a5e",
- "4ae664d503fd4cff50cfc1fb8fc606580f87b0fcdac9554ba0e01d785bdf278e",
- "1aff2e7a2c4279d0126f57a65a77a8d9d0087cf2733366699bec27eb53d5740705a8574bb1acc2abbe90e44f0dd28d6c",
- "3c7647c93c1379a31a609542aa44e7f117a70085",
- "0d73102994be74a575a3ead8532590ca32a526d4",
- "ac7581b0b6c10d85bbd905ffbf36c65e",
- "ff07edde49682b45466bd2e39464b306",
- 20,
- 16,
- },
- {
- VersionSSL30,
- "832d515f1d61eebb2be56ba0ef79879efb9b527504abb386fb4310ed5d0e3b1f220d3bb6b455033a2773e6d8bdf951d278a187482b400d45deb88a5d5a6bb7d6a7a1decc04eb9ef0642876cd4a82d374d3b6ff35f0351dc5d411104de431375355addc39bfb1f6329fb163b0bc298d658338930d07d313cd980a7e3d9196cac1",
- "4ae663b2ee389c0de147c509d8f18f5052afc4aaf9699efe8cb05ece883d3a5e",
- "4ae664d503fd4cff50cfc1fb8fc606580f87b0fcdac9554ba0e01d785bdf278e",
- "a614863e56299dcffeea2938f22c2ba023768dbe4b3f6877bc9c346c6ae529b51d9cb87ff9695ea4d01f2205584405b2",
- "2c450d5b6f6e2013ac6bea6a0b32200d4e1ffb94",
- "7a7a7438769536f2fb1ae49a61f0703b79b2dc53",
- "f8f6b26c10f12855c9aafb1e0e839ccf",
- "2b9d4b4a60cb7f396780ebff50650419",
- 20,
- 16,
- },
-}
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv10-ClientCert-ECDSA-ECDSA b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv10-ClientCert-ECDSA-ECDSA
deleted file mode 100644
index 00722cb..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv10-ClientCert-ECDSA-ECDSA
+++ /dev/null
@@ -1,129 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
->>> Flow 2 (server to client)
-00000000 16 03 01 00 59 02 00 00 55 03 01 53 04 f1 03 46 |....Y...U..S...F|
-00000010 0f 84 c4 cb 55 ef 85 f6 4f d7 0e e1 4b 10 d4 bb |....U...O...K...|
-00000020 35 87 2d f3 d7 18 ec 4e 95 4b f4 20 28 82 94 d9 |5.-....N.K. (...|
-00000030 df c4 fc ee 21 23 c1 e2 76 3e 7b 09 af 2c 39 23 |....!#..v>{..,9#|
-00000040 f8 46 6c 31 88 42 f0 79 de 37 2b 00 c0 09 00 00 |.Fl1.B.y.7+.....|
-00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
-00000060 01 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..|
-00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....|
-00000080 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 0b 30 |0...*.H.=..0E1.0|
-00000090 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...|
-000000a0 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1|
-000000b0 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern|
-000000c0 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L|
-000000d0 74 64 30 1e 17 0d 31 32 31 31 32 32 31 35 30 36 |td0...1211221506|
-000000e0 33 32 5a 17 0d 32 32 31 31 32 30 31 35 30 36 33 |32Z..22112015063|
-000000f0 32 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 |2Z0E1.0...U....A|
-00000100 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 |U1.0...U....Some|
-00000110 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 |-State1!0...U...|
-00000120 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 |.Internet Widgit|
-00000130 73 20 50 74 79 20 4c 74 64 30 81 9b 30 10 06 07 |s Pty Ltd0..0...|
-00000140 2a 86 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 |*.H.=....+...#..|
-00000150 86 00 04 00 c4 a1 ed be 98 f9 0b 48 73 36 7e c3 |...........Hs6~.|
-00000160 16 56 11 22 f2 3d 53 c3 3b 4d 21 3d cd 6b 75 e6 |.V.".=S.;M!=.ku.|
-00000170 f6 b0 dc 9a df 26 c1 bc b2 87 f0 72 32 7c b3 64 |.....&.....r2|.d|
-00000180 2f 1c 90 bc ea 68 23 10 7e fe e3 25 c0 48 3a 69 |/....h#.~..%.H:i|
-00000190 e0 28 6d d3 37 00 ef 04 62 dd 0d a0 9c 70 62 83 |.(m.7...b....pb.|
-000001a0 d8 81 d3 64 31 aa 9e 97 31 bd 96 b0 68 c0 9b 23 |...d1...1...h..#|
-000001b0 de 76 64 3f 1a 5c 7f e9 12 0e 58 58 b6 5f 70 dd |.vd?.\....XX._p.|
-000001c0 9b d8 ea d5 d7 f5 d5 cc b9 b6 9f 30 66 5b 66 9a |...........0f[f.|
-000001d0 20 e2 27 e5 bf fe 3b 30 09 06 07 2a 86 48 ce 3d | .'...;0...*.H.=|
-000001e0 04 01 03 81 8c 00 30 81 88 02 42 01 88 a2 4f eb |......0...B...O.|
-000001f0 e2 45 c5 48 7d 1b ac f5 ed 98 9d ae 47 70 c0 5e |.E.H}.......Gp.^|
-00000200 1b b6 2f bd f1 b6 4d b7 61 40 d3 11 a2 ce ee 0b |../...M.a@......|
-00000210 7e 92 7e ff 76 9d c3 3b 7e a5 3f ce fa 10 e2 59 |~.~.v..;~.?....Y|
-00000220 ec 47 2d 7c ac da 4e 97 0e 15 a0 6f d0 02 42 01 |.G-|..N....o..B.|
-00000230 4d fc be 67 13 9c 2d 05 0e bd 3f a3 8c 25 c1 33 |M..g..-...?..%.3|
-00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....|
-00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.|
-00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....|
-00000270 2a 16 03 01 00 d5 0c 00 00 d1 03 00 17 41 04 4f |*............A.O|
-00000280 47 16 72 98 9e 9f 2e 8e 78 e9 0f fe 95 83 7b aa |G.r.....x.....{.|
-00000290 e5 3d c0 7d cf 83 bd 22 0b fd 48 f1 a7 49 a5 7d |.=.}..."..H..I.}|
-000002a0 8e 0c 83 7f e1 2d 71 03 cc 90 09 ab f7 35 81 48 |.....-q......5.H|
-000002b0 a4 1e 7d 87 21 23 12 58 2c 47 f3 af c7 6c 71 00 |..}.!#.X,G...lq.|
-000002c0 8a 30 81 87 02 42 00 b4 03 38 60 43 d9 32 ef 64 |.0...B...8`C.2.d|
-000002d0 5a 9c 91 95 0d 10 21 53 c7 78 f8 bf 50 ed 13 5d |Z.....!S.x..P..]|
-000002e0 c3 e7 71 d6 11 04 f1 e4 9d ce 17 99 8d 1a 87 1f |..q.............|
-000002f0 cb dd f8 1b ae cd bc 4a 77 ab 7c 50 bf 73 c3 ea |.......Jw.|P.s..|
-00000300 d6 df 88 56 f6 b1 03 83 02 41 66 3d fb 4e 7e af |...V.....Af=.N~.|
-00000310 4e c1 60 fe 09 fa 7e 74 99 66 7f de b4 b2 74 89 |N.`...~t.f....t.|
-00000320 1c a4 cf 74 1a 55 a5 be 74 f9 36 21 3d ae c8 c3 |...t.U..t.6!=...|
-00000330 24 8e ad db a3 26 67 8f 98 27 e3 93 ee d9 5c fb |$....&g..'....\.|
-00000340 85 82 e2 13 c3 50 ab e9 f6 39 2b 16 03 01 00 0e |.....P...9+.....|
-00000350 0d 00 00 06 03 01 02 40 00 00 0e 00 00 00 |.......@......|
->>> Flow 3 (client to server)
-00000000 16 03 01 02 0a 0b 00 02 06 00 02 03 00 02 00 30 |...............0|
-00000010 82 01 fc 30 82 01 5e 02 09 00 9a 30 84 6c 26 35 |...0..^....0.l&5|
-00000020 d9 17 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 |..0...*.H.=..0E1|
-00000030 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 |.0...U....AU1.0.|
-00000040 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 |..U....Some-Stat|
-00000050 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 |e1!0...U....Inte|
-00000060 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 |rnet Widgits Pty|
-00000070 20 4c 74 64 30 1e 17 0d 31 32 31 31 31 34 31 33 | Ltd0...12111413|
-00000080 32 35 35 33 5a 17 0d 32 32 31 31 31 32 31 33 32 |2553Z..221112132|
-00000090 35 35 33 5a 30 41 31 0b 30 09 06 03 55 04 06 13 |553Z0A1.0...U...|
-000000a0 02 41 55 31 0c 30 0a 06 03 55 04 08 13 03 4e 53 |.AU1.0...U....NS|
-000000b0 57 31 10 30 0e 06 03 55 04 07 13 07 50 79 72 6d |W1.0...U....Pyrm|
-000000c0 6f 6e 74 31 12 30 10 06 03 55 04 03 13 09 4a 6f |ont1.0...U....Jo|
-000000d0 65 6c 20 53 69 6e 67 30 81 9b 30 10 06 07 2a 86 |el Sing0..0...*.|
-000000e0 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 86 00 |H.=....+...#....|
-000000f0 04 00 95 8c 91 75 14 c0 5e c4 57 b4 d4 c3 6f 8d |.....u..^.W...o.|
-00000100 ae 68 1e dd 6f ce 86 e1 7e 6e b2 48 3e 81 e5 4e |.h..o...~n.H>..N|
-00000110 e2 c6 88 4b 64 dc f5 30 bb d3 ff 65 cc 5b f4 dd |...Kd..0...e.[..|
-00000120 b5 6a 3e 3e d0 1d de 47 c3 76 ad 19 f6 45 2c 8c |.j>>...G.v...E,.|
-00000130 bc d8 1d 01 4c 1f 70 90 46 76 48 8b 8f 83 cc 4a |....L.p.FvH....J|
-00000140 5c 8f 40 76 da e0 89 ec 1d 2b c4 4e 30 76 28 41 |\.@v.....+.N0v(A|
-00000150 b2 62 a8 fb 5b f1 f9 4e 7a 8d bd 09 b8 ae ea 8b |.b..[..Nz.......|
-00000160 18 27 4f 2e 70 fe 13 96 ba c3 d3 40 16 cd 65 4e |.'O.p......@..eN|
-00000170 ac 11 1e e6 f1 30 09 06 07 2a 86 48 ce 3d 04 01 |.....0...*.H.=..|
-00000180 03 81 8c 00 30 81 88 02 42 00 e0 14 c4 60 60 0b |....0...B....``.|
-00000190 72 68 b0 32 5d 61 4a 02 74 5c c2 81 b9 16 a8 3f |rh.2]aJ.t\.....?|
-000001a0 29 c8 36 c7 81 ff 6c b6 5b d9 70 f1 38 3b 50 48 |).6...l.[.p.8;PH|
-000001b0 28 94 cb 09 1a 52 f1 5d ee 8d f2 b9 f0 f0 da d9 |(....R.]........|
-000001c0 15 3a f9 bd 03 7a 87 a2 23 35 ec 02 42 01 a3 d4 |.:...z..#5..B...|
-000001d0 8a 78 35 1c 4a 9a 23 d2 0a be 2b 10 31 9d 9c 5f |.x5.J.#...+.1.._|
-000001e0 be e8 91 b3 da 1a f5 5d a3 23 f5 26 8b 45 70 8d |.......].#.&.Ep.|
-000001f0 65 62 9b 7e 01 99 3d 18 f6 10 9a 38 61 9b 2e 57 |eb.~..=....8a..W|
-00000200 e4 fa cc b1 8a ce e2 23 a0 87 f0 e1 67 51 eb 16 |.......#....gQ..|
-00000210 03 01 00 46 10 00 00 42 41 04 1e 18 37 ef 0d 19 |...F...BA...7...|
-00000220 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd a7 |Q.5uq..T[....g..|
-00000230 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 |$ >.V...(^.+-O..|
-00000240 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 |..lK[.V.2B.X..I.|
-00000250 b5 68 1a 41 03 56 6b dc 5a 89 16 03 01 00 90 0f |.h.A.Vk.Z.......|
-00000260 00 00 8c 00 8a 30 81 87 02 42 00 c6 85 8e 06 b7 |.....0...B......|
-00000270 04 04 e9 cd 9e 3e cb 66 23 95 b4 42 9c 64 81 39 |.....>.f#..B.d.9|
-00000280 05 3f b5 21 f8 28 af 60 6b 4d 3d ba a1 4b 5e 77 |.?.!.(.`kM=..K^w|
-00000290 ef e7 59 28 fe 1d c1 27 a2 ff a8 de 33 48 b3 c1 |..Y(...'....3H..|
-000002a0 85 6a 42 9b f9 7e 7e 31 c2 e5 bd 66 02 41 4b 49 |.jB..~~1...f.AKI|
-000002b0 c6 cd 02 e3 83 f7 03 50 18 6d b4 c9 51 02 c0 ab |.......P.m..Q...|
-000002c0 87 bc e0 3e 4b 89 53 3a e2 65 89 97 02 c1 87 f1 |...>K.S:.e......|
-000002d0 67 d0 f2 06 28 4e 51 4e fd f0 01 be 41 3c 52 42 |g...(NQN....A<RB|
-000002e0 10 44 73 88 3e 44 24 bb 2e 77 01 77 6f a8 ac 14 |.Ds.>D$..w.wo...|
-000002f0 03 01 00 01 01 16 03 01 00 30 a3 da 45 22 96 83 |.........0..E"..|
-00000300 59 90 e9 6b ec 3b 77 50 05 89 e6 0c 61 d1 1d 2b |Y..k.;wP....a..+|
-00000310 da d4 49 bf b9 c6 dd ad c3 9c 82 bd 53 62 e8 57 |..I.........Sb.W|
-00000320 a4 6a e7 9f b1 d5 39 77 88 6d |.j....9w.m|
->>> Flow 4 (server to client)
-00000000 14 03 01 00 01 01 16 03 01 00 30 a4 45 dd 99 df |..........0.E...|
-00000010 66 ae f5 c7 bd 1a eb 6a ff ac a6 38 14 81 b5 07 |f......j...8....|
-00000020 86 24 80 f1 09 59 ad 33 3d 43 ed 9e 43 b1 1e 9f |.$...Y.3=C..C...|
-00000030 bd 8c b3 e0 41 83 a1 34 91 c5 a1 |....A..4...|
->>> Flow 5 (client to server)
-00000000 17 03 01 00 20 ae e3 ae 7f 2d e3 a2 f7 1b 4e 69 |.... ....-....Ni|
-00000010 cb 18 c6 68 42 f8 de 61 92 4c fa d6 19 7c 8c 09 |...hB..a.L...|..|
-00000020 82 e2 f2 32 19 17 03 01 00 20 2a 77 65 1f c1 fd |...2..... *we...|
-00000030 5e 37 b7 15 f6 1f 4c 7f 5f 89 52 b4 32 27 4d 17 |^7....L._.R.2'M.|
-00000040 33 c6 e8 50 ac 70 c8 b9 2d 0a 15 03 01 00 20 e0 |3..P.p..-..... .|
-00000050 cb ce 07 80 55 a0 46 ca a7 25 4c 5f 9d 7c 73 37 |....U.F..%L_.|s7|
-00000060 de 72 6d 36 a8 e4 be fd 2a e7 f8 8d 14 80 b7 |.rm6....*......|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv10-ClientCert-ECDSA-RSA b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv10-ClientCert-ECDSA-RSA
deleted file mode 100644
index c0be824..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv10-ClientCert-ECDSA-RSA
+++ /dev/null
@@ -1,125 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
->>> Flow 2 (server to client)
-00000000 16 03 01 00 51 02 00 00 4d 03 01 53 04 f1 02 ed |....Q...M..S....|
-00000010 86 9c 56 84 5a d3 7d d7 f3 4e 6f 2c 69 0d f0 59 |..V.Z.}..No,i..Y|
-00000020 a5 d1 de 2d 03 2f dd 63 c3 ab fa 20 30 d6 5a 24 |...-./.c... 0.Z$|
-00000030 5c 31 67 36 8d 4c 43 e1 64 c4 8a 2c a5 fd 39 92 |\1g6.LC.d..,..9.|
-00000040 c5 6f 58 47 a3 fe 63 14 98 92 11 90 00 05 00 00 |.oXG..c.........|
-00000050 05 ff 01 00 01 00 16 03 01 02 be 0b 00 02 ba 00 |................|
-00000060 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000070 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000080 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000090 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-000000a0 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-000000b0 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000c0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000d0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000e0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000f0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-00000100 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-00000110 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000120 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000130 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000140 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000150 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000160 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000170 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000180 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000190 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-000001a0 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-000001b0 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001c0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001d0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001e0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001f0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-00000200 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-00000210 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000220 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000230 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000240 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000250 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000260 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000270 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000280 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000290 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-000002a0 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-000002b0 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002c0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002d0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002e0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002f0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-00000300 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-00000310 6e 38 50 29 6c 90 a7 bd d9 16 03 01 00 0e 0d 00 |n8P)l...........|
-00000320 00 06 03 01 02 40 00 00 0e 00 00 00 |.....@......|
->>> Flow 3 (client to server)
-00000000 16 03 01 02 0a 0b 00 02 06 00 02 03 00 02 00 30 |...............0|
-00000010 82 01 fc 30 82 01 5e 02 09 00 9a 30 84 6c 26 35 |...0..^....0.l&5|
-00000020 d9 17 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 |..0...*.H.=..0E1|
-00000030 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 |.0...U....AU1.0.|
-00000040 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 |..U....Some-Stat|
-00000050 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 |e1!0...U....Inte|
-00000060 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 |rnet Widgits Pty|
-00000070 20 4c 74 64 30 1e 17 0d 31 32 31 31 31 34 31 33 | Ltd0...12111413|
-00000080 32 35 35 33 5a 17 0d 32 32 31 31 31 32 31 33 32 |2553Z..221112132|
-00000090 35 35 33 5a 30 41 31 0b 30 09 06 03 55 04 06 13 |553Z0A1.0...U...|
-000000a0 02 41 55 31 0c 30 0a 06 03 55 04 08 13 03 4e 53 |.AU1.0...U....NS|
-000000b0 57 31 10 30 0e 06 03 55 04 07 13 07 50 79 72 6d |W1.0...U....Pyrm|
-000000c0 6f 6e 74 31 12 30 10 06 03 55 04 03 13 09 4a 6f |ont1.0...U....Jo|
-000000d0 65 6c 20 53 69 6e 67 30 81 9b 30 10 06 07 2a 86 |el Sing0..0...*.|
-000000e0 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 86 00 |H.=....+...#....|
-000000f0 04 00 95 8c 91 75 14 c0 5e c4 57 b4 d4 c3 6f 8d |.....u..^.W...o.|
-00000100 ae 68 1e dd 6f ce 86 e1 7e 6e b2 48 3e 81 e5 4e |.h..o...~n.H>..N|
-00000110 e2 c6 88 4b 64 dc f5 30 bb d3 ff 65 cc 5b f4 dd |...Kd..0...e.[..|
-00000120 b5 6a 3e 3e d0 1d de 47 c3 76 ad 19 f6 45 2c 8c |.j>>...G.v...E,.|
-00000130 bc d8 1d 01 4c 1f 70 90 46 76 48 8b 8f 83 cc 4a |....L.p.FvH....J|
-00000140 5c 8f 40 76 da e0 89 ec 1d 2b c4 4e 30 76 28 41 |\.@v.....+.N0v(A|
-00000150 b2 62 a8 fb 5b f1 f9 4e 7a 8d bd 09 b8 ae ea 8b |.b..[..Nz.......|
-00000160 18 27 4f 2e 70 fe 13 96 ba c3 d3 40 16 cd 65 4e |.'O.p......@..eN|
-00000170 ac 11 1e e6 f1 30 09 06 07 2a 86 48 ce 3d 04 01 |.....0...*.H.=..|
-00000180 03 81 8c 00 30 81 88 02 42 00 e0 14 c4 60 60 0b |....0...B....``.|
-00000190 72 68 b0 32 5d 61 4a 02 74 5c c2 81 b9 16 a8 3f |rh.2]aJ.t\.....?|
-000001a0 29 c8 36 c7 81 ff 6c b6 5b d9 70 f1 38 3b 50 48 |).6...l.[.p.8;PH|
-000001b0 28 94 cb 09 1a 52 f1 5d ee 8d f2 b9 f0 f0 da d9 |(....R.]........|
-000001c0 15 3a f9 bd 03 7a 87 a2 23 35 ec 02 42 01 a3 d4 |.:...z..#5..B...|
-000001d0 8a 78 35 1c 4a 9a 23 d2 0a be 2b 10 31 9d 9c 5f |.x5.J.#...+.1.._|
-000001e0 be e8 91 b3 da 1a f5 5d a3 23 f5 26 8b 45 70 8d |.......].#.&.Ep.|
-000001f0 65 62 9b 7e 01 99 3d 18 f6 10 9a 38 61 9b 2e 57 |eb.~..=....8a..W|
-00000200 e4 fa cc b1 8a ce e2 23 a0 87 f0 e1 67 51 eb 16 |.......#....gQ..|
-00000210 03 01 00 86 10 00 00 82 00 80 6d 51 f3 7f f9 3e |..........mQ...>|
-00000220 fb 75 82 41 36 83 e8 6a ee 2a 2e 25 90 67 4c 8e |.u.A6..j.*.%.gL.|
-00000230 62 2f 30 81 17 e0 85 09 0c 2b b7 23 d7 b0 e2 1d |b/0......+.#....|
-00000240 f7 3b d7 f5 a1 27 b6 ee 24 b6 1b cc 5b ea 66 0d |.;...'..$...[.f.|
-00000250 6a f4 e5 85 f9 da 43 b4 0e 86 85 e1 f5 aa be c8 |j.....C.........|
-00000260 ce 39 4c 9c 86 00 08 c2 4b e2 c6 ec 2f f7 ce e6 |.9L.....K.../...|
-00000270 bd 77 82 6f 23 b6 e0 bd a2 92 b7 3a ac e8 56 f1 |.w.o#......:..V.|
-00000280 af 54 5e 46 87 e9 3b 33 e7 b8 28 b7 d6 c8 90 35 |.T^F..;3..(....5|
-00000290 d4 1c 43 d1 30 6f 55 4e 0a 70 16 03 01 00 90 0f |..C.0oUN.p......|
-000002a0 00 00 8c 00 8a 30 81 87 02 42 00 c6 85 8e 06 b7 |.....0...B......|
-000002b0 04 04 e9 cd 9e 3e cb 66 23 95 b4 42 9c 64 81 39 |.....>.f#..B.d.9|
-000002c0 05 3f b5 21 f8 28 af 60 6b 4d 3d ba a1 4b 5e 77 |.?.!.(.`kM=..K^w|
-000002d0 ef e7 59 28 fe 1d c1 27 a2 ff a8 de 33 48 b3 c1 |..Y(...'....3H..|
-000002e0 85 6a 42 9b f9 7e 7e 31 c2 e5 bd 66 02 41 4b 49 |.jB..~~1...f.AKI|
-000002f0 c6 cd 02 e3 83 f7 03 50 18 6d b4 c9 51 02 c0 ab |.......P.m..Q...|
-00000300 87 bc e0 3e 4b 89 53 3a e2 65 89 97 02 c1 87 f1 |...>K.S:.e......|
-00000310 67 d0 f2 06 28 4e 51 4e fd f0 01 47 e7 c9 d9 23 |g...(NQN...G...#|
-00000320 21 6b 87 d2 55 e3 c9 f7 eb 86 d5 1e 50 df d5 14 |!k..U.......P...|
-00000330 03 01 00 01 01 16 03 01 00 24 95 62 42 be 90 39 |.........$.bB..9|
-00000340 68 ae f5 77 47 21 14 b9 ac ee 81 2d e3 9e c7 34 |h..wG!.....-...4|
-00000350 3a 00 5c c9 12 1d c0 5a 7c e7 ef e0 cd fd |:.\....Z|.....|
->>> Flow 4 (server to client)
-00000000 14 03 01 00 01 01 16 03 01 00 24 ea 98 c0 fb 86 |..........$.....|
-00000010 87 7a 2e e1 c7 68 61 3e 5b cc da 1f d6 7b ab 5a |.z...ha>[....{.Z|
-00000020 a0 ae a2 cf d0 54 44 19 12 db 75 2b 8c 73 8c |.....TD...u+.s.|
->>> Flow 5 (client to server)
-00000000 17 03 01 00 1a f3 28 77 31 33 4c b3 7c 4b 75 61 |......(w13L.|Kua|
-00000010 38 69 6b ae c9 36 ab 2e 56 16 29 6a 9a 00 2f 15 |8ik..6..V.)j../.|
-00000020 03 01 00 16 6b ed 68 18 ed ff 44 39 9b 4a e4 a2 |....k.h...D9.J..|
-00000030 cd 79 ef 2a 3e 5a 4d b1 5d 56 |.y.*>ZM.]V|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv10-ClientCert-RSA-ECDSA b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv10-ClientCert-RSA-ECDSA
deleted file mode 100644
index 3e6dbc2..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv10-ClientCert-RSA-ECDSA
+++ /dev/null
@@ -1,128 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
->>> Flow 2 (server to client)
-00000000 16 03 01 00 59 02 00 00 55 03 01 53 04 f1 02 4f |....Y...U..S...O|
-00000010 73 06 2d 72 41 36 a1 b2 d3 50 97 55 8c c5 f1 43 |s.-rA6...P.U...C|
-00000020 37 1f 1a 2a fe 51 70 0b 2f 25 9e 20 50 61 86 80 |7..*.Qp./%. Pa..|
-00000030 9a 9c 6d 6f c9 ea 5c ce 0c b7 7c ce e3 be d0 e5 |..mo..\...|.....|
-00000040 be d0 c4 80 78 c3 c7 17 0c 2d 8e c8 c0 09 00 00 |....x....-......|
-00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
-00000060 01 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..|
-00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....|
-00000080 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 0b 30 |0...*.H.=..0E1.0|
-00000090 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...|
-000000a0 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1|
-000000b0 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern|
-000000c0 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L|
-000000d0 74 64 30 1e 17 0d 31 32 31 31 32 32 31 35 30 36 |td0...1211221506|
-000000e0 33 32 5a 17 0d 32 32 31 31 32 30 31 35 30 36 33 |32Z..22112015063|
-000000f0 32 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 |2Z0E1.0...U....A|
-00000100 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 |U1.0...U....Some|
-00000110 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 |-State1!0...U...|
-00000120 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 |.Internet Widgit|
-00000130 73 20 50 74 79 20 4c 74 64 30 81 9b 30 10 06 07 |s Pty Ltd0..0...|
-00000140 2a 86 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 |*.H.=....+...#..|
-00000150 86 00 04 00 c4 a1 ed be 98 f9 0b 48 73 36 7e c3 |...........Hs6~.|
-00000160 16 56 11 22 f2 3d 53 c3 3b 4d 21 3d cd 6b 75 e6 |.V.".=S.;M!=.ku.|
-00000170 f6 b0 dc 9a df 26 c1 bc b2 87 f0 72 32 7c b3 64 |.....&.....r2|.d|
-00000180 2f 1c 90 bc ea 68 23 10 7e fe e3 25 c0 48 3a 69 |/....h#.~..%.H:i|
-00000190 e0 28 6d d3 37 00 ef 04 62 dd 0d a0 9c 70 62 83 |.(m.7...b....pb.|
-000001a0 d8 81 d3 64 31 aa 9e 97 31 bd 96 b0 68 c0 9b 23 |...d1...1...h..#|
-000001b0 de 76 64 3f 1a 5c 7f e9 12 0e 58 58 b6 5f 70 dd |.vd?.\....XX._p.|
-000001c0 9b d8 ea d5 d7 f5 d5 cc b9 b6 9f 30 66 5b 66 9a |...........0f[f.|
-000001d0 20 e2 27 e5 bf fe 3b 30 09 06 07 2a 86 48 ce 3d | .'...;0...*.H.=|
-000001e0 04 01 03 81 8c 00 30 81 88 02 42 01 88 a2 4f eb |......0...B...O.|
-000001f0 e2 45 c5 48 7d 1b ac f5 ed 98 9d ae 47 70 c0 5e |.E.H}.......Gp.^|
-00000200 1b b6 2f bd f1 b6 4d b7 61 40 d3 11 a2 ce ee 0b |../...M.a@......|
-00000210 7e 92 7e ff 76 9d c3 3b 7e a5 3f ce fa 10 e2 59 |~.~.v..;~.?....Y|
-00000220 ec 47 2d 7c ac da 4e 97 0e 15 a0 6f d0 02 42 01 |.G-|..N....o..B.|
-00000230 4d fc be 67 13 9c 2d 05 0e bd 3f a3 8c 25 c1 33 |M..g..-...?..%.3|
-00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....|
-00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.|
-00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....|
-00000270 2a 16 03 01 00 d6 0c 00 00 d2 03 00 17 41 04 b1 |*............A..|
-00000280 0f 0f 4a 18 ed 25 32 b3 a3 19 ed 4b 61 b6 eb e4 |..J..%2....Ka...|
-00000290 d3 f7 77 13 ac 9f 60 c7 8d 6d cb f1 ee 99 1a 71 |..w...`..m.....q|
-000002a0 68 aa d3 a7 70 7f 38 d0 f6 23 ab 9a f6 dd 19 4f |h...p.8..#.....O|
-000002b0 ce 10 ef d5 cf 64 85 2f 75 f6 20 06 4b f0 b9 00 |.....d./u. .K...|
-000002c0 8b 30 81 88 02 42 01 00 b9 6b 80 91 59 0a 48 3f |.0...B...k..Y.H?|
-000002d0 72 16 96 8f 21 2c 28 e4 6d 03 74 66 35 16 7d ec |r...!,(.m.tf5.}.|
-000002e0 c7 08 9b 52 b5 05 d9 38 d8 b7 51 42 a7 4a 9f 9b |...R...8..QB.J..|
-000002f0 1a 37 14 de c5 f5 16 96 83 81 58 d3 a6 1e ce 8a |.7........X.....|
-00000300 bc 19 47 30 fe c5 85 55 02 42 01 4f 61 59 68 85 |..G0...U.B.OaYh.|
-00000310 c7 64 23 22 f6 83 53 cc 58 38 25 b5 ce 74 c1 68 |.d#"..S.X8%..t.h|
-00000320 9f 32 72 33 ea c9 62 e0 26 63 92 e3 5f 34 10 0b |.2r3..b.&c.._4..|
-00000330 3c d5 83 fe 9f 67 69 ef 33 6b 19 c1 ec d6 6c 35 |<....gi.3k....l5|
-00000340 89 33 17 d3 9d 93 e2 e5 6e 89 9a a1 16 03 01 00 |.3......n.......|
-00000350 0e 0d 00 00 06 03 01 02 40 00 00 0e 00 00 00 |........@......|
->>> Flow 3 (client to server)
-00000000 16 03 01 01 fb 0b 00 01 f7 00 01 f4 00 01 f1 30 |...............0|
-00000010 82 01 ed 30 82 01 58 a0 03 02 01 02 02 01 00 30 |...0..X........0|
-00000020 0b 06 09 2a 86 48 86 f7 0d 01 01 05 30 26 31 10 |...*.H......0&1.|
-00000030 30 0e 06 03 55 04 0a 13 07 41 63 6d 65 20 43 6f |0...U....Acme Co|
-00000040 31 12 30 10 06 03 55 04 03 13 09 31 32 37 2e 30 |1.0...U....127.0|
-00000050 2e 30 2e 31 30 1e 17 0d 31 31 31 32 30 38 30 37 |.0.10...11120807|
-00000060 35 35 31 32 5a 17 0d 31 32 31 32 30 37 30 38 30 |5512Z..121207080|
-00000070 30 31 32 5a 30 26 31 10 30 0e 06 03 55 04 0a 13 |012Z0&1.0...U...|
-00000080 07 41 63 6d 65 20 43 6f 31 12 30 10 06 03 55 04 |.Acme Co1.0...U.|
-00000090 03 13 09 31 32 37 2e 30 2e 30 2e 31 30 81 9c 30 |...127.0.0.10..0|
-000000a0 0b 06 09 2a 86 48 86 f7 0d 01 01 01 03 81 8c 00 |...*.H..........|
-000000b0 30 81 88 02 81 80 4e d0 7b 31 e3 82 64 d9 59 c0 |0.....N.{1..d.Y.|
-000000c0 c2 87 a4 5e 1e 8b 73 33 c7 63 53 df 66 92 06 84 |...^..s3.cS.f...|
-000000d0 f6 64 d5 8f e4 36 a7 1d 2b e8 b3 20 36 45 23 b5 |.d...6..+.. 6E#.|
-000000e0 e3 95 ae ed e0 f5 20 9c 8d 95 df 7f 5a 12 ef 87 |...... .....Z...|
-000000f0 e4 5b 68 e4 e9 0e 74 ec 04 8a 7f de 93 27 c4 01 |.[h...t......'..|
-00000100 19 7a bd f2 dc 3d 14 ab d0 54 ca 21 0c d0 4d 6e |.z...=...T.!..Mn|
-00000110 87 2e 5c c5 d2 bb 4d 4b 4f ce b6 2c f7 7e 88 ec |..\...MKO..,.~..|
-00000120 7c d7 02 91 74 a6 1e 0c 1a da e3 4a 5a 2e de 13 ||...t......JZ...|
-00000130 9c 4c 40 88 59 93 02 03 01 00 01 a3 32 30 30 30 |.L@.Y.......2000|
-00000140 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02 00 a0 30 |...U...........0|
-00000150 0d 06 03 55 1d 0e 04 06 04 04 01 02 03 04 30 0f |...U..........0.|
-00000160 06 03 55 1d 23 04 08 30 06 80 04 01 02 03 04 30 |..U.#..0.......0|
-00000170 0b 06 09 2a 86 48 86 f7 0d 01 01 05 03 81 81 00 |...*.H..........|
-00000180 36 1f b3 7a 0c 75 c9 6e 37 46 61 2b d5 bd c0 a7 |6..z.u.n7Fa+....|
-00000190 4b cc 46 9a 81 58 7c 85 79 29 c8 c8 c6 67 dd 32 |K.F..X|.y)...g.2|
-000001a0 56 45 2b 75 b6 e9 24 a9 50 9a be 1f 5a fa 1a 15 |VE+u..$.P...Z...|
-000001b0 d9 cc 55 95 72 16 83 b9 c2 b6 8f fd 88 8c 38 84 |..U.r.........8.|
-000001c0 1d ab 5d 92 31 13 4f fd 83 3b c6 9d f1 11 62 b6 |..].1.O..;....b.|
-000001d0 8b ec ab 67 be c8 64 b0 11 50 46 58 17 6b 99 1c |...g..d..PFX.k..|
-000001e0 d3 1d fc 06 f1 0e e5 96 a8 0c f9 78 20 b7 44 18 |...........x .D.|
-000001f0 51 8d 10 7e 4f 94 67 df a3 4e 70 73 8e 90 91 85 |Q..~O.g..Nps....|
-00000200 16 03 01 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
-00000210 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
-00000220 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
-00000230 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
-00000240 a6 b5 68 1a 41 03 56 6b dc 5a 89 16 03 01 00 86 |..h.A.Vk.Z......|
-00000250 0f 00 00 82 00 80 20 2c 5a 08 3a 00 33 50 19 b2 |...... ,Z.:.3P..|
-00000260 0f ba 6c 76 7f 5c 92 e2 78 55 3e 32 32 bb 33 bc |..lv.\..xU>22.3.|
-00000270 ab a9 34 e0 83 cf 82 cd 9e 6b 3f 9d e6 49 61 29 |..4......k?..Ia)|
-00000280 8b b4 ed e8 12 cd a9 52 86 11 48 64 08 61 72 8d |.......R..Hd.ar.|
-00000290 d6 6a ac 42 cc e4 07 5f 08 56 9f 2f c5 35 d3 9b |.j.B..._.V./.5..|
-000002a0 e9 0d 91 82 c0 e9 bb 9f a9 8f df 96 85 08 9a 69 |...............i|
-000002b0 a4 93 b3 72 37 ba f9 b1 a4 0b b0 9f 43 6a 15 ec |...r7.......Cj..|
-000002c0 79 b8 fd 9c 1f 5f 0d 2c 56 33 c7 15 d5 4a b7 82 |y...._.,V3...J..|
-000002d0 ea 44 80 20 c5 80 14 03 01 00 01 01 16 03 01 00 |.D. ............|
-000002e0 30 c9 c0 7c d7 57 d3 00 ab 87 eb 78 56 6b a1 69 |0..|.W.....xVk.i|
-000002f0 1d fa ec ae 38 f3 ef 5d 49 19 0d 4b f0 73 63 af |....8..]I..K.sc.|
-00000300 89 b6 cb 76 cf fb b9 c1 99 98 06 0a 54 67 a0 6e |...v........Tg.n|
-00000310 e7 |.|
->>> Flow 4 (server to client)
-00000000 14 03 01 00 01 01 16 03 01 00 30 20 db fd ed ed |..........0 ....|
-00000010 7c d5 bf 8f 06 3b 86 1b c1 60 7d a4 74 e9 a6 c9 ||....;...`}.t...|
-00000020 f5 7c c7 f4 65 91 06 d5 53 88 d7 57 a4 22 b6 1f |.|..e...S..W."..|
-00000030 f1 02 e9 79 36 e6 a1 22 51 3a 4c |...y6.."Q:L|
->>> Flow 5 (client to server)
-00000000 17 03 01 00 20 00 66 51 6a 14 ca ea e2 21 48 74 |.... .fQj....!Ht|
-00000010 c4 c1 6e b9 8b 23 af 7c 33 c9 00 f8 0b ec ab 35 |..n..#.|3......5|
-00000020 e7 42 0a d1 ae 17 03 01 00 20 00 1c 6d 60 75 5d |.B....... ..m`u]|
-00000030 b3 fb 40 2e e0 b7 0d 48 f4 87 ac d4 bf ea 01 0d |..@....H........|
-00000040 fe 10 0d 05 04 43 6b 19 ed f2 15 03 01 00 20 f8 |.....Ck....... .|
-00000050 03 ac 62 4b 1f db 2e d2 4e 00 c3 a4 57 3c 0a 62 |..bK....N...W<.b|
-00000060 05 a0 ef bd 2b 9b 9a 63 27 72 d7 d8 f1 8d 84 |....+..c'r.....|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv10-ClientCert-RSA-RSA b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv10-ClientCert-RSA-RSA
deleted file mode 100644
index 94e6860..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv10-ClientCert-RSA-RSA
+++ /dev/null
@@ -1,124 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
->>> Flow 2 (server to client)
-00000000 16 03 01 00 51 02 00 00 4d 03 01 53 04 f1 02 73 |....Q...M..S...s|
-00000010 ee 5f 70 a4 aa 0d be d7 46 a3 25 3f e3 5d ef 7b |._p.....F.%?.].{|
-00000020 73 49 7c b6 82 4d 99 2f 31 fc 8b 20 2d a3 33 7c |sI|..M./1.. -.3||
-00000030 a5 c3 85 86 ba 61 4d 05 b0 5e d3 5e 88 6e c3 4b |.....aM..^.^.n.K|
-00000040 95 d3 e9 67 f1 96 24 58 7a 6f e6 c5 00 05 00 00 |...g..$Xzo......|
-00000050 05 ff 01 00 01 00 16 03 01 02 be 0b 00 02 ba 00 |................|
-00000060 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000070 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000080 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000090 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-000000a0 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-000000b0 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000c0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000d0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000e0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000f0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-00000100 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-00000110 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000120 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000130 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000140 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000150 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000160 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000170 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000180 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000190 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-000001a0 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-000001b0 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001c0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001d0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001e0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001f0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-00000200 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-00000210 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000220 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000230 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000240 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000250 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000260 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000270 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000280 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000290 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-000002a0 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-000002b0 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002c0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002d0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002e0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002f0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-00000300 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-00000310 6e 38 50 29 6c 90 a7 bd d9 16 03 01 00 0e 0d 00 |n8P)l...........|
-00000320 00 06 03 01 02 40 00 00 0e 00 00 00 |.....@......|
->>> Flow 3 (client to server)
-00000000 16 03 01 01 fb 0b 00 01 f7 00 01 f4 00 01 f1 30 |...............0|
-00000010 82 01 ed 30 82 01 58 a0 03 02 01 02 02 01 00 30 |...0..X........0|
-00000020 0b 06 09 2a 86 48 86 f7 0d 01 01 05 30 26 31 10 |...*.H......0&1.|
-00000030 30 0e 06 03 55 04 0a 13 07 41 63 6d 65 20 43 6f |0...U....Acme Co|
-00000040 31 12 30 10 06 03 55 04 03 13 09 31 32 37 2e 30 |1.0...U....127.0|
-00000050 2e 30 2e 31 30 1e 17 0d 31 31 31 32 30 38 30 37 |.0.10...11120807|
-00000060 35 35 31 32 5a 17 0d 31 32 31 32 30 37 30 38 30 |5512Z..121207080|
-00000070 30 31 32 5a 30 26 31 10 30 0e 06 03 55 04 0a 13 |012Z0&1.0...U...|
-00000080 07 41 63 6d 65 20 43 6f 31 12 30 10 06 03 55 04 |.Acme Co1.0...U.|
-00000090 03 13 09 31 32 37 2e 30 2e 30 2e 31 30 81 9c 30 |...127.0.0.10..0|
-000000a0 0b 06 09 2a 86 48 86 f7 0d 01 01 01 03 81 8c 00 |...*.H..........|
-000000b0 30 81 88 02 81 80 4e d0 7b 31 e3 82 64 d9 59 c0 |0.....N.{1..d.Y.|
-000000c0 c2 87 a4 5e 1e 8b 73 33 c7 63 53 df 66 92 06 84 |...^..s3.cS.f...|
-000000d0 f6 64 d5 8f e4 36 a7 1d 2b e8 b3 20 36 45 23 b5 |.d...6..+.. 6E#.|
-000000e0 e3 95 ae ed e0 f5 20 9c 8d 95 df 7f 5a 12 ef 87 |...... .....Z...|
-000000f0 e4 5b 68 e4 e9 0e 74 ec 04 8a 7f de 93 27 c4 01 |.[h...t......'..|
-00000100 19 7a bd f2 dc 3d 14 ab d0 54 ca 21 0c d0 4d 6e |.z...=...T.!..Mn|
-00000110 87 2e 5c c5 d2 bb 4d 4b 4f ce b6 2c f7 7e 88 ec |..\...MKO..,.~..|
-00000120 7c d7 02 91 74 a6 1e 0c 1a da e3 4a 5a 2e de 13 ||...t......JZ...|
-00000130 9c 4c 40 88 59 93 02 03 01 00 01 a3 32 30 30 30 |.L@.Y.......2000|
-00000140 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02 00 a0 30 |...U...........0|
-00000150 0d 06 03 55 1d 0e 04 06 04 04 01 02 03 04 30 0f |...U..........0.|
-00000160 06 03 55 1d 23 04 08 30 06 80 04 01 02 03 04 30 |..U.#..0.......0|
-00000170 0b 06 09 2a 86 48 86 f7 0d 01 01 05 03 81 81 00 |...*.H..........|
-00000180 36 1f b3 7a 0c 75 c9 6e 37 46 61 2b d5 bd c0 a7 |6..z.u.n7Fa+....|
-00000190 4b cc 46 9a 81 58 7c 85 79 29 c8 c8 c6 67 dd 32 |K.F..X|.y)...g.2|
-000001a0 56 45 2b 75 b6 e9 24 a9 50 9a be 1f 5a fa 1a 15 |VE+u..$.P...Z...|
-000001b0 d9 cc 55 95 72 16 83 b9 c2 b6 8f fd 88 8c 38 84 |..U.r.........8.|
-000001c0 1d ab 5d 92 31 13 4f fd 83 3b c6 9d f1 11 62 b6 |..].1.O..;....b.|
-000001d0 8b ec ab 67 be c8 64 b0 11 50 46 58 17 6b 99 1c |...g..d..PFX.k..|
-000001e0 d3 1d fc 06 f1 0e e5 96 a8 0c f9 78 20 b7 44 18 |...........x .D.|
-000001f0 51 8d 10 7e 4f 94 67 df a3 4e 70 73 8e 90 91 85 |Q..~O.g..Nps....|
-00000200 16 03 01 00 86 10 00 00 82 00 80 6d 51 f3 7f f9 |...........mQ...|
-00000210 3e fb 75 82 41 36 83 e8 6a ee 2a 2e 25 90 67 4c |>.u.A6..j.*.%.gL|
-00000220 8e 62 2f 30 81 17 e0 85 09 0c 2b b7 23 d7 b0 e2 |.b/0......+.#...|
-00000230 1d f7 3b d7 f5 a1 27 b6 ee 24 b6 1b cc 5b ea 66 |..;...'..$...[.f|
-00000240 0d 6a f4 e5 85 f9 da 43 b4 0e 86 85 e1 f5 aa be |.j.....C........|
-00000250 c8 ce 39 4c 9c 86 00 08 c2 4b e2 c6 ec 2f f7 ce |..9L.....K.../..|
-00000260 e6 bd 77 82 6f 23 b6 e0 bd a2 92 b7 3a ac e8 56 |..w.o#......:..V|
-00000270 f1 af 54 5e 46 87 e9 3b 33 e7 b8 28 b7 d6 c8 90 |..T^F..;3..(....|
-00000280 35 d4 1c 43 d1 30 6f 55 4e 0a 70 16 03 01 00 86 |5..C.0oUN.p.....|
-00000290 0f 00 00 82 00 80 0f 4c d2 b2 f0 94 6d 61 d1 2c |.......L....ma.,|
-000002a0 db 6f 79 03 bd 40 b2 d2 1d 61 ef 83 1b 4a 0c 7b |.oy..@...a...J.{|
-000002b0 c5 73 1e 1a 81 e7 67 0a d6 aa 2d 04 04 cc 0e 4b |.s....g...-....K|
-000002c0 2e da 96 7f 15 6c 05 ee c4 53 7e 33 89 28 7d db |.....l...S~3.(}.|
-000002d0 a1 77 43 ba a3 51 a9 1c b9 f5 ec 9a 8d eb 2c 46 |.wC..Q........,F|
-000002e0 5c 33 59 6b 16 af de f4 9b 80 76 a3 22 30 5d bb |\3Yk......v."0].|
-000002f0 02 b9 77 96 8a db 36 9f 54 95 00 d8 58 e1 aa 04 |..w...6.T...X...|
-00000300 98 c9 0c 32 ae 62 81 12 0c f6 1b 76 c6 58 a7 8c |...2.b.....v.X..|
-00000310 0e d8 b7 8e ed 0f 14 03 01 00 01 01 16 03 01 00 |................|
-00000320 24 1d c0 20 02 2d da 69 54 29 8c ff af 5c 56 a8 |$.. .-.iT)...\V.|
-00000330 eb d0 09 95 29 8f 52 8c e2 7b 9f 36 3e 47 a0 33 |....).R..{.6>G.3|
-00000340 2e 63 a2 24 93 |.c.$.|
->>> Flow 4 (server to client)
-00000000 14 03 01 00 01 01 16 03 01 00 24 99 e8 fb 65 f4 |..........$...e.|
-00000010 95 ae 8b 71 cc 5d a4 95 a7 27 98 fd 16 3f 7a 1a |...q.]...'...?z.|
-00000020 b6 bd bf 0a 58 72 77 97 1f 8e b1 dd 4b 12 12 |....Xrw.....K..|
->>> Flow 5 (client to server)
-00000000 17 03 01 00 1a 42 70 c0 89 78 12 5c 91 7e 88 2d |.....Bp..x.\.~.-|
-00000010 2f 8f be f2 f2 12 9d 81 ae 78 08 38 5e 6d 1b 15 |/........x.8^m..|
-00000020 03 01 00 16 1a 64 b1 6f 8a ff d3 63 6a c7 b8 95 |.....d.o...cj...|
-00000030 3d b0 87 bc 62 e9 88 5b 26 bd |=...b..[&.|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv10-ECDHE-ECDSA-AES b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv10-ECDHE-ECDSA-AES
deleted file mode 100644
index 30c4c6b..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv10-ECDHE-ECDSA-AES
+++ /dev/null
@@ -1,87 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
->>> Flow 2 (server to client)
-00000000 16 03 01 00 59 02 00 00 55 03 01 53 04 f1 02 b2 |....Y...U..S....|
-00000010 e0 f6 f6 b5 c9 5b 28 d0 5d 58 1b 6f 4e 2b 9d 05 |.....[(.]X.oN+..|
-00000020 2a b9 b4 da 45 cf f3 10 b2 23 44 20 f8 4d 59 05 |*...E....#D .MY.|
-00000030 ad 27 f2 a0 ee 7f ec cc 20 dc e7 a2 1b 07 b3 a5 |.'...... .......|
-00000040 37 7e 61 3d d6 5c 03 cf cc f5 9b ca c0 09 00 00 |7~a=.\..........|
-00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
-00000060 01 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..|
-00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....|
-00000080 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 0b 30 |0...*.H.=..0E1.0|
-00000090 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...|
-000000a0 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1|
-000000b0 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern|
-000000c0 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L|
-000000d0 74 64 30 1e 17 0d 31 32 31 31 32 32 31 35 30 36 |td0...1211221506|
-000000e0 33 32 5a 17 0d 32 32 31 31 32 30 31 35 30 36 33 |32Z..22112015063|
-000000f0 32 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 |2Z0E1.0...U....A|
-00000100 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 |U1.0...U....Some|
-00000110 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 |-State1!0...U...|
-00000120 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 |.Internet Widgit|
-00000130 73 20 50 74 79 20 4c 74 64 30 81 9b 30 10 06 07 |s Pty Ltd0..0...|
-00000140 2a 86 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 |*.H.=....+...#..|
-00000150 86 00 04 00 c4 a1 ed be 98 f9 0b 48 73 36 7e c3 |...........Hs6~.|
-00000160 16 56 11 22 f2 3d 53 c3 3b 4d 21 3d cd 6b 75 e6 |.V.".=S.;M!=.ku.|
-00000170 f6 b0 dc 9a df 26 c1 bc b2 87 f0 72 32 7c b3 64 |.....&.....r2|.d|
-00000180 2f 1c 90 bc ea 68 23 10 7e fe e3 25 c0 48 3a 69 |/....h#.~..%.H:i|
-00000190 e0 28 6d d3 37 00 ef 04 62 dd 0d a0 9c 70 62 83 |.(m.7...b....pb.|
-000001a0 d8 81 d3 64 31 aa 9e 97 31 bd 96 b0 68 c0 9b 23 |...d1...1...h..#|
-000001b0 de 76 64 3f 1a 5c 7f e9 12 0e 58 58 b6 5f 70 dd |.vd?.\....XX._p.|
-000001c0 9b d8 ea d5 d7 f5 d5 cc b9 b6 9f 30 66 5b 66 9a |...........0f[f.|
-000001d0 20 e2 27 e5 bf fe 3b 30 09 06 07 2a 86 48 ce 3d | .'...;0...*.H.=|
-000001e0 04 01 03 81 8c 00 30 81 88 02 42 01 88 a2 4f eb |......0...B...O.|
-000001f0 e2 45 c5 48 7d 1b ac f5 ed 98 9d ae 47 70 c0 5e |.E.H}.......Gp.^|
-00000200 1b b6 2f bd f1 b6 4d b7 61 40 d3 11 a2 ce ee 0b |../...M.a@......|
-00000210 7e 92 7e ff 76 9d c3 3b 7e a5 3f ce fa 10 e2 59 |~.~.v..;~.?....Y|
-00000220 ec 47 2d 7c ac da 4e 97 0e 15 a0 6f d0 02 42 01 |.G-|..N....o..B.|
-00000230 4d fc be 67 13 9c 2d 05 0e bd 3f a3 8c 25 c1 33 |M..g..-...?..%.3|
-00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....|
-00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.|
-00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....|
-00000270 2a 16 03 01 00 d5 0c 00 00 d1 03 00 17 41 04 da |*............A..|
-00000280 5a fd 09 e5 d6 c0 70 41 5e 3a 87 eb df 0c ad 90 |Z.....pA^:......|
-00000290 22 8a 2f 90 81 0c 24 00 68 92 f3 d5 95 2f 93 43 |"./...$.h..../.C|
-000002a0 e9 58 2d 18 28 62 ee 33 5b 21 2e 49 87 21 4d 32 |.X-.(b.3[!.I.!M2|
-000002b0 32 19 b3 ba fe 2d 9a 85 12 0e a1 77 08 06 75 00 |2....-.....w..u.|
-000002c0 8a 30 81 87 02 42 01 91 14 fc 68 74 95 10 4b d4 |.0...B....ht..K.|
-000002d0 67 60 12 46 bb b0 f6 98 77 a3 41 b8 01 5c 49 54 |g`.F....w.A..\IT|
-000002e0 9e 3e 81 e7 97 a3 b9 73 6e 15 74 67 be e5 d9 eb |.>.....sn.tg....|
-000002f0 8b 87 c5 22 ab ab 58 28 4f d1 b6 80 94 1b f5 f7 |..."..X(O.......|
-00000300 12 43 ef 0a c7 3e 1a 76 02 41 7a 00 49 cb 9f 3b |.C...>.v.Az.I..;|
-00000310 91 6e 38 58 0a d3 d0 d1 ee 67 f0 b6 5d cd fa 23 |.n8X.....g..]..#|
-00000320 b6 98 43 af 9c 71 90 1e 1d 50 a2 6e 61 5b f2 92 |..C..q...P.na[..|
-00000330 b4 69 73 f2 3b 54 bf 1c 9d 05 19 97 e4 4e 41 9e |.is.;T.......NA.|
-00000340 f2 9a 76 77 9a 86 43 1f 1f 30 a2 16 03 01 00 04 |..vw..C..0......|
-00000350 0e 00 00 00 |....|
->>> Flow 3 (client to server)
-00000000 16 03 01 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
-00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
-00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
-00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
-00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 01 00 01 |..h.A.Vk.Z......|
-00000050 01 16 03 01 00 30 88 60 65 b2 d7 51 1f ad 96 56 |.....0.`e..Q...V|
-00000060 4e 0a 20 eb b5 b0 1a dd 4c f6 1a cf d4 5c 47 c4 |N. .....L....\G.|
-00000070 9c 7c a0 36 dd d1 1b 96 91 99 c0 a7 2d 9a 7c 42 |.|.6........-.|B|
-00000080 51 d1 de 87 2b a4 |Q...+.|
->>> Flow 4 (server to client)
-00000000 14 03 01 00 01 01 16 03 01 00 30 86 6c b5 94 69 |..........0.l..i|
-00000010 2e e0 55 a2 4d a8 63 f2 5b 1f ae 34 21 c8 21 6a |..U.M.c.[..4!.!j|
-00000020 00 b6 56 ed 4e 2a b0 ff 01 2f da ce a1 c0 41 03 |..V.N*.../....A.|
-00000030 a9 1b 6e 2e e1 88 50 ba 62 14 88 |..n...P.b..|
->>> Flow 5 (client to server)
-00000000 17 03 01 00 20 a6 63 0a 2f a5 dc e1 fb cb 7b 1f |.... .c./.....{.|
-00000010 f2 da 74 c3 ff e9 f5 8b 9c 5f 0c d3 f7 1f 44 e6 |..t......_....D.|
-00000020 90 13 5c 48 50 17 03 01 00 20 c7 75 b5 ff bc 09 |..\HP.... .u....|
-00000030 34 f2 45 db 0d 22 08 8e f1 35 cd b6 0f b0 eb 2a |4.E.."...5.....*|
-00000040 b7 1a d0 8e 14 a4 54 84 f9 dc 15 03 01 00 20 e0 |......T....... .|
-00000050 36 3d aa b3 a9 b4 20 23 ca 9e 8c 5d fc a8 c8 b7 |6=.... #...]....|
-00000060 f5 c2 b6 d0 5a e2 ce a5 7b 68 a0 48 86 95 6a |....Z...{h.H..j|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv10-ECDHE-RSA-AES b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv10-ECDHE-RSA-AES
deleted file mode 100644
index 868f0ce..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv10-ECDHE-RSA-AES
+++ /dev/null
@@ -1,97 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
->>> Flow 2 (server to client)
-00000000 16 03 01 00 59 02 00 00 55 03 01 53 04 f1 02 21 |....Y...U..S...!|
-00000010 67 b5 2b 34 fb 62 d7 36 4f cf 68 2e 29 39 d0 28 |g.+4.b.6O.h.)9.(|
-00000020 3a 02 32 82 8f 95 de 62 d6 03 77 20 e6 98 56 cd |:.2....b..w ..V.|
-00000030 96 24 d1 b9 4d eb 51 19 bb b7 71 f4 9c 29 32 d4 |.$..M.Q...q..)2.|
-00000040 e5 c6 0a 54 e0 4a 20 29 3e bd 06 0d c0 13 00 00 |...T.J )>.......|
-00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
-00000060 01 02 be 0b 00 02 ba 00 02 b7 00 02 b4 30 82 02 |.............0..|
-00000070 b0 30 82 02 19 a0 03 02 01 02 02 09 00 85 b0 bb |.0..............|
-00000080 a4 8a 7f b8 ca 30 0d 06 09 2a 86 48 86 f7 0d 01 |.....0...*.H....|
-00000090 01 05 05 00 30 45 31 0b 30 09 06 03 55 04 06 13 |....0E1.0...U...|
-000000a0 02 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f |.AU1.0...U....So|
-000000b0 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 |me-State1!0...U.|
-000000c0 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 |...Internet Widg|
-000000d0 69 74 73 20 50 74 79 20 4c 74 64 30 1e 17 0d 31 |its Pty Ltd0...1|
-000000e0 30 30 34 32 34 30 39 30 39 33 38 5a 17 0d 31 31 |00424090938Z..11|
-000000f0 30 34 32 34 30 39 30 39 33 38 5a 30 45 31 0b 30 |0424090938Z0E1.0|
-00000100 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...|
-00000110 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1|
-00000120 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern|
-00000130 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L|
-00000140 74 64 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 |td0..0...*.H....|
-00000150 01 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 bb |........0.......|
-00000160 79 d6 f5 17 b5 e5 bf 46 10 d0 dc 69 be e6 2b 07 |y......F...i..+.|
-00000170 43 5a d0 03 2d 8a 7a 43 85 b7 14 52 e7 a5 65 4c |CZ..-.zC...R..eL|
-00000180 2c 78 b8 23 8c b5 b4 82 e5 de 1f 95 3b 7e 62 a5 |,x.#........;~b.|
-00000190 2c a5 33 d6 fe 12 5c 7a 56 fc f5 06 bf fa 58 7b |,.3...\zV.....X{|
-000001a0 26 3f b5 cd 04 d3 d0 c9 21 96 4a c7 f4 54 9f 5a |&?......!.J..T.Z|
-000001b0 bf ef 42 71 00 fe 18 99 07 7f 7e 88 7d 7d f1 04 |..Bq......~.}}..|
-000001c0 39 c4 a2 2e db 51 c9 7c e3 c0 4c 3b 32 66 01 cf |9....Q.|..L;2f..|
-000001d0 af b1 1d b8 71 9a 1d db db 89 6b ae da 2d 79 02 |....q.....k..-y.|
-000001e0 03 01 00 01 a3 81 a7 30 81 a4 30 1d 06 03 55 1d |.......0..0...U.|
-000001f0 0e 04 16 04 14 b1 ad e2 85 5a cf cb 28 db 69 ce |.........Z..(.i.|
-00000200 23 69 de d3 26 8e 18 88 39 30 75 06 03 55 1d 23 |#i..&...90u..U.#|
-00000210 04 6e 30 6c 80 14 b1 ad e2 85 5a cf cb 28 db 69 |.n0l......Z..(.i|
-00000220 ce 23 69 de d3 26 8e 18 88 39 a1 49 a4 47 30 45 |.#i..&...9.I.G0E|
-00000230 31 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 30 |1.0...U....AU1.0|
-00000240 11 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 |...U....Some-Sta|
-00000250 74 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 |te1!0...U....Int|
-00000260 65 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 |ernet Widgits Pt|
-00000270 79 20 4c 74 64 82 09 00 85 b0 bb a4 8a 7f b8 ca |y Ltd...........|
-00000280 30 0c 06 03 55 1d 13 04 05 30 03 01 01 ff 30 0d |0...U....0....0.|
-00000290 06 09 2a 86 48 86 f7 0d 01 01 05 05 00 03 81 81 |..*.H...........|
-000002a0 00 08 6c 45 24 c7 6b b1 59 ab 0c 52 cc f2 b0 14 |..lE$.k.Y..R....|
-000002b0 d7 87 9d 7a 64 75 b5 5a 95 66 e4 c5 2b 8e ae 12 |...zdu.Z.f..+...|
-000002c0 66 1f eb 4f 38 b3 6e 60 d3 92 fd f7 41 08 b5 25 |f..O8.n`....A..%|
-000002d0 13 b1 18 7a 24 fb 30 1d ba ed 98 b9 17 ec e7 d7 |...z$.0.........|
-000002e0 31 59 db 95 d3 1d 78 ea 50 56 5c d5 82 5a 2d 5a |1Y....x.PV\..Z-Z|
-000002f0 5f 33 c4 b6 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 |_3....u....R....|
-00000300 1f 89 20 5f f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 |.. _..........W.|
-00000310 70 e8 26 6d 71 99 9b 26 6e 38 50 29 6c 90 a7 bd |p.&mq..&n8P)l...|
-00000320 d9 16 03 01 00 cb 0c 00 00 c7 03 00 17 41 04 05 |.............A..|
-00000330 45 33 f8 4b e9 96 0e 4a fd ec 54 76 21 9b 24 8a |E3.K...J..Tv!.$.|
-00000340 75 0b 80 84 c7 30 2b 22 f0 85 57 a4 a9 79 d6 f6 |u....0+"..W..y..|
-00000350 6d 80 b0 71 d9 66 c9 6c dd 76 fc 32 d0 c6 bc 52 |m..q.f.l.v.2...R|
-00000360 2f f1 c9 62 17 53 76 ec be a6 1c 93 f2 b4 5d 00 |/..b.Sv.......].|
-00000370 80 72 d9 20 52 70 7c 03 b1 33 fa 51 23 cd 05 97 |.r. Rp|..3.Q#...|
-00000380 6f d6 89 2f 8d 2e 3a 17 32 eb f2 ff 6b 39 70 5e |o../..:.2...k9p^|
-00000390 21 41 8d 69 02 c8 9a 17 19 e4 48 9b 51 c3 7f 9b |!A.i......H.Q...|
-000003a0 8d 4a 83 97 07 0e 30 f1 8b 6b e9 92 12 01 d6 96 |.J....0..k......|
-000003b0 f2 1a a2 10 7f 59 87 16 1a fb 55 67 68 fc 78 c6 |.....Y....Ugh.x.|
-000003c0 57 ac 05 dd f3 6f 77 84 eb ae b0 33 2d 19 2c ba |W....ow....3-.,.|
-000003d0 b8 ae 9f 95 69 85 95 45 5e 37 f4 17 17 9b 03 c1 |....i..E^7......|
-000003e0 50 b1 36 42 bd 60 5c 8b d8 b6 f3 c8 34 c8 9d 9d |P.6B.`\.....4...|
-000003f0 75 16 03 01 00 04 0e 00 00 00 |u.........|
->>> Flow 3 (client to server)
-00000000 16 03 01 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
-00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
-00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
-00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
-00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 01 00 01 |..h.A.Vk.Z......|
-00000050 01 16 03 01 00 30 ca d1 1b 08 27 9b 44 e7 e9 b4 |.....0....'.D...|
-00000060 90 16 4d 30 4e 65 5c 0d 47 ba 46 86 cf c9 80 e7 |..M0Ne\.G.F.....|
-00000070 64 31 f5 a1 9e dc 39 15 d3 be 16 4f c7 90 b6 62 |d1....9....O...b|
-00000080 5d 6d 7f 41 4e 3e |]m.AN>|
->>> Flow 4 (server to client)
-00000000 14 03 01 00 01 01 16 03 01 00 30 98 81 24 8e cd |..........0..$..|
-00000010 b6 48 2f 80 de 8e 24 3c cd 02 67 80 34 97 d7 92 |.H/...$<..g.4...|
-00000020 78 c2 44 3d 5d 05 eb 88 76 79 46 7a c3 fa ca 73 |x.D=]...vyFz...s|
-00000030 45 82 ad c1 81 00 ca 40 c1 2f 13 |E......@./.|
->>> Flow 5 (client to server)
-00000000 17 03 01 00 20 ee 19 59 67 67 a9 8b db 99 87 50 |.... ..Ygg.....P|
-00000010 01 e2 02 c1 d5 6d 36 79 af aa ec 1b 80 0e b6 5e |.....m6y.......^|
-00000020 5f fa 03 01 cc 17 03 01 00 20 ec e2 04 b7 3b a5 |_........ ....;.|
-00000030 f2 e0 13 1f 17 48 e7 6e d3 eb f0 fa 36 ef 6e 2e |.....H.n....6.n.|
-00000040 fb ea c8 39 c4 5f 4b 28 d4 50 15 03 01 00 20 c7 |...9._K(.P.... .|
-00000050 45 ff fb c7 07 0c d8 0e 35 a3 c5 31 47 b7 03 0e |E.......5..1G...|
-00000060 14 c8 29 fd 53 70 5f 15 ac d2 1c 4c 69 fb d6 |..).Sp_....Li..|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv10-RSA-RC4 b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv10-RSA-RC4
deleted file mode 100644
index 395d53b..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv10-RSA-RC4
+++ /dev/null
@@ -1,83 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
->>> Flow 2 (server to client)
-00000000 16 03 01 00 51 02 00 00 4d 03 01 53 04 f1 02 76 |....Q...M..S...v|
-00000010 e8 45 7f 57 f3 42 4b 33 0b 06 fa a6 fa c4 3d 84 |.E.W.BK3......=.|
-00000020 5a 45 dc 93 41 a5 8d 79 6e 8f 11 20 e7 c6 29 2b |ZE..A..yn.. ..)+|
-00000030 ff 4a 6e 63 67 a6 10 cb 49 19 46 1e 5e 0a d5 70 |.Jncg...I.F.^..p|
-00000040 96 88 9a 32 48 ef c3 4a 45 4c 6d e0 00 05 00 00 |...2H..JELm.....|
-00000050 05 ff 01 00 01 00 16 03 01 02 be 0b 00 02 ba 00 |................|
-00000060 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000070 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000080 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000090 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-000000a0 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-000000b0 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000c0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000d0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000e0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000f0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-00000100 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-00000110 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000120 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000130 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000140 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000150 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000160 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000170 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000180 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000190 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-000001a0 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-000001b0 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001c0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001d0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001e0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001f0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-00000200 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-00000210 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000220 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000230 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000240 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000250 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000260 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000270 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000280 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000290 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-000002a0 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-000002b0 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002c0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002d0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002e0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002f0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-00000300 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-00000310 6e 38 50 29 6c 90 a7 bd d9 16 03 01 00 04 0e 00 |n8P)l...........|
-00000320 00 00 |..|
->>> Flow 3 (client to server)
-00000000 16 03 01 00 86 10 00 00 82 00 80 6d 51 f3 7f f9 |...........mQ...|
-00000010 3e fb 75 82 41 36 83 e8 6a ee 2a 2e 25 90 67 4c |>.u.A6..j.*.%.gL|
-00000020 8e 62 2f 30 81 17 e0 85 09 0c 2b b7 23 d7 b0 e2 |.b/0......+.#...|
-00000030 1d f7 3b d7 f5 a1 27 b6 ee 24 b6 1b cc 5b ea 66 |..;...'..$...[.f|
-00000040 0d 6a f4 e5 85 f9 da 43 b4 0e 86 85 e1 f5 aa be |.j.....C........|
-00000050 c8 ce 39 4c 9c 86 00 08 c2 4b e2 c6 ec 2f f7 ce |..9L.....K.../..|
-00000060 e6 bd 77 82 6f 23 b6 e0 bd a2 92 b7 3a ac e8 56 |..w.o#......:..V|
-00000070 f1 af 54 5e 46 87 e9 3b 33 e7 b8 28 b7 d6 c8 90 |..T^F..;3..(....|
-00000080 35 d4 1c 43 d1 30 6f 55 4e 0a 70 14 03 01 00 01 |5..C.0oUN.p.....|
-00000090 01 16 03 01 00 24 cd c0 68 dc 2e 69 cc c7 5b c5 |.....$..h..i..[.|
-000000a0 3f bd 40 cf a0 0f 41 34 ce 16 37 10 26 c8 3f d1 |?.@...A4..7.&.?.|
-000000b0 46 3b ad 7b b0 31 f3 c5 36 e7 |F;.{.1..6.|
->>> Flow 4 (server to client)
-00000000 14 03 01 00 01 01 16 03 01 00 24 ea 77 6f 3c 42 |..........$.wo<B|
-00000010 12 16 51 de e8 b6 f9 85 06 d9 6d 05 75 50 2b 27 |..Q.......m.uP+'|
-00000020 93 b7 6b 65 e9 14 99 48 53 3e be e4 be 03 5d |..ke...HS>....]|
->>> Flow 5 (client to server)
-00000000 17 03 01 00 1a 9e ae ca 55 df c4 d9 47 04 55 dd |........U...G.U.|
-00000010 3b 33 e1 a6 16 6f a1 94 b1 9b 4d 0d cb 6c 3b 15 |;3...o....M..l;.|
-00000020 03 01 00 16 92 5d 76 07 e9 b7 31 29 09 c5 b1 09 |.....]v...1)....|
-00000030 2d 64 3d 85 8d f1 d1 40 54 b8 |-d=....@T.|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv11-ECDHE-ECDSA-AES b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv11-ECDHE-ECDSA-AES
deleted file mode 100644
index 9f941f8..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv11-ECDHE-ECDSA-AES
+++ /dev/null
@@ -1,89 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
->>> Flow 2 (server to client)
-00000000 16 03 02 00 59 02 00 00 55 03 02 53 04 f1 02 1c |....Y...U..S....|
-00000010 d1 1c 6a 5f 7a 5c 26 69 92 cd ee c3 57 ed 96 90 |..j_z\&i....W...|
-00000020 e3 c5 f1 ee 8b ee 99 5f 46 2c e6 20 c8 50 6a a4 |......._F,. .Pj.|
-00000030 4b 93 e6 da ba 6d d4 87 f6 75 a8 9d 44 db b5 43 |K....m...u..D..C|
-00000040 df 12 57 de a4 f1 bc fb b8 7a 3f 6a c0 09 00 00 |..W......z?j....|
-00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
-00000060 02 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..|
-00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....|
-00000080 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 0b 30 |0...*.H.=..0E1.0|
-00000090 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...|
-000000a0 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1|
-000000b0 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern|
-000000c0 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L|
-000000d0 74 64 30 1e 17 0d 31 32 31 31 32 32 31 35 30 36 |td0...1211221506|
-000000e0 33 32 5a 17 0d 32 32 31 31 32 30 31 35 30 36 33 |32Z..22112015063|
-000000f0 32 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 |2Z0E1.0...U....A|
-00000100 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 |U1.0...U....Some|
-00000110 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 |-State1!0...U...|
-00000120 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 |.Internet Widgit|
-00000130 73 20 50 74 79 20 4c 74 64 30 81 9b 30 10 06 07 |s Pty Ltd0..0...|
-00000140 2a 86 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 |*.H.=....+...#..|
-00000150 86 00 04 00 c4 a1 ed be 98 f9 0b 48 73 36 7e c3 |...........Hs6~.|
-00000160 16 56 11 22 f2 3d 53 c3 3b 4d 21 3d cd 6b 75 e6 |.V.".=S.;M!=.ku.|
-00000170 f6 b0 dc 9a df 26 c1 bc b2 87 f0 72 32 7c b3 64 |.....&.....r2|.d|
-00000180 2f 1c 90 bc ea 68 23 10 7e fe e3 25 c0 48 3a 69 |/....h#.~..%.H:i|
-00000190 e0 28 6d d3 37 00 ef 04 62 dd 0d a0 9c 70 62 83 |.(m.7...b....pb.|
-000001a0 d8 81 d3 64 31 aa 9e 97 31 bd 96 b0 68 c0 9b 23 |...d1...1...h..#|
-000001b0 de 76 64 3f 1a 5c 7f e9 12 0e 58 58 b6 5f 70 dd |.vd?.\....XX._p.|
-000001c0 9b d8 ea d5 d7 f5 d5 cc b9 b6 9f 30 66 5b 66 9a |...........0f[f.|
-000001d0 20 e2 27 e5 bf fe 3b 30 09 06 07 2a 86 48 ce 3d | .'...;0...*.H.=|
-000001e0 04 01 03 81 8c 00 30 81 88 02 42 01 88 a2 4f eb |......0...B...O.|
-000001f0 e2 45 c5 48 7d 1b ac f5 ed 98 9d ae 47 70 c0 5e |.E.H}.......Gp.^|
-00000200 1b b6 2f bd f1 b6 4d b7 61 40 d3 11 a2 ce ee 0b |../...M.a@......|
-00000210 7e 92 7e ff 76 9d c3 3b 7e a5 3f ce fa 10 e2 59 |~.~.v..;~.?....Y|
-00000220 ec 47 2d 7c ac da 4e 97 0e 15 a0 6f d0 02 42 01 |.G-|..N....o..B.|
-00000230 4d fc be 67 13 9c 2d 05 0e bd 3f a3 8c 25 c1 33 |M..g..-...?..%.3|
-00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....|
-00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.|
-00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....|
-00000270 2a 16 03 02 00 d4 0c 00 00 d0 03 00 17 41 04 7b |*............A.{|
-00000280 c4 00 37 35 51 de c3 f2 a4 95 2c 19 21 3e a6 94 |..75Q.....,.!>..|
-00000290 7b fd 04 d7 b7 1c 56 e6 af 3c ee 36 cb 55 e6 f0 |{.....V..<.6.U..|
-000002a0 e6 24 34 6b 8a 02 66 71 f9 e2 f5 a6 c9 d7 6c dc |.$4k..fq......l.|
-000002b0 65 59 ff 1c c9 ec a9 8b 07 d6 52 2c 01 3c c3 00 |eY........R,.<..|
-000002c0 89 30 81 86 02 41 74 89 1a 31 72 e6 8b c0 4a ce |.0...At..1r...J.|
-000002d0 8f 5a 49 a7 52 2d 6d b9 8b 50 17 62 2a 99 d6 3b |.ZI.R-m..P.b*..;|
-000002e0 02 85 41 4d 34 53 b5 09 bd e3 ac 16 c1 9b e9 83 |..AM4S..........|
-000002f0 cc 83 e3 9c 23 34 67 71 72 d4 05 a2 34 f7 08 29 |....#4gqr...4..)|
-00000300 62 43 2e cc bc 08 01 02 41 59 de 5a d0 dd d7 6b |bC......AY.Z...k|
-00000310 db 9c 35 29 79 f8 96 91 56 74 1f 18 7b ee 25 83 |..5)y...Vt..{.%.|
-00000320 f2 37 0e 77 ab 38 fb 5e 04 0b 09 d9 b4 1f 3f be |.7.w.8.^......?.|
-00000330 2e e3 60 e3 96 f3 29 c1 6d 8f 56 1b fd 62 14 48 |..`...).m.V..b.H|
-00000340 e3 d9 2a ea 2f be 93 d0 8b 31 16 03 02 00 04 0e |..*./....1......|
-00000350 00 00 00 |...|
->>> Flow 3 (client to server)
-00000000 16 03 02 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
-00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
-00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
-00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
-00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 02 00 01 |..h.A.Vk.Z......|
-00000050 01 16 03 02 00 40 00 00 00 00 00 00 00 00 00 00 |.....@..........|
-00000060 00 00 00 00 00 00 b6 98 a2 a9 48 34 12 6b 0a 94 |..........H4.k..|
-00000070 89 fc 38 04 63 5a 6f 63 36 3e d9 35 12 64 8c 28 |..8.cZoc6>.5.d.(|
-00000080 99 a6 cf 2e 57 e3 14 6d 0a 8a ab f0 a6 58 37 7c |....W..m.....X7||
-00000090 96 04 d3 71 bc d4 |...q..|
->>> Flow 4 (server to client)
-00000000 14 03 02 00 01 01 16 03 02 00 40 c5 01 c9 0a b0 |..........@.....|
-00000010 d8 ca 5e c1 19 dc 37 6c 2e a0 b3 11 a8 87 65 5a |..^...7l......eZ|
-00000020 09 41 b9 fe 53 c4 c9 76 97 6d 7f ac c0 be d2 07 |.A..S..v.m......|
-00000030 84 e5 5b 78 37 34 ee da 3b cb 3e 82 52 79 91 44 |..[x74..;.>.Ry.D|
-00000040 b4 e4 1c ec 3a c0 c0 9d cd ff 13 |....:......|
->>> Flow 5 (client to server)
-00000000 17 03 02 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-00000010 00 00 00 00 00 46 60 13 39 2b 2f 72 95 ed 0e aa |.....F`.9+/r....|
-00000020 69 6e b4 64 3e 83 43 d0 f9 7f 37 7c 1d b9 ce 11 |in.d>.C...7|....|
-00000030 d9 41 66 60 6d 15 03 02 00 30 00 00 00 00 00 00 |.Af`m....0......|
-00000040 00 00 00 00 00 00 00 00 00 00 b1 26 d0 5d 08 98 |...........&.]..|
-00000050 eb 28 42 74 31 58 42 95 c5 ad 1a 92 0a f5 5f ed |.(Bt1XB......._.|
-00000060 45 98 e0 90 e5 a3 b6 8b 8d 18 |E.........|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv11-ECDHE-RSA-AES b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv11-ECDHE-RSA-AES
deleted file mode 100644
index fc72339..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv11-ECDHE-RSA-AES
+++ /dev/null
@@ -1,99 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
->>> Flow 2 (server to client)
-00000000 16 03 02 00 59 02 00 00 55 03 02 53 04 f1 02 fe |....Y...U..S....|
-00000010 17 8b 79 ad 93 2e d3 89 66 9b 5d 9b b4 03 3e ba |..y.....f.]...>.|
-00000020 65 2a f1 55 f9 3c 33 de 2c a7 47 20 fa 4f 82 11 |e*.U.<3.,.G .O..|
-00000030 96 81 d0 70 2e 65 b3 68 2e 3a 6d d7 6c 74 22 33 |...p.e.h.:m.lt"3|
-00000040 d4 ae 6c aa c8 f0 c7 20 8b 10 21 e7 c0 13 00 00 |..l.... ..!.....|
-00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
-00000060 02 02 be 0b 00 02 ba 00 02 b7 00 02 b4 30 82 02 |.............0..|
-00000070 b0 30 82 02 19 a0 03 02 01 02 02 09 00 85 b0 bb |.0..............|
-00000080 a4 8a 7f b8 ca 30 0d 06 09 2a 86 48 86 f7 0d 01 |.....0...*.H....|
-00000090 01 05 05 00 30 45 31 0b 30 09 06 03 55 04 06 13 |....0E1.0...U...|
-000000a0 02 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f |.AU1.0...U....So|
-000000b0 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 |me-State1!0...U.|
-000000c0 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 |...Internet Widg|
-000000d0 69 74 73 20 50 74 79 20 4c 74 64 30 1e 17 0d 31 |its Pty Ltd0...1|
-000000e0 30 30 34 32 34 30 39 30 39 33 38 5a 17 0d 31 31 |00424090938Z..11|
-000000f0 30 34 32 34 30 39 30 39 33 38 5a 30 45 31 0b 30 |0424090938Z0E1.0|
-00000100 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...|
-00000110 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1|
-00000120 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern|
-00000130 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L|
-00000140 74 64 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 |td0..0...*.H....|
-00000150 01 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 bb |........0.......|
-00000160 79 d6 f5 17 b5 e5 bf 46 10 d0 dc 69 be e6 2b 07 |y......F...i..+.|
-00000170 43 5a d0 03 2d 8a 7a 43 85 b7 14 52 e7 a5 65 4c |CZ..-.zC...R..eL|
-00000180 2c 78 b8 23 8c b5 b4 82 e5 de 1f 95 3b 7e 62 a5 |,x.#........;~b.|
-00000190 2c a5 33 d6 fe 12 5c 7a 56 fc f5 06 bf fa 58 7b |,.3...\zV.....X{|
-000001a0 26 3f b5 cd 04 d3 d0 c9 21 96 4a c7 f4 54 9f 5a |&?......!.J..T.Z|
-000001b0 bf ef 42 71 00 fe 18 99 07 7f 7e 88 7d 7d f1 04 |..Bq......~.}}..|
-000001c0 39 c4 a2 2e db 51 c9 7c e3 c0 4c 3b 32 66 01 cf |9....Q.|..L;2f..|
-000001d0 af b1 1d b8 71 9a 1d db db 89 6b ae da 2d 79 02 |....q.....k..-y.|
-000001e0 03 01 00 01 a3 81 a7 30 81 a4 30 1d 06 03 55 1d |.......0..0...U.|
-000001f0 0e 04 16 04 14 b1 ad e2 85 5a cf cb 28 db 69 ce |.........Z..(.i.|
-00000200 23 69 de d3 26 8e 18 88 39 30 75 06 03 55 1d 23 |#i..&...90u..U.#|
-00000210 04 6e 30 6c 80 14 b1 ad e2 85 5a cf cb 28 db 69 |.n0l......Z..(.i|
-00000220 ce 23 69 de d3 26 8e 18 88 39 a1 49 a4 47 30 45 |.#i..&...9.I.G0E|
-00000230 31 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 30 |1.0...U....AU1.0|
-00000240 11 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 |...U....Some-Sta|
-00000250 74 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 |te1!0...U....Int|
-00000260 65 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 |ernet Widgits Pt|
-00000270 79 20 4c 74 64 82 09 00 85 b0 bb a4 8a 7f b8 ca |y Ltd...........|
-00000280 30 0c 06 03 55 1d 13 04 05 30 03 01 01 ff 30 0d |0...U....0....0.|
-00000290 06 09 2a 86 48 86 f7 0d 01 01 05 05 00 03 81 81 |..*.H...........|
-000002a0 00 08 6c 45 24 c7 6b b1 59 ab 0c 52 cc f2 b0 14 |..lE$.k.Y..R....|
-000002b0 d7 87 9d 7a 64 75 b5 5a 95 66 e4 c5 2b 8e ae 12 |...zdu.Z.f..+...|
-000002c0 66 1f eb 4f 38 b3 6e 60 d3 92 fd f7 41 08 b5 25 |f..O8.n`....A..%|
-000002d0 13 b1 18 7a 24 fb 30 1d ba ed 98 b9 17 ec e7 d7 |...z$.0.........|
-000002e0 31 59 db 95 d3 1d 78 ea 50 56 5c d5 82 5a 2d 5a |1Y....x.PV\..Z-Z|
-000002f0 5f 33 c4 b6 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 |_3....u....R....|
-00000300 1f 89 20 5f f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 |.. _..........W.|
-00000310 70 e8 26 6d 71 99 9b 26 6e 38 50 29 6c 90 a7 bd |p.&mq..&n8P)l...|
-00000320 d9 16 03 02 00 cb 0c 00 00 c7 03 00 17 41 04 26 |.............A.&|
-00000330 56 18 02 e5 66 d4 aa 24 7e ae 39 e5 ca 78 6c c1 |V...f..$~.9..xl.|
-00000340 90 02 c3 c4 ad 79 2c 47 a8 bf 54 e2 8a 22 b6 ef |.....y,G..T.."..|
-00000350 99 d4 7a 7f 8f 78 6a 78 4e 14 2a 16 0d bb 54 38 |..z..xjxN.*...T8|
-00000360 59 1f 7a 53 1b c7 73 10 89 4b de c3 66 39 7a 00 |Y.zS..s..K..f9z.|
-00000370 80 3a 88 38 c8 15 07 ab 2f 0f 0d cb 19 07 84 ac |.:.8..../.......|
-00000380 24 fd 8b d2 9d 05 45 c6 11 c3 d6 84 58 95 5a 08 |$.....E.....X.Z.|
-00000390 b9 a4 2c c0 41 4e 34 e0 b2 24 98 94 b7 67 27 50 |..,.AN4..$...g'P|
-000003a0 ba 82 35 28 a9 bf 16 ee e3 7b 49 9c 4c 81 80 69 |..5(.....{I.L..i|
-000003b0 d7 aa ed 46 ea 9a 68 c4 97 b7 11 d4 35 91 74 5e |...F..h.....5.t^|
-000003c0 54 10 34 83 cd c4 06 18 49 7d 7a 28 c9 53 06 73 |T.4.....I}z(.S.s|
-000003d0 00 7b 04 b6 d8 36 a7 4b 67 7f 81 30 94 de 40 4d |.{...6.Kg..0..@M|
-000003e0 18 f8 c4 b7 02 00 44 8e bc 72 06 24 53 15 74 72 |......D..r.$S.tr|
-000003f0 8d 16 03 02 00 04 0e 00 00 00 |..........|
->>> Flow 3 (client to server)
-00000000 16 03 02 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
-00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
-00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
-00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
-00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 02 00 01 |..h.A.Vk.Z......|
-00000050 01 16 03 02 00 40 00 00 00 00 00 00 00 00 00 00 |.....@..........|
-00000060 00 00 00 00 00 00 8a 87 81 38 35 c0 4c bb f8 12 |.........85.L...|
-00000070 fa 75 04 cd 1e 3a 61 96 93 c8 fb 07 d1 6d b4 55 |.u...:a......m.U|
-00000080 0f b5 0f 07 35 0a 96 ce 5c 6f 24 62 d3 68 e4 b0 |....5...\o$b.h..|
-00000090 5d be 81 37 c2 9c |]..7..|
->>> Flow 4 (server to client)
-00000000 14 03 02 00 01 01 16 03 02 00 40 66 36 8d f8 8c |..........@f6...|
-00000010 7f db 38 e8 39 df f8 2f cb 88 9c 14 d9 89 10 b4 |..8.9../........|
-00000020 be 59 88 d7 f3 73 62 af a3 42 66 6e 74 38 64 9f |.Y...sb..Bfnt8d.|
-00000030 16 79 09 d7 14 7e 91 8a 70 73 63 28 30 58 fe cc |.y...~..psc(0X..|
-00000040 42 45 d6 37 fb 9e 8c c1 01 af 34 |BE.7......4|
->>> Flow 5 (client to server)
-00000000 17 03 02 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-00000010 00 00 00 00 00 31 0b e3 9d 2a 05 83 19 7d 10 36 |.....1...*...}.6|
-00000020 23 dc da fe 00 ab d3 aa 8f ce 28 5f 08 fd b7 59 |#.........(_...Y|
-00000030 1e 00 2e 25 5a 15 03 02 00 30 00 00 00 00 00 00 |...%Z....0......|
-00000040 00 00 00 00 00 00 00 00 00 00 10 91 fd fa 59 07 |..............Y.|
-00000050 df 2c 92 25 15 7b 7c 83 44 89 0d 4f 65 43 99 2e |.,.%.{|.D..OeC..|
-00000060 41 5d 51 c9 09 89 ed 02 08 bc |A]Q.......|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv11-RSA-RC4 b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv11-RSA-RC4
deleted file mode 100644
index f7be3f7..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv11-RSA-RC4
+++ /dev/null
@@ -1,83 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
->>> Flow 2 (server to client)
-00000000 16 03 02 00 51 02 00 00 4d 03 02 53 04 f1 02 d4 |....Q...M..S....|
-00000010 69 65 aa 96 3d 42 96 eb 9e 7d 8a 18 af 4c 7c 5d |ie..=B...}...L|]|
-00000020 fb 97 5f da 94 62 13 69 1f 66 06 20 aa 52 e3 08 |.._..b.i.f. .R..|
-00000030 35 0a 87 d5 ef 93 49 ab 1a 74 dd 90 bd 69 70 d1 |5.....I..t...ip.|
-00000040 e9 f1 44 17 3a dc 33 98 f5 e5 ab 93 00 05 00 00 |..D.:.3.........|
-00000050 05 ff 01 00 01 00 16 03 02 02 be 0b 00 02 ba 00 |................|
-00000060 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000070 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000080 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000090 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-000000a0 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-000000b0 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000c0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000d0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000e0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000f0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-00000100 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-00000110 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000120 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000130 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000140 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000150 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000160 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000170 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000180 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000190 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-000001a0 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-000001b0 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001c0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001d0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001e0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001f0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-00000200 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-00000210 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000220 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000230 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000240 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000250 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000260 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000270 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000280 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000290 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-000002a0 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-000002b0 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002c0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002d0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002e0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002f0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-00000300 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-00000310 6e 38 50 29 6c 90 a7 bd d9 16 03 02 00 04 0e 00 |n8P)l...........|
-00000320 00 00 |..|
->>> Flow 3 (client to server)
-00000000 16 03 02 00 86 10 00 00 82 00 80 6d 51 f3 7f f9 |...........mQ...|
-00000010 3e fb 75 82 41 36 83 e8 6a ee 2a 2e 25 90 67 4c |>.u.A6..j.*.%.gL|
-00000020 8e 62 2f 30 81 17 e0 85 09 0c 2b b7 23 d7 b0 e2 |.b/0......+.#...|
-00000030 1d f7 3b d7 f5 a1 27 b6 ee 24 b6 1b cc 5b ea 66 |..;...'..$...[.f|
-00000040 0d 6a f4 e5 85 f9 da 43 b4 0e 86 85 e1 f5 aa be |.j.....C........|
-00000050 c8 ce 39 4c 9c 86 00 08 c2 4b e2 c6 ec 2f f7 ce |..9L.....K.../..|
-00000060 e6 bd 77 82 6f 23 b6 e0 bd a2 92 b7 3a ac e8 56 |..w.o#......:..V|
-00000070 f1 af 54 5e 46 87 e9 3b 33 e7 b8 28 b7 d6 c8 90 |..T^F..;3..(....|
-00000080 35 d4 1c 43 d1 30 6f 55 4e 0a 70 14 03 02 00 01 |5..C.0oUN.p.....|
-00000090 01 16 03 02 00 24 07 9f dc df 2d c3 a6 88 06 28 |.....$....-....(|
-000000a0 21 e0 e0 d3 31 99 fc 89 b8 82 6e 95 f4 4b 9e e2 |!...1.....n..K..|
-000000b0 d9 36 5c 14 ce d7 db e2 78 4e |.6\.....xN|
->>> Flow 4 (server to client)
-00000000 14 03 02 00 01 01 16 03 02 00 24 81 72 75 80 d4 |..........$.ru..|
-00000010 1b 1a 32 00 89 bf 9e 79 30 b9 6b 67 e0 8e c7 eb |..2....y0.kg....|
-00000020 73 f2 e4 93 51 65 9b 5f 91 b1 b4 b1 f7 44 76 |s...Qe._.....Dv|
->>> Flow 5 (client to server)
-00000000 17 03 02 00 1a b2 91 39 63 c0 38 3c 4d 25 fd 14 |.......9c.8<M%..|
-00000010 b9 b6 e1 23 21 b4 8d 17 9e 1f d8 33 92 69 c2 15 |...#!......3.i..|
-00000020 03 02 00 16 4b 10 25 4d 9d 09 c2 11 96 be f7 5b |....K.%M.......[|
-00000030 c2 9b 99 fd 1f 8e af 0f 2c 51 |........,Q|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ALPN b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ALPN
deleted file mode 100644
index f09a4f1..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ALPN
+++ /dev/null
@@ -1,97 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 8d 01 00 00 89 03 03 00 00 00 00 00 |................|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 46 33 74 00 00 |./.5.......F3t..|
-00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
-00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0a 00 |................|
-00000070 08 04 01 04 03 02 01 02 03 ff 01 00 01 00 00 10 |................|
-00000080 00 10 00 0e 06 70 72 6f 74 6f 32 06 70 72 6f 74 |.....proto2.prot|
-00000090 6f 31 |o1|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 66 02 00 00 62 03 03 77 a9 7d 9c 4b |....f...b..w.}.K|
-00000010 69 65 aa dc 95 cb 78 08 3d d2 1a 0a 45 69 23 73 |ie....x.=...Ei#s|
-00000020 4f 41 4f 24 12 2e 57 47 b7 53 64 20 82 9a f8 e7 |OAO$..WG.Sd ....|
-00000030 79 f8 13 2c 9d cd b5 cb cb 9a 95 56 0e e9 cb a8 |y..,.......V....|
-00000040 e4 a2 8a d6 bc dc fa 25 b3 57 cc cf c0 2f 00 00 |.......%.W.../..|
-00000050 1a ff 01 00 01 00 00 0b 00 04 03 00 01 02 00 10 |................|
-00000060 00 09 00 07 06 70 72 6f 74 6f 31 16 03 03 02 be |.....proto1.....|
-00000070 0b 00 02 ba 00 02 b7 00 02 b4 30 82 02 b0 30 82 |..........0...0.|
-00000080 02 19 a0 03 02 01 02 02 09 00 85 b0 bb a4 8a 7f |................|
-00000090 b8 ca 30 0d 06 09 2a 86 48 86 f7 0d 01 01 05 05 |..0...*.H.......|
-000000a0 00 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 55 |.0E1.0...U....AU|
-000000b0 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 2d |1.0...U....Some-|
-000000c0 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 18 |State1!0...U....|
-000000d0 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 73 |Internet Widgits|
-000000e0 20 50 74 79 20 4c 74 64 30 1e 17 0d 31 30 30 34 | Pty Ltd0...1004|
-000000f0 32 34 30 39 30 39 33 38 5a 17 0d 31 31 30 34 32 |24090938Z..11042|
-00000100 34 30 39 30 39 33 38 5a 30 45 31 0b 30 09 06 03 |4090938Z0E1.0...|
-00000110 55 04 06 13 02 41 55 31 13 30 11 06 03 55 04 08 |U....AU1.0...U..|
-00000120 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f |..Some-State1!0.|
-00000130 06 03 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 |..U....Internet |
-00000140 57 69 64 67 69 74 73 20 50 74 79 20 4c 74 64 30 |Widgits Pty Ltd0|
-00000150 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 |..0...*.H.......|
-00000160 00 03 81 8d 00 30 81 89 02 81 81 00 bb 79 d6 f5 |.....0.......y..|
-00000170 17 b5 e5 bf 46 10 d0 dc 69 be e6 2b 07 43 5a d0 |....F...i..+.CZ.|
-00000180 03 2d 8a 7a 43 85 b7 14 52 e7 a5 65 4c 2c 78 b8 |.-.zC...R..eL,x.|
-00000190 23 8c b5 b4 82 e5 de 1f 95 3b 7e 62 a5 2c a5 33 |#........;~b.,.3|
-000001a0 d6 fe 12 5c 7a 56 fc f5 06 bf fa 58 7b 26 3f b5 |...\zV.....X{&?.|
-000001b0 cd 04 d3 d0 c9 21 96 4a c7 f4 54 9f 5a bf ef 42 |.....!.J..T.Z..B|
-000001c0 71 00 fe 18 99 07 7f 7e 88 7d 7d f1 04 39 c4 a2 |q......~.}}..9..|
-000001d0 2e db 51 c9 7c e3 c0 4c 3b 32 66 01 cf af b1 1d |..Q.|..L;2f.....|
-000001e0 b8 71 9a 1d db db 89 6b ae da 2d 79 02 03 01 00 |.q.....k..-y....|
-000001f0 01 a3 81 a7 30 81 a4 30 1d 06 03 55 1d 0e 04 16 |....0..0...U....|
-00000200 04 14 b1 ad e2 85 5a cf cb 28 db 69 ce 23 69 de |......Z..(.i.#i.|
-00000210 d3 26 8e 18 88 39 30 75 06 03 55 1d 23 04 6e 30 |.&...90u..U.#.n0|
-00000220 6c 80 14 b1 ad e2 85 5a cf cb 28 db 69 ce 23 69 |l......Z..(.i.#i|
-00000230 de d3 26 8e 18 88 39 a1 49 a4 47 30 45 31 0b 30 |..&...9.I.G0E1.0|
-00000240 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...|
-00000250 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1|
-00000260 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern|
-00000270 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L|
-00000280 74 64 82 09 00 85 b0 bb a4 8a 7f b8 ca 30 0c 06 |td...........0..|
-00000290 03 55 1d 13 04 05 30 03 01 01 ff 30 0d 06 09 2a |.U....0....0...*|
-000002a0 86 48 86 f7 0d 01 01 05 05 00 03 81 81 00 08 6c |.H.............l|
-000002b0 45 24 c7 6b b1 59 ab 0c 52 cc f2 b0 14 d7 87 9d |E$.k.Y..R.......|
-000002c0 7a 64 75 b5 5a 95 66 e4 c5 2b 8e ae 12 66 1f eb |zdu.Z.f..+...f..|
-000002d0 4f 38 b3 6e 60 d3 92 fd f7 41 08 b5 25 13 b1 18 |O8.n`....A..%...|
-000002e0 7a 24 fb 30 1d ba ed 98 b9 17 ec e7 d7 31 59 db |z$.0.........1Y.|
-000002f0 95 d3 1d 78 ea 50 56 5c d5 82 5a 2d 5a 5f 33 c4 |...x.PV\..Z-Z_3.|
-00000300 b6 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 1f 89 20 |...u....R...... |
-00000310 5f f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 70 e8 26 |_..........W.p.&|
-00000320 6d 71 99 9b 26 6e 38 50 29 6c 90 a7 bd d9 16 03 |mq..&n8P)l......|
-00000330 03 00 cd 0c 00 00 c9 03 00 17 41 04 1b 42 c3 ae |..........A..B..|
-00000340 44 19 d3 84 7c 6c 98 cb b9 22 a2 67 63 95 aa cc |D...|l...".gc...|
-00000350 bd e4 1e f8 08 e6 60 f3 bc 83 9f 81 da 9c 1c 8c |......`.........|
-00000360 ff 6f f4 3e 1e e5 3b f6 49 61 f9 70 43 7f c1 69 |.o.>..;.Ia.pC..i|
-00000370 de 73 98 4b bd 5c c3 78 24 18 a8 ec 04 01 00 80 |.s.K.\.x$.......|
-00000380 70 d2 5b e1 39 cf 4d 54 de d2 74 4e 5e a8 b3 ca |p.[.9.MT..tN^...|
-00000390 e1 f2 4e 76 3c 77 8b ef f7 d1 df b9 ad c1 70 39 |..Nv<w........p9|
-000003a0 c7 a3 1e 0f 7b 6c 78 2e c1 86 d2 67 36 d8 25 e0 |....{lx....g6.%.|
-000003b0 e8 e5 cc 35 a2 96 a1 b4 b7 06 68 1e aa c7 06 97 |...5......h.....|
-000003c0 b7 c2 83 ce c0 17 dd 4f 9e 6f 7a bd cd c7 6e 7f |.......O.oz...n.|
-000003d0 cb 80 d1 7d 06 2d f9 f1 fb 5f cc bb d8 62 5b f0 |...}.-..._...b[.|
-000003e0 27 12 57 d5 9b 55 aa 55 4b 9a 5a f6 a5 aa c1 82 |'.W..U.UK.Z.....|
-000003f0 39 11 6b dc 83 7f a8 47 28 5a 0f 3d 3f 0f c2 22 |9.k....G(Z.=?.."|
-00000400 16 03 03 00 04 0e 00 00 00 |.........|
->>> Flow 3 (client to server)
-00000000 16 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
-00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
-00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
-00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
-00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 03 00 01 |..h.A.Vk.Z......|
-00000050 01 16 03 03 00 28 00 00 00 00 00 00 00 00 35 9d |.....(........5.|
-00000060 92 e8 bf df 7f a7 77 1b cf 03 2a bf e2 6c 62 2b |......w...*..lb+|
-00000070 26 f0 fb 93 d3 df fd 55 84 d3 ed 88 31 cb |&......U....1.|
->>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 28 c8 c0 78 09 73 |..........(..x.s|
-00000010 58 41 73 66 88 cf db f3 fe c6 57 ab 45 be 2e d8 |XAsf......W.E...|
-00000020 4e e5 ff 42 57 13 74 d2 cc c2 62 07 39 8b 06 46 |N..BW.t...b.9..F|
-00000030 1d 8f 88 |...|
->>> Flow 5 (client to server)
-00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 10 c3 5f |..............._|
-00000010 3f c8 92 6c 7a a7 23 05 f3 d8 31 20 01 52 f1 99 |?..lz.#...1 .R..|
-00000020 33 c1 2a 15 03 03 00 1a 00 00 00 00 00 00 00 02 |3.*.............|
-00000030 cc ef eb 78 e4 e1 9d 90 05 6d 95 ac f2 49 ba 8e |...x.....m...I..|
-00000040 6b 8d |k.|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ALPN-NoMatch b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ALPN-NoMatch
deleted file mode 100644
index f24a70c..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ALPN-NoMatch
+++ /dev/null
@@ -1,95 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 86 01 00 00 82 03 03 00 00 00 00 00 |................|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 3f 33 74 00 00 |./.5.......?3t..|
-00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
-00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0a 00 |................|
-00000070 08 04 01 04 03 02 01 02 03 ff 01 00 01 00 00 10 |................|
-00000080 00 09 00 07 06 70 72 6f 74 6f 33 |.....proto3|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 59 02 00 00 55 03 03 69 84 d1 d3 44 |....Y...U..i...D|
-00000010 e9 66 08 48 bc 70 d8 ae 40 0b 17 69 e7 27 f6 7a |.f.H.p..@..i.'.z|
-00000020 d5 ee 86 74 54 9e a8 bb 79 76 89 20 57 53 1b 02 |...tT...yv. WS..|
-00000030 5b 70 81 a6 f1 53 bc 9d b7 42 5e ac 92 93 b5 20 |[p...S...B^.... |
-00000040 8a bb 36 cc 8f cb 7e a0 61 a2 e8 ef c0 2f 00 00 |..6...~.a..../..|
-00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
-00000060 03 02 be 0b 00 02 ba 00 02 b7 00 02 b4 30 82 02 |.............0..|
-00000070 b0 30 82 02 19 a0 03 02 01 02 02 09 00 85 b0 bb |.0..............|
-00000080 a4 8a 7f b8 ca 30 0d 06 09 2a 86 48 86 f7 0d 01 |.....0...*.H....|
-00000090 01 05 05 00 30 45 31 0b 30 09 06 03 55 04 06 13 |....0E1.0...U...|
-000000a0 02 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f |.AU1.0...U....So|
-000000b0 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 |me-State1!0...U.|
-000000c0 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 |...Internet Widg|
-000000d0 69 74 73 20 50 74 79 20 4c 74 64 30 1e 17 0d 31 |its Pty Ltd0...1|
-000000e0 30 30 34 32 34 30 39 30 39 33 38 5a 17 0d 31 31 |00424090938Z..11|
-000000f0 30 34 32 34 30 39 30 39 33 38 5a 30 45 31 0b 30 |0424090938Z0E1.0|
-00000100 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...|
-00000110 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1|
-00000120 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern|
-00000130 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L|
-00000140 74 64 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 |td0..0...*.H....|
-00000150 01 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 bb |........0.......|
-00000160 79 d6 f5 17 b5 e5 bf 46 10 d0 dc 69 be e6 2b 07 |y......F...i..+.|
-00000170 43 5a d0 03 2d 8a 7a 43 85 b7 14 52 e7 a5 65 4c |CZ..-.zC...R..eL|
-00000180 2c 78 b8 23 8c b5 b4 82 e5 de 1f 95 3b 7e 62 a5 |,x.#........;~b.|
-00000190 2c a5 33 d6 fe 12 5c 7a 56 fc f5 06 bf fa 58 7b |,.3...\zV.....X{|
-000001a0 26 3f b5 cd 04 d3 d0 c9 21 96 4a c7 f4 54 9f 5a |&?......!.J..T.Z|
-000001b0 bf ef 42 71 00 fe 18 99 07 7f 7e 88 7d 7d f1 04 |..Bq......~.}}..|
-000001c0 39 c4 a2 2e db 51 c9 7c e3 c0 4c 3b 32 66 01 cf |9....Q.|..L;2f..|
-000001d0 af b1 1d b8 71 9a 1d db db 89 6b ae da 2d 79 02 |....q.....k..-y.|
-000001e0 03 01 00 01 a3 81 a7 30 81 a4 30 1d 06 03 55 1d |.......0..0...U.|
-000001f0 0e 04 16 04 14 b1 ad e2 85 5a cf cb 28 db 69 ce |.........Z..(.i.|
-00000200 23 69 de d3 26 8e 18 88 39 30 75 06 03 55 1d 23 |#i..&...90u..U.#|
-00000210 04 6e 30 6c 80 14 b1 ad e2 85 5a cf cb 28 db 69 |.n0l......Z..(.i|
-00000220 ce 23 69 de d3 26 8e 18 88 39 a1 49 a4 47 30 45 |.#i..&...9.I.G0E|
-00000230 31 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 30 |1.0...U....AU1.0|
-00000240 11 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 |...U....Some-Sta|
-00000250 74 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 |te1!0...U....Int|
-00000260 65 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 |ernet Widgits Pt|
-00000270 79 20 4c 74 64 82 09 00 85 b0 bb a4 8a 7f b8 ca |y Ltd...........|
-00000280 30 0c 06 03 55 1d 13 04 05 30 03 01 01 ff 30 0d |0...U....0....0.|
-00000290 06 09 2a 86 48 86 f7 0d 01 01 05 05 00 03 81 81 |..*.H...........|
-000002a0 00 08 6c 45 24 c7 6b b1 59 ab 0c 52 cc f2 b0 14 |..lE$.k.Y..R....|
-000002b0 d7 87 9d 7a 64 75 b5 5a 95 66 e4 c5 2b 8e ae 12 |...zdu.Z.f..+...|
-000002c0 66 1f eb 4f 38 b3 6e 60 d3 92 fd f7 41 08 b5 25 |f..O8.n`....A..%|
-000002d0 13 b1 18 7a 24 fb 30 1d ba ed 98 b9 17 ec e7 d7 |...z$.0.........|
-000002e0 31 59 db 95 d3 1d 78 ea 50 56 5c d5 82 5a 2d 5a |1Y....x.PV\..Z-Z|
-000002f0 5f 33 c4 b6 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 |_3....u....R....|
-00000300 1f 89 20 5f f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 |.. _..........W.|
-00000310 70 e8 26 6d 71 99 9b 26 6e 38 50 29 6c 90 a7 bd |p.&mq..&n8P)l...|
-00000320 d9 16 03 03 00 cd 0c 00 00 c9 03 00 17 41 04 04 |.............A..|
-00000330 be 27 08 6f 12 83 1b 04 76 fa 5f 16 d6 e3 64 76 |.'.o....v._...dv|
-00000340 ad 0a 77 37 71 64 44 4c 3f 1a be dc 85 ce 46 c8 |..w7qdDL?.....F.|
-00000350 29 a1 e2 24 78 66 1f 35 90 05 46 c0 91 d1 fd dd |)..$xf.5..F.....|
-00000360 b5 5b 87 d7 6d 9d 77 a7 f7 b3 df 68 27 fd 6d 04 |.[..m.w....h'.m.|
-00000370 01 00 80 7b 9b fd 0d 62 57 07 ef 97 f5 ff a9 00 |...{...bW.......|
-00000380 a0 89 35 5a 8a e6 e7 ae 7b 55 c5 dc 21 64 87 6e |..5Z....{U..!d.n|
-00000390 0f ab 85 6d 82 e8 83 fd 7d 3b 49 a7 ae 92 5f 6d |...m....};I..._m|
-000003a0 a3 42 ce ff ef a6 00 6a 33 32 1f 7b eb b7 c2 5c |.B.....j32.{...\|
-000003b0 2d 38 cf 10 4b 59 69 4d 15 e0 68 49 39 ba cb 2a |-8..KYiM..hI9..*|
-000003c0 d9 b9 f3 fe 33 01 4f 7e ac 69 02 35 a5 e0 33 8d |....3.O~.i.5..3.|
-000003d0 b3 74 34 14 45 9c 89 ad 41 2d d0 27 22 90 58 c6 |.t4.E...A-.'".X.|
-000003e0 e0 2c b4 6e 19 04 e4 46 26 ec 13 35 48 a6 3f 64 |.,.n...F&..5H.?d|
-000003f0 dc 85 2b 16 03 03 00 04 0e 00 00 00 |..+.........|
->>> Flow 3 (client to server)
-00000000 16 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
-00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
-00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
-00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
-00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 03 00 01 |..h.A.Vk.Z......|
-00000050 01 16 03 03 00 28 00 00 00 00 00 00 00 00 88 0d |.....(..........|
-00000060 04 8b 8e 93 55 58 d6 75 ca 16 26 42 a3 60 20 67 |....UX.u..&B.` g|
-00000070 84 cf d7 b3 10 fe 63 6c 2f 40 64 0c d6 78 |......cl/@d..x|
->>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 28 bd 6c 2f 70 b9 |..........(.l/p.|
-00000010 2f 9c 29 70 af 34 49 4c 5b 25 c3 14 b6 6d 28 81 |/.)p.4IL[%...m(.|
-00000020 ff 54 d9 71 8d 2c c7 38 dd 44 27 6b 54 1e 53 7b |.T.q.,.8.D'kT.S{|
-00000030 22 cb 65 |".e|
->>> Flow 5 (client to server)
-00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 7f 0d d7 |................|
-00000010 d9 4b 87 7b 36 fb 24 92 69 22 43 50 1e 46 fb c4 |.K.{6.$.i"CP.F..|
-00000020 86 64 6f 15 03 03 00 1a 00 00 00 00 00 00 00 02 |.do.............|
-00000030 37 d5 2d 0a be c5 a8 ae d4 bd 2b 09 34 18 a0 87 |7.-.......+.4...|
-00000040 08 a6 |..|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ClientCert-ECDSA-ECDSA b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ClientCert-ECDSA-ECDSA
deleted file mode 100644
index 2073270..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ClientCert-ECDSA-ECDSA
+++ /dev/null
@@ -1,134 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 59 02 00 00 55 03 03 53 04 f1 03 6f |....Y...U..S...o|
-00000010 c6 4b 55 27 fe e8 fe 4d 7c 0e d4 20 98 b8 7c 81 |.KU'...M|.. ..|.|
-00000020 3d 31 f8 35 66 2f 0a 0b f1 2c e3 20 86 4d 12 32 |=1.5f/...,. .M.2|
-00000030 73 e3 ba be 25 50 a4 a2 a1 7b f1 9a 76 7a 75 fb |s...%P...{..vzu.|
-00000040 e2 64 a2 12 ec f3 e7 9d 9a 24 6e 94 c0 09 00 00 |.d.......$n.....|
-00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
-00000060 03 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..|
-00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....|
-00000080 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 0b 30 |0...*.H.=..0E1.0|
-00000090 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...|
-000000a0 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1|
-000000b0 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern|
-000000c0 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L|
-000000d0 74 64 30 1e 17 0d 31 32 31 31 32 32 31 35 30 36 |td0...1211221506|
-000000e0 33 32 5a 17 0d 32 32 31 31 32 30 31 35 30 36 33 |32Z..22112015063|
-000000f0 32 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 |2Z0E1.0...U....A|
-00000100 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 |U1.0...U....Some|
-00000110 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 |-State1!0...U...|
-00000120 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 |.Internet Widgit|
-00000130 73 20 50 74 79 20 4c 74 64 30 81 9b 30 10 06 07 |s Pty Ltd0..0...|
-00000140 2a 86 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 |*.H.=....+...#..|
-00000150 86 00 04 00 c4 a1 ed be 98 f9 0b 48 73 36 7e c3 |...........Hs6~.|
-00000160 16 56 11 22 f2 3d 53 c3 3b 4d 21 3d cd 6b 75 e6 |.V.".=S.;M!=.ku.|
-00000170 f6 b0 dc 9a df 26 c1 bc b2 87 f0 72 32 7c b3 64 |.....&.....r2|.d|
-00000180 2f 1c 90 bc ea 68 23 10 7e fe e3 25 c0 48 3a 69 |/....h#.~..%.H:i|
-00000190 e0 28 6d d3 37 00 ef 04 62 dd 0d a0 9c 70 62 83 |.(m.7...b....pb.|
-000001a0 d8 81 d3 64 31 aa 9e 97 31 bd 96 b0 68 c0 9b 23 |...d1...1...h..#|
-000001b0 de 76 64 3f 1a 5c 7f e9 12 0e 58 58 b6 5f 70 dd |.vd?.\....XX._p.|
-000001c0 9b d8 ea d5 d7 f5 d5 cc b9 b6 9f 30 66 5b 66 9a |...........0f[f.|
-000001d0 20 e2 27 e5 bf fe 3b 30 09 06 07 2a 86 48 ce 3d | .'...;0...*.H.=|
-000001e0 04 01 03 81 8c 00 30 81 88 02 42 01 88 a2 4f eb |......0...B...O.|
-000001f0 e2 45 c5 48 7d 1b ac f5 ed 98 9d ae 47 70 c0 5e |.E.H}.......Gp.^|
-00000200 1b b6 2f bd f1 b6 4d b7 61 40 d3 11 a2 ce ee 0b |../...M.a@......|
-00000210 7e 92 7e ff 76 9d c3 3b 7e a5 3f ce fa 10 e2 59 |~.~.v..;~.?....Y|
-00000220 ec 47 2d 7c ac da 4e 97 0e 15 a0 6f d0 02 42 01 |.G-|..N....o..B.|
-00000230 4d fc be 67 13 9c 2d 05 0e bd 3f a3 8c 25 c1 33 |M..g..-...?..%.3|
-00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....|
-00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.|
-00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....|
-00000270 2a 16 03 03 00 d7 0c 00 00 d3 03 00 17 41 04 a3 |*............A..|
-00000280 03 8c de d2 b0 68 c8 25 0e 85 ea d7 ae 13 0d 79 |.....h.%.......y|
-00000290 ec 59 0d b5 4d 51 96 d9 7f 64 36 fb 4c d5 6a 26 |.Y..MQ...d6.L.j&|
-000002a0 ae 0e 48 61 df 5c 2b d4 ff 09 41 15 c4 14 8e 1b |..Ha.\+...A.....|
-000002b0 84 a8 c8 cd ef 10 97 95 66 67 85 dd fd dc 2a 04 |........fg....*.|
-000002c0 03 00 8a 30 81 87 02 41 11 75 5d bc bd 08 28 d4 |...0...A.u]...(.|
-000002d0 5b 1b 45 7f 9c d3 8d 0b 91 fa f6 82 ba 59 bd 3e |[.E..........Y.>|
-000002e0 96 01 c6 1d 38 db fe 08 e7 56 89 fc 10 b0 37 6a |....8....V....7j|
-000002f0 3d d6 c9 50 16 53 f7 c2 a2 60 67 82 1f 74 b8 d5 |=..P.S...`g..t..|
-00000300 bc 02 ec 96 db 82 18 8c 87 02 42 01 0d df f7 b7 |..........B.....|
-00000310 05 3c 8c 56 f0 1d 33 18 cf c5 4c 80 7e 0b d9 f9 |.<.V..3...L.~...|
-00000320 f0 51 69 fe 5d b8 0b 64 c0 c7 0d f4 75 65 ae 07 |.Qi.]..d....ue..|
-00000330 9d cf f4 4b ad 52 f6 b8 10 26 18 bd d6 e2 0d a8 |...K.R...&......|
-00000340 80 10 50 34 15 cd 72 0b 7d a9 94 de 4c 16 03 03 |..P4..r.}...L...|
-00000350 00 30 0d 00 00 28 03 01 02 40 00 20 06 01 06 02 |.0...(...@. ....|
-00000360 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................|
-00000370 03 02 03 03 02 01 02 02 02 03 01 01 00 00 0e 00 |................|
-00000380 00 00 |..|
->>> Flow 3 (client to server)
-00000000 16 03 03 02 0a 0b 00 02 06 00 02 03 00 02 00 30 |...............0|
-00000010 82 01 fc 30 82 01 5e 02 09 00 9a 30 84 6c 26 35 |...0..^....0.l&5|
-00000020 d9 17 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 |..0...*.H.=..0E1|
-00000030 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 |.0...U....AU1.0.|
-00000040 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 |..U....Some-Stat|
-00000050 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 |e1!0...U....Inte|
-00000060 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 |rnet Widgits Pty|
-00000070 20 4c 74 64 30 1e 17 0d 31 32 31 31 31 34 31 33 | Ltd0...12111413|
-00000080 32 35 35 33 5a 17 0d 32 32 31 31 31 32 31 33 32 |2553Z..221112132|
-00000090 35 35 33 5a 30 41 31 0b 30 09 06 03 55 04 06 13 |553Z0A1.0...U...|
-000000a0 02 41 55 31 0c 30 0a 06 03 55 04 08 13 03 4e 53 |.AU1.0...U....NS|
-000000b0 57 31 10 30 0e 06 03 55 04 07 13 07 50 79 72 6d |W1.0...U....Pyrm|
-000000c0 6f 6e 74 31 12 30 10 06 03 55 04 03 13 09 4a 6f |ont1.0...U....Jo|
-000000d0 65 6c 20 53 69 6e 67 30 81 9b 30 10 06 07 2a 86 |el Sing0..0...*.|
-000000e0 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 86 00 |H.=....+...#....|
-000000f0 04 00 95 8c 91 75 14 c0 5e c4 57 b4 d4 c3 6f 8d |.....u..^.W...o.|
-00000100 ae 68 1e dd 6f ce 86 e1 7e 6e b2 48 3e 81 e5 4e |.h..o...~n.H>..N|
-00000110 e2 c6 88 4b 64 dc f5 30 bb d3 ff 65 cc 5b f4 dd |...Kd..0...e.[..|
-00000120 b5 6a 3e 3e d0 1d de 47 c3 76 ad 19 f6 45 2c 8c |.j>>...G.v...E,.|
-00000130 bc d8 1d 01 4c 1f 70 90 46 76 48 8b 8f 83 cc 4a |....L.p.FvH....J|
-00000140 5c 8f 40 76 da e0 89 ec 1d 2b c4 4e 30 76 28 41 |\.@v.....+.N0v(A|
-00000150 b2 62 a8 fb 5b f1 f9 4e 7a 8d bd 09 b8 ae ea 8b |.b..[..Nz.......|
-00000160 18 27 4f 2e 70 fe 13 96 ba c3 d3 40 16 cd 65 4e |.'O.p......@..eN|
-00000170 ac 11 1e e6 f1 30 09 06 07 2a 86 48 ce 3d 04 01 |.....0...*.H.=..|
-00000180 03 81 8c 00 30 81 88 02 42 00 e0 14 c4 60 60 0b |....0...B....``.|
-00000190 72 68 b0 32 5d 61 4a 02 74 5c c2 81 b9 16 a8 3f |rh.2]aJ.t\.....?|
-000001a0 29 c8 36 c7 81 ff 6c b6 5b d9 70 f1 38 3b 50 48 |).6...l.[.p.8;PH|
-000001b0 28 94 cb 09 1a 52 f1 5d ee 8d f2 b9 f0 f0 da d9 |(....R.]........|
-000001c0 15 3a f9 bd 03 7a 87 a2 23 35 ec 02 42 01 a3 d4 |.:...z..#5..B...|
-000001d0 8a 78 35 1c 4a 9a 23 d2 0a be 2b 10 31 9d 9c 5f |.x5.J.#...+.1.._|
-000001e0 be e8 91 b3 da 1a f5 5d a3 23 f5 26 8b 45 70 8d |.......].#.&.Ep.|
-000001f0 65 62 9b 7e 01 99 3d 18 f6 10 9a 38 61 9b 2e 57 |eb.~..=....8a..W|
-00000200 e4 fa cc b1 8a ce e2 23 a0 87 f0 e1 67 51 eb 16 |.......#....gQ..|
-00000210 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d 19 |...F...BA...7...|
-00000220 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd a7 |Q.5uq..T[....g..|
-00000230 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 |$ >.V...(^.+-O..|
-00000240 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 |..lK[.V.2B.X..I.|
-00000250 b5 68 1a 41 03 56 6b dc 5a 89 16 03 03 00 92 0f |.h.A.Vk.Z.......|
-00000260 00 00 8e 04 03 00 8a 30 81 87 02 42 00 c6 85 8e |.......0...B....|
-00000270 06 b7 04 04 e9 cd 9e 3e cb 66 23 95 b4 42 9c 64 |.......>.f#..B.d|
-00000280 81 39 05 3f b5 21 f8 28 af 60 6b 4d 3d ba a1 4b |.9.?.!.(.`kM=..K|
-00000290 5e 77 ef e7 59 28 fe 1d c1 27 a2 ff a8 de 33 48 |^w..Y(...'....3H|
-000002a0 b3 c1 85 6a 42 9b f9 7e 7e 31 c2 e5 bd 66 02 41 |...jB..~~1...f.A|
-000002b0 4b 49 c6 cd 02 e3 83 f7 03 50 18 6d b4 c9 51 02 |KI.......P.m..Q.|
-000002c0 c0 ab 87 bc e0 3e 4b 89 53 3a e2 65 89 97 02 c1 |.....>K.S:.e....|
-000002d0 88 0d 64 db 8e 4f 73 4e ea 29 0b ed a0 f5 ce 3d |..d..OsN.).....=|
-000002e0 5f cc 20 ef 0a 22 02 82 f2 14 2a b7 42 68 bd c7 |_. .."....*.Bh..|
-000002f0 4d 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 |M..........@....|
-00000300 00 00 00 00 00 00 00 00 00 00 00 00 f0 cc 4f c7 |..............O.|
-00000310 b6 0f c9 38 4d 4b 97 2c 4f be 53 08 4c d6 5b 4e |...8MK.,O.S.L.[N|
-00000320 24 70 30 81 82 3a 7f 62 95 03 4d fc 54 78 ec 13 |$p0..:.b..M.Tx..|
-00000330 b2 a1 00 85 2b 04 e4 1d 7b 6e 87 60 |....+...{n.`|
->>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 40 d5 2a 76 79 1c |..........@.*vy.|
-00000010 e7 d5 b1 5c 65 6b d1 45 73 53 4c 05 3a 6c 5d 81 |...\ek.EsSL.:l].|
-00000020 dd 2f f0 74 62 e4 8e f8 ed 21 99 c7 4f d6 28 40 |./.tb....!..O.(@|
-00000030 63 d9 6d e5 b0 04 73 27 7a 1d 08 19 31 10 da ef |c.m...s'z...1...|
-00000040 79 26 33 fb 45 23 be a4 7c 03 66 |y&3.E#..|.f|
->>> Flow 5 (client to server)
-00000000 17 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-00000010 00 00 00 00 00 e2 53 bd c0 ef 9e e6 44 94 ea 5d |......S.....D..]|
-00000020 f5 c5 a9 4b ed eb 1c 49 9f 79 44 f9 cd d7 de 02 |...K...I.yD.....|
-00000030 51 10 ae 87 7d 15 03 03 00 30 00 00 00 00 00 00 |Q...}....0......|
-00000040 00 00 00 00 00 00 00 00 00 00 d3 95 13 7f 5f 58 |.............._X|
-00000050 ab d6 17 ea 01 2c 2a ea 5d 7c 44 61 4a 27 97 52 |.....,*.]|DaJ'.R|
-00000060 cc 9b 86 f6 37 42 2b 94 01 49 |....7B+..I|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ClientCert-ECDSA-RSA b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ClientCert-ECDSA-RSA
deleted file mode 100644
index c3b753a..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ClientCert-ECDSA-RSA
+++ /dev/null
@@ -1,127 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 51 02 00 00 4d 03 03 53 04 f1 03 b0 |....Q...M..S....|
-00000010 43 00 97 24 a7 a8 ea b2 24 fe 96 24 a1 49 64 fd |C..$....$..$.Id.|
-00000020 1c a3 30 35 2d 85 a7 40 42 86 6b 20 af 27 7f ac |..05-..@B.k .'..|
-00000030 8b 16 89 6c 78 b7 f5 29 02 58 a6 8b 61 43 c2 b0 |...lx..).X..aC..|
-00000040 e0 a8 96 c8 fa 2b 26 ad 9a 5f 2d d6 00 05 00 00 |.....+&.._-.....|
-00000050 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................|
-00000060 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000070 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000080 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000090 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-000000a0 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-000000b0 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000c0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000d0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000e0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000f0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-00000100 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-00000110 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000120 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000130 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000140 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000150 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000160 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000170 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000180 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000190 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-000001a0 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-000001b0 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001c0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001d0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001e0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001f0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-00000200 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-00000210 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000220 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000230 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000240 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000250 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000260 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000270 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000280 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000290 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-000002a0 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-000002b0 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002c0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002d0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002e0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002f0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-00000300 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-00000310 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 30 0d 00 |n8P)l........0..|
-00000320 00 28 03 01 02 40 00 20 06 01 06 02 06 03 05 01 |.(...@. ........|
-00000330 05 02 05 03 04 01 04 02 04 03 03 01 03 02 03 03 |................|
-00000340 02 01 02 02 02 03 01 01 00 00 0e 00 00 00 |..............|
->>> Flow 3 (client to server)
-00000000 16 03 03 02 0a 0b 00 02 06 00 02 03 00 02 00 30 |...............0|
-00000010 82 01 fc 30 82 01 5e 02 09 00 9a 30 84 6c 26 35 |...0..^....0.l&5|
-00000020 d9 17 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 |..0...*.H.=..0E1|
-00000030 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 |.0...U....AU1.0.|
-00000040 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 |..U....Some-Stat|
-00000050 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 |e1!0...U....Inte|
-00000060 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 |rnet Widgits Pty|
-00000070 20 4c 74 64 30 1e 17 0d 31 32 31 31 31 34 31 33 | Ltd0...12111413|
-00000080 32 35 35 33 5a 17 0d 32 32 31 31 31 32 31 33 32 |2553Z..221112132|
-00000090 35 35 33 5a 30 41 31 0b 30 09 06 03 55 04 06 13 |553Z0A1.0...U...|
-000000a0 02 41 55 31 0c 30 0a 06 03 55 04 08 13 03 4e 53 |.AU1.0...U....NS|
-000000b0 57 31 10 30 0e 06 03 55 04 07 13 07 50 79 72 6d |W1.0...U....Pyrm|
-000000c0 6f 6e 74 31 12 30 10 06 03 55 04 03 13 09 4a 6f |ont1.0...U....Jo|
-000000d0 65 6c 20 53 69 6e 67 30 81 9b 30 10 06 07 2a 86 |el Sing0..0...*.|
-000000e0 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 86 00 |H.=....+...#....|
-000000f0 04 00 95 8c 91 75 14 c0 5e c4 57 b4 d4 c3 6f 8d |.....u..^.W...o.|
-00000100 ae 68 1e dd 6f ce 86 e1 7e 6e b2 48 3e 81 e5 4e |.h..o...~n.H>..N|
-00000110 e2 c6 88 4b 64 dc f5 30 bb d3 ff 65 cc 5b f4 dd |...Kd..0...e.[..|
-00000120 b5 6a 3e 3e d0 1d de 47 c3 76 ad 19 f6 45 2c 8c |.j>>...G.v...E,.|
-00000130 bc d8 1d 01 4c 1f 70 90 46 76 48 8b 8f 83 cc 4a |....L.p.FvH....J|
-00000140 5c 8f 40 76 da e0 89 ec 1d 2b c4 4e 30 76 28 41 |\.@v.....+.N0v(A|
-00000150 b2 62 a8 fb 5b f1 f9 4e 7a 8d bd 09 b8 ae ea 8b |.b..[..Nz.......|
-00000160 18 27 4f 2e 70 fe 13 96 ba c3 d3 40 16 cd 65 4e |.'O.p......@..eN|
-00000170 ac 11 1e e6 f1 30 09 06 07 2a 86 48 ce 3d 04 01 |.....0...*.H.=..|
-00000180 03 81 8c 00 30 81 88 02 42 00 e0 14 c4 60 60 0b |....0...B....``.|
-00000190 72 68 b0 32 5d 61 4a 02 74 5c c2 81 b9 16 a8 3f |rh.2]aJ.t\.....?|
-000001a0 29 c8 36 c7 81 ff 6c b6 5b d9 70 f1 38 3b 50 48 |).6...l.[.p.8;PH|
-000001b0 28 94 cb 09 1a 52 f1 5d ee 8d f2 b9 f0 f0 da d9 |(....R.]........|
-000001c0 15 3a f9 bd 03 7a 87 a2 23 35 ec 02 42 01 a3 d4 |.:...z..#5..B...|
-000001d0 8a 78 35 1c 4a 9a 23 d2 0a be 2b 10 31 9d 9c 5f |.x5.J.#...+.1.._|
-000001e0 be e8 91 b3 da 1a f5 5d a3 23 f5 26 8b 45 70 8d |.......].#.&.Ep.|
-000001f0 65 62 9b 7e 01 99 3d 18 f6 10 9a 38 61 9b 2e 57 |eb.~..=....8a..W|
-00000200 e4 fa cc b1 8a ce e2 23 a0 87 f0 e1 67 51 eb 16 |.......#....gQ..|
-00000210 03 03 00 86 10 00 00 82 00 80 6d 51 f3 7f f9 3e |..........mQ...>|
-00000220 fb 75 82 41 36 83 e8 6a ee 2a 2e 25 90 67 4c 8e |.u.A6..j.*.%.gL.|
-00000230 62 2f 30 81 17 e0 85 09 0c 2b b7 23 d7 b0 e2 1d |b/0......+.#....|
-00000240 f7 3b d7 f5 a1 27 b6 ee 24 b6 1b cc 5b ea 66 0d |.;...'..$...[.f.|
-00000250 6a f4 e5 85 f9 da 43 b4 0e 86 85 e1 f5 aa be c8 |j.....C.........|
-00000260 ce 39 4c 9c 86 00 08 c2 4b e2 c6 ec 2f f7 ce e6 |.9L.....K.../...|
-00000270 bd 77 82 6f 23 b6 e0 bd a2 92 b7 3a ac e8 56 f1 |.w.o#......:..V.|
-00000280 af 54 5e 46 87 e9 3b 33 e7 b8 28 b7 d6 c8 90 35 |.T^F..;3..(....5|
-00000290 d4 1c 43 d1 30 6f 55 4e 0a 70 16 03 03 00 92 0f |..C.0oUN.p......|
-000002a0 00 00 8e 04 03 00 8a 30 81 87 02 42 00 c6 85 8e |.......0...B....|
-000002b0 06 b7 04 04 e9 cd 9e 3e cb 66 23 95 b4 42 9c 64 |.......>.f#..B.d|
-000002c0 81 39 05 3f b5 21 f8 28 af 60 6b 4d 3d ba a1 4b |.9.?.!.(.`kM=..K|
-000002d0 5e 77 ef e7 59 28 fe 1d c1 27 a2 ff a8 de 33 48 |^w..Y(...'....3H|
-000002e0 b3 c1 85 6a 42 9b f9 7e 7e 31 c2 e5 bd 66 02 41 |...jB..~~1...f.A|
-000002f0 4b 49 c6 cd 02 e3 83 f7 03 50 18 6d b4 c9 51 02 |KI.......P.m..Q.|
-00000300 c0 ab 87 bc e0 3e 4b 89 53 3a e2 65 89 97 02 c1 |.....>K.S:.e....|
-00000310 88 5a 97 82 3e 55 6b 7c d8 db b8 cc 1b 30 84 0a |.Z..>Uk|.....0..|
-00000320 7a 97 71 e4 10 bb a4 39 8c 2a cf f5 88 c7 d1 95 |z.q....9.*......|
-00000330 73 14 03 03 00 01 01 16 03 03 00 24 9f 1e f0 72 |s..........$...r|
-00000340 92 ea dc f7 56 96 37 e4 69 db db 66 1d f6 94 c4 |....V.7.i..f....|
-00000350 18 31 4f d0 5d c5 f4 53 21 aa 98 b1 dc 08 94 94 |.1O.]..S!.......|
->>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 24 ee 68 c1 87 9f |..........$.h...|
-00000010 d7 90 94 f1 3b 6d 26 0b 3d 89 7a 45 3b 52 5d 3c |....;m&.=.zE;R]<|
-00000020 dd 7c c1 4e 57 3e a9 ee 91 be cf 2b a3 98 9d |.|.NW>.....+...|
->>> Flow 5 (client to server)
-00000000 17 03 03 00 1a 88 33 3e 2b 22 6b 92 d0 bb 8a 1e |......3>+"k.....|
-00000010 9b f4 9e aa 91 8b 2b 95 ea 53 c8 03 0a 93 58 15 |......+..S....X.|
-00000020 03 03 00 16 c4 67 79 ba ec cf 90 b1 f9 ac ec 64 |.....gy........d|
-00000030 72 01 08 8f 3a 98 aa 66 25 00 |r...:..f%.|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ClientCert-RSA-ECDSA b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ClientCert-RSA-ECDSA
deleted file mode 100644
index 0037af6..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ClientCert-RSA-ECDSA
+++ /dev/null
@@ -1,133 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 59 02 00 00 55 03 03 53 04 f1 02 fd |....Y...U..S....|
-00000010 41 bd ef ee f3 da fc 1a 31 8c 77 f2 e9 66 54 a0 |A.......1.w..fT.|
-00000020 f4 15 b1 1c 84 0d 6d 74 87 ac 7d 20 78 17 8b 08 |......mt..} x...|
-00000030 10 20 c9 44 e4 8a 43 af 4a c7 b8 3d 99 f2 f7 af |. .D..C.J..=....|
-00000040 bb a3 21 2f 40 cc ed b6 da a8 a1 d5 c0 09 00 00 |..!/@...........|
-00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
-00000060 03 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..|
-00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....|
-00000080 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 0b 30 |0...*.H.=..0E1.0|
-00000090 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...|
-000000a0 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1|
-000000b0 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern|
-000000c0 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L|
-000000d0 74 64 30 1e 17 0d 31 32 31 31 32 32 31 35 30 36 |td0...1211221506|
-000000e0 33 32 5a 17 0d 32 32 31 31 32 30 31 35 30 36 33 |32Z..22112015063|
-000000f0 32 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 |2Z0E1.0...U....A|
-00000100 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 |U1.0...U....Some|
-00000110 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 |-State1!0...U...|
-00000120 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 |.Internet Widgit|
-00000130 73 20 50 74 79 20 4c 74 64 30 81 9b 30 10 06 07 |s Pty Ltd0..0...|
-00000140 2a 86 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 |*.H.=....+...#..|
-00000150 86 00 04 00 c4 a1 ed be 98 f9 0b 48 73 36 7e c3 |...........Hs6~.|
-00000160 16 56 11 22 f2 3d 53 c3 3b 4d 21 3d cd 6b 75 e6 |.V.".=S.;M!=.ku.|
-00000170 f6 b0 dc 9a df 26 c1 bc b2 87 f0 72 32 7c b3 64 |.....&.....r2|.d|
-00000180 2f 1c 90 bc ea 68 23 10 7e fe e3 25 c0 48 3a 69 |/....h#.~..%.H:i|
-00000190 e0 28 6d d3 37 00 ef 04 62 dd 0d a0 9c 70 62 83 |.(m.7...b....pb.|
-000001a0 d8 81 d3 64 31 aa 9e 97 31 bd 96 b0 68 c0 9b 23 |...d1...1...h..#|
-000001b0 de 76 64 3f 1a 5c 7f e9 12 0e 58 58 b6 5f 70 dd |.vd?.\....XX._p.|
-000001c0 9b d8 ea d5 d7 f5 d5 cc b9 b6 9f 30 66 5b 66 9a |...........0f[f.|
-000001d0 20 e2 27 e5 bf fe 3b 30 09 06 07 2a 86 48 ce 3d | .'...;0...*.H.=|
-000001e0 04 01 03 81 8c 00 30 81 88 02 42 01 88 a2 4f eb |......0...B...O.|
-000001f0 e2 45 c5 48 7d 1b ac f5 ed 98 9d ae 47 70 c0 5e |.E.H}.......Gp.^|
-00000200 1b b6 2f bd f1 b6 4d b7 61 40 d3 11 a2 ce ee 0b |../...M.a@......|
-00000210 7e 92 7e ff 76 9d c3 3b 7e a5 3f ce fa 10 e2 59 |~.~.v..;~.?....Y|
-00000220 ec 47 2d 7c ac da 4e 97 0e 15 a0 6f d0 02 42 01 |.G-|..N....o..B.|
-00000230 4d fc be 67 13 9c 2d 05 0e bd 3f a3 8c 25 c1 33 |M..g..-...?..%.3|
-00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....|
-00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.|
-00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....|
-00000270 2a 16 03 03 00 d8 0c 00 00 d4 03 00 17 41 04 a9 |*............A..|
-00000280 19 8b d9 9b 5c 7c 6a 7d 85 d2 70 4e 89 7e 0b 5b |....\|j}..pN.~.[|
-00000290 dd 5e a1 63 8d 15 bc 0b 0c 47 3d 4d e8 a7 56 88 |.^.c.....G=M..V.|
-000002a0 2e f6 7f e2 4d fc ed cc 03 ed a1 2d ac ae 81 a5 |....M......-....|
-000002b0 e2 6d 7f 9f a3 93 e9 10 c1 0e 48 1b f3 f4 38 04 |.m........H...8.|
-000002c0 03 00 8b 30 81 88 02 42 00 87 fe 7e 63 82 14 57 |...0...B...~c..W|
-000002d0 dc 7d e2 0f cc 97 2d ba 3c a7 56 4a 17 a8 09 6a |.}....-.<.VJ...j|
-000002e0 28 2e f2 66 1a 3f 2d 48 2b 6f 79 a1 60 cd 5e 10 |(..f.?-H+oy.`.^.|
-000002f0 0b 0a 28 f2 5f e4 3f 4f f9 c9 91 34 d9 dc bc fc |..(._.?O...4....|
-00000300 98 ea 77 0b 99 f8 a2 11 c4 bd 02 42 01 a0 b0 dc |..w........B....|
-00000310 db 5b c2 09 99 bd ee a0 b9 aa 31 b9 10 84 22 be |.[........1...".|
-00000320 5a 63 12 5a 43 00 8e c1 33 cc 91 bb c2 70 7a 63 |Zc.ZC...3....pzc|
-00000330 19 82 c0 74 48 a1 c7 3d 1f f1 6f 4a 6f 6a 8c 3f |...tH..=..oJoj.?|
-00000340 28 31 a8 0c 65 19 26 62 4b 7a 7c 4b ea 1a 16 03 |(1..e.&bKz|K....|
-00000350 03 00 30 0d 00 00 28 03 01 02 40 00 20 06 01 06 |..0...(...@. ...|
-00000360 02 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 |................|
-00000370 01 03 02 03 03 02 01 02 02 02 03 01 01 00 00 0e |................|
-00000380 00 00 00 |...|
->>> Flow 3 (client to server)
-00000000 16 03 03 01 fb 0b 00 01 f7 00 01 f4 00 01 f1 30 |...............0|
-00000010 82 01 ed 30 82 01 58 a0 03 02 01 02 02 01 00 30 |...0..X........0|
-00000020 0b 06 09 2a 86 48 86 f7 0d 01 01 05 30 26 31 10 |...*.H......0&1.|
-00000030 30 0e 06 03 55 04 0a 13 07 41 63 6d 65 20 43 6f |0...U....Acme Co|
-00000040 31 12 30 10 06 03 55 04 03 13 09 31 32 37 2e 30 |1.0...U....127.0|
-00000050 2e 30 2e 31 30 1e 17 0d 31 31 31 32 30 38 30 37 |.0.10...11120807|
-00000060 35 35 31 32 5a 17 0d 31 32 31 32 30 37 30 38 30 |5512Z..121207080|
-00000070 30 31 32 5a 30 26 31 10 30 0e 06 03 55 04 0a 13 |012Z0&1.0...U...|
-00000080 07 41 63 6d 65 20 43 6f 31 12 30 10 06 03 55 04 |.Acme Co1.0...U.|
-00000090 03 13 09 31 32 37 2e 30 2e 30 2e 31 30 81 9c 30 |...127.0.0.10..0|
-000000a0 0b 06 09 2a 86 48 86 f7 0d 01 01 01 03 81 8c 00 |...*.H..........|
-000000b0 30 81 88 02 81 80 4e d0 7b 31 e3 82 64 d9 59 c0 |0.....N.{1..d.Y.|
-000000c0 c2 87 a4 5e 1e 8b 73 33 c7 63 53 df 66 92 06 84 |...^..s3.cS.f...|
-000000d0 f6 64 d5 8f e4 36 a7 1d 2b e8 b3 20 36 45 23 b5 |.d...6..+.. 6E#.|
-000000e0 e3 95 ae ed e0 f5 20 9c 8d 95 df 7f 5a 12 ef 87 |...... .....Z...|
-000000f0 e4 5b 68 e4 e9 0e 74 ec 04 8a 7f de 93 27 c4 01 |.[h...t......'..|
-00000100 19 7a bd f2 dc 3d 14 ab d0 54 ca 21 0c d0 4d 6e |.z...=...T.!..Mn|
-00000110 87 2e 5c c5 d2 bb 4d 4b 4f ce b6 2c f7 7e 88 ec |..\...MKO..,.~..|
-00000120 7c d7 02 91 74 a6 1e 0c 1a da e3 4a 5a 2e de 13 ||...t......JZ...|
-00000130 9c 4c 40 88 59 93 02 03 01 00 01 a3 32 30 30 30 |.L@.Y.......2000|
-00000140 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02 00 a0 30 |...U...........0|
-00000150 0d 06 03 55 1d 0e 04 06 04 04 01 02 03 04 30 0f |...U..........0.|
-00000160 06 03 55 1d 23 04 08 30 06 80 04 01 02 03 04 30 |..U.#..0.......0|
-00000170 0b 06 09 2a 86 48 86 f7 0d 01 01 05 03 81 81 00 |...*.H..........|
-00000180 36 1f b3 7a 0c 75 c9 6e 37 46 61 2b d5 bd c0 a7 |6..z.u.n7Fa+....|
-00000190 4b cc 46 9a 81 58 7c 85 79 29 c8 c8 c6 67 dd 32 |K.F..X|.y)...g.2|
-000001a0 56 45 2b 75 b6 e9 24 a9 50 9a be 1f 5a fa 1a 15 |VE+u..$.P...Z...|
-000001b0 d9 cc 55 95 72 16 83 b9 c2 b6 8f fd 88 8c 38 84 |..U.r.........8.|
-000001c0 1d ab 5d 92 31 13 4f fd 83 3b c6 9d f1 11 62 b6 |..].1.O..;....b.|
-000001d0 8b ec ab 67 be c8 64 b0 11 50 46 58 17 6b 99 1c |...g..d..PFX.k..|
-000001e0 d3 1d fc 06 f1 0e e5 96 a8 0c f9 78 20 b7 44 18 |...........x .D.|
-000001f0 51 8d 10 7e 4f 94 67 df a3 4e 70 73 8e 90 91 85 |Q..~O.g..Nps....|
-00000200 16 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
-00000210 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
-00000220 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
-00000230 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
-00000240 a6 b5 68 1a 41 03 56 6b dc 5a 89 16 03 03 00 88 |..h.A.Vk.Z......|
-00000250 0f 00 00 84 04 01 00 80 38 f2 16 e5 b5 86 16 62 |........8......b|
-00000260 86 e1 7d 01 f1 a8 e1 f7 e7 85 b1 a0 17 ee 84 25 |..}............%|
-00000270 cb 3c 46 61 1a 78 7b 1e ee 32 bc d9 6c fa 6b 76 |.<Fa.x{..2..l.kv|
-00000280 67 a7 9e c8 7a 4c e8 79 0d 22 27 ad e7 98 6a 98 |g...zL.y."'...j.|
-00000290 89 88 8b a9 69 5b 6f c6 00 48 9a 21 77 a9 7c 15 |....i[o..H.!w.|.|
-000002a0 ba 47 16 74 8d 6c 67 dc 6d f1 98 b6 61 e8 bc 08 |.G.t.lg.m...a...|
-000002b0 18 53 a6 93 bf fc 27 5e b7 4d d2 eb 68 e9 23 ee |.S....'^.M..h.#.|
-000002c0 d2 70 d2 55 2c c7 99 7d c0 66 b5 1c ea 38 71 5c |.p.U,..}.f...8q\|
-000002d0 a6 57 1f 52 e4 8e e8 51 14 03 03 00 01 01 16 03 |.W.R...Q........|
-000002e0 03 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 |..@.............|
-000002f0 00 00 00 5e e7 6e 1c a2 02 24 34 f0 a6 b6 27 ea |...^.n...$4...'.|
-00000300 69 d5 0e 2e a8 ad 5c ad 6c 06 78 68 39 92 27 f1 |i.....\.l.xh9.'.|
-00000310 e8 35 49 67 4d fb 5d 8a 31 2e 4e 3f 19 ed ea 30 |.5IgM.].1.N?...0|
-00000320 20 60 e1 | `.|
->>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 40 ee a8 82 bc 3f |..........@....?|
-00000010 bf ab a6 e4 30 e0 3d f1 2f 19 a2 ac 7a 81 57 f1 |....0.=./...z.W.|
-00000020 ee 67 3f 55 2b 30 fa 72 b5 10 03 ec 8d 0a 8f bb |.g?U+0.r........|
-00000030 24 f5 45 f5 4e 53 4b 93 a5 0d 42 6c 46 69 98 fb |$.E.NSK...BlFi..|
-00000040 63 c5 9f 95 65 d1 b6 f0 a4 15 bd |c...e......|
->>> Flow 5 (client to server)
-00000000 17 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-00000010 00 00 00 00 00 cb 4e bc d1 a9 58 ef c8 39 a9 36 |......N...X..9.6|
-00000020 f4 35 05 96 8e a4 50 bc f4 15 06 f9 fd 41 6d 1e |.5....P......Am.|
-00000030 5e 7c 82 63 94 15 03 03 00 30 00 00 00 00 00 00 |^|.c.....0......|
-00000040 00 00 00 00 00 00 00 00 00 00 bd 77 87 a5 5a d4 |...........w..Z.|
-00000050 b8 59 e6 6b 0f dd ea f9 ed 18 b2 9f a9 61 b4 3a |.Y.k.........a.:|
-00000060 47 15 15 3b 83 ef e1 6d db a8 |G..;...m..|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ClientCert-RSA-RSA b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ClientCert-RSA-RSA
deleted file mode 100644
index df3eaa4..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ClientCert-RSA-RSA
+++ /dev/null
@@ -1,126 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 51 02 00 00 4d 03 03 53 04 f1 02 1d |....Q...M..S....|
-00000010 0e dc 86 e5 a9 07 71 46 15 34 af 47 15 3f 03 9c |......qF.4.G.?..|
-00000020 fc d6 fd 44 7c f4 f1 c7 8d 6f f8 20 28 ea 3c dc |...D|....o. (.<.|
-00000030 b2 4c b7 ba 20 88 c4 db a5 73 ea 93 ab 3a 85 a6 |.L.. ....s...:..|
-00000040 8f 59 49 d9 a9 31 14 d5 a6 2b 4f d1 00 05 00 00 |.YI..1...+O.....|
-00000050 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................|
-00000060 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000070 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000080 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000090 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-000000a0 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-000000b0 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000c0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000d0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000e0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000f0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-00000100 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-00000110 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000120 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000130 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000140 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000150 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000160 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000170 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000180 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000190 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-000001a0 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-000001b0 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001c0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001d0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001e0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001f0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-00000200 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-00000210 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000220 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000230 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000240 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000250 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000260 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000270 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000280 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000290 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-000002a0 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-000002b0 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002c0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002d0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002e0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002f0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-00000300 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-00000310 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 30 0d 00 |n8P)l........0..|
-00000320 00 28 03 01 02 40 00 20 06 01 06 02 06 03 05 01 |.(...@. ........|
-00000330 05 02 05 03 04 01 04 02 04 03 03 01 03 02 03 03 |................|
-00000340 02 01 02 02 02 03 01 01 00 00 0e 00 00 00 |..............|
->>> Flow 3 (client to server)
-00000000 16 03 03 01 fb 0b 00 01 f7 00 01 f4 00 01 f1 30 |...............0|
-00000010 82 01 ed 30 82 01 58 a0 03 02 01 02 02 01 00 30 |...0..X........0|
-00000020 0b 06 09 2a 86 48 86 f7 0d 01 01 05 30 26 31 10 |...*.H......0&1.|
-00000030 30 0e 06 03 55 04 0a 13 07 41 63 6d 65 20 43 6f |0...U....Acme Co|
-00000040 31 12 30 10 06 03 55 04 03 13 09 31 32 37 2e 30 |1.0...U....127.0|
-00000050 2e 30 2e 31 30 1e 17 0d 31 31 31 32 30 38 30 37 |.0.10...11120807|
-00000060 35 35 31 32 5a 17 0d 31 32 31 32 30 37 30 38 30 |5512Z..121207080|
-00000070 30 31 32 5a 30 26 31 10 30 0e 06 03 55 04 0a 13 |012Z0&1.0...U...|
-00000080 07 41 63 6d 65 20 43 6f 31 12 30 10 06 03 55 04 |.Acme Co1.0...U.|
-00000090 03 13 09 31 32 37 2e 30 2e 30 2e 31 30 81 9c 30 |...127.0.0.10..0|
-000000a0 0b 06 09 2a 86 48 86 f7 0d 01 01 01 03 81 8c 00 |...*.H..........|
-000000b0 30 81 88 02 81 80 4e d0 7b 31 e3 82 64 d9 59 c0 |0.....N.{1..d.Y.|
-000000c0 c2 87 a4 5e 1e 8b 73 33 c7 63 53 df 66 92 06 84 |...^..s3.cS.f...|
-000000d0 f6 64 d5 8f e4 36 a7 1d 2b e8 b3 20 36 45 23 b5 |.d...6..+.. 6E#.|
-000000e0 e3 95 ae ed e0 f5 20 9c 8d 95 df 7f 5a 12 ef 87 |...... .....Z...|
-000000f0 e4 5b 68 e4 e9 0e 74 ec 04 8a 7f de 93 27 c4 01 |.[h...t......'..|
-00000100 19 7a bd f2 dc 3d 14 ab d0 54 ca 21 0c d0 4d 6e |.z...=...T.!..Mn|
-00000110 87 2e 5c c5 d2 bb 4d 4b 4f ce b6 2c f7 7e 88 ec |..\...MKO..,.~..|
-00000120 7c d7 02 91 74 a6 1e 0c 1a da e3 4a 5a 2e de 13 ||...t......JZ...|
-00000130 9c 4c 40 88 59 93 02 03 01 00 01 a3 32 30 30 30 |.L@.Y.......2000|
-00000140 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02 00 a0 30 |...U...........0|
-00000150 0d 06 03 55 1d 0e 04 06 04 04 01 02 03 04 30 0f |...U..........0.|
-00000160 06 03 55 1d 23 04 08 30 06 80 04 01 02 03 04 30 |..U.#..0.......0|
-00000170 0b 06 09 2a 86 48 86 f7 0d 01 01 05 03 81 81 00 |...*.H..........|
-00000180 36 1f b3 7a 0c 75 c9 6e 37 46 61 2b d5 bd c0 a7 |6..z.u.n7Fa+....|
-00000190 4b cc 46 9a 81 58 7c 85 79 29 c8 c8 c6 67 dd 32 |K.F..X|.y)...g.2|
-000001a0 56 45 2b 75 b6 e9 24 a9 50 9a be 1f 5a fa 1a 15 |VE+u..$.P...Z...|
-000001b0 d9 cc 55 95 72 16 83 b9 c2 b6 8f fd 88 8c 38 84 |..U.r.........8.|
-000001c0 1d ab 5d 92 31 13 4f fd 83 3b c6 9d f1 11 62 b6 |..].1.O..;....b.|
-000001d0 8b ec ab 67 be c8 64 b0 11 50 46 58 17 6b 99 1c |...g..d..PFX.k..|
-000001e0 d3 1d fc 06 f1 0e e5 96 a8 0c f9 78 20 b7 44 18 |...........x .D.|
-000001f0 51 8d 10 7e 4f 94 67 df a3 4e 70 73 8e 90 91 85 |Q..~O.g..Nps....|
-00000200 16 03 03 00 86 10 00 00 82 00 80 6d 51 f3 7f f9 |...........mQ...|
-00000210 3e fb 75 82 41 36 83 e8 6a ee 2a 2e 25 90 67 4c |>.u.A6..j.*.%.gL|
-00000220 8e 62 2f 30 81 17 e0 85 09 0c 2b b7 23 d7 b0 e2 |.b/0......+.#...|
-00000230 1d f7 3b d7 f5 a1 27 b6 ee 24 b6 1b cc 5b ea 66 |..;...'..$...[.f|
-00000240 0d 6a f4 e5 85 f9 da 43 b4 0e 86 85 e1 f5 aa be |.j.....C........|
-00000250 c8 ce 39 4c 9c 86 00 08 c2 4b e2 c6 ec 2f f7 ce |..9L.....K.../..|
-00000260 e6 bd 77 82 6f 23 b6 e0 bd a2 92 b7 3a ac e8 56 |..w.o#......:..V|
-00000270 f1 af 54 5e 46 87 e9 3b 33 e7 b8 28 b7 d6 c8 90 |..T^F..;3..(....|
-00000280 35 d4 1c 43 d1 30 6f 55 4e 0a 70 16 03 03 00 88 |5..C.0oUN.p.....|
-00000290 0f 00 00 84 04 01 00 80 2a 1f ae 48 9f 86 16 dc |........*..H....|
-000002a0 c2 55 1f 5f 95 81 ed 56 00 5d 35 46 e5 b6 57 d5 |.U._...V.]5F..W.|
-000002b0 a6 3e 32 38 8b e2 c6 1c b9 b1 38 b2 da 66 45 ed |.>28......8..fE.|
-000002c0 58 6a 7f 43 41 93 a5 09 da b9 04 ce 3f 13 8a 19 |Xj.CA.......?...|
-000002d0 13 e9 2c 1f c5 e7 35 b4 2d ea 7c 81 90 33 c0 66 |..,...5.-.|..3.f|
-000002e0 dc 41 8b 23 08 8f 69 d4 d6 a2 5f c1 bd 26 e6 2e |.A.#..i..._..&..|
-000002f0 7f c8 7c a8 2d d4 08 95 ce 6e 58 54 04 a2 a6 63 |..|.-....nXT...c|
-00000300 54 72 67 f2 7f 61 0a 6b 58 46 d4 88 95 38 37 f2 |Trg..a.kXF...87.|
-00000310 93 95 48 56 14 a7 b9 7c 14 03 03 00 01 01 16 03 |..HV...|........|
-00000320 03 00 24 64 bb 41 3a cb a2 2f 95 53 5c 2f f7 83 |..$d.A:../.S\/..|
-00000330 a2 35 18 f6 d0 8d 6f e2 54 ed 2f 07 10 f4 36 e2 |.5....o.T./...6.|
-00000340 3d e5 30 1d e3 63 01 |=.0..c.|
->>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 24 0a 22 b6 bc da |..........$."...|
-00000010 34 38 53 8e 80 e2 25 7b 31 2f 70 8e 3a db e8 a3 |48S...%{1/p.:...|
-00000020 70 0e 88 22 b4 a8 be d4 a3 e3 cc 13 94 ef 47 |p.."..........G|
->>> Flow 5 (client to server)
-00000000 17 03 03 00 1a b4 9c b1 57 ea 01 03 fe 01 e7 1e |........W.......|
-00000010 c4 a7 0f 25 14 99 00 4f 88 51 c1 98 6e 99 01 15 |...%...O.Q..n...|
-00000020 03 03 00 16 2e c4 11 8b 1a fc 37 81 18 33 e4 9f |..........7..3..|
-00000030 48 a3 29 e3 ad 9b 9b ec 9f 99 |H.).......|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ECDHE-ECDSA-AES b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ECDHE-ECDSA-AES
deleted file mode 100644
index 7644590..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ECDHE-ECDSA-AES
+++ /dev/null
@@ -1,89 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 59 02 00 00 55 03 03 53 04 f1 02 a0 |....Y...U..S....|
-00000010 5f bd a4 8d 98 93 b8 da 08 86 9f b2 be 9a a4 91 |_...............|
-00000020 2b 3c 1f 18 f0 75 7c a9 a8 a0 f7 20 4a 89 9a d2 |+<...u|.... J...|
-00000030 34 3b d9 b1 c2 fd 61 bd 97 19 22 ce b9 d1 5b a7 |4;....a..."...[.|
-00000040 83 80 9c 19 d0 f5 a0 aa 4c ac 06 20 c0 09 00 00 |........L.. ....|
-00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
-00000060 03 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..|
-00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....|
-00000080 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 0b 30 |0...*.H.=..0E1.0|
-00000090 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...|
-000000a0 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1|
-000000b0 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern|
-000000c0 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L|
-000000d0 74 64 30 1e 17 0d 31 32 31 31 32 32 31 35 30 36 |td0...1211221506|
-000000e0 33 32 5a 17 0d 32 32 31 31 32 30 31 35 30 36 33 |32Z..22112015063|
-000000f0 32 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 |2Z0E1.0...U....A|
-00000100 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 |U1.0...U....Some|
-00000110 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 |-State1!0...U...|
-00000120 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 |.Internet Widgit|
-00000130 73 20 50 74 79 20 4c 74 64 30 81 9b 30 10 06 07 |s Pty Ltd0..0...|
-00000140 2a 86 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 |*.H.=....+...#..|
-00000150 86 00 04 00 c4 a1 ed be 98 f9 0b 48 73 36 7e c3 |...........Hs6~.|
-00000160 16 56 11 22 f2 3d 53 c3 3b 4d 21 3d cd 6b 75 e6 |.V.".=S.;M!=.ku.|
-00000170 f6 b0 dc 9a df 26 c1 bc b2 87 f0 72 32 7c b3 64 |.....&.....r2|.d|
-00000180 2f 1c 90 bc ea 68 23 10 7e fe e3 25 c0 48 3a 69 |/....h#.~..%.H:i|
-00000190 e0 28 6d d3 37 00 ef 04 62 dd 0d a0 9c 70 62 83 |.(m.7...b....pb.|
-000001a0 d8 81 d3 64 31 aa 9e 97 31 bd 96 b0 68 c0 9b 23 |...d1...1...h..#|
-000001b0 de 76 64 3f 1a 5c 7f e9 12 0e 58 58 b6 5f 70 dd |.vd?.\....XX._p.|
-000001c0 9b d8 ea d5 d7 f5 d5 cc b9 b6 9f 30 66 5b 66 9a |...........0f[f.|
-000001d0 20 e2 27 e5 bf fe 3b 30 09 06 07 2a 86 48 ce 3d | .'...;0...*.H.=|
-000001e0 04 01 03 81 8c 00 30 81 88 02 42 01 88 a2 4f eb |......0...B...O.|
-000001f0 e2 45 c5 48 7d 1b ac f5 ed 98 9d ae 47 70 c0 5e |.E.H}.......Gp.^|
-00000200 1b b6 2f bd f1 b6 4d b7 61 40 d3 11 a2 ce ee 0b |../...M.a@......|
-00000210 7e 92 7e ff 76 9d c3 3b 7e a5 3f ce fa 10 e2 59 |~.~.v..;~.?....Y|
-00000220 ec 47 2d 7c ac da 4e 97 0e 15 a0 6f d0 02 42 01 |.G-|..N....o..B.|
-00000230 4d fc be 67 13 9c 2d 05 0e bd 3f a3 8c 25 c1 33 |M..g..-...?..%.3|
-00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....|
-00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.|
-00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....|
-00000270 2a 16 03 03 00 d7 0c 00 00 d3 03 00 17 41 04 3c |*............A.<|
-00000280 8f 35 1e 47 5d 7b ad 13 0c e9 5c c0 97 c7 83 06 |.5.G]{....\.....|
-00000290 49 0f 6c cf e5 4d 3b ed f7 1b c6 96 8d ba 54 35 |I.l..M;.......T5|
-000002a0 7f df 35 e3 6e 28 e9 71 f2 24 b5 ab 17 2b 4b 2b |..5.n(.q.$...+K+|
-000002b0 0c 8f 9f 48 89 73 8f 09 69 84 af 7f ec 43 7a 04 |...H.s..i....Cz.|
-000002c0 03 00 8a 30 81 87 02 41 79 84 43 0c 78 fa 7e e2 |...0...Ay.C.x.~.|
-000002d0 c5 51 c1 60 88 c4 4a 59 7d 02 fa dc 19 68 33 ed |.Q.`..JY}....h3.|
-000002e0 19 ef a1 df ef 6b 21 a6 98 aa ba a9 13 70 91 0f |.....k!......p..|
-000002f0 cc 6c 5c 1e 99 53 1b 42 51 6c 06 a7 3c c4 04 22 |.l\..S.BQl..<.."|
-00000300 5d 0d c1 30 ab e3 ec b4 54 02 42 01 15 15 1a 6e |]..0....T.B....n|
-00000310 6f f1 c6 b1 10 84 2c c8 04 de 2b 52 d5 b4 f7 c9 |o.....,...+R....|
-00000320 4f 6d 0e 0e 26 45 1d 7a 28 59 2b 8b f6 92 3a 23 |Om..&E.z(Y+...:#|
-00000330 7a 39 9c d5 4e cc 5d c5 45 92 9c d0 5f 33 12 e3 |z9..N.].E..._3..|
-00000340 2b 29 39 52 bb 16 aa e1 72 9e b5 fe 99 16 03 03 |+)9R....r.......|
-00000350 00 04 0e 00 00 00 |......|
->>> Flow 3 (client to server)
-00000000 16 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
-00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
-00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
-00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
-00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 03 00 01 |..h.A.Vk.Z......|
-00000050 01 16 03 03 00 40 00 00 00 00 00 00 00 00 00 00 |.....@..........|
-00000060 00 00 00 00 00 00 20 a3 f8 5a e2 ea f3 09 19 3e |...... ..Z.....>|
-00000070 4a 54 69 70 06 5b 17 35 0f ed e7 30 3b 6f eb a1 |JTip.[.5...0;o..|
-00000080 cb 9c 35 81 10 2e 34 f7 12 a5 e4 63 20 b2 65 31 |..5...4....c .e1|
-00000090 19 da 30 43 39 59 |..0C9Y|
->>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 40 8d 4d 31 07 df |..........@.M1..|
-00000010 ab 41 f5 19 9c 1a 57 fc 33 ab 5f e6 bd 45 b9 fa |.A....W.3._..E..|
-00000020 7f db c0 df 72 f2 3b ef aa d4 5e 34 e6 3d 44 7c |....r.;...^4.=D||
-00000030 12 05 c7 57 da 54 b1 e3 66 f0 0a ab cd 15 a5 bf |...W.T..f.......|
-00000040 c5 c2 07 a9 d9 a7 2e 5e 29 da da |.......^)..|
->>> Flow 5 (client to server)
-00000000 17 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-00000010 00 00 00 00 00 dc 03 7b 29 2c 49 64 58 2d dc f7 |.......{),IdX-..|
-00000020 26 a1 3b ec 2d e8 30 c4 6c a3 ff e2 bc b5 a4 a6 |&.;.-.0.l.......|
-00000030 93 ce 14 bd da 15 03 03 00 30 00 00 00 00 00 00 |.........0......|
-00000040 00 00 00 00 00 00 00 00 00 00 a6 77 10 30 15 eb |...........w.0..|
-00000050 ed cf 73 5b 74 5d 09 52 4a 5b e2 f0 e4 67 f8 7a |..s[t].RJ[...g.z|
-00000060 5e 5e fc ba 7f 80 0a d2 f4 fb |^^........|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ECDHE-ECDSA-AES-GCM b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ECDHE-ECDSA-AES-GCM
deleted file mode 100644
index fb5af17..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ECDHE-ECDSA-AES-GCM
+++ /dev/null
@@ -1,84 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 59 02 00 00 55 03 03 53 04 f1 02 48 |....Y...U..S...H|
-00000010 03 36 01 05 56 6f f0 54 d2 c3 d3 41 c2 e2 69 7b |.6..Vo.T...A..i{|
-00000020 50 f8 03 ef 3f 5d 7c e6 9c cb fe 20 82 a0 81 fd |P...?]|.... ....|
-00000030 72 4b b8 e6 29 76 3b 0f 1d 0a b7 82 9d 0b cf a0 |rK..)v;.........|
-00000040 65 b1 56 53 c9 d5 58 7b f0 b6 2d cf c0 2b 00 00 |e.VS..X{..-..+..|
-00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
-00000060 03 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..|
-00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....|
-00000080 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 0b 30 |0...*.H.=..0E1.0|
-00000090 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...|
-000000a0 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1|
-000000b0 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern|
-000000c0 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L|
-000000d0 74 64 30 1e 17 0d 31 32 31 31 32 32 31 35 30 36 |td0...1211221506|
-000000e0 33 32 5a 17 0d 32 32 31 31 32 30 31 35 30 36 33 |32Z..22112015063|
-000000f0 32 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 |2Z0E1.0...U....A|
-00000100 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 |U1.0...U....Some|
-00000110 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 |-State1!0...U...|
-00000120 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 |.Internet Widgit|
-00000130 73 20 50 74 79 20 4c 74 64 30 81 9b 30 10 06 07 |s Pty Ltd0..0...|
-00000140 2a 86 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 |*.H.=....+...#..|
-00000150 86 00 04 00 c4 a1 ed be 98 f9 0b 48 73 36 7e c3 |...........Hs6~.|
-00000160 16 56 11 22 f2 3d 53 c3 3b 4d 21 3d cd 6b 75 e6 |.V.".=S.;M!=.ku.|
-00000170 f6 b0 dc 9a df 26 c1 bc b2 87 f0 72 32 7c b3 64 |.....&.....r2|.d|
-00000180 2f 1c 90 bc ea 68 23 10 7e fe e3 25 c0 48 3a 69 |/....h#.~..%.H:i|
-00000190 e0 28 6d d3 37 00 ef 04 62 dd 0d a0 9c 70 62 83 |.(m.7...b....pb.|
-000001a0 d8 81 d3 64 31 aa 9e 97 31 bd 96 b0 68 c0 9b 23 |...d1...1...h..#|
-000001b0 de 76 64 3f 1a 5c 7f e9 12 0e 58 58 b6 5f 70 dd |.vd?.\....XX._p.|
-000001c0 9b d8 ea d5 d7 f5 d5 cc b9 b6 9f 30 66 5b 66 9a |...........0f[f.|
-000001d0 20 e2 27 e5 bf fe 3b 30 09 06 07 2a 86 48 ce 3d | .'...;0...*.H.=|
-000001e0 04 01 03 81 8c 00 30 81 88 02 42 01 88 a2 4f eb |......0...B...O.|
-000001f0 e2 45 c5 48 7d 1b ac f5 ed 98 9d ae 47 70 c0 5e |.E.H}.......Gp.^|
-00000200 1b b6 2f bd f1 b6 4d b7 61 40 d3 11 a2 ce ee 0b |../...M.a@......|
-00000210 7e 92 7e ff 76 9d c3 3b 7e a5 3f ce fa 10 e2 59 |~.~.v..;~.?....Y|
-00000220 ec 47 2d 7c ac da 4e 97 0e 15 a0 6f d0 02 42 01 |.G-|..N....o..B.|
-00000230 4d fc be 67 13 9c 2d 05 0e bd 3f a3 8c 25 c1 33 |M..g..-...?..%.3|
-00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....|
-00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.|
-00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....|
-00000270 2a 16 03 03 00 d7 0c 00 00 d3 03 00 17 41 04 86 |*............A..|
-00000280 36 b4 78 76 87 70 ed ae 0d 34 70 3d 16 e5 a4 db |6.xv.p...4p=....|
-00000290 ae 28 58 4c 01 5a 56 73 a7 0d 34 59 a7 04 75 69 |.(XL.ZVs..4Y..ui|
-000002a0 f2 55 24 40 b0 33 c6 93 ff ae e0 14 f5 4b ce a8 |.U$@.3.......K..|
-000002b0 e2 e6 9a 67 1d 66 fb 8f fd 56 59 e7 73 f2 2c 04 |...g.f...VY.s.,.|
-000002c0 03 00 8a 30 81 87 02 41 73 ab a8 3c 64 17 69 9f |...0...As..<d.i.|
-000002d0 4d b2 9b 55 12 60 33 94 cf f3 83 40 2b 7b 1b af |M..U.`3....@+{..|
-000002e0 5c f4 cd 02 66 fb 83 04 35 fd ab 74 98 1a 7d f6 |\...f...5..t..}.|
-000002f0 9e 50 98 c3 98 e8 56 9c f2 2a b0 30 9d 05 14 58 |.P....V..*.0...X|
-00000300 68 6a 88 04 49 07 78 bf 3a 02 42 01 be b2 05 9e |hj..I.x.:.B.....|
-00000310 67 da 1e e9 5a 36 98 52 21 9f 43 75 43 ba bb 9a |g...Z6.R!.CuC...|
-00000320 e6 e2 65 f4 e0 44 45 08 5a 1e 54 06 dd 5f 60 2e |..e..DE.Z.T.._`.|
-00000330 7d e7 55 08 d3 7b 4e 0a c7 da d4 27 34 d4 bd b0 |}.U..{N....'4...|
-00000340 12 2f 41 7a ed 71 32 ef ee 12 74 66 00 16 03 03 |./Az.q2...tf....|
-00000350 00 04 0e 00 00 00 |......|
->>> Flow 3 (client to server)
-00000000 16 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
-00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
-00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
-00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
-00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 03 00 01 |..h.A.Vk.Z......|
-00000050 01 16 03 03 00 28 00 00 00 00 00 00 00 00 87 7a |.....(.........z|
-00000060 82 d7 46 25 1d a6 bb c2 a8 a8 4e a5 d1 f8 02 db |..F%......N.....|
-00000070 33 33 ca 78 b6 d3 bd 77 8a 33 23 a7 95 fb |33.x...w.3#...|
->>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 28 ce a1 9d 01 c0 |..........(.....|
-00000010 31 e5 d5 57 16 e1 a6 b3 8b 25 58 0f fa 2a de 3e |1..W.....%X..*.>|
-00000020 0c d9 06 11 a6 b0 d7 b0 33 ad 31 73 5b 26 b4 d2 |........3.1s[&..|
-00000030 12 56 c8 |.V.|
->>> Flow 5 (client to server)
-00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 d5 04 4c |...............L|
-00000010 7b 35 b4 d7 90 ae fe 00 d2 f2 4b 76 f1 36 5e 24 |{5........Kv.6^$|
-00000020 4a aa 94 15 03 03 00 1a 00 00 00 00 00 00 00 02 |J...............|
-00000030 d3 1c 41 37 ab f6 17 79 f0 01 a4 19 a5 75 7a 8e |..A7...y.....uz.|
-00000040 a3 b2 |..|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ECDHE-RSA-AES b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ECDHE-RSA-AES
deleted file mode 100644
index 5336bbb..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-ECDHE-RSA-AES
+++ /dev/null
@@ -1,99 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 59 02 00 00 55 03 03 53 04 f1 02 41 |....Y...U..S...A|
-00000010 95 cc 56 30 65 46 24 75 d5 9e 3c a7 5b 6c 99 fe |..V0eF$u..<.[l..|
-00000020 86 35 23 42 3a 8f 4d 4c b9 98 7d 20 a7 46 43 72 |.5#B:.ML..} .FCr|
-00000030 66 bb b6 ad ff ad cf 63 37 fe 6b b4 78 94 08 49 |f......c7.k.x..I|
-00000040 54 06 ed f4 85 73 38 4a c6 fe b6 98 c0 13 00 00 |T....s8J........|
-00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
-00000060 03 02 be 0b 00 02 ba 00 02 b7 00 02 b4 30 82 02 |.............0..|
-00000070 b0 30 82 02 19 a0 03 02 01 02 02 09 00 85 b0 bb |.0..............|
-00000080 a4 8a 7f b8 ca 30 0d 06 09 2a 86 48 86 f7 0d 01 |.....0...*.H....|
-00000090 01 05 05 00 30 45 31 0b 30 09 06 03 55 04 06 13 |....0E1.0...U...|
-000000a0 02 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f |.AU1.0...U....So|
-000000b0 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 |me-State1!0...U.|
-000000c0 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 |...Internet Widg|
-000000d0 69 74 73 20 50 74 79 20 4c 74 64 30 1e 17 0d 31 |its Pty Ltd0...1|
-000000e0 30 30 34 32 34 30 39 30 39 33 38 5a 17 0d 31 31 |00424090938Z..11|
-000000f0 30 34 32 34 30 39 30 39 33 38 5a 30 45 31 0b 30 |0424090938Z0E1.0|
-00000100 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...|
-00000110 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1|
-00000120 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern|
-00000130 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L|
-00000140 74 64 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 |td0..0...*.H....|
-00000150 01 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 bb |........0.......|
-00000160 79 d6 f5 17 b5 e5 bf 46 10 d0 dc 69 be e6 2b 07 |y......F...i..+.|
-00000170 43 5a d0 03 2d 8a 7a 43 85 b7 14 52 e7 a5 65 4c |CZ..-.zC...R..eL|
-00000180 2c 78 b8 23 8c b5 b4 82 e5 de 1f 95 3b 7e 62 a5 |,x.#........;~b.|
-00000190 2c a5 33 d6 fe 12 5c 7a 56 fc f5 06 bf fa 58 7b |,.3...\zV.....X{|
-000001a0 26 3f b5 cd 04 d3 d0 c9 21 96 4a c7 f4 54 9f 5a |&?......!.J..T.Z|
-000001b0 bf ef 42 71 00 fe 18 99 07 7f 7e 88 7d 7d f1 04 |..Bq......~.}}..|
-000001c0 39 c4 a2 2e db 51 c9 7c e3 c0 4c 3b 32 66 01 cf |9....Q.|..L;2f..|
-000001d0 af b1 1d b8 71 9a 1d db db 89 6b ae da 2d 79 02 |....q.....k..-y.|
-000001e0 03 01 00 01 a3 81 a7 30 81 a4 30 1d 06 03 55 1d |.......0..0...U.|
-000001f0 0e 04 16 04 14 b1 ad e2 85 5a cf cb 28 db 69 ce |.........Z..(.i.|
-00000200 23 69 de d3 26 8e 18 88 39 30 75 06 03 55 1d 23 |#i..&...90u..U.#|
-00000210 04 6e 30 6c 80 14 b1 ad e2 85 5a cf cb 28 db 69 |.n0l......Z..(.i|
-00000220 ce 23 69 de d3 26 8e 18 88 39 a1 49 a4 47 30 45 |.#i..&...9.I.G0E|
-00000230 31 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 30 |1.0...U....AU1.0|
-00000240 11 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 |...U....Some-Sta|
-00000250 74 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 |te1!0...U....Int|
-00000260 65 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 |ernet Widgits Pt|
-00000270 79 20 4c 74 64 82 09 00 85 b0 bb a4 8a 7f b8 ca |y Ltd...........|
-00000280 30 0c 06 03 55 1d 13 04 05 30 03 01 01 ff 30 0d |0...U....0....0.|
-00000290 06 09 2a 86 48 86 f7 0d 01 01 05 05 00 03 81 81 |..*.H...........|
-000002a0 00 08 6c 45 24 c7 6b b1 59 ab 0c 52 cc f2 b0 14 |..lE$.k.Y..R....|
-000002b0 d7 87 9d 7a 64 75 b5 5a 95 66 e4 c5 2b 8e ae 12 |...zdu.Z.f..+...|
-000002c0 66 1f eb 4f 38 b3 6e 60 d3 92 fd f7 41 08 b5 25 |f..O8.n`....A..%|
-000002d0 13 b1 18 7a 24 fb 30 1d ba ed 98 b9 17 ec e7 d7 |...z$.0.........|
-000002e0 31 59 db 95 d3 1d 78 ea 50 56 5c d5 82 5a 2d 5a |1Y....x.PV\..Z-Z|
-000002f0 5f 33 c4 b6 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 |_3....u....R....|
-00000300 1f 89 20 5f f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 |.. _..........W.|
-00000310 70 e8 26 6d 71 99 9b 26 6e 38 50 29 6c 90 a7 bd |p.&mq..&n8P)l...|
-00000320 d9 16 03 03 00 cd 0c 00 00 c9 03 00 17 41 04 48 |.............A.H|
-00000330 68 d8 8a 10 b4 bf eb 8d d1 98 b0 a6 f4 47 5d 91 |h............G].|
-00000340 61 da 50 d9 85 7b 5d 90 02 2c 38 c9 af 81 d3 55 |a.P..{]..,8....U|
-00000350 07 62 b1 62 58 7f 39 94 d7 91 96 a8 1f 47 60 a5 |.b.bX.9......G`.|
-00000360 c0 04 f2 fb cb 15 75 a6 16 3f 94 53 7c ff dd 04 |......u..?.S|...|
-00000370 01 00 80 b9 82 fa 0b f8 8c 94 2c 6e 05 81 7d 80 |..........,n..}.|
-00000380 5d 9a 77 78 af c8 33 5d 89 7e 2e 3c e5 72 66 a8 |].wx..3].~.<.rf.|
-00000390 f1 5c 02 04 02 70 76 7b 45 ff 0d 29 a0 cb 0d db |.\...pv{E..)....|
-000003a0 7a 4c c4 13 19 cd 47 b2 f1 c9 43 4f 95 d2 f1 c6 |zL....G...CO....|
-000003b0 bc ae 31 4a 9d de 80 b2 a4 b7 b6 dd 8c 03 3e 2a |..1J..........>*|
-000003c0 46 5e d1 e7 5b c5 9e 06 58 f3 55 b2 77 09 f3 98 |F^..[...X.U.w...|
-000003d0 d5 7f 5a 74 64 7e 48 22 8f 7d a8 68 b6 1d 90 df |..Ztd~H".}.h....|
-000003e0 2c 91 d7 c5 07 3d d1 6f e9 c1 91 03 3c 23 5a 56 |,....=.o....<#ZV|
-000003f0 3b b2 c2 16 03 03 00 04 0e 00 00 00 |;...........|
->>> Flow 3 (client to server)
-00000000 16 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
-00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
-00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
-00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
-00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 03 00 01 |..h.A.Vk.Z......|
-00000050 01 16 03 03 00 40 00 00 00 00 00 00 00 00 00 00 |.....@..........|
-00000060 00 00 00 00 00 00 59 e6 92 05 27 ec 09 2c b0 a5 |......Y...'..,..|
-00000070 2a fb 7e f1 03 53 16 63 68 a1 86 13 bb da 98 27 |*.~..S.ch......'|
-00000080 6d 42 08 35 6a ec 58 61 2a 4d 44 ec ae c5 b9 d2 |mB.5j.Xa*MD.....|
-00000090 76 57 1f 75 9f 8d |vW.u..|
->>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 40 6e 03 d0 e6 98 |..........@n....|
-00000010 1f f5 39 7b 06 9f 95 f0 7a 88 35 7c 55 db c3 2f |..9{....z.5|U../|
-00000020 00 ef 5b d3 62 87 a2 94 da 2f f6 4a 89 c9 a8 3d |..[.b..../.J...=|
-00000030 3a 92 db 77 35 92 01 4b f5 c5 6b 95 09 9f cd 79 |:..w5..K..k....y|
-00000040 3c af 37 5b 27 bf 93 3e 04 55 71 |<.7['..>.Uq|
->>> Flow 5 (client to server)
-00000000 17 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-00000010 00 00 00 00 00 bc c9 d0 8e 80 14 de 32 18 49 e8 |............2.I.|
-00000020 20 dc 5e 6c e4 6d 14 00 df 51 71 fb 86 95 16 4c | .^l.m...Qq....L|
-00000030 04 8e 71 e1 48 15 03 03 00 30 00 00 00 00 00 00 |..q.H....0......|
-00000040 00 00 00 00 00 00 00 00 00 00 b7 6d 30 72 61 53 |...........m0raS|
-00000050 d8 0a d4 1d ae e5 d4 22 46 c9 d5 4e 4a 86 f5 ac |......."F..NJ...|
-00000060 72 98 c6 db 38 29 97 2c 84 0b |r...8).,..|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-RSA-RC4 b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-RSA-RC4
deleted file mode 100644
index 0377f05..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Client-TLSv12-RSA-RC4
+++ /dev/null
@@ -1,83 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 51 02 00 00 4d 03 03 53 04 f1 02 9d |....Q...M..S....|
-00000010 2e 4e d9 17 4a 35 fa 9d 94 f6 45 0a f6 6b 5d 1c |.N..J5....E..k].|
-00000020 1e 15 19 8d 6d 94 cc 90 d9 39 94 20 8b 4b de 76 |....m....9. .K.v|
-00000030 d5 64 5d b7 19 df e7 eb 7e a0 22 c4 09 38 a0 12 |.d].....~."..8..|
-00000040 d5 59 10 c8 31 06 dc fc e4 9d d1 80 00 05 00 00 |.Y..1...........|
-00000050 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................|
-00000060 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000070 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000080 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000090 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-000000a0 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-000000b0 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000c0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000d0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000e0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000f0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-00000100 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-00000110 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000120 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000130 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000140 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000150 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000160 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000170 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000180 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000190 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-000001a0 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-000001b0 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001c0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001d0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001e0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001f0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-00000200 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-00000210 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000220 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000230 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000240 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000250 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000260 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000270 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000280 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000290 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-000002a0 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-000002b0 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002c0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002d0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002e0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002f0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-00000300 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-00000310 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 04 0e 00 |n8P)l...........|
-00000320 00 00 |..|
->>> Flow 3 (client to server)
-00000000 16 03 03 00 86 10 00 00 82 00 80 6d 51 f3 7f f9 |...........mQ...|
-00000010 3e fb 75 82 41 36 83 e8 6a ee 2a 2e 25 90 67 4c |>.u.A6..j.*.%.gL|
-00000020 8e 62 2f 30 81 17 e0 85 09 0c 2b b7 23 d7 b0 e2 |.b/0......+.#...|
-00000030 1d f7 3b d7 f5 a1 27 b6 ee 24 b6 1b cc 5b ea 66 |..;...'..$...[.f|
-00000040 0d 6a f4 e5 85 f9 da 43 b4 0e 86 85 e1 f5 aa be |.j.....C........|
-00000050 c8 ce 39 4c 9c 86 00 08 c2 4b e2 c6 ec 2f f7 ce |..9L.....K.../..|
-00000060 e6 bd 77 82 6f 23 b6 e0 bd a2 92 b7 3a ac e8 56 |..w.o#......:..V|
-00000070 f1 af 54 5e 46 87 e9 3b 33 e7 b8 28 b7 d6 c8 90 |..T^F..;3..(....|
-00000080 35 d4 1c 43 d1 30 6f 55 4e 0a 70 14 03 03 00 01 |5..C.0oUN.p.....|
-00000090 01 16 03 03 00 24 37 14 b2 97 7b b5 f0 9a 38 05 |.....$7...{...8.|
-000000a0 22 35 69 9c 95 2f 86 4b 37 98 22 db 4e 9a 46 9c |"5i../.K7.".N.F.|
-000000b0 b9 81 74 72 58 18 53 0c 5c 3c |..trX.S.\<|
->>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 24 3c b3 e7 77 5a |..........$<..wZ|
-00000010 7c 36 5a 74 74 26 8d 5b 5a 09 96 60 e8 24 45 2f ||6Ztt&.[Z..`.$E/|
-00000020 c2 39 14 5e db 58 12 49 ad a8 b6 ea ef 58 16 |.9.^.X.I.....X.|
->>> Flow 5 (client to server)
-00000000 17 03 03 00 1a 6d 29 d7 ba 2f 85 02 b6 f0 82 64 |.....m)../.....d|
-00000010 6c 55 ae ab f6 fd 14 ff b8 38 f0 f8 a6 ea cc 15 |lU.......8......|
-00000020 03 03 00 16 10 c5 d9 41 7b e2 89 67 dc 29 8e f8 |.......A{..g.)..|
-00000030 b5 ab 32 91 44 2c 27 84 49 f7 |..2.D,'.I.|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-SSLv3-RSA-3DES b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-SSLv3-RSA-3DES
deleted file mode 100644
index a6c7a41..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-SSLv3-RSA-3DES
+++ /dev/null
@@ -1,83 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 00 00 2f 01 00 00 2b 03 00 52 cc 57 59 d8 |..../...+..R.WY.|
-00000010 86 d6 07 ae e0 8d 63 b7 1e cb aa c6 67 32 c8 dd |......c.....g2..|
-00000020 68 03 d8 3d 37 18 72 c3 c0 f1 9d 00 00 04 00 0a |h..=7.r.........|
-00000030 00 ff 01 00 |....|
->>> Flow 2 (server to client)
-00000000 16 03 00 00 31 02 00 00 2d 03 00 00 00 00 00 00 |....1...-.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 0a 00 00 |................|
-00000030 05 ff 01 00 01 00 16 03 00 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 00 00 04 0e 00 |n8P)l...........|
-00000300 00 00 |..|
->>> Flow 3 (client to server)
-00000000 16 03 00 00 84 10 00 00 80 75 e0 c9 76 d6 e9 34 |.........u..v..4|
-00000010 1d e3 31 9e db 3b 03 41 93 e8 db 73 7c e9 3f 6a |..1..;.A...s|.?j|
-00000020 d8 2a 7b 25 83 4f 45 de 3f 78 3f b6 53 a7 b4 6c |.*{%.OE.?x?.S..l|
-00000030 e3 87 c4 c3 70 55 71 79 55 dc 74 98 84 21 19 13 |....pUqyU.t..!..|
-00000040 be d5 8e 0a ff 2f 9f 7a 6b d4 6c ef 78 d1 cb 65 |...../.zk.l.x..e|
-00000050 32 4c 0c c5 29 b9 60 94 c6 79 56 a2 aa 2d d9 ad |2L..).`..yV..-..|
-00000060 51 2c 54 1b 28 23 33 54 cd 48 cb 80 13 45 3d 4a |Q,T.(#3T.H...E=J|
-00000070 8e 2f f2 da bd 68 3e 1b eb 73 f9 2d 35 6b b1 40 |./...h>..s.-5k.@|
-00000080 2e 6d 9d 1c e9 c1 02 80 37 14 03 00 00 01 01 16 |.m......7.......|
-00000090 03 00 00 40 f7 c3 dd a4 64 3d 81 24 de a2 81 7d |...@....d=.$...}|
-000000a0 e4 df 78 46 e7 ba 93 6c 36 43 05 96 fc 75 ef ec |..xF...l6C...u..|
-000000b0 a5 46 6d 47 a5 be 74 ad 15 93 d9 87 4f 1d e2 b3 |.FmG..t.....O...|
-000000c0 03 ff 2e 89 6e 50 f4 d6 a6 e2 b3 54 cb 74 07 f7 |....nP.....T.t..|
-000000d0 ca 1b 8c 0a |....|
->>> Flow 4 (server to client)
-00000000 14 03 00 00 01 01 16 03 00 00 40 6d 3d d8 d5 cf |..........@m=...|
-00000010 05 7d 98 8c 28 28 e2 43 ab ad 4a fa ae bf ec c3 |.}..((.C..J.....|
-00000020 9c 0a 13 4d 28 a4 45 c4 b9 f2 bc c5 12 a2 68 91 |...M(.E.......h.|
-00000030 77 fa 72 f8 9e 4e b7 1f b4 02 02 e3 5d 57 b0 8b |w.r..N......]W..|
-00000040 d8 90 0c 9d e6 df 5b 90 92 a1 0d 17 03 00 00 18 |......[.........|
-00000050 91 48 8a e1 d6 bf 79 1c d5 0a 70 d5 94 20 25 78 |.H....y...p.. %x|
-00000060 d8 84 c8 6e 54 f0 99 01 17 03 00 00 28 74 19 90 |...nT.......(t..|
-00000070 41 44 53 27 bb fb 1f fd 71 34 20 61 a0 eb a4 7c |ADS'....q4 a...||
-00000080 fe 36 f8 4b d7 b0 27 d3 b9 36 e1 67 af 2d 0e 23 |.6.K..'..6.g.-.#|
-00000090 2b 76 a7 2f c3 15 03 00 00 18 db fc e9 fd 87 5f |+v./..........._|
-000000a0 92 a8 3d 4b 35 f5 c6 48 2c b4 42 50 c3 81 28 f0 |..=K5..H,.BP..(.|
-000000b0 2b 41 |+A|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-SSLv3-RSA-AES b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-SSLv3-RSA-AES
deleted file mode 100644
index 4885b26..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-SSLv3-RSA-AES
+++ /dev/null
@@ -1,84 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 00 00 2f 01 00 00 2b 03 00 52 cc 57 59 30 |..../...+..R.WY0|
-00000010 e1 ee 8c 60 5b 40 dd 95 bd b4 84 87 2f 01 15 e7 |...`[@....../...|
-00000020 50 88 4c 82 6b 6d 93 8a 57 d0 27 00 00 04 00 2f |P.L.km..W.'..../|
-00000030 00 ff 01 00 |....|
->>> Flow 2 (server to client)
-00000000 16 03 00 00 31 02 00 00 2d 03 00 00 00 00 00 00 |....1...-.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 2f 00 00 |............./..|
-00000030 05 ff 01 00 01 00 16 03 00 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 00 00 04 0e 00 |n8P)l...........|
-00000300 00 00 |..|
->>> Flow 3 (client to server)
-00000000 16 03 00 00 84 10 00 00 80 74 50 05 6f f5 83 c9 |.........tP.o...|
-00000010 f5 0c 5a 65 c7 4e c6 f3 87 96 d7 5d 3e 88 27 32 |..Ze.N.....]>.'2|
-00000020 89 12 ba ec db ef c0 85 70 84 ed b6 83 03 8f 44 |........p......D|
-00000030 f5 6f fa fa d0 1f 95 30 d1 ae a7 71 cf ee e9 b1 |.o.....0...q....|
-00000040 80 7b 34 a9 ea 1b 5e e5 71 40 3f e8 7d 30 d1 8b |.{4...^.q@?.}0..|
-00000050 11 f1 68 1f c8 25 f0 77 c5 af b3 92 6e d9 81 cc |..h..%.w....n...|
-00000060 f8 fd 82 95 cc 1f 4a b1 05 15 7a b3 a1 22 33 09 |......J...z.."3.|
-00000070 e7 a5 c2 89 7f 03 e0 91 b6 61 a3 a0 4e 17 0d 7a |.........a..N..z|
-00000080 13 01 c4 b6 50 c7 d9 81 15 14 03 00 00 01 01 16 |....P...........|
-00000090 03 00 00 40 56 da 56 ab e6 26 98 58 53 1f 36 b5 |...@V.V..&.XS.6.|
-000000a0 03 14 bd 42 29 ee 9c 7c e4 48 26 82 68 ae fd fe |...B)..|.H&.h...|
-000000b0 5e a4 43 22 75 95 7b c8 77 88 fd d6 d4 9b c9 b5 |^.C"u.{.w.......|
-000000c0 ee 3e a6 e8 c5 04 90 63 3f ac be 56 67 da 30 d4 |.>.....c?..Vg.0.|
-000000d0 64 fb a8 a0 |d...|
->>> Flow 4 (server to client)
-00000000 14 03 00 00 01 01 16 03 00 00 40 96 af fb 79 96 |..........@...y.|
-00000010 92 97 2d d0 67 46 1e 08 b5 35 65 ef dc bc 8e 57 |..-.gF...5e....W|
-00000020 53 b7 36 58 74 d7 88 b1 55 fc eb fa 2e f3 17 b7 |S.6Xt...U.......|
-00000030 62 58 a0 9d 99 e1 85 d4 33 e0 b4 1f 1d 94 f2 88 |bX......3.......|
-00000040 d5 9a 34 5b 74 cd d2 ff 87 bd 52 17 03 00 00 20 |..4[t.....R.... |
-00000050 c6 61 c2 28 ac d2 0c 08 7f f1 c2 62 af 37 7e 78 |.a.(.......b.7~x|
-00000060 e8 e2 a1 54 f2 3a 80 97 f8 47 64 f2 cd 94 dd 0b |...T.:...Gd.....|
-00000070 17 03 00 00 30 b8 40 8f a3 18 ff 03 84 d4 1c 28 |....0.@........(|
-00000080 82 ce d8 9a 81 3a dd 23 7c 65 d8 ca f7 f1 46 1b |.....:.#|e....F.|
-00000090 70 f0 d7 d9 54 a7 71 e6 4d d4 25 61 5a e4 30 d3 |p...T.q.M.%aZ.0.|
-000000a0 4a 42 ae 26 a5 15 03 00 00 20 c4 e8 ed 40 57 00 |JB.&..... ...@W.|
-000000b0 dc a5 0e 82 90 47 92 08 dd 7e 50 6b 30 66 5e 90 |.....G...~Pk0f^.|
-000000c0 73 7c 81 93 8d 24 b1 06 e7 39 |s|...$...9|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-SSLv3-RSA-RC4 b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-SSLv3-RSA-RC4
deleted file mode 100644
index 1314b65..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-SSLv3-RSA-RC4
+++ /dev/null
@@ -1,79 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 00 00 2f 01 00 00 2b 03 00 52 cc 57 59 79 |..../...+..R.WYy|
-00000010 b9 3b ef df 53 fb 09 f6 01 e5 18 0a fc 3d 65 bb |.;..S........=e.|
-00000020 cf 9c 4c 77 b1 e8 6b 4f 5f c7 94 00 00 04 00 05 |..Lw..kO_.......|
-00000030 00 ff 01 00 |....|
->>> Flow 2 (server to client)
-00000000 16 03 00 00 31 02 00 00 2d 03 00 00 00 00 00 00 |....1...-.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 05 00 00 |................|
-00000030 05 ff 01 00 01 00 16 03 00 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 00 00 04 0e 00 |n8P)l...........|
-00000300 00 00 |..|
->>> Flow 3 (client to server)
-00000000 16 03 00 00 84 10 00 00 80 4d 66 7a f3 f8 ab 86 |.........Mfz....|
-00000010 43 4c 5f 7c 52 ca e7 3f ba 62 b3 82 88 16 7d ca |CL_|R..?.b....}.|
-00000020 3a 66 15 c0 36 55 2c ab bf 30 6b cd 9c d8 b9 48 |:f..6U,..0k....H|
-00000030 03 c9 d0 98 ab 0b a6 5b 39 c8 fe 82 8e bb f0 16 |.......[9.......|
-00000040 6f 96 62 81 f2 dc 52 02 c9 de e4 47 73 21 6e 1e |o.b...R....Gs!n.|
-00000050 3a 11 89 7a e2 6b 9e 04 64 72 15 ba 2d 10 a2 69 |:..z.k..dr..-..i|
-00000060 07 e6 ba 17 cf 54 d6 4e 5f 99 e8 59 8b 54 ce 8e |.....T.N_..Y.T..|
-00000070 6b 58 ba 83 68 46 4a 5f 43 3e 9b e1 32 a2 19 42 |kX..hFJ_C>..2..B|
-00000080 46 0f e4 47 1a 3b 16 5f e1 14 03 00 00 01 01 16 |F..G.;._........|
-00000090 03 00 00 3c 78 7e ee da 0d 38 0b 1a d6 d4 8e d5 |...<x~...8......|
-000000a0 6a c5 3a 0f 85 e7 37 a6 3c 8d 1e 4b da 02 94 bf |j.:...7.<..K....|
-000000b0 ae 2c 50 3b 4e 1c 0c 3c 4f cc d5 1c da 33 13 43 |.,P;N..<O....3.C|
-000000c0 37 64 44 ac 26 43 28 0b d0 c2 04 09 b5 0f 23 1d |7dD.&C(.......#.|
->>> Flow 4 (server to client)
-00000000 14 03 00 00 01 01 16 03 00 00 3c 23 29 64 62 23 |..........<#)db#|
-00000010 19 20 f8 2e 15 07 ee c8 f4 ab f0 3e 66 c3 ed 7b |. .........>f..{|
-00000020 7c a7 c2 7e c3 25 3c 8f f3 04 dc 37 e8 fc 0a 1d ||..~.%<....7....|
-00000030 fa 7a 09 d4 21 11 e3 24 21 4b 37 d1 85 cc 40 bf |.z..!..$!K7...@.|
-00000040 bd bd f8 59 6b cd 73 17 03 00 00 21 47 1d ac 54 |...Yk.s....!G..T|
-00000050 bd 58 a6 c0 04 e2 0c 6b 66 64 5a 85 09 0e 47 fc |.X.....kfdZ...G.|
-00000060 0b 57 ee f1 24 b6 89 57 46 be 6b 0d f2 15 03 00 |.W..$..WF.k.....|
-00000070 00 16 b4 f7 34 99 19 43 b6 b3 5a 8b c3 d2 67 2f |....4..C..Z...g/|
-00000080 3b 19 1c 31 d4 f9 bd 96 |;..1....|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv10-ECDHE-ECDSA-AES b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv10-ECDHE-ECDSA-AES
deleted file mode 100644
index 9b8cb4d..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv10-ECDHE-ECDSA-AES
+++ /dev/null
@@ -1,84 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 76 01 00 00 72 03 01 53 04 f0 f9 4b |....v...r..S...K|
-00000010 30 a8 68 d0 79 13 14 69 ee 3b 5d 05 cb 71 63 43 |0.h.y..i.;]..qcC|
-00000020 4a 55 6b 05 25 53 19 ba e0 2f b1 00 00 04 c0 0a |JUk.%S.../......|
-00000030 00 ff 01 00 00 45 00 0b 00 04 03 00 01 02 00 0a |.....E..........|
-00000040 00 34 00 32 00 0e 00 0d 00 19 00 0b 00 0c 00 18 |.4.2............|
-00000050 00 09 00 0a 00 16 00 17 00 08 00 06 00 07 00 14 |................|
-00000060 00 15 00 04 00 05 00 12 00 13 00 01 00 02 00 03 |................|
-00000070 00 0f 00 10 00 11 00 0f 00 01 01 |...........|
->>> Flow 2 (server to client)
-00000000 16 03 01 00 31 02 00 00 2d 03 01 00 00 00 00 00 |....1...-.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 c0 0a 00 00 |................|
-00000030 05 ff 01 00 01 00 16 03 01 02 0e 0b 00 02 0a 00 |................|
-00000040 02 07 00 02 04 30 82 02 00 30 82 01 62 02 09 00 |.....0...0..b...|
-00000050 b8 bf 2d 47 a0 d2 eb f4 30 09 06 07 2a 86 48 ce |..-G....0...*.H.|
-00000060 3d 04 01 30 45 31 0b 30 09 06 03 55 04 06 13 02 |=..0E1.0...U....|
-00000070 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-00000080 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000090 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-000000a0 74 73 20 50 74 79 20 4c 74 64 30 1e 17 0d 31 32 |ts Pty Ltd0...12|
-000000b0 31 31 32 32 31 35 30 36 33 32 5a 17 0d 32 32 31 |1122150632Z..221|
-000000c0 31 32 30 31 35 30 36 33 32 5a 30 45 31 0b 30 09 |120150632Z0E1.0.|
-000000d0 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 55 |..U....AU1.0...U|
-000000e0 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 21 |....Some-State1!|
-000000f0 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e 65 |0...U....Interne|
-00000100 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c 74 |t Widgits Pty Lt|
-00000110 64 30 81 9b 30 10 06 07 2a 86 48 ce 3d 02 01 06 |d0..0...*.H.=...|
-00000120 05 2b 81 04 00 23 03 81 86 00 04 00 c4 a1 ed be |.+...#..........|
-00000130 98 f9 0b 48 73 36 7e c3 16 56 11 22 f2 3d 53 c3 |...Hs6~..V.".=S.|
-00000140 3b 4d 21 3d cd 6b 75 e6 f6 b0 dc 9a df 26 c1 bc |;M!=.ku......&..|
-00000150 b2 87 f0 72 32 7c b3 64 2f 1c 90 bc ea 68 23 10 |...r2|.d/....h#.|
-00000160 7e fe e3 25 c0 48 3a 69 e0 28 6d d3 37 00 ef 04 |~..%.H:i.(m.7...|
-00000170 62 dd 0d a0 9c 70 62 83 d8 81 d3 64 31 aa 9e 97 |b....pb....d1...|
-00000180 31 bd 96 b0 68 c0 9b 23 de 76 64 3f 1a 5c 7f e9 |1...h..#.vd?.\..|
-00000190 12 0e 58 58 b6 5f 70 dd 9b d8 ea d5 d7 f5 d5 cc |..XX._p.........|
-000001a0 b9 b6 9f 30 66 5b 66 9a 20 e2 27 e5 bf fe 3b 30 |...0f[f. .'...;0|
-000001b0 09 06 07 2a 86 48 ce 3d 04 01 03 81 8c 00 30 81 |...*.H.=......0.|
-000001c0 88 02 42 01 88 a2 4f eb e2 45 c5 48 7d 1b ac f5 |..B...O..E.H}...|
-000001d0 ed 98 9d ae 47 70 c0 5e 1b b6 2f bd f1 b6 4d b7 |....Gp.^../...M.|
-000001e0 61 40 d3 11 a2 ce ee 0b 7e 92 7e ff 76 9d c3 3b |a@......~.~.v..;|
-000001f0 7e a5 3f ce fa 10 e2 59 ec 47 2d 7c ac da 4e 97 |~.?....Y.G-|..N.|
-00000200 0e 15 a0 6f d0 02 42 01 4d fc be 67 13 9c 2d 05 |...o..B.M..g..-.|
-00000210 0e bd 3f a3 8c 25 c1 33 13 83 0d 94 06 bb d4 37 |..?..%.3.......7|
-00000220 7a f6 ec 7a c9 86 2e dd d7 11 69 7f 85 7c 56 de |z..z......i..|V.|
-00000230 fb 31 78 2b e4 c7 78 0d ae cb be 9e 4e 36 24 31 |.1x+..x.....N6$1|
-00000240 7b 6a 0f 39 95 12 07 8f 2a 16 03 01 00 d6 0c 00 |{j.9....*.......|
-00000250 00 d2 03 00 17 41 04 1e 18 37 ef 0d 19 51 88 35 |.....A...7...Q.5|
-00000260 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd a7 24 20 3e |uq..T[....g..$ >|
-00000270 b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 07 9f 6c |.V...(^.+-O....l|
-00000280 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 b5 68 1a |K[.V.2B.X..I..h.|
-00000290 41 03 56 6b dc 5a 89 00 8b 30 81 88 02 42 00 c6 |A.Vk.Z...0...B..|
-000002a0 85 8e 06 b7 04 04 e9 cd 9e 3e cb 66 23 95 b4 42 |.........>.f#..B|
-000002b0 9c 64 81 39 05 3f b5 21 f8 28 af 60 6b 4d 3d ba |.d.9.?.!.(.`kM=.|
-000002c0 a1 4b 5e 77 ef e7 59 28 fe 1d c1 27 a2 ff a8 de |.K^w..Y(...'....|
-000002d0 33 48 b3 c1 85 6a 42 9b f9 7e 7e 31 c2 e5 bd 66 |3H...jB..~~1...f|
-000002e0 02 42 00 ad 7d 06 35 ab ec 8d ac d4 ba 1b 49 5e |.B..}.5.......I^|
-000002f0 05 5f f0 97 93 82 b8 2b 8d 91 98 63 8e b4 14 62 |._.....+...c...b|
-00000300 db 1e c9 2b 30 f8 41 9b a6 e6 bc de 0e 68 30 21 |...+0.A......h0!|
-00000310 d8 ef 2f 05 42 da f2 e0 2c 06 33 1d 0d 9a 1a 75 |../.B...,.3....u|
-00000320 59 a7 3a bc 16 03 01 00 04 0e 00 00 00 |Y.:..........|
->>> Flow 3 (client to server)
-00000000 16 03 01 00 46 10 00 00 42 41 04 08 28 cf bd 3c |....F...BA..(..<|
-00000010 3c cc 98 9e 73 3f 92 a7 cb 22 83 3b c7 61 46 0e |<...s?...".;.aF.|
-00000020 4d 7c 30 b5 06 85 2f 01 be b5 40 e2 64 1e 45 c1 |M|0.../...@.d.E.|
-00000030 9d 73 95 d5 65 92 0b 9b e7 6f c6 91 ab b6 fa be |.s..e....o......|
-00000040 61 83 a7 f2 eb f5 65 31 fe 24 7b 14 03 01 00 01 |a.....e1.${.....|
-00000050 01 16 03 01 00 30 15 d1 c4 ca 0b 01 84 13 5a ba |.....0........Z.|
-00000060 89 04 87 73 7c bb d8 89 7e 10 27 ba 6f 5d dc d3 |...s|...~.'.o]..|
-00000070 b5 ef 32 86 58 cc fb eb 5c 32 9e 95 ef 01 1c ac |..2.X...\2......|
-00000080 dc 8e df 7f fe 0a |......|
->>> Flow 4 (server to client)
-00000000 14 03 01 00 01 01 16 03 01 00 30 e8 48 86 81 3c |..........0.H..<|
-00000010 f5 25 5c 94 a9 06 c4 5c 71 62 b1 43 76 ec 2c 44 |.%\....\qb.Cv.,D|
-00000020 95 b5 8c 95 d2 ff 82 92 b6 fc 52 75 03 c6 a1 f0 |..........Ru....|
-00000030 99 6d b1 ed ec 68 6c d7 9f 18 50 17 03 01 00 20 |.m...hl...P.... |
-00000040 32 d9 26 8a 81 b8 9d a5 7b fd d5 4e 7a db 2e 29 |2.&.....{..Nz..)|
-00000050 58 9a 4f 6a 27 18 bc dc c2 49 b8 65 cb 8e 16 5a |X.Oj'....I.e...Z|
-00000060 17 03 01 00 30 c4 56 0a ad 9a 82 cb 3e 32 f1 7c |....0.V.....>2.||
-00000070 95 6e dd cd e9 4d f0 e5 2d c9 a3 f7 de bb d7 fd |.n...M..-.......|
-00000080 84 bb df 34 8c 64 1f 03 58 64 19 4a 5b 7a a8 81 |...4.d..Xd.J[z..|
-00000090 52 bb 51 0a 43 15 03 01 00 20 89 18 7a 40 ec 49 |R.Q.C.... ..z@.I|
-000000a0 52 d5 d3 20 ac 07 eb e9 4a 78 23 cf e7 21 32 74 |R.. ....Jx#..!2t|
-000000b0 ec 40 8d a8 f4 33 1c ae 93 cf |.@...3....|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv10-RSA-3DES b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv10-RSA-3DES
deleted file mode 100644
index c0e6241..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv10-RSA-3DES
+++ /dev/null
@@ -1,79 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 36 01 00 00 32 03 01 52 cc 57 59 13 |....6...2..R.WY.|
-00000010 8b e6 5b a3 1d cb 94 ef 48 e4 59 7e 20 6d 07 67 |..[.....H.Y~ m.g|
-00000020 1e 28 6d 31 a2 e7 96 b3 7d 32 cc 00 00 04 00 0a |.(m1....}2......|
-00000030 00 ff 01 00 00 05 00 0f 00 01 01 |...........|
->>> Flow 2 (server to client)
-00000000 16 03 01 00 31 02 00 00 2d 03 01 00 00 00 00 00 |....1...-.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 0a 00 00 |................|
-00000030 05 ff 01 00 01 00 16 03 01 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 01 00 04 0e 00 |n8P)l...........|
-00000300 00 00 |..|
->>> Flow 3 (client to server)
-00000000 16 03 01 00 86 10 00 00 82 00 80 2e af d2 61 f6 |..............a.|
-00000010 e2 b8 24 da 28 17 55 99 fd 11 bd 7a ab 98 dd f2 |..$.(.U....z....|
-00000020 f6 5f e0 11 6b 12 61 6f 86 48 b2 6e db f0 dd d5 |._..k.ao.H.n....|
-00000030 07 88 e5 95 f4 2d 6b 0c d0 09 1a 5e 5f 50 1f dc |.....-k....^_P..|
-00000040 f2 e7 02 7d 5e a0 70 29 80 ef 87 aa cc 95 3f 2e |...}^.p)......?.|
-00000050 24 d1 40 b6 62 53 1d 25 31 87 1e 2f 77 d3 e1 1c |$.@.bS.%1../w...|
-00000060 c4 99 89 bc 99 09 e9 ad 1f ce 09 e6 36 1c 3e 97 |............6.>.|
-00000070 be 62 69 a0 4e 14 20 9c 82 2a 3e fc 7e 9b c4 7a |.bi.N. ..*>.~..z|
-00000080 5a f7 ad 1a 03 17 2a f8 7a 5f 44 14 03 01 00 01 |Z.....*.z_D.....|
-00000090 01 16 03 01 00 28 49 6b da 73 07 ad 85 9a 0e fb |.....(Ik.s......|
-000000a0 dd e0 69 ef c9 22 2d 86 91 51 26 63 d0 24 7d 16 |..i.."-..Q&c.$}.|
-000000b0 3c db 9b 00 c9 7e 64 e2 69 02 85 7d f7 47 |<....~d.i..}.G|
->>> Flow 4 (server to client)
-00000000 14 03 01 00 01 01 16 03 01 00 28 dc 60 83 43 6c |..........(.`.Cl|
-00000010 37 79 ab 6e 92 1f 66 d0 b1 12 ce c1 64 9d 2b 68 |7y.n..f.....d.+h|
-00000020 c7 1a e5 1f 8c 80 08 d2 86 3e a1 2c e3 7e f4 64 |.........>.,.~.d|
-00000030 e7 96 b2 17 03 01 00 18 8d b5 7c 03 78 cf dc 09 |..........|.x...|
-00000040 95 06 4b a6 82 f9 30 d2 6b 26 cb 0a 9a 9d 47 9f |..K...0.k&....G.|
-00000050 17 03 01 00 28 30 a9 55 dd b9 4d 6a 76 00 39 96 |....(0.U..Mjv.9.|
-00000060 a3 94 6a df e5 af 1e a2 eb bb e4 ac 95 2c f7 93 |..j..........,..|
-00000070 ef d1 b5 13 d8 e2 06 1a ad 5c 00 dd 0c 15 03 01 |.........\......|
-00000080 00 18 a5 62 e4 8b 51 1d 28 46 bc 8a c8 50 a3 32 |...b..Q.(F...P.2|
-00000090 6b 7b f1 b6 19 43 63 1f 7d 38 |k{...Cc.}8|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv10-RSA-AES b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv10-RSA-AES
deleted file mode 100644
index 1670997..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv10-RSA-AES
+++ /dev/null
@@ -1,82 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 36 01 00 00 32 03 01 52 cc 57 59 5d |....6...2..R.WY]|
-00000010 0d 77 24 3e b3 32 3d ba 0f b0 aa 1d e3 13 06 f6 |.w$>.2=.........|
-00000020 0f be 3c 92 ba 93 bd a6 6d 69 53 00 00 04 00 2f |..<.....miS..../|
-00000030 00 ff 01 00 00 05 00 0f 00 01 01 |...........|
->>> Flow 2 (server to client)
-00000000 16 03 01 00 31 02 00 00 2d 03 01 00 00 00 00 00 |....1...-.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 2f 00 00 |............./..|
-00000030 05 ff 01 00 01 00 16 03 01 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 01 00 04 0e 00 |n8P)l...........|
-00000300 00 00 |..|
->>> Flow 3 (client to server)
-00000000 16 03 01 00 86 10 00 00 82 00 80 20 e6 80 f7 48 |........... ...H|
-00000010 7e 7d 08 08 54 e1 b4 e3 98 27 5f 90 9d 3b e3 c2 |~}..T....'_..;..|
-00000020 c8 8b dc 9e ff 75 fa fc 60 e1 9e 67 7c c4 08 27 |.....u..`..g|..'|
-00000030 cc 6f 15 6c bc 7c 96 de 83 8f 98 6d 4a c7 b7 20 |.o.l.|.....mJ.. |
-00000040 8c 19 47 5a ff 76 92 0a df df 66 d2 b6 9d 2d 06 |..GZ.v....f...-.|
-00000050 fb ac 07 cf 38 08 f1 fd 0d fe 07 d7 69 3e 8a 79 |....8.......i>.y|
-00000060 dc 2d ab bb f7 18 3c 51 14 6e c6 70 95 a2 59 b1 |.-....<Q.n.p..Y.|
-00000070 39 04 9f ae f3 5f fb a7 2b d3 5a c0 96 d9 4d 2a |9...._..+.Z...M*|
-00000080 2a 6c 6d 39 ee fc ce 76 1a 92 1b 14 03 01 00 01 |*lm9...v........|
-00000090 01 16 03 01 00 30 10 20 90 7b 0e e6 c2 05 81 c3 |.....0. .{......|
-000000a0 bc da 84 67 dd 5f 97 e2 74 c4 35 4e bf d2 1b 90 |...g._..t.5N....|
-000000b0 2f e0 af dd 6b f5 52 db 36 cd 3e e1 e6 bd 99 30 |/...k.R.6.>....0|
-000000c0 ed c6 bc c2 38 b6 |....8.|
->>> Flow 4 (server to client)
-00000000 14 03 01 00 01 01 16 03 01 00 30 5d 0c a2 18 13 |..........0]....|
-00000010 40 a1 84 ce c5 d8 4e fc a4 8a 14 b5 94 18 b1 86 |@.....N.........|
-00000020 da 6a 7d 26 08 d6 a0 f8 78 5b 42 7e f8 83 54 56 |.j}&....x[B~..TV|
-00000030 36 a4 91 37 67 5a d7 68 37 c4 4f 17 03 01 00 20 |6..7gZ.h7.O.... |
-00000040 fd aa 5e cf 4b 12 c5 be a4 a2 65 5d 6e 65 46 5f |..^.K.....e]neF_|
-00000050 d2 fe 46 e7 77 2d 9c 1e 0b 39 40 48 c2 2f be 21 |..F.w-...9@H./.!|
-00000060 17 03 01 00 30 03 af 9e 6b d6 76 ed 9e 1d 8b 8b |....0...k.v.....|
-00000070 2e 2a 5d da c4 73 95 ac 0e 6f 69 cb 63 df 50 27 |.*]..s...oi.c.P'|
-00000080 30 de 2e 55 86 85 ad 3e 33 22 49 72 f2 e2 9f 8f |0..U...>3"Ir....|
-00000090 ba cf 4e 30 34 15 03 01 00 20 4c 4c 97 61 70 ea |..N04.... LL.ap.|
-000000a0 ae fc a2 e9 c6 c2 b6 2e 4d 85 f6 ae 2b 56 46 82 |........M...+VF.|
-000000b0 9d d8 a5 82 17 fa 3e 62 67 7e |......>bg~|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv10-RSA-RC4 b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv10-RSA-RC4
deleted file mode 100644
index d653561..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv10-RSA-RC4
+++ /dev/null
@@ -1,76 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 36 01 00 00 32 03 01 52 cc 57 59 cf |....6...2..R.WY.|
-00000010 00 a1 49 a4 37 69 74 d8 a7 93 ea 8d e7 50 b7 b3 |..I.7it......P..|
-00000020 8c ec e5 56 fb dc 5f 1a 2e ab 18 00 00 04 00 05 |...V.._.........|
-00000030 00 ff 01 00 00 05 00 0f 00 01 01 |...........|
->>> Flow 2 (server to client)
-00000000 16 03 01 00 31 02 00 00 2d 03 01 00 00 00 00 00 |....1...-.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 05 00 00 |................|
-00000030 05 ff 01 00 01 00 16 03 01 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 01 00 04 0e 00 |n8P)l...........|
-00000300 00 00 |..|
->>> Flow 3 (client to server)
-00000000 16 03 01 00 86 10 00 00 82 00 80 b1 96 7b 6f f5 |.............{o.|
-00000010 a0 cb 0d 60 9b 64 d3 f5 17 76 47 7b bc a5 0e 96 |...`.d...vG{....|
-00000020 53 af 68 0c 96 22 f7 28 0c 24 37 9c 51 69 ed b2 |S.h..".(.$7.Qi..|
-00000030 47 14 ba 33 c5 79 6b 96 f2 ab 3c 02 5c 37 a4 97 |G..3.yk...<.\7..|
-00000040 23 fc 7f d3 95 2d 85 99 1a 10 1b 38 e5 f1 83 55 |#....-.....8...U|
-00000050 4a ab 60 f8 89 0a 6a c4 eb 45 f5 b0 f4 f8 09 31 |J.`...j..E.....1|
-00000060 6e f0 25 30 fd 5e 68 61 bc cb 0d 9e 05 73 0a f4 |n.%0.^ha.....s..|
-00000070 a5 2e d9 d5 4e 08 f6 3b 8d 2d 21 f5 79 b6 97 55 |....N..;.-!.y..U|
-00000080 b9 99 03 49 ea 96 36 49 21 56 bf 14 03 01 00 01 |...I..6I!V......|
-00000090 01 16 03 01 00 24 f0 4f 30 06 c3 25 01 93 34 ab |.....$.O0..%..4.|
-000000a0 93 8f 59 26 83 6e 8a fd 5a a6 cf af ad b1 a2 83 |..Y&.n..Z.......|
-000000b0 28 ff c2 66 5f ac e5 a5 a5 03 |(..f_.....|
->>> Flow 4 (server to client)
-00000000 14 03 01 00 01 01 16 03 01 00 24 9d b4 ea d8 be |..........$.....|
-00000010 b5 9f 00 fd b5 99 04 12 6b 7a 3f b8 52 d7 52 a9 |........kz?.R.R.|
-00000020 e9 bd 5b 63 ad b0 53 ac 46 80 be 48 6e dd ee 17 |..[c..S.F..Hn...|
-00000030 03 01 00 21 07 ac c4 fb 21 e4 b8 6b 64 3b b5 27 |...!....!..kd;.'|
-00000040 29 67 a1 10 2e d2 71 d5 59 5e fc 1d 84 31 15 6e |)g....q.Y^...1.n|
-00000050 4d 4b dc a9 3a 15 03 01 00 16 25 22 a5 78 23 5a |MK..:.....%".x#Z|
-00000060 69 6f 99 a1 b3 1c 8d bf f3 bd 1b c8 1c 57 15 75 |io...........W.u|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv11-RSA-RC4 b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv11-RSA-RC4
deleted file mode 100644
index 9237db0..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv11-RSA-RC4
+++ /dev/null
@@ -1,76 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 36 01 00 00 32 03 02 52 cc 57 59 bd |....6...2..R.WY.|
-00000010 cd 9d 1e 17 38 43 a5 e3 e7 30 e4 2b 2a ef f7 5b |....8C...0.+*..[|
-00000020 81 91 0c 0b 52 f8 2d 2c 61 d3 13 00 00 04 00 05 |....R.-,a.......|
-00000030 00 ff 01 00 00 05 00 0f 00 01 01 |...........|
->>> Flow 2 (server to client)
-00000000 16 03 02 00 31 02 00 00 2d 03 02 00 00 00 00 00 |....1...-.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 05 00 00 |................|
-00000030 05 ff 01 00 01 00 16 03 02 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 02 00 04 0e 00 |n8P)l...........|
-00000300 00 00 |..|
->>> Flow 3 (client to server)
-00000000 16 03 02 00 86 10 00 00 82 00 80 71 2b 19 25 86 |...........q+.%.|
-00000010 a0 ff ba d5 1c a6 0c 8b 6b 0a b8 e9 42 93 2f 55 |........k...B./U|
-00000020 a8 ee 62 fa ed bc 6d e2 9d e3 76 a6 73 d7 99 58 |..b...m...v.s..X|
-00000030 cc 0b 14 42 96 7c b6 c7 8f 21 16 cf 71 9b 2b b9 |...B.|...!..q.+.|
-00000040 e0 34 57 76 22 d5 87 8a ce 1f ea 26 6e 1e e6 ca |.4Wv"......&n...|
-00000050 55 3b 20 cd cf 42 26 b1 51 3e 8c 1d a2 ae c4 63 |U; ..B&.Q>.....c|
-00000060 f5 ce 27 3c 1e c3 e0 e3 b1 16 c1 8a 62 bd 21 7f |..'<........b.!.|
-00000070 38 b5 b7 3a 3c bb 03 37 e1 a5 ff f1 29 e2 21 0a |8..:<..7....).!.|
-00000080 8c 20 02 e0 c0 82 97 9d 18 6d f8 14 03 02 00 01 |. .......m......|
-00000090 01 16 03 02 00 24 bc 19 16 6e fd 0b db 9e d5 1d |.....$...n......|
-000000a0 65 b6 57 1c 58 b5 6a ac f7 4f f0 cd a1 a9 0c c0 |e.W.X.j..O......|
-000000b0 df e6 eb d5 00 f7 fd 43 bb 27 |.......C.'|
->>> Flow 4 (server to client)
-00000000 14 03 02 00 01 01 16 03 02 00 24 cf 4f e4 27 b0 |..........$.O.'.|
-00000010 3d 17 34 b1 3c 37 6e c5 2b 3d 4a c3 46 50 44 b4 |=.4.<7n.+=J.FPD.|
-00000020 de 77 18 10 4f 60 b3 4e dc 06 fd 25 ec 05 15 17 |.w..O`.N...%....|
-00000030 03 02 00 21 a5 c9 32 f2 21 fb 94 7e 0d 15 65 fd |...!..2.!..~..e.|
-00000040 3e fe e4 c1 a5 e9 88 72 b2 f1 26 39 a6 48 59 97 |>......r..&9.HY.|
-00000050 65 e3 f0 cb 46 15 03 02 00 16 4b 02 ec cd ca 30 |e...F.....K....0|
-00000060 42 cf 3d a0 4a fa 8e 79 bb ed b0 59 40 9b 2c 1a |B.=.J..y...Y@.,.|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-ALPN b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-ALPN
deleted file mode 100644
index 106244d..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-ALPN
+++ /dev/null
@@ -1,122 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 01 8a 01 00 01 86 03 03 34 54 69 f3 d7 |...........4Ti..|
-00000010 20 9d 1d 74 db 72 e9 2f 51 7c c2 82 0a 9b cb 6d | ..t.r./Q|.....m|
-00000020 90 b4 8e a2 1f 2f c7 66 74 8f 33 00 00 d6 c0 30 |...../.ft.3....0|
-00000030 c0 2c c0 28 c0 24 c0 14 c0 0a c0 22 c0 21 c0 20 |.,.(.$.....".!. |
-00000040 00 a5 00 a3 00 a1 00 9f 00 6b 00 6a 00 69 00 68 |.........k.j.i.h|
-00000050 00 39 00 38 00 37 00 36 00 88 00 87 00 86 00 85 |.9.8.7.6........|
-00000060 c0 32 c0 2e c0 2a c0 26 c0 0f c0 05 00 9d 00 3d |.2...*.&.......=|
-00000070 00 35 00 84 c0 2f c0 2b c0 27 c0 23 c0 13 c0 09 |.5.../.+.'.#....|
-00000080 c0 1f c0 1e c0 1d 00 a4 00 a2 00 a0 00 9e 00 67 |...............g|
-00000090 00 40 00 3f 00 3e 00 33 00 32 00 31 00 30 00 9a |.@.?.>.3.2.1.0..|
-000000a0 00 99 00 98 00 97 00 45 00 44 00 43 00 42 c0 31 |.......E.D.C.B.1|
-000000b0 c0 2d c0 29 c0 25 c0 0e c0 04 00 9c 00 3c 00 2f |.-.).%.......<./|
-000000c0 00 96 00 41 00 07 c0 11 c0 07 c0 0c c0 02 00 05 |...A............|
-000000d0 00 04 c0 12 c0 08 c0 1c c0 1b c0 1a 00 16 00 13 |................|
-000000e0 00 10 00 0d c0 0d c0 03 00 0a 00 15 00 12 00 0f |................|
-000000f0 00 0c 00 09 00 14 00 11 00 0e 00 0b 00 08 00 06 |................|
-00000100 00 03 00 ff 01 00 00 87 00 0b 00 04 03 00 01 02 |................|
-00000110 00 0a 00 3a 00 38 00 0e 00 0d 00 19 00 1c 00 0b |...:.8..........|
-00000120 00 0c 00 1b 00 18 00 09 00 0a 00 1a 00 16 00 17 |................|
-00000130 00 08 00 06 00 07 00 14 00 15 00 04 00 05 00 12 |................|
-00000140 00 13 00 01 00 02 00 03 00 0f 00 10 00 11 00 23 |...............#|
-00000150 00 00 00 0d 00 20 00 1e 06 01 06 02 06 03 05 01 |..... ..........|
-00000160 05 02 05 03 04 01 04 02 04 03 03 01 03 02 03 03 |................|
-00000170 02 01 02 02 02 03 00 0f 00 01 01 00 10 00 10 00 |................|
-00000180 0e 06 70 72 6f 74 6f 32 06 70 72 6f 74 6f 31 |..proto2.proto1|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 42 02 00 00 3e 03 03 00 00 00 00 00 |....B...>.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 c0 14 00 00 |................|
-00000030 16 00 23 00 00 ff 01 00 01 00 00 10 00 09 00 07 |..#.............|
-00000040 06 70 72 6f 74 6f 31 16 03 03 02 be 0b 00 02 ba |.proto1.........|
-00000050 00 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 |......0...0.....|
-00000060 02 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d |..............0.|
-00000070 06 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 |..*.H........0E1|
-00000080 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 |.0...U....AU1.0.|
-00000090 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 |..U....Some-Stat|
-000000a0 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 |e1!0...U....Inte|
-000000b0 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 |rnet Widgits Pty|
-000000c0 20 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 | Ltd0...10042409|
-000000d0 30 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 |0938Z..110424090|
-000000e0 39 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 |938Z0E1.0...U...|
-000000f0 02 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f |.AU1.0...U....So|
-00000100 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 |me-State1!0...U.|
-00000110 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 |...Internet Widg|
-00000120 69 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d |its Pty Ltd0..0.|
-00000130 06 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d |..*.H...........|
-00000140 00 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf |.0.......y......|
-00000150 46 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a |F...i..+.CZ..-.z|
-00000160 43 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 |C...R..eL,x.#...|
-00000170 82 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c |.....;~b.,.3...\|
-00000180 7a 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 |zV.....X{&?.....|
-00000190 c9 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 |.!.J..T.Z..Bq...|
-000001a0 99 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 |...~.}}..9....Q.|
-000001b0 7c e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d ||..L;2f......q..|
-000001c0 db db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 |...k..-y........|
-000001d0 30 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad |0..0...U........|
-000001e0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-000001f0 88 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 |.90u..U.#.n0l...|
-00000200 ad e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e |...Z..(.i.#i..&.|
-00000210 18 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 |..9.I.G0E1.0...U|
-00000220 04 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 |....AU1.0...U...|
-00000230 0a 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 |.Some-State1!0..|
-00000240 03 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 |.U....Internet W|
-00000250 69 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 |idgits Pty Ltd..|
-00000260 00 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 |.........0...U..|
-00000270 04 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 |..0....0...*.H..|
-00000280 0d 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b |...........lE$.k|
-00000290 b1 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 |.Y..R.......zdu.|
-000002a0 5a 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e |Z.f..+...f..O8.n|
-000002b0 60 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 |`....A..%...z$.0|
-000002c0 1d ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 |.........1Y....x|
-000002d0 ea 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 |.PV\..Z-Z_3....u|
-000002e0 90 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c |....R...... _...|
-000002f0 a3 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b |.......W.p.&mq..|
-00000300 26 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 cd 0c |&n8P)l..........|
-00000310 00 00 c9 03 00 17 41 04 1e 18 37 ef 0d 19 51 88 |......A...7...Q.|
-00000320 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd a7 24 20 |5uq..T[....g..$ |
-00000330 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 07 9f |>.V...(^.+-O....|
-00000340 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 b5 68 |lK[.V.2B.X..I..h|
-00000350 1a 41 03 56 6b dc 5a 89 04 01 00 80 2d a0 6e 47 |.A.Vk.Z.....-.nG|
-00000360 93 a2 19 17 32 f5 42 58 93 f6 4f d4 e9 4d a4 0f |....2.BX..O..M..|
-00000370 fe 4e d7 2c 62 b6 fb 83 37 a3 09 60 4b 69 e2 4c |.N.,b...7..`Ki.L|
-00000380 fc b8 4c d1 a6 9a 89 a0 c5 76 f5 62 b7 e8 eb c2 |..L......v.b....|
-00000390 fa 0f 0e 61 86 bc 70 da 13 72 8d 87 94 16 9a 8d |...a..p..r......|
-000003a0 5f 80 82 92 77 37 4f 9e 55 5d dc 35 42 a3 75 5c |_...w7O.U].5B.u\|
-000003b0 ec a4 58 78 66 97 97 da 49 67 2e b6 7e 11 de fb |..Xxf...Ig..~...|
-000003c0 e3 8f e8 bf 1d 91 1e 91 20 1b 2a df c6 58 e4 82 |........ .*..X..|
-000003d0 ce 37 dd 6f a5 ac 51 3d 65 db 3f f5 16 03 03 00 |.7.o..Q=e.?.....|
-000003e0 04 0e 00 00 00 |.....|
->>> Flow 3 (client to server)
-00000000 16 03 03 00 46 10 00 00 42 41 04 f3 fc ea d8 50 |....F...BA.....P|
-00000010 e6 15 b0 e7 11 c7 6d ee 09 ad 80 d5 54 eb 4f 62 |......m.....T.Ob|
-00000020 7d bb a7 2d 28 0c 66 33 42 09 cf 2b 58 f8 58 41 |}..-(.f3B..+X.XA|
-00000030 bd 46 51 0a f0 7d 8c 0c 98 9e 26 77 20 fd 5e c1 |.FQ..}....&w .^.|
-00000040 a9 b3 e5 c3 6c 05 97 e3 81 fd db 14 03 03 00 01 |....l...........|
-00000050 01 16 03 03 00 40 02 2a 28 41 e3 9c 5d 45 d4 45 |.....@.*(A..]E.E|
-00000060 51 8c 7a c0 ba b1 8e a4 84 2c f3 83 cd c4 55 5c |Q.z......,....U\|
-00000070 d6 5c 6f 72 ab 89 7a c6 d7 9c 2a 54 f0 c4 20 ee |.\or..z...*T.. .|
-00000080 37 74 9b b6 8c f7 e4 37 2c eb d4 9f 5c 5e 55 a0 |7t.....7,...\^U.|
-00000090 e2 5a fe 1e c8 67 |.Z...g|
->>> Flow 4 (server to client)
-00000000 16 03 03 00 72 04 00 00 6e 00 00 00 00 00 68 00 |....r...n.....h.|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 65 |...............e|
-00000020 ea 8b c0 ef ba 59 31 75 33 96 f1 f8 c9 e1 ef 30 |.....Y1u3......0|
-00000030 00 a3 a9 1d ab c8 4b 29 94 f2 c8 c8 8d 03 57 ab |......K)......W.|
-00000040 56 df 0f 4e 0d 30 13 09 c9 e4 fa 51 4e b3 26 ad |V..N.0.....QN.&.|
-00000050 43 9f ae 62 d5 59 23 05 9b 69 8f 5b a8 ba 39 f1 |C..b.Y#..i.[..9.|
-00000060 90 84 35 bf 8f 8d d5 39 93 98 ee b9 75 03 3f 91 |..5....9....u.?.|
-00000070 e8 56 0b cb 44 a6 7a 14 03 03 00 01 01 16 03 03 |.V..D.z.........|
-00000080 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |.@..............|
-00000090 00 00 f9 a0 8e 23 34 f1 61 15 a8 4e ae c4 f3 2a |.....#4.a..N...*|
-000000a0 a6 f8 ee 1b 65 c4 c0 ff 93 14 74 ed 82 ae 48 a8 |....e.....t...H.|
-000000b0 42 fb a9 24 5d dd fd 98 b8 65 73 03 88 99 e1 ed |B..$]....es.....|
-000000c0 02 95 17 03 03 00 40 00 00 00 00 00 00 00 00 00 |......@.........|
-000000d0 00 00 00 00 00 00 00 b9 b3 f5 41 84 3b 2a a9 c3 |..........A.;*..|
-000000e0 9c e3 d4 38 90 76 c1 8c f0 4f 10 1b 04 b5 07 fe |...8.v...O......|
-000000f0 79 3d 7b 77 a4 17 0f 4e df 64 70 70 9e 34 8e b6 |y={w...N.dpp.4..|
-00000100 db b2 b6 fd 41 fe b3 15 03 03 00 30 00 00 00 00 |....A......0....|
-00000110 00 00 00 00 00 00 00 00 00 00 00 00 02 73 de fe |.............s..|
-00000120 fa 4b 69 6d 30 69 79 96 7e 4f 2f 04 67 36 96 27 |.Kim0iy.~O/.g6.'|
-00000130 67 23 2b dc 7a c4 6c 34 ea fc 79 fd |g#+.z.l4..y.|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-ALPN-NoMatch b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-ALPN-NoMatch
deleted file mode 100644
index db5881b..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-ALPN-NoMatch
+++ /dev/null
@@ -1,121 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 01 8a 01 00 01 86 03 03 0a a8 82 53 61 |..............Sa|
-00000010 68 e0 83 91 71 36 f9 c1 19 ff e8 09 fc 21 9f 03 |h...q6.......!..|
-00000020 31 f3 87 4a 04 8c 3d c2 6e 00 32 00 00 d6 c0 30 |1..J..=.n.2....0|
-00000030 c0 2c c0 28 c0 24 c0 14 c0 0a c0 22 c0 21 c0 20 |.,.(.$.....".!. |
-00000040 00 a5 00 a3 00 a1 00 9f 00 6b 00 6a 00 69 00 68 |.........k.j.i.h|
-00000050 00 39 00 38 00 37 00 36 00 88 00 87 00 86 00 85 |.9.8.7.6........|
-00000060 c0 32 c0 2e c0 2a c0 26 c0 0f c0 05 00 9d 00 3d |.2...*.&.......=|
-00000070 00 35 00 84 c0 2f c0 2b c0 27 c0 23 c0 13 c0 09 |.5.../.+.'.#....|
-00000080 c0 1f c0 1e c0 1d 00 a4 00 a2 00 a0 00 9e 00 67 |...............g|
-00000090 00 40 00 3f 00 3e 00 33 00 32 00 31 00 30 00 9a |.@.?.>.3.2.1.0..|
-000000a0 00 99 00 98 00 97 00 45 00 44 00 43 00 42 c0 31 |.......E.D.C.B.1|
-000000b0 c0 2d c0 29 c0 25 c0 0e c0 04 00 9c 00 3c 00 2f |.-.).%.......<./|
-000000c0 00 96 00 41 00 07 c0 11 c0 07 c0 0c c0 02 00 05 |...A............|
-000000d0 00 04 c0 12 c0 08 c0 1c c0 1b c0 1a 00 16 00 13 |................|
-000000e0 00 10 00 0d c0 0d c0 03 00 0a 00 15 00 12 00 0f |................|
-000000f0 00 0c 00 09 00 14 00 11 00 0e 00 0b 00 08 00 06 |................|
-00000100 00 03 00 ff 01 00 00 87 00 0b 00 04 03 00 01 02 |................|
-00000110 00 0a 00 3a 00 38 00 0e 00 0d 00 19 00 1c 00 0b |...:.8..........|
-00000120 00 0c 00 1b 00 18 00 09 00 0a 00 1a 00 16 00 17 |................|
-00000130 00 08 00 06 00 07 00 14 00 15 00 04 00 05 00 12 |................|
-00000140 00 13 00 01 00 02 00 03 00 0f 00 10 00 11 00 23 |...............#|
-00000150 00 00 00 0d 00 20 00 1e 06 01 06 02 06 03 05 01 |..... ..........|
-00000160 05 02 05 03 04 01 04 02 04 03 03 01 03 02 03 03 |................|
-00000170 02 01 02 02 02 03 00 0f 00 01 01 00 10 00 10 00 |................|
-00000180 0e 06 70 72 6f 74 6f 32 06 70 72 6f 74 6f 31 |..proto2.proto1|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 35 02 00 00 31 03 03 00 00 00 00 00 |....5...1.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 c0 14 00 00 |................|
-00000030 09 00 23 00 00 ff 01 00 01 00 16 03 03 02 be 0b |..#.............|
-00000040 00 02 ba 00 02 b7 00 02 b4 30 82 02 b0 30 82 02 |.........0...0..|
-00000050 19 a0 03 02 01 02 02 09 00 85 b0 bb a4 8a 7f b8 |................|
-00000060 ca 30 0d 06 09 2a 86 48 86 f7 0d 01 01 05 05 00 |.0...*.H........|
-00000070 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 55 31 |0E1.0...U....AU1|
-00000080 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 |.0...U....Some-S|
-00000090 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 18 49 |tate1!0...U....I|
-000000a0 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 73 20 |nternet Widgits |
-000000b0 50 74 79 20 4c 74 64 30 1e 17 0d 31 30 30 34 32 |Pty Ltd0...10042|
-000000c0 34 30 39 30 39 33 38 5a 17 0d 31 31 30 34 32 34 |4090938Z..110424|
-000000d0 30 39 30 39 33 38 5a 30 45 31 0b 30 09 06 03 55 |090938Z0E1.0...U|
-000000e0 04 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 |....AU1.0...U...|
-000000f0 0a 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 |.Some-State1!0..|
-00000100 03 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 |.U....Internet W|
-00000110 69 64 67 69 74 73 20 50 74 79 20 4c 74 64 30 81 |idgits Pty Ltd0.|
-00000120 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 00 |.0...*.H........|
-00000130 03 81 8d 00 30 81 89 02 81 81 00 bb 79 d6 f5 17 |....0.......y...|
-00000140 b5 e5 bf 46 10 d0 dc 69 be e6 2b 07 43 5a d0 03 |...F...i..+.CZ..|
-00000150 2d 8a 7a 43 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 |-.zC...R..eL,x.#|
-00000160 8c b5 b4 82 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 |........;~b.,.3.|
-00000170 fe 12 5c 7a 56 fc f5 06 bf fa 58 7b 26 3f b5 cd |..\zV.....X{&?..|
-00000180 04 d3 d0 c9 21 96 4a c7 f4 54 9f 5a bf ef 42 71 |....!.J..T.Z..Bq|
-00000190 00 fe 18 99 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e |......~.}}..9...|
-000001a0 db 51 c9 7c e3 c0 4c 3b 32 66 01 cf af b1 1d b8 |.Q.|..L;2f......|
-000001b0 71 9a 1d db db 89 6b ae da 2d 79 02 03 01 00 01 |q.....k..-y.....|
-000001c0 a3 81 a7 30 81 a4 30 1d 06 03 55 1d 0e 04 16 04 |...0..0...U.....|
-000001d0 14 b1 ad e2 85 5a cf cb 28 db 69 ce 23 69 de d3 |.....Z..(.i.#i..|
-000001e0 26 8e 18 88 39 30 75 06 03 55 1d 23 04 6e 30 6c |&...90u..U.#.n0l|
-000001f0 80 14 b1 ad e2 85 5a cf cb 28 db 69 ce 23 69 de |......Z..(.i.#i.|
-00000200 d3 26 8e 18 88 39 a1 49 a4 47 30 45 31 0b 30 09 |.&...9.I.G0E1.0.|
-00000210 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 55 |..U....AU1.0...U|
-00000220 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 21 |....Some-State1!|
-00000230 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e 65 |0...U....Interne|
-00000240 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c 74 |t Widgits Pty Lt|
-00000250 64 82 09 00 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 |d...........0...|
-00000260 55 1d 13 04 05 30 03 01 01 ff 30 0d 06 09 2a 86 |U....0....0...*.|
-00000270 48 86 f7 0d 01 01 05 05 00 03 81 81 00 08 6c 45 |H.............lE|
-00000280 24 c7 6b b1 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a |$.k.Y..R.......z|
-00000290 64 75 b5 5a 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f |du.Z.f..+...f..O|
-000002a0 38 b3 6e 60 d3 92 fd f7 41 08 b5 25 13 b1 18 7a |8.n`....A..%...z|
-000002b0 24 fb 30 1d ba ed 98 b9 17 ec e7 d7 31 59 db 95 |$.0.........1Y..|
-000002c0 d3 1d 78 ea 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 |..x.PV\..Z-Z_3..|
-000002d0 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f |..u....R...... _|
-000002e0 f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d |..........W.p.&m|
-000002f0 71 99 9b 26 6e 38 50 29 6c 90 a7 bd d9 16 03 03 |q..&n8P)l.......|
-00000300 00 cd 0c 00 00 c9 03 00 17 41 04 1e 18 37 ef 0d |.........A...7..|
-00000310 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
-00000320 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
-00000330 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
-00000340 a6 b5 68 1a 41 03 56 6b dc 5a 89 04 01 00 80 b9 |..h.A.Vk.Z......|
-00000350 0f 79 8a 16 f4 da 8f 27 b4 16 fc c0 51 db ae d1 |.y.....'....Q...|
-00000360 af 79 77 d5 d5 a2 13 05 45 20 cc eb ac ed cb 30 |.yw.....E .....0|
-00000370 32 2e 2c bd fa 1c 4d b5 32 a6 37 43 c8 5c 2d f8 |2.,...M.2.7C.\-.|
-00000380 6e 85 f5 cd 54 92 29 ad 13 7d d5 9e 8c 1d b7 d0 |n...T.)..}......|
-00000390 c1 c7 3d e8 ba 4a 0f 9a a6 3e 25 5f 27 62 b1 00 |..=..J...>%_'b..|
-000003a0 91 d9 23 48 3f 10 fe c5 e3 07 9a 58 57 6d cc 10 |..#H?......XWm..|
-000003b0 3b f8 1a d5 6e 8b 1f 03 6f 82 84 98 b5 f7 71 5d |;...n...o.....q]|
-000003c0 c2 ad 60 14 c1 88 07 5a 3d 99 fd a8 c9 9a 03 16 |..`....Z=.......|
-000003d0 03 03 00 04 0e 00 00 00 |........|
->>> Flow 3 (client to server)
-00000000 16 03 03 00 46 10 00 00 42 41 04 76 aa 4e b9 f9 |....F...BA.v.N..|
-00000010 68 85 81 74 7c d9 f9 64 7f bd 09 83 08 5b 4f 76 |h..t|..d.....[Ov|
-00000020 6e be 79 b6 4e 97 17 63 e4 b5 1c 77 e5 85 76 8a |n.y.N..c...w..v.|
-00000030 5d 9f f1 21 88 ec f9 a7 7c 41 af f9 c5 fe 11 81 |]..!....|A......|
-00000040 11 51 8e a7 20 33 5f cf e7 90 90 14 03 03 00 01 |.Q.. 3_.........|
-00000050 01 16 03 03 00 40 44 3e 32 01 71 ac 5a b5 1f 2c |.....@D>2.q.Z..,|
-00000060 37 d9 4b 70 72 91 89 d4 d7 c2 c3 e7 ff dc 72 2a |7.Kpr.........r*|
-00000070 ba f5 30 b0 e9 dd 48 10 3d cd 98 48 a3 e3 ca de |..0...H.=..H....|
-00000080 15 0e 90 8e e5 04 14 74 42 b8 b0 12 cc 68 7b 7d |.......tB....h{}|
-00000090 6c 43 72 60 05 0d |lCr`..|
->>> Flow 4 (server to client)
-00000000 16 03 03 00 72 04 00 00 6e 00 00 00 00 00 68 00 |....r...n.....h.|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 65 |...............e|
-00000020 ea 8b c0 ef ba 12 45 17 61 24 cd d2 4c 22 bb 3b |......E.a$..L".;|
-00000030 e3 0e d0 ff 83 e9 7c b7 8f 10 3c 16 1c fc c2 44 |......|...<....D|
-00000040 ef 45 f8 27 30 56 db ea eb ae f5 b6 17 b2 ef f9 |.E.'0V..........|
-00000050 96 0d 2d db e4 59 23 0a fc fa e3 13 48 57 e5 b3 |..-..Y#.....HW..|
-00000060 3a d1 f5 5e ca ef d7 3f 7b b5 f4 69 85 c3 bd da |:..^...?{..i....|
-00000070 fd 9c 50 05 2f 86 ce 14 03 03 00 01 01 16 03 03 |..P./...........|
-00000080 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |.@..............|
-00000090 00 00 60 25 1c ed 6f c6 a5 bd b2 29 39 4e 09 d1 |..`%..o....)9N..|
-000000a0 64 cc 75 cd df 91 a8 90 9d 03 aa 92 07 f2 d0 8a |d.u.............|
-000000b0 60 bb 3e 85 21 22 fe f8 dc 52 3c 4e 82 77 14 14 |`.>.!"...R<N.w..|
-000000c0 0f 1f 17 03 03 00 40 00 00 00 00 00 00 00 00 00 |......@.........|
-000000d0 00 00 00 00 00 00 00 0b 87 12 62 3e e5 3e 7d 74 |..........b>.>}t|
-000000e0 0d ac c4 a9 df 67 1c 5a ad 3e 01 34 03 88 2f 39 |.....g.Z.>.4../9|
-000000f0 f7 3c 06 e4 f6 81 43 66 b1 1b ed a5 e5 b6 a8 43 |.<....Cf.......C|
-00000100 7f 36 2f b2 da 45 9a 15 03 03 00 30 00 00 00 00 |.6/..E.....0....|
-00000110 00 00 00 00 00 00 00 00 00 00 00 00 fa 63 4e c5 |.............cN.|
-00000120 77 89 71 56 e3 0a cf 98 da 2f 89 8f 74 8e 76 24 |w.qV...../..t.v$|
-00000130 e2 40 a5 9f 29 1b b2 11 ef 7a 55 7f |.@..)....zU.|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-CipherSuiteCertPreferenceECDSA b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-CipherSuiteCertPreferenceECDSA
deleted file mode 100644
index 0ab8b8d..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-CipherSuiteCertPreferenceECDSA
+++ /dev/null
@@ -1,91 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 ca 01 00 00 c6 03 03 53 04 f1 3f 5f |...........S..?_|
-00000010 f4 ef 1f b3 41 0b 54 e4 4d 56 0a 31 22 b8 5c 73 |....A.T.MV.1".\s|
-00000020 a3 cb b5 b2 9d 43 f1 83 bc d3 bd 00 00 32 c0 30 |.....C.......2.0|
-00000030 c0 2c c0 28 c0 24 c0 14 c0 0a c0 22 c0 21 00 a3 |.,.(.$.....".!..|
-00000040 00 9f 00 6b 00 6a 00 39 00 38 00 88 00 87 c0 32 |...k.j.9.8.....2|
-00000050 c0 2e c0 2a c0 26 c0 0f c0 05 00 9d 00 3d 00 35 |...*.&.......=.5|
-00000060 01 00 00 6b 00 0b 00 04 03 00 01 02 00 0a 00 34 |...k...........4|
-00000070 00 32 00 0e 00 0d 00 19 00 0b 00 0c 00 18 00 09 |.2..............|
-00000080 00 0a 00 16 00 17 00 08 00 06 00 07 00 14 00 15 |................|
-00000090 00 04 00 05 00 12 00 13 00 01 00 02 00 03 00 0f |................|
-000000a0 00 10 00 11 00 0d 00 22 00 20 06 01 06 02 06 03 |.......". ......|
-000000b0 05 01 05 02 05 03 04 01 04 02 04 03 03 01 03 02 |................|
-000000c0 03 03 02 01 02 02 02 03 01 01 00 0f 00 01 01 |...............|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 2a 02 00 00 26 03 03 00 00 00 00 00 |....*...&.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 c0 0a 00 16 |................|
-00000030 03 03 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 |..............0.|
-00000040 02 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb |..0..b.....-G...|
-00000050 f4 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 0b |.0...*.H.=..0E1.|
-00000060 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000070 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000080 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-00000090 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000a0 4c 74 64 30 1e 17 0d 31 32 31 31 32 32 31 35 30 |Ltd0...121122150|
-000000b0 36 33 32 5a 17 0d 32 32 31 31 32 30 31 35 30 36 |632Z..2211201506|
-000000c0 33 32 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |32Z0E1.0...U....|
-000000d0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000e0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-000000f0 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000100 74 73 20 50 74 79 20 4c 74 64 30 81 9b 30 10 06 |ts Pty Ltd0..0..|
-00000110 07 2a 86 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 |.*.H.=....+...#.|
-00000120 81 86 00 04 00 c4 a1 ed be 98 f9 0b 48 73 36 7e |............Hs6~|
-00000130 c3 16 56 11 22 f2 3d 53 c3 3b 4d 21 3d cd 6b 75 |..V.".=S.;M!=.ku|
-00000140 e6 f6 b0 dc 9a df 26 c1 bc b2 87 f0 72 32 7c b3 |......&.....r2|.|
-00000150 64 2f 1c 90 bc ea 68 23 10 7e fe e3 25 c0 48 3a |d/....h#.~..%.H:|
-00000160 69 e0 28 6d d3 37 00 ef 04 62 dd 0d a0 9c 70 62 |i.(m.7...b....pb|
-00000170 83 d8 81 d3 64 31 aa 9e 97 31 bd 96 b0 68 c0 9b |....d1...1...h..|
-00000180 23 de 76 64 3f 1a 5c 7f e9 12 0e 58 58 b6 5f 70 |#.vd?.\....XX._p|
-00000190 dd 9b d8 ea d5 d7 f5 d5 cc b9 b6 9f 30 66 5b 66 |............0f[f|
-000001a0 9a 20 e2 27 e5 bf fe 3b 30 09 06 07 2a 86 48 ce |. .'...;0...*.H.|
-000001b0 3d 04 01 03 81 8c 00 30 81 88 02 42 01 88 a2 4f |=......0...B...O|
-000001c0 eb e2 45 c5 48 7d 1b ac f5 ed 98 9d ae 47 70 c0 |..E.H}.......Gp.|
-000001d0 5e 1b b6 2f bd f1 b6 4d b7 61 40 d3 11 a2 ce ee |^../...M.a@.....|
-000001e0 0b 7e 92 7e ff 76 9d c3 3b 7e a5 3f ce fa 10 e2 |.~.~.v..;~.?....|
-000001f0 59 ec 47 2d 7c ac da 4e 97 0e 15 a0 6f d0 02 42 |Y.G-|..N....o..B|
-00000200 01 4d fc be 67 13 9c 2d 05 0e bd 3f a3 8c 25 c1 |.M..g..-...?..%.|
-00000210 33 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e |3.......7z..z...|
-00000220 dd d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 |...i..|V..1x+..x|
-00000230 0d ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 |.....N6$1{j.9...|
-00000240 8f 2a 16 03 03 00 d8 0c 00 00 d4 03 00 17 41 04 |.*............A.|
-00000250 1e 18 37 ef 0d 19 51 88 35 75 71 b5 e5 54 5b 12 |..7...Q.5uq..T[.|
-00000260 2e 8f 09 67 fd a7 24 20 3e b2 56 1c ce 97 28 5e |...g..$ >.V...(^|
-00000270 f8 2b 2d 4f 9e f1 07 9f 6c 4b 5b 83 56 e2 32 42 |.+-O....lK[.V.2B|
-00000280 e9 58 b6 d7 49 a6 b5 68 1a 41 03 56 6b dc 5a 89 |.X..I..h.A.Vk.Z.|
-00000290 04 03 00 8b 30 81 88 02 42 00 c6 85 8e 06 b7 04 |....0...B.......|
-000002a0 04 e9 cd 9e 3e cb 66 23 95 b4 42 9c 64 81 39 05 |....>.f#..B.d.9.|
-000002b0 3f b5 21 f8 28 af 60 6b 4d 3d ba a1 4b 5e 77 ef |?.!.(.`kM=..K^w.|
-000002c0 e7 59 28 fe 1d c1 27 a2 ff a8 de 33 48 b3 c1 85 |.Y(...'....3H...|
-000002d0 6a 42 9b f9 7e 7e 31 c2 e5 bd 66 02 42 00 ad 7d |jB..~~1...f.B..}|
-000002e0 06 35 ab ec 8d ac d4 ba 1b 49 5e 05 5f f0 97 93 |.5.......I^._...|
-000002f0 82 b8 2b 8d 91 98 63 8e b4 14 62 db 1e c9 2b 64 |..+...c...b...+d|
-00000300 e9 e6 bf 15 5b 67 c2 40 90 c6 1f b7 92 db 4b f6 |....[g.@......K.|
-00000310 f4 db ae 82 f1 4f 02 75 52 40 38 10 ff 35 f0 16 |.....O.uR@8..5..|
-00000320 03 03 00 04 0e 00 00 00 |........|
->>> Flow 3 (client to server)
-00000000 16 03 03 00 46 10 00 00 42 41 04 d8 94 c4 05 26 |....F...BA.....&|
-00000010 76 29 2d 0e ec 47 b6 50 d5 a3 da 2a ba 02 11 37 |v)-..G.P...*...7|
-00000020 3d ef e6 2a db d0 47 47 a7 9a 5f 43 2d 98 78 26 |=..*..GG.._C-.x&|
-00000030 81 e2 f1 ba fe f7 66 c6 61 cb c1 b7 60 62 34 a5 |......f.a...`b4.|
-00000040 78 67 50 3d 9a 0e 4a 8c 8f d7 10 14 03 03 00 01 |xgP=..J.........|
-00000050 01 16 03 03 00 40 5e 46 b0 5d 30 f6 da 8f 9e 67 |.....@^F.]0....g|
-00000060 f5 3e bd fe c9 b8 53 b2 10 d5 7c 0e 34 e3 93 6d |.>....S...|.4..m|
-00000070 0e 8e 8a 2b df fb 9a 0f a5 23 55 e7 0a 4b e2 d3 |...+.....#U..K..|
-00000080 db 15 e8 52 74 26 78 b3 b0 56 65 63 ac ae 1e c0 |...Rt&x..Vec....|
-00000090 0b f4 92 56 a9 04 |...V..|
->>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 00 |..........@.....|
-00000010 00 00 00 00 00 00 00 00 00 00 00 16 a9 63 0a 99 |.............c..|
-00000020 21 8a fc 5c b3 ee 05 71 4e 75 c0 d9 40 54 0d 3e |!..\...qNu..@T.>|
-00000030 4e 5d 44 b7 4b 5d a9 e7 5a 30 ed b6 d5 08 50 b1 |N]D.K]..Z0....P.|
-00000040 e8 8c 54 eb 1b 39 7a f9 3b ac 2e 17 03 03 00 40 |..T..9z.;......@|
-00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000060 96 03 20 2b 20 c4 c1 9a 76 7b f3 96 bd 33 ed e6 |.. + ...v{...3..|
-00000070 38 48 ea 53 d5 e0 62 b5 7e 1a 36 a8 dd 9f 2d 4b |8H.S..b.~.6...-K|
-00000080 06 0d ae f6 bc 99 14 b3 93 14 27 63 e2 a0 c8 76 |..........'c...v|
-00000090 15 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-000000a0 00 00 00 00 00 48 af e1 e4 11 e1 b7 03 19 b0 e3 |.....H..........|
-000000b0 e6 a9 66 d8 ac af aa 03 f6 0d 51 df 9a 27 78 3a |..f.......Q..'x:|
-000000c0 56 5a 03 1a 4c |VZ..L|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-CipherSuiteCertPreferenceRSA b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-CipherSuiteCertPreferenceRSA
deleted file mode 100644
index 88abb15..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-CipherSuiteCertPreferenceRSA
+++ /dev/null
@@ -1,101 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 ca 01 00 00 c6 03 03 53 04 f1 3f cc |...........S..?.|
-00000010 41 74 00 07 cb ae 3b 30 79 48 51 60 41 a3 8c ab |At....;0yHQ`A...|
-00000020 dc 76 f9 74 52 1e c5 fb a9 69 c2 00 00 32 c0 30 |.v.tR....i...2.0|
-00000030 c0 2c c0 28 c0 24 c0 14 c0 0a c0 22 c0 21 00 a3 |.,.(.$.....".!..|
-00000040 00 9f 00 6b 00 6a 00 39 00 38 00 88 00 87 c0 32 |...k.j.9.8.....2|
-00000050 c0 2e c0 2a c0 26 c0 0f c0 05 00 9d 00 3d 00 35 |...*.&.......=.5|
-00000060 01 00 00 6b 00 0b 00 04 03 00 01 02 00 0a 00 34 |...k...........4|
-00000070 00 32 00 0e 00 0d 00 19 00 0b 00 0c 00 18 00 09 |.2..............|
-00000080 00 0a 00 16 00 17 00 08 00 06 00 07 00 14 00 15 |................|
-00000090 00 04 00 05 00 12 00 13 00 01 00 02 00 03 00 0f |................|
-000000a0 00 10 00 11 00 0d 00 22 00 20 06 01 06 02 06 03 |.......". ......|
-000000b0 05 01 05 02 05 03 04 01 04 02 04 03 03 01 03 02 |................|
-000000c0 03 03 02 01 02 02 02 03 01 01 00 0f 00 01 01 |...............|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 2a 02 00 00 26 03 03 00 00 00 00 00 |....*...&.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 c0 14 00 16 |................|
-00000030 03 03 02 be 0b 00 02 ba 00 02 b7 00 02 b4 30 82 |..............0.|
-00000040 02 b0 30 82 02 19 a0 03 02 01 02 02 09 00 85 b0 |..0.............|
-00000050 bb a4 8a 7f b8 ca 30 0d 06 09 2a 86 48 86 f7 0d |......0...*.H...|
-00000060 01 01 05 05 00 30 45 31 0b 30 09 06 03 55 04 06 |.....0E1.0...U..|
-00000070 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 |..AU1.0...U....S|
-00000080 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 |ome-State1!0...U|
-00000090 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 |....Internet Wid|
-000000a0 67 69 74 73 20 50 74 79 20 4c 74 64 30 1e 17 0d |gits Pty Ltd0...|
-000000b0 31 30 30 34 32 34 30 39 30 39 33 38 5a 17 0d 31 |100424090938Z..1|
-000000c0 31 30 34 32 34 30 39 30 39 33 38 5a 30 45 31 0b |10424090938Z0E1.|
-000000d0 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-000000e0 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-000000f0 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-00000100 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-00000110 4c 74 64 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d |Ltd0..0...*.H...|
-00000120 01 01 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 |.........0......|
-00000130 bb 79 d6 f5 17 b5 e5 bf 46 10 d0 dc 69 be e6 2b |.y......F...i..+|
-00000140 07 43 5a d0 03 2d 8a 7a 43 85 b7 14 52 e7 a5 65 |.CZ..-.zC...R..e|
-00000150 4c 2c 78 b8 23 8c b5 b4 82 e5 de 1f 95 3b 7e 62 |L,x.#........;~b|
-00000160 a5 2c a5 33 d6 fe 12 5c 7a 56 fc f5 06 bf fa 58 |.,.3...\zV.....X|
-00000170 7b 26 3f b5 cd 04 d3 d0 c9 21 96 4a c7 f4 54 9f |{&?......!.J..T.|
-00000180 5a bf ef 42 71 00 fe 18 99 07 7f 7e 88 7d 7d f1 |Z..Bq......~.}}.|
-00000190 04 39 c4 a2 2e db 51 c9 7c e3 c0 4c 3b 32 66 01 |.9....Q.|..L;2f.|
-000001a0 cf af b1 1d b8 71 9a 1d db db 89 6b ae da 2d 79 |.....q.....k..-y|
-000001b0 02 03 01 00 01 a3 81 a7 30 81 a4 30 1d 06 03 55 |........0..0...U|
-000001c0 1d 0e 04 16 04 14 b1 ad e2 85 5a cf cb 28 db 69 |..........Z..(.i|
-000001d0 ce 23 69 de d3 26 8e 18 88 39 30 75 06 03 55 1d |.#i..&...90u..U.|
-000001e0 23 04 6e 30 6c 80 14 b1 ad e2 85 5a cf cb 28 db |#.n0l......Z..(.|
-000001f0 69 ce 23 69 de d3 26 8e 18 88 39 a1 49 a4 47 30 |i.#i..&...9.I.G0|
-00000200 45 31 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 |E1.0...U....AU1.|
-00000210 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 |0...U....Some-St|
-00000220 61 74 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e |ate1!0...U....In|
-00000230 74 65 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 |ternet Widgits P|
-00000240 74 79 20 4c 74 64 82 09 00 85 b0 bb a4 8a 7f b8 |ty Ltd..........|
-00000250 ca 30 0c 06 03 55 1d 13 04 05 30 03 01 01 ff 30 |.0...U....0....0|
-00000260 0d 06 09 2a 86 48 86 f7 0d 01 01 05 05 00 03 81 |...*.H..........|
-00000270 81 00 08 6c 45 24 c7 6b b1 59 ab 0c 52 cc f2 b0 |...lE$.k.Y..R...|
-00000280 14 d7 87 9d 7a 64 75 b5 5a 95 66 e4 c5 2b 8e ae |....zdu.Z.f..+..|
-00000290 12 66 1f eb 4f 38 b3 6e 60 d3 92 fd f7 41 08 b5 |.f..O8.n`....A..|
-000002a0 25 13 b1 18 7a 24 fb 30 1d ba ed 98 b9 17 ec e7 |%...z$.0........|
-000002b0 d7 31 59 db 95 d3 1d 78 ea 50 56 5c d5 82 5a 2d |.1Y....x.PV\..Z-|
-000002c0 5a 5f 33 c4 b6 d8 c9 75 90 96 8c 0f 52 98 b5 cd |Z_3....u....R...|
-000002d0 98 1f 89 20 5f f2 a0 1c a3 1b 96 94 dd a9 fd 57 |... _..........W|
-000002e0 e9 70 e8 26 6d 71 99 9b 26 6e 38 50 29 6c 90 a7 |.p.&mq..&n8P)l..|
-000002f0 bd d9 16 03 03 00 cd 0c 00 00 c9 03 00 17 41 04 |..............A.|
-00000300 1e 18 37 ef 0d 19 51 88 35 75 71 b5 e5 54 5b 12 |..7...Q.5uq..T[.|
-00000310 2e 8f 09 67 fd a7 24 20 3e b2 56 1c ce 97 28 5e |...g..$ >.V...(^|
-00000320 f8 2b 2d 4f 9e f1 07 9f 6c 4b 5b 83 56 e2 32 42 |.+-O....lK[.V.2B|
-00000330 e9 58 b6 d7 49 a6 b5 68 1a 41 03 56 6b dc 5a 89 |.X..I..h.A.Vk.Z.|
-00000340 04 01 00 80 9d 84 09 35 73 fb f6 ea 94 7b 49 fb |.......5s....{I.|
-00000350 c2 70 b1 11 64 5b 93 9f d9 8c f5 56 98 f6 d3 66 |.p..d[.....V...f|
-00000360 a6 1d 18 56 88 87 71 3f b0 38 9d 44 1f ad 2c 0d |...V..q?.8.D..,.|
-00000370 3a a7 e8 d4 3e 33 3c 41 20 f3 3f 5c e5 fb e3 23 |:...>3<A .?\...#|
-00000380 12 48 ff d2 c4 30 7c 8a 51 3f 9f 19 6e 34 d7 60 |.H...0|.Q?..n4.`|
-00000390 7d 12 8a aa 90 0f 50 d9 0b 9a b2 d7 66 b1 c6 84 |}.....P.....f...|
-000003a0 af 5c e2 5e 16 3e 36 61 73 84 64 89 b3 c1 6d 50 |.\.^.>6as.d...mP|
-000003b0 33 55 c7 e1 c5 a5 4c 32 5c 95 dc 07 43 60 49 11 |3U....L2\...C`I.|
-000003c0 e9 98 cc ba 16 03 03 00 04 0e 00 00 00 |.............|
->>> Flow 3 (client to server)
-00000000 16 03 03 00 46 10 00 00 42 41 04 28 02 84 d5 b4 |....F...BA.(....|
-00000010 58 07 47 d5 a0 d6 0b 1d 37 91 e6 34 a4 ad 0b ad |X.G.....7..4....|
-00000020 22 01 82 77 a7 32 86 78 83 3a da 75 2f e5 68 7a |"..w.2.x.:.u/.hz|
-00000030 de e4 05 e0 02 47 40 4e 38 d2 2c c3 7b da 53 73 |.....G@N8.,.{.Ss|
-00000040 19 cb 8b 73 34 72 4d 33 71 39 c8 14 03 03 00 01 |...s4rM3q9......|
-00000050 01 16 03 03 00 40 10 63 43 76 83 bd 36 e4 1e 4d |.....@.cCv..6..M|
-00000060 7e 13 b0 ac aa c8 ec 90 31 df 84 46 49 68 39 5a |~.......1..FIh9Z|
-00000070 05 8b 73 32 86 15 3a 18 57 d8 e2 2c 2d 05 89 93 |..s2..:.W..,-...|
-00000080 37 b8 dd 73 33 92 ff a7 b2 53 27 94 b7 25 56 64 |7..s3....S'..%Vd|
-00000090 a1 d3 2c f7 6b 71 |..,.kq|
->>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 00 |..........@.....|
-00000010 00 00 00 00 00 00 00 00 00 00 00 21 5c 31 b1 4b |...........!\1.K|
-00000020 96 96 30 8f 79 35 3a 3a 2d 26 67 d0 70 48 be 30 |..0.y5::-&g.pH.0|
-00000030 f8 3e e8 c1 cb 1d d5 89 f6 9c 72 bb 1c f9 4d 90 |.>........r...M.|
-00000040 9c d7 c6 fa 40 76 a5 61 46 61 24 17 03 03 00 40 |....@v.aFa$....@|
-00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000060 94 8a 14 04 06 b9 30 a0 67 fd b2 4c 84 f4 10 93 |......0.g..L....|
-00000070 7d d4 2b 23 f0 e9 62 93 c2 20 a2 f2 7c 07 21 4b |}.+#..b.. ..|.!K|
-00000080 94 ba 7b 7d cb 77 da 85 93 bd 53 ee ca db 9b 3e |..{}.w....S....>|
-00000090 15 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-000000a0 00 00 00 00 00 17 3f 53 8d b3 35 b4 84 ed bb 12 |......?S..5.....|
-000000b0 cf 73 25 25 7c c3 d3 bb 1f 5a 6b 73 9a 8a b1 a2 |.s%%|....Zks....|
-000000c0 ba 99 f8 0e 43 |....C|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-ClientAuthRequestedAndECDSAGiven b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-ClientAuthRequestedAndECDSAGiven
deleted file mode 100644
index 547f798..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-ClientAuthRequestedAndECDSAGiven
+++ /dev/null
@@ -1,122 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 5c 01 00 00 58 03 03 52 cc 57 59 65 |....\...X..R.WYe|
-00000010 ae b3 ec a4 7a 05 f7 ec 39 22 7d 8c 91 96 6b e0 |....z...9"}...k.|
-00000020 69 81 ff 88 28 17 60 ac 94 19 ff 00 00 04 00 05 |i...(.`.........|
-00000030 00 ff 01 00 00 2b 00 0d 00 22 00 20 06 01 06 02 |.....+...". ....|
-00000040 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................|
-00000050 03 02 03 03 02 01 02 02 02 03 01 01 00 0f 00 01 |................|
-00000060 01 |.|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 05 00 00 |................|
-00000030 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 0f 0d 00 |n8P)l...........|
-00000300 00 0b 02 01 40 00 04 04 01 04 03 00 00 16 03 03 |....@...........|
-00000310 00 04 0e 00 00 00 |......|
->>> Flow 3 (client to server)
-00000000 16 03 03 02 0a 0b 00 02 06 00 02 03 00 02 00 30 |...............0|
-00000010 82 01 fc 30 82 01 5e 02 09 00 9a 30 84 6c 26 35 |...0..^....0.l&5|
-00000020 d9 17 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 |..0...*.H.=..0E1|
-00000030 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 |.0...U....AU1.0.|
-00000040 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 |..U....Some-Stat|
-00000050 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 |e1!0...U....Inte|
-00000060 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 |rnet Widgits Pty|
-00000070 20 4c 74 64 30 1e 17 0d 31 32 31 31 31 34 31 33 | Ltd0...12111413|
-00000080 32 35 35 33 5a 17 0d 32 32 31 31 31 32 31 33 32 |2553Z..221112132|
-00000090 35 35 33 5a 30 41 31 0b 30 09 06 03 55 04 06 13 |553Z0A1.0...U...|
-000000a0 02 41 55 31 0c 30 0a 06 03 55 04 08 13 03 4e 53 |.AU1.0...U....NS|
-000000b0 57 31 10 30 0e 06 03 55 04 07 13 07 50 79 72 6d |W1.0...U....Pyrm|
-000000c0 6f 6e 74 31 12 30 10 06 03 55 04 03 13 09 4a 6f |ont1.0...U....Jo|
-000000d0 65 6c 20 53 69 6e 67 30 81 9b 30 10 06 07 2a 86 |el Sing0..0...*.|
-000000e0 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 86 00 |H.=....+...#....|
-000000f0 04 00 95 8c 91 75 14 c0 5e c4 57 b4 d4 c3 6f 8d |.....u..^.W...o.|
-00000100 ae 68 1e dd 6f ce 86 e1 7e 6e b2 48 3e 81 e5 4e |.h..o...~n.H>..N|
-00000110 e2 c6 88 4b 64 dc f5 30 bb d3 ff 65 cc 5b f4 dd |...Kd..0...e.[..|
-00000120 b5 6a 3e 3e d0 1d de 47 c3 76 ad 19 f6 45 2c 8c |.j>>...G.v...E,.|
-00000130 bc d8 1d 01 4c 1f 70 90 46 76 48 8b 8f 83 cc 4a |....L.p.FvH....J|
-00000140 5c 8f 40 76 da e0 89 ec 1d 2b c4 4e 30 76 28 41 |\.@v.....+.N0v(A|
-00000150 b2 62 a8 fb 5b f1 f9 4e 7a 8d bd 09 b8 ae ea 8b |.b..[..Nz.......|
-00000160 18 27 4f 2e 70 fe 13 96 ba c3 d3 40 16 cd 65 4e |.'O.p......@..eN|
-00000170 ac 11 1e e6 f1 30 09 06 07 2a 86 48 ce 3d 04 01 |.....0...*.H.=..|
-00000180 03 81 8c 00 30 81 88 02 42 00 e0 14 c4 60 60 0b |....0...B....``.|
-00000190 72 68 b0 32 5d 61 4a 02 74 5c c2 81 b9 16 a8 3f |rh.2]aJ.t\.....?|
-000001a0 29 c8 36 c7 81 ff 6c b6 5b d9 70 f1 38 3b 50 48 |).6...l.[.p.8;PH|
-000001b0 28 94 cb 09 1a 52 f1 5d ee 8d f2 b9 f0 f0 da d9 |(....R.]........|
-000001c0 15 3a f9 bd 03 7a 87 a2 23 35 ec 02 42 01 a3 d4 |.:...z..#5..B...|
-000001d0 8a 78 35 1c 4a 9a 23 d2 0a be 2b 10 31 9d 9c 5f |.x5.J.#...+.1.._|
-000001e0 be e8 91 b3 da 1a f5 5d a3 23 f5 26 8b 45 70 8d |.......].#.&.Ep.|
-000001f0 65 62 9b 7e 01 99 3d 18 f6 10 9a 38 61 9b 2e 57 |eb.~..=....8a..W|
-00000200 e4 fa cc b1 8a ce e2 23 a0 87 f0 e1 67 51 eb 16 |.......#....gQ..|
-00000210 03 03 00 86 10 00 00 82 00 80 47 5a 2f b8 78 46 |..........GZ/.xF|
-00000220 9f 3c fc ab 8b 35 c9 77 da c3 96 78 31 7c 2b 4f |.<...5.w...x1|+O|
-00000230 56 be 0f 33 bd 17 bc 1c 86 5a ae b3 0f 8b 18 2f |V..3.....Z...../|
-00000240 48 0d e0 0a 20 d3 53 96 88 d2 8a 7d b6 58 13 44 |H... .S....}.X.D|
-00000250 a5 e8 19 6d 02 df a6 1b 79 c5 54 c2 ef 4d 41 4f |...m....y.T..MAO|
-00000260 04 1c eb 37 55 b7 2b f4 7c 6d 37 9c f1 89 a0 2c |...7U.+.|m7....,|
-00000270 0f ba 10 09 e4 a1 ee 0a 7e 9a fd 2c 32 63 1c 55 |........~..,2c.U|
-00000280 85 38 de d0 7b 5f 46 03 1f cc 4d 69 51 97 d8 d7 |.8..{_F...MiQ...|
-00000290 88 6f ba 43 04 b0 42 09 61 5e 16 03 03 00 92 0f |.o.C..B.a^......|
-000002a0 00 00 8e 04 03 00 8a 30 81 87 02 41 14 3d 4c 71 |.......0...A.=Lq|
-000002b0 c2 32 4a 20 ee b7 69 17 55 e8 99 55 11 76 51 7a |.2J ..i.U..U.vQz|
-000002c0 74 55 e7 e8 c3 3b b3 70 db 1c 8e f6 8a d4 99 40 |tU...;.p.......@|
-000002d0 6e da 04 fd 7a 47 41 d6 ae c0 63 ad fd 91 a8 58 |n...zGA...c....X|
-000002e0 24 b9 ac 2f 7a 4c bf 5b 24 12 cb 3a f3 02 42 00 |$../zL.[$..:..B.|
-000002f0 90 f9 48 97 0e d4 33 99 09 9f 1d a8 97 16 60 82 |..H...3.......`.|
-00000300 85 cc 5a 5d 79 f7 2f 03 2a c0 b8 12 61 ac 9f 88 |..Z]y./.*...a...|
-00000310 1d 0d 9e 0a ee 28 a8 5a e2 42 b7 94 e2 e6 0e 13 |.....(.Z.B......|
-00000320 c8 64 dc 4e d3 6b 10 d6 83 41 9c dc d4 53 c3 08 |.d.N.k...A...S..|
-00000330 19 14 03 03 00 01 01 16 03 03 00 24 ef bd e3 23 |...........$...#|
-00000340 10 23 ae 6e b5 12 eb 9c 21 78 db 36 fd bf 7f ee |.#.n....!x.6....|
-00000350 6f c8 00 2d b6 35 cc 2f 38 73 ae a4 34 cf 0d df |o..-.5./8s..4...|
->>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 24 a7 50 0f 50 b4 |..........$.P.P.|
-00000010 1c c3 4d f3 7a 64 df 65 ac 35 22 13 46 cc ec 36 |..M.zd.e.5".F..6|
-00000020 e6 d2 f3 67 94 6a 18 85 9f 4a 3c 44 a3 58 b0 17 |...g.j...J<D.X..|
-00000030 03 03 00 21 51 0a 41 8c fd 50 e3 54 8b 6a 1f 83 |...!Q.A..P.T.j..|
-00000040 a5 37 98 e1 5b 1e ec 03 1d c7 0e 28 6d 79 3f 34 |.7..[......(my?4|
-00000050 de 1c 38 6d 7e 15 03 03 00 16 06 fc b1 7d ad 70 |..8m~........}.p|
-00000060 1a de d4 b7 b5 e7 a2 6d 1b 9a b0 31 0c cc 7b 70 |.......m...1..{p|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-ClientAuthRequestedAndGiven b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-ClientAuthRequestedAndGiven
deleted file mode 100644
index 04a5b11..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-ClientAuthRequestedAndGiven
+++ /dev/null
@@ -1,121 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 5c 01 00 00 58 03 03 52 cc 57 59 6b |....\...X..R.WYk|
-00000010 11 07 04 39 77 20 c2 b4 3f cb 0a c9 53 fe 5b 3e |...9w ..?...S.[>|
-00000020 5f 58 2c 7e 30 69 e1 8e 6c 9d c8 00 00 04 00 05 |_X,~0i..l.......|
-00000030 00 ff 01 00 00 2b 00 0d 00 22 00 20 06 01 06 02 |.....+...". ....|
-00000040 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................|
-00000050 03 02 03 03 02 01 02 02 02 03 01 01 00 0f 00 01 |................|
-00000060 01 |.|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 05 00 00 |................|
-00000030 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 0f 0d 00 |n8P)l...........|
-00000300 00 0b 02 01 40 00 04 04 01 04 03 00 00 16 03 03 |....@...........|
-00000310 00 04 0e 00 00 00 |......|
->>> Flow 3 (client to server)
-00000000 16 03 03 01 fb 0b 00 01 f7 00 01 f4 00 01 f1 30 |...............0|
-00000010 82 01 ed 30 82 01 58 a0 03 02 01 02 02 01 00 30 |...0..X........0|
-00000020 0b 06 09 2a 86 48 86 f7 0d 01 01 05 30 26 31 10 |...*.H......0&1.|
-00000030 30 0e 06 03 55 04 0a 13 07 41 63 6d 65 20 43 6f |0...U....Acme Co|
-00000040 31 12 30 10 06 03 55 04 03 13 09 31 32 37 2e 30 |1.0...U....127.0|
-00000050 2e 30 2e 31 30 1e 17 0d 31 31 31 32 30 38 30 37 |.0.10...11120807|
-00000060 35 35 31 32 5a 17 0d 31 32 31 32 30 37 30 38 30 |5512Z..121207080|
-00000070 30 31 32 5a 30 26 31 10 30 0e 06 03 55 04 0a 13 |012Z0&1.0...U...|
-00000080 07 41 63 6d 65 20 43 6f 31 12 30 10 06 03 55 04 |.Acme Co1.0...U.|
-00000090 03 13 09 31 32 37 2e 30 2e 30 2e 31 30 81 9c 30 |...127.0.0.10..0|
-000000a0 0b 06 09 2a 86 48 86 f7 0d 01 01 01 03 81 8c 00 |...*.H..........|
-000000b0 30 81 88 02 81 80 4e d0 7b 31 e3 82 64 d9 59 c0 |0.....N.{1..d.Y.|
-000000c0 c2 87 a4 5e 1e 8b 73 33 c7 63 53 df 66 92 06 84 |...^..s3.cS.f...|
-000000d0 f6 64 d5 8f e4 36 a7 1d 2b e8 b3 20 36 45 23 b5 |.d...6..+.. 6E#.|
-000000e0 e3 95 ae ed e0 f5 20 9c 8d 95 df 7f 5a 12 ef 87 |...... .....Z...|
-000000f0 e4 5b 68 e4 e9 0e 74 ec 04 8a 7f de 93 27 c4 01 |.[h...t......'..|
-00000100 19 7a bd f2 dc 3d 14 ab d0 54 ca 21 0c d0 4d 6e |.z...=...T.!..Mn|
-00000110 87 2e 5c c5 d2 bb 4d 4b 4f ce b6 2c f7 7e 88 ec |..\...MKO..,.~..|
-00000120 7c d7 02 91 74 a6 1e 0c 1a da e3 4a 5a 2e de 13 ||...t......JZ...|
-00000130 9c 4c 40 88 59 93 02 03 01 00 01 a3 32 30 30 30 |.L@.Y.......2000|
-00000140 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02 00 a0 30 |...U...........0|
-00000150 0d 06 03 55 1d 0e 04 06 04 04 01 02 03 04 30 0f |...U..........0.|
-00000160 06 03 55 1d 23 04 08 30 06 80 04 01 02 03 04 30 |..U.#..0.......0|
-00000170 0b 06 09 2a 86 48 86 f7 0d 01 01 05 03 81 81 00 |...*.H..........|
-00000180 36 1f b3 7a 0c 75 c9 6e 37 46 61 2b d5 bd c0 a7 |6..z.u.n7Fa+....|
-00000190 4b cc 46 9a 81 58 7c 85 79 29 c8 c8 c6 67 dd 32 |K.F..X|.y)...g.2|
-000001a0 56 45 2b 75 b6 e9 24 a9 50 9a be 1f 5a fa 1a 15 |VE+u..$.P...Z...|
-000001b0 d9 cc 55 95 72 16 83 b9 c2 b6 8f fd 88 8c 38 84 |..U.r.........8.|
-000001c0 1d ab 5d 92 31 13 4f fd 83 3b c6 9d f1 11 62 b6 |..].1.O..;....b.|
-000001d0 8b ec ab 67 be c8 64 b0 11 50 46 58 17 6b 99 1c |...g..d..PFX.k..|
-000001e0 d3 1d fc 06 f1 0e e5 96 a8 0c f9 78 20 b7 44 18 |...........x .D.|
-000001f0 51 8d 10 7e 4f 94 67 df a3 4e 70 73 8e 90 91 85 |Q..~O.g..Nps....|
-00000200 16 03 03 00 86 10 00 00 82 00 80 44 89 7d aa 26 |...........D.}.&|
-00000210 30 ce 6b db 25 70 b0 1e 16 fa 5b 3a dd 4a 4b bd |0.k.%p....[:.JK.|
-00000220 ec ee 50 9d 21 ba 52 b5 51 4f a8 65 d8 2e 41 e2 |..P.!.R.QO.e..A.|
-00000230 e1 dc f3 1a df 58 4f 87 7a d3 e1 e1 1c 13 b2 0b |.....XO.z.......|
-00000240 b7 43 b7 92 f2 df 19 bb 79 71 e0 71 44 ab 19 2f |.C......yq.qD../|
-00000250 37 11 ac 62 50 b6 f1 53 fe aa b4 bc 29 8e 0b 4c |7..bP..S....)..L|
-00000260 0b 12 8d d5 84 a9 fa a9 ea 16 aa c3 0d da 32 c8 |..............2.|
-00000270 e0 4c 9f 99 f8 69 cd a8 c3 b1 76 42 67 f3 ff 15 |.L...i....vBg...|
-00000280 52 95 43 66 da 49 43 25 9d e5 eb 16 03 03 00 88 |R.Cf.IC%........|
-00000290 0f 00 00 84 04 01 00 80 01 d5 0e 1c 75 97 89 52 |............u..R|
-000002a0 1a f0 cc ef 93 6e 71 b2 b1 38 8c 50 11 f7 a3 02 |.....nq..8.P....|
-000002b0 71 c4 d5 6f 8d 01 83 06 2e ea 5a 10 8a 0d d0 fc |q..o......Z.....|
-000002c0 b6 a2 63 af 4f 99 b5 eb ab fd 01 c2 fb 26 fc fd |..c.O........&..|
-000002d0 ad 2c b3 63 b3 87 a6 f5 14 ea 7d e7 fe a8 e7 7e |.,.c......}....~|
-000002e0 20 ab b9 f6 c3 58 bd c0 f3 96 eb 83 dc 42 6c 0d | ....X.......Bl.|
-000002f0 5e e8 09 55 c7 b8 24 05 dd e1 7c af 9f 2c 22 6c |^..U..$...|..,"l|
-00000300 fa b8 94 13 3b f1 09 e1 38 59 fc a1 8c cb aa ca |....;...8Y......|
-00000310 f8 e0 2a 9c 36 f9 c3 2b 14 03 03 00 01 01 16 03 |..*.6..+........|
-00000320 03 00 24 d0 12 7c cc d2 3e 37 1f f4 7d b4 c0 fc |..$..|..>7..}...|
-00000330 19 f6 c8 ea 62 12 e0 0d af 62 d4 69 f7 96 5a c0 |....b....b.i..Z.|
-00000340 97 d3 bb b0 a3 f7 3f |......?|
->>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 24 cd 20 85 1e 74 |..........$. ..t|
-00000010 18 b2 71 48 d5 10 61 c6 b0 18 26 83 c2 7f f1 b1 |..qH..a...&.....|
-00000020 2f b5 35 d0 47 a8 99 9a 9a a5 62 64 fb f9 29 17 |/.5.G.....bd..).|
-00000030 03 03 00 21 22 7b ed 61 e3 9b 6d 98 b9 23 98 e3 |...!"{.a..m..#..|
-00000040 55 11 b8 0f 7e 2b e1 c1 d4 f1 83 79 c3 f8 03 f0 |U...~+.....y....|
-00000050 02 5c 61 24 d7 15 03 03 00 16 14 2b a3 5a 56 f0 |.\a$.......+.ZV.|
-00000060 92 da d0 e6 32 91 d8 30 7a b4 d0 a2 93 f5 01 ea |....2..0z.......|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-ClientAuthRequestedNotGiven b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-ClientAuthRequestedNotGiven
deleted file mode 100644
index 562fe1a..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-ClientAuthRequestedNotGiven
+++ /dev/null
@@ -1,81 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 5c 01 00 00 58 03 03 52 cc 57 59 1b |....\...X..R.WY.|
-00000010 08 fe f7 8a bf 07 84 2b 60 a6 13 2d 15 13 f8 b6 |.......+`..-....|
-00000020 d4 b6 3b f2 7a 98 ff 32 a0 68 7c 00 00 04 00 05 |..;.z..2.h|.....|
-00000030 00 ff 01 00 00 2b 00 0d 00 22 00 20 06 01 06 02 |.....+...". ....|
-00000040 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................|
-00000050 03 02 03 03 02 01 02 02 02 03 01 01 00 0f 00 01 |................|
-00000060 01 |.|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 05 00 00 |................|
-00000030 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 0f 0d 00 |n8P)l...........|
-00000300 00 0b 02 01 40 00 04 04 01 04 03 00 00 16 03 03 |....@...........|
-00000310 00 04 0e 00 00 00 |......|
->>> Flow 3 (client to server)
-00000000 16 03 03 00 07 0b 00 00 03 00 00 00 16 03 03 00 |................|
-00000010 86 10 00 00 82 00 80 6b 51 48 d3 18 7d 30 e0 0c |.......kQH..}0..|
-00000020 20 8d f3 e4 39 47 30 0e a5 85 79 f9 8b 11 50 9e | ...9G0...y...P.|
-00000030 81 71 5c 26 c6 bb cb aa d5 00 d1 89 79 b1 77 2d |.q\&........y.w-|
-00000040 eb 9b 86 7c 52 c6 f7 b7 10 b0 b6 94 22 51 b8 12 |...|R......."Q..|
-00000050 3c 09 35 8e 1b cc f4 3b b7 b8 78 ab 89 59 41 49 |<.5....;..x..YAI|
-00000060 21 31 eb f0 f8 94 63 3d e6 96 8f b6 63 95 05 dd |!1....c=....c...|
-00000070 46 b3 00 8a d6 83 75 99 1b 5a 48 0a 23 b5 10 c1 |F.....u..ZH.#...|
-00000080 95 b5 bc 15 72 b5 f5 a0 62 e2 1d c0 ff d2 87 a5 |....r...b.......|
-00000090 97 5c 33 49 a7 26 35 14 03 03 00 01 01 16 03 03 |.\3I.&5.........|
-000000a0 00 24 61 38 1f 9d fb d9 65 2e 02 07 fb be f9 85 |.$a8....e.......|
-000000b0 8d 15 34 c0 d1 0e 4e 10 3c 25 60 2f ac 04 21 66 |..4...N.<%`/..!f|
-000000c0 04 9d 9a 60 31 72 |...`1r|
->>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 24 fe 0e 3e 84 af |..........$..>..|
-00000010 e5 6b 10 ed 41 9c 2b e0 ba e0 2b 53 61 36 1b 40 |.k..A.+...+Sa6.@|
-00000020 35 de 3a c7 c3 5c df 74 67 f7 05 74 84 f5 e1 17 |5.:..\.tg..t....|
-00000030 03 03 00 21 d3 8d 81 85 b7 1f 30 bd 89 33 f9 81 |...!......0..3..|
-00000040 89 f7 af d1 be b0 c1 46 e3 df 32 f6 dc 2f 4d 82 |.......F..2../M.|
-00000050 0a 84 9f 5b 03 15 03 03 00 16 13 af 37 91 82 67 |...[........7..g|
-00000060 b0 7c 5e 0e ec 8e cc 31 a0 ea a5 72 a4 2b 0b 73 |.|^....1...r.+.s|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-ECDHE-ECDSA-AES b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-ECDHE-ECDSA-AES
deleted file mode 100644
index aacbb86..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-ECDHE-ECDSA-AES
+++ /dev/null
@@ -1,89 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 9c 01 00 00 98 03 03 53 04 f0 f9 09 |...........S....|
-00000010 13 56 01 37 84 b1 32 59 4c 73 b1 8e bb 02 1a 32 |.V.7..2YLs.....2|
-00000020 db ab 8c e6 ed ad 7f 52 9a 59 39 00 00 04 c0 0a |.......R.Y9.....|
-00000030 00 ff 01 00 00 6b 00 0b 00 04 03 00 01 02 00 0a |.....k..........|
-00000040 00 34 00 32 00 0e 00 0d 00 19 00 0b 00 0c 00 18 |.4.2............|
-00000050 00 09 00 0a 00 16 00 17 00 08 00 06 00 07 00 14 |................|
-00000060 00 15 00 04 00 05 00 12 00 13 00 01 00 02 00 03 |................|
-00000070 00 0f 00 10 00 11 00 0d 00 22 00 20 06 01 06 02 |.........". ....|
-00000080 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................|
-00000090 03 02 03 03 02 01 02 02 02 03 01 01 00 0f 00 01 |................|
-000000a0 01 |.|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 c0 0a 00 00 |................|
-00000030 05 ff 01 00 01 00 16 03 03 02 0e 0b 00 02 0a 00 |................|
-00000040 02 07 00 02 04 30 82 02 00 30 82 01 62 02 09 00 |.....0...0..b...|
-00000050 b8 bf 2d 47 a0 d2 eb f4 30 09 06 07 2a 86 48 ce |..-G....0...*.H.|
-00000060 3d 04 01 30 45 31 0b 30 09 06 03 55 04 06 13 02 |=..0E1.0...U....|
-00000070 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-00000080 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000090 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-000000a0 74 73 20 50 74 79 20 4c 74 64 30 1e 17 0d 31 32 |ts Pty Ltd0...12|
-000000b0 31 31 32 32 31 35 30 36 33 32 5a 17 0d 32 32 31 |1122150632Z..221|
-000000c0 31 32 30 31 35 30 36 33 32 5a 30 45 31 0b 30 09 |120150632Z0E1.0.|
-000000d0 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 55 |..U....AU1.0...U|
-000000e0 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 21 |....Some-State1!|
-000000f0 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e 65 |0...U....Interne|
-00000100 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c 74 |t Widgits Pty Lt|
-00000110 64 30 81 9b 30 10 06 07 2a 86 48 ce 3d 02 01 06 |d0..0...*.H.=...|
-00000120 05 2b 81 04 00 23 03 81 86 00 04 00 c4 a1 ed be |.+...#..........|
-00000130 98 f9 0b 48 73 36 7e c3 16 56 11 22 f2 3d 53 c3 |...Hs6~..V.".=S.|
-00000140 3b 4d 21 3d cd 6b 75 e6 f6 b0 dc 9a df 26 c1 bc |;M!=.ku......&..|
-00000150 b2 87 f0 72 32 7c b3 64 2f 1c 90 bc ea 68 23 10 |...r2|.d/....h#.|
-00000160 7e fe e3 25 c0 48 3a 69 e0 28 6d d3 37 00 ef 04 |~..%.H:i.(m.7...|
-00000170 62 dd 0d a0 9c 70 62 83 d8 81 d3 64 31 aa 9e 97 |b....pb....d1...|
-00000180 31 bd 96 b0 68 c0 9b 23 de 76 64 3f 1a 5c 7f e9 |1...h..#.vd?.\..|
-00000190 12 0e 58 58 b6 5f 70 dd 9b d8 ea d5 d7 f5 d5 cc |..XX._p.........|
-000001a0 b9 b6 9f 30 66 5b 66 9a 20 e2 27 e5 bf fe 3b 30 |...0f[f. .'...;0|
-000001b0 09 06 07 2a 86 48 ce 3d 04 01 03 81 8c 00 30 81 |...*.H.=......0.|
-000001c0 88 02 42 01 88 a2 4f eb e2 45 c5 48 7d 1b ac f5 |..B...O..E.H}...|
-000001d0 ed 98 9d ae 47 70 c0 5e 1b b6 2f bd f1 b6 4d b7 |....Gp.^../...M.|
-000001e0 61 40 d3 11 a2 ce ee 0b 7e 92 7e ff 76 9d c3 3b |a@......~.~.v..;|
-000001f0 7e a5 3f ce fa 10 e2 59 ec 47 2d 7c ac da 4e 97 |~.?....Y.G-|..N.|
-00000200 0e 15 a0 6f d0 02 42 01 4d fc be 67 13 9c 2d 05 |...o..B.M..g..-.|
-00000210 0e bd 3f a3 8c 25 c1 33 13 83 0d 94 06 bb d4 37 |..?..%.3.......7|
-00000220 7a f6 ec 7a c9 86 2e dd d7 11 69 7f 85 7c 56 de |z..z......i..|V.|
-00000230 fb 31 78 2b e4 c7 78 0d ae cb be 9e 4e 36 24 31 |.1x+..x.....N6$1|
-00000240 7b 6a 0f 39 95 12 07 8f 2a 16 03 03 00 d8 0c 00 |{j.9....*.......|
-00000250 00 d4 03 00 17 41 04 1e 18 37 ef 0d 19 51 88 35 |.....A...7...Q.5|
-00000260 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd a7 24 20 3e |uq..T[....g..$ >|
-00000270 b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 07 9f 6c |.V...(^.+-O....l|
-00000280 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 b5 68 1a |K[.V.2B.X..I..h.|
-00000290 41 03 56 6b dc 5a 89 04 03 00 8b 30 81 88 02 42 |A.Vk.Z.....0...B|
-000002a0 00 c6 85 8e 06 b7 04 04 e9 cd 9e 3e cb 66 23 95 |...........>.f#.|
-000002b0 b4 42 9c 64 81 39 05 3f b5 21 f8 28 af 60 6b 4d |.B.d.9.?.!.(.`kM|
-000002c0 3d ba a1 4b 5e 77 ef e7 59 28 fe 1d c1 27 a2 ff |=..K^w..Y(...'..|
-000002d0 a8 de 33 48 b3 c1 85 6a 42 9b f9 7e 7e 31 c2 e5 |..3H...jB..~~1..|
-000002e0 bd 66 02 42 00 ad 7d 06 35 ab ec 8d ac d4 ba 1b |.f.B..}.5.......|
-000002f0 49 5e 05 5f f0 97 93 82 b8 2b 8d 91 98 63 8e b4 |I^._.....+...c..|
-00000300 14 62 db 1e c9 2c 13 ae b7 d3 17 38 23 2f f6 7f |.b...,.....8#/..|
-00000310 0c 4d d3 33 d2 79 d1 77 ee cb b1 c2 fc 34 b8 69 |.M.3.y.w.....4.i|
-00000320 f9 10 8b 61 89 85 16 03 03 00 04 0e 00 00 00 |...a...........|
->>> Flow 3 (client to server)
-00000000 16 03 03 00 46 10 00 00 42 41 04 dd 22 68 a1 4e |....F...BA.."h.N|
-00000010 04 1b 47 f9 c5 7d 04 1d d8 fe 84 fa be 31 2e a7 |..G..}.......1..|
-00000020 f8 e5 b8 14 92 44 99 11 0e 34 97 fc e5 b1 91 cf |.....D...4......|
-00000030 a4 d1 3f b4 71 94 c6 06 16 f0 98 c0 3e 05 f9 2f |..?.q.......>../|
-00000040 0a 97 78 3d ef dc fa a2 d7 ee 7d 14 03 03 00 01 |..x=......}.....|
-00000050 01 16 03 03 00 40 90 bf 7f e9 c9 6e d1 80 f5 12 |.....@.....n....|
-00000060 6d c5 b7 c5 15 4b 18 a5 d3 18 1e f8 8c 4d 7e 6d |m....K.......M~m|
-00000070 03 60 29 7c 45 7c b2 ca 8c 07 71 70 aa 23 fa 6e |.`)|E|....qp.#.n|
-00000080 d9 0b 0a 32 4c 9e e5 00 f9 19 9b b6 8d dc d3 67 |...2L..........g|
-00000090 3d 0f bb b8 4b 9e |=...K.|
->>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 00 |..........@.....|
-00000010 00 00 00 00 00 00 00 00 00 00 00 a1 6e e5 d1 ca |............n...|
-00000020 03 f4 77 dc ec ee 5d f0 22 5e 7f 55 1a 8d ad 45 |..w...]."^.U...E|
-00000030 09 f1 3b b2 61 36 dc 3d 2a 1e 1f e5 a7 84 76 a9 |..;.a6.=*.....v.|
-00000040 41 5b 86 03 ac 22 18 20 9b a9 29 17 03 03 00 40 |A[...". ..)....@|
-00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000060 f5 cb 28 1e b5 bc 82 7f 82 38 54 14 e8 b9 6d 3b |..(......8T...m;|
-00000070 bc 99 d6 0e f9 00 96 99 a8 92 2e 86 9d 62 4e 90 |.............bN.|
-00000080 27 52 58 45 20 93 90 a1 f3 a8 89 2b e7 21 24 16 |'RXE ......+.!$.|
-00000090 15 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-000000a0 00 00 00 00 00 a8 2a ab 8f b0 ce 49 8b fd a5 c9 |......*....I....|
-000000b0 11 b2 04 83 18 f3 1d 6c 82 34 1d df dd 2f 45 3b |.......l.4.../E;|
-000000c0 27 8a 0f 16 69 |'...i|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-IssueTicket b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-IssueTicket
deleted file mode 100644
index e3e62f2..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-IssueTicket
+++ /dev/null
@@ -1,87 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 60 01 00 00 5c 03 03 52 cc 57 59 7e |....`...\..R.WY~|
-00000010 43 5c 3b fd 50 ab 61 3f 64 a4 f9 bd ba 8c 28 e1 |C\;.P.a?d.....(.|
-00000020 f9 a1 45 7e 48 9e 62 af 25 de 0e 00 00 04 00 05 |..E~H.b.%.......|
-00000030 00 ff 01 00 00 2f 00 23 00 00 00 0d 00 22 00 20 |...../.#.....". |
-00000040 06 01 06 02 06 03 05 01 05 02 05 03 04 01 04 02 |................|
-00000050 04 03 03 01 03 02 03 03 02 01 02 02 02 03 01 01 |................|
-00000060 00 0f 00 01 01 |.....|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 35 02 00 00 31 03 03 00 00 00 00 00 |....5...1.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 05 00 00 |................|
-00000030 09 00 23 00 00 ff 01 00 01 00 16 03 03 02 be 0b |..#.............|
-00000040 00 02 ba 00 02 b7 00 02 b4 30 82 02 b0 30 82 02 |.........0...0..|
-00000050 19 a0 03 02 01 02 02 09 00 85 b0 bb a4 8a 7f b8 |................|
-00000060 ca 30 0d 06 09 2a 86 48 86 f7 0d 01 01 05 05 00 |.0...*.H........|
-00000070 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 55 31 |0E1.0...U....AU1|
-00000080 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 |.0...U....Some-S|
-00000090 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 18 49 |tate1!0...U....I|
-000000a0 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 73 20 |nternet Widgits |
-000000b0 50 74 79 20 4c 74 64 30 1e 17 0d 31 30 30 34 32 |Pty Ltd0...10042|
-000000c0 34 30 39 30 39 33 38 5a 17 0d 31 31 30 34 32 34 |4090938Z..110424|
-000000d0 30 39 30 39 33 38 5a 30 45 31 0b 30 09 06 03 55 |090938Z0E1.0...U|
-000000e0 04 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 |....AU1.0...U...|
-000000f0 0a 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 |.Some-State1!0..|
-00000100 03 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 |.U....Internet W|
-00000110 69 64 67 69 74 73 20 50 74 79 20 4c 74 64 30 81 |idgits Pty Ltd0.|
-00000120 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 00 |.0...*.H........|
-00000130 03 81 8d 00 30 81 89 02 81 81 00 bb 79 d6 f5 17 |....0.......y...|
-00000140 b5 e5 bf 46 10 d0 dc 69 be e6 2b 07 43 5a d0 03 |...F...i..+.CZ..|
-00000150 2d 8a 7a 43 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 |-.zC...R..eL,x.#|
-00000160 8c b5 b4 82 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 |........;~b.,.3.|
-00000170 fe 12 5c 7a 56 fc f5 06 bf fa 58 7b 26 3f b5 cd |..\zV.....X{&?..|
-00000180 04 d3 d0 c9 21 96 4a c7 f4 54 9f 5a bf ef 42 71 |....!.J..T.Z..Bq|
-00000190 00 fe 18 99 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e |......~.}}..9...|
-000001a0 db 51 c9 7c e3 c0 4c 3b 32 66 01 cf af b1 1d b8 |.Q.|..L;2f......|
-000001b0 71 9a 1d db db 89 6b ae da 2d 79 02 03 01 00 01 |q.....k..-y.....|
-000001c0 a3 81 a7 30 81 a4 30 1d 06 03 55 1d 0e 04 16 04 |...0..0...U.....|
-000001d0 14 b1 ad e2 85 5a cf cb 28 db 69 ce 23 69 de d3 |.....Z..(.i.#i..|
-000001e0 26 8e 18 88 39 30 75 06 03 55 1d 23 04 6e 30 6c |&...90u..U.#.n0l|
-000001f0 80 14 b1 ad e2 85 5a cf cb 28 db 69 ce 23 69 de |......Z..(.i.#i.|
-00000200 d3 26 8e 18 88 39 a1 49 a4 47 30 45 31 0b 30 09 |.&...9.I.G0E1.0.|
-00000210 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 55 |..U....AU1.0...U|
-00000220 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 21 |....Some-State1!|
-00000230 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e 65 |0...U....Interne|
-00000240 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c 74 |t Widgits Pty Lt|
-00000250 64 82 09 00 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 |d...........0...|
-00000260 55 1d 13 04 05 30 03 01 01 ff 30 0d 06 09 2a 86 |U....0....0...*.|
-00000270 48 86 f7 0d 01 01 05 05 00 03 81 81 00 08 6c 45 |H.............lE|
-00000280 24 c7 6b b1 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a |$.k.Y..R.......z|
-00000290 64 75 b5 5a 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f |du.Z.f..+...f..O|
-000002a0 38 b3 6e 60 d3 92 fd f7 41 08 b5 25 13 b1 18 7a |8.n`....A..%...z|
-000002b0 24 fb 30 1d ba ed 98 b9 17 ec e7 d7 31 59 db 95 |$.0.........1Y..|
-000002c0 d3 1d 78 ea 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 |..x.PV\..Z-Z_3..|
-000002d0 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f |..u....R...... _|
-000002e0 f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d |..........W.p.&m|
-000002f0 71 99 9b 26 6e 38 50 29 6c 90 a7 bd d9 16 03 03 |q..&n8P)l.......|
-00000300 00 04 0e 00 00 00 |......|
->>> Flow 3 (client to server)
-00000000 16 03 03 00 86 10 00 00 82 00 80 6e 2e 79 82 3a |...........n.y.:|
-00000010 c4 68 72 f5 a2 42 3d 71 f9 ec 22 8c 0b fa f0 82 |.hr..B=q..".....|
-00000020 82 c0 cb fc 52 0a 51 03 04 8c eb 4a 4e 4f b6 49 |....R.Q....JNO.I|
-00000030 ef 94 65 21 3c f7 9d 46 85 6e 35 d5 17 6b ff a3 |..e!<..F.n5..k..|
-00000040 5e 4d c1 36 1a 2f 68 f5 06 d4 2d 73 4f 1c 3b 7b |^M.6./h...-sO.;{|
-00000050 c1 fa 4e 7e 7c f9 6c 13 a6 f4 3a 43 e9 aa be 22 |..N~|.l...:C..."|
-00000060 85 6f 2f 7c 5b b0 08 e2 86 b2 ae cb a9 12 d8 32 |.o/|[..........2|
-00000070 80 1d e4 2e 5d c3 66 d1 19 e5 89 33 2a 88 24 40 |....].f....3*.$@|
-00000080 2a 6d 6b b5 f1 92 4b 66 06 b8 49 14 03 03 00 01 |*mk...Kf..I.....|
-00000090 01 16 03 03 00 24 16 49 e2 a0 67 31 cf 0d 72 cb |.....$.I..g1..r.|
-000000a0 ac 16 2c 80 37 71 69 f7 5f c4 d3 00 19 b7 4b fb |..,.7qi._.....K.|
-000000b0 e5 e9 74 8e 30 b3 1c c5 ae e6 |..t.0.....|
->>> Flow 4 (server to client)
-00000000 16 03 03 00 72 04 00 00 6e 00 00 00 00 00 68 00 |....r...n.....h.|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 65 |...............e|
-00000020 ea 4b d1 ef ba 06 38 1e e1 88 82 3a cd 03 ac 3b |.K....8....:...;|
-00000030 39 0a e0 19 fd af 6c 57 30 df 31 6e f7 92 38 4b |9.....lW0.1n..8K|
-00000040 5d 77 90 39 ff 32 51 f5 ed 12 d7 b0 7c 4d 6c c5 |]w.9.2Q.....|Ml.|
-00000050 76 e4 72 48 3e 59 23 fe 0d 15 df f4 ba ea b9 67 |v.rH>Y#........g|
-00000060 16 23 8f 7d 15 b6 11 f1 ab d7 d4 cd a3 21 82 92 |.#.}.........!..|
-00000070 2a 12 cf 95 f3 60 b2 14 03 03 00 01 01 16 03 03 |*....`..........|
-00000080 00 24 89 ad 87 04 4f 08 dc 2a 71 37 fb f1 95 d1 |.$....O..*q7....|
-00000090 2e 3c c2 6e 0f 38 5d e4 0e c3 f7 27 d0 46 a3 c1 |.<.n.8]....'.F..|
-000000a0 a8 3b 06 ed 96 ec 17 03 03 00 21 30 d4 9f 0b 49 |.;........!0...I|
-000000b0 9f a2 a8 a1 2c 0a 79 93 56 2d 8a ee 85 ed 62 42 |....,.y.V-....bB|
-000000c0 8c 18 fe 7a 09 3a 24 c4 5e ed 7d 2a 15 03 03 00 |...z.:$.^.}*....|
-000000d0 16 a0 24 0a 8b 90 4c fc 99 ba 67 bb 04 1e 59 69 |..$...L...g...Yi|
-000000e0 c2 98 49 b5 00 0b e0 |..I....|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-RSA-3DES b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-RSA-3DES
deleted file mode 100644
index 5995b33..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-RSA-3DES
+++ /dev/null
@@ -1,83 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 5c 01 00 00 58 03 03 52 cc 57 59 68 |....\...X..R.WYh|
-00000010 11 72 a6 ec 6b 0a 47 1d 10 06 ec 75 af 07 38 a0 |.r..k.G....u..8.|
-00000020 30 9e 91 12 e1 9b 19 46 0d d4 45 00 00 04 00 0a |0......F..E.....|
-00000030 00 ff 01 00 00 2b 00 0d 00 22 00 20 06 01 06 02 |.....+...". ....|
-00000040 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................|
-00000050 03 02 03 03 02 01 02 02 02 03 01 01 00 0f 00 01 |................|
-00000060 01 |.|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 0a 00 00 |................|
-00000030 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 04 0e 00 |n8P)l...........|
-00000300 00 00 |..|
->>> Flow 3 (client to server)
-00000000 16 03 03 00 86 10 00 00 82 00 80 7a c0 73 ec cb |...........z.s..|
-00000010 cf c2 a8 86 c0 7e 03 63 57 a1 ce 42 37 6d 78 54 |.....~.cW..B7mxT|
-00000020 29 f5 3e cc 57 c7 0d d9 69 e1 52 5c 3b 6b c4 c7 |).>.W...i.R\;k..|
-00000030 20 6d 59 ee c0 07 81 74 74 9f 62 41 64 f0 4d c8 | mY....tt.bAd.M.|
-00000040 9b aa 1a b9 da 56 07 f5 6c 1c 59 8c d3 f9 08 d9 |.....V..l.Y.....|
-00000050 08 f4 16 93 5d 9a e5 6f fb 9f ba 3d 3c d6 81 ad |....]..o...=<...|
-00000060 02 12 a7 28 b6 81 6a 77 c3 e9 d7 c7 54 d6 77 83 |...(..jw....T.w.|
-00000070 77 de 71 fb b3 f3 2d c4 a5 b1 e5 de aa 0e 21 bd |w.q...-.......!.|
-00000080 91 a2 dc 7f f7 6f 90 82 54 b1 e7 14 03 03 00 01 |.....o..T.......|
-00000090 01 16 03 03 00 30 8f ee bf fb c8 5c 54 f5 29 23 |.....0.....\T.)#|
-000000a0 d4 55 f6 98 a1 6e d5 43 e7 81 b2 36 f2 98 d8 1b |.U...n.C...6....|
-000000b0 0d 76 cb 14 ba 32 d7 36 30 e6 ab 42 80 95 f6 8a |.v...2.60..B....|
-000000c0 60 64 a0 6b 90 81 |`d.k..|
->>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 30 00 00 00 00 00 |..........0.....|
-00000010 00 00 00 2c 21 52 34 63 ac e3 a3 66 45 00 41 0c |...,!R4c...fE.A.|
-00000020 93 5d 6a 74 5a 25 dc 69 1d 76 73 0c f4 42 6a 18 |.]jtZ%.i.vs..Bj.|
-00000030 5b 62 23 e7 fe 41 cf d4 9b 86 35 17 03 03 00 30 |[b#..A....5....0|
-00000040 00 00 00 00 00 00 00 00 7d 5d ce 43 85 5c 6b 89 |........}].C.\k.|
-00000050 c9 a5 0e 22 69 8e b9 4a 77 4c c0 4e cc 79 d9 7e |..."i..JwL.N.y.~|
-00000060 a3 c8 d3 db 5c 53 f8 92 4d c4 5a 88 72 58 05 11 |....\S..M.Z.rX..|
-00000070 15 03 03 00 20 00 00 00 00 00 00 00 00 1d 63 8b |.... .........c.|
-00000080 a7 74 fb 76 1d 47 31 93 1f ec 8c e2 18 8e 21 dd |.t.v.G1.......!.|
-00000090 87 97 9f 1c ca |.....|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-RSA-AES b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-RSA-AES
deleted file mode 100644
index a152a96..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-RSA-AES
+++ /dev/null
@@ -1,87 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 5c 01 00 00 58 03 03 52 cc 57 59 d0 |....\...X..R.WY.|
-00000010 38 05 36 7e e3 1e 93 2a 5a bf dc c2 f8 0a 03 6f |8.6~...*Z......o|
-00000020 1a fc 21 74 e5 8b 2a c3 9e 2c 26 00 00 04 00 2f |..!t..*..,&..../|
-00000030 00 ff 01 00 00 2b 00 0d 00 22 00 20 06 01 06 02 |.....+...". ....|
-00000040 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................|
-00000050 03 02 03 03 02 01 02 02 02 03 01 01 00 0f 00 01 |................|
-00000060 01 |.|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 2f 00 00 |............./..|
-00000030 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 04 0e 00 |n8P)l...........|
-00000300 00 00 |..|
->>> Flow 3 (client to server)
-00000000 16 03 03 00 86 10 00 00 82 00 80 4b b4 28 bc 78 |...........K.(.x|
-00000010 41 34 f3 49 e8 74 07 74 42 ae 2e 55 9e 9a ce e5 |A4.I.t.tB..U....|
-00000020 4a 1b e7 55 c7 64 c4 9c b3 dd 20 d6 f8 8e 67 b3 |J..U.d.... ...g.|
-00000030 7a 5c 3b 34 e4 1a f6 bd 65 fc 21 cd 9a de 64 77 |z\;4....e.!...dw|
-00000040 09 a5 92 e5 a4 f5 18 7b 23 5b 8b c1 95 23 97 6f |.......{#[...#.o|
-00000050 76 55 04 34 22 7d 43 71 db cd eb f8 36 36 44 4b |vU.4"}Cq....66DK|
-00000060 ae e3 cc ec 64 88 7b e1 ea d6 ab 49 35 94 a5 04 |....d.{....I5...|
-00000070 1e 83 c5 cf 21 bb ca 33 5f d4 bf 1d d3 4d 07 59 |....!..3_....M.Y|
-00000080 b4 39 b2 4b 7b 05 43 70 0d ba 7a 14 03 03 00 01 |.9.K{.Cp..z.....|
-00000090 01 16 03 03 00 40 74 4b 7d b2 53 49 ea 86 90 c3 |.....@tK}.SI....|
-000000a0 64 6b 64 31 1a 2a 3f 1a 37 1e 56 b8 dd 12 6d 56 |dkd1.*?.7.V...mV|
-000000b0 2a 61 92 5b 39 e7 e1 be 71 70 4b 9b b3 f0 71 e7 |*a.[9...qpK...q.|
-000000c0 47 2e 2e 17 c3 0a 66 9f 69 74 30 2d f0 a0 7f 84 |G.....f.it0-....|
-000000d0 25 db c1 81 ee cf |%.....|
->>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 00 |..........@.....|
-00000010 00 00 00 00 00 00 00 00 00 00 00 f3 4d 5a fc 21 |............MZ.!|
-00000020 30 b5 a1 86 9d e2 ea 38 ac 54 57 fa 5a 54 97 b8 |0......8.TW.ZT..|
-00000030 bb 4d 64 09 ef ce a1 75 0c 50 8d ff 5c c2 e9 47 |.Md....u.P..\..G|
-00000040 95 93 53 c0 bd dc c5 9c e0 59 17 17 03 03 00 40 |..S......Y.....@|
-00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000060 69 c5 48 6e 45 cf 98 1b 2c 23 40 d1 ab a3 c2 e2 |i.HnE...,#@.....|
-00000070 10 7b b1 c8 21 3c f0 eb 96 bd 4f 78 b2 4a 7b 18 |.{..!<....Ox.J{.|
-00000080 4c b1 a6 67 bf 06 40 01 d0 8d 91 be 17 d8 0c 71 |L..g..@........q|
-00000090 15 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-000000a0 00 00 00 00 00 20 84 80 3d 70 fe ae ee d7 2f e9 |..... ..=p..../.|
-000000b0 bf 65 30 bf 0b dd 98 ea bb ba 12 14 98 53 7f d5 |.e0..........S..|
-000000c0 56 ce 06 3c d0 |V..<.|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-RSA-AES-GCM b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-RSA-AES-GCM
deleted file mode 100644
index 0ddfe02..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-RSA-AES-GCM
+++ /dev/null
@@ -1,93 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 9c 01 00 00 98 03 03 53 04 f1 30 73 |...........S..0s|
-00000010 a1 ea 8c d2 90 1c c6 d6 0d 3c af 58 21 65 90 25 |.........<.X!e.%|
-00000020 5e fa f4 27 22 65 c9 68 90 b9 04 00 00 04 c0 2f |^..'"e.h......./|
-00000030 00 ff 01 00 00 6b 00 0b 00 04 03 00 01 02 00 0a |.....k..........|
-00000040 00 34 00 32 00 0e 00 0d 00 19 00 0b 00 0c 00 18 |.4.2............|
-00000050 00 09 00 0a 00 16 00 17 00 08 00 06 00 07 00 14 |................|
-00000060 00 15 00 04 00 05 00 12 00 13 00 01 00 02 00 03 |................|
-00000070 00 0f 00 10 00 11 00 0d 00 22 00 20 06 01 06 02 |.........". ....|
-00000080 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................|
-00000090 03 02 03 03 02 01 02 02 02 03 01 01 00 0f 00 01 |................|
-000000a0 01 |.|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 c0 2f 00 00 |............./..|
-00000030 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 cd 0c 00 |n8P)l...........|
-00000300 00 c9 03 00 17 41 04 1e 18 37 ef 0d 19 51 88 35 |.....A...7...Q.5|
-00000310 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd a7 24 20 3e |uq..T[....g..$ >|
-00000320 b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 07 9f 6c |.V...(^.+-O....l|
-00000330 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 b5 68 1a |K[.V.2B.X..I..h.|
-00000340 41 03 56 6b dc 5a 89 04 01 00 80 a2 54 61 84 29 |A.Vk.Z......Ta.)|
-00000350 3e 97 4b 97 9a 9f 5c c0 49 6d 86 d2 79 8e 95 a1 |>.K...\.Im..y...|
-00000360 0a 5a 36 73 34 bb 05 73 35 47 e1 2b 5d f3 ef 36 |.Z6s4..s5G.+]..6|
-00000370 a8 32 e2 7e ef aa 3f 1f b3 64 60 d4 06 2e 98 e3 |.2.~..?..d`.....|
-00000380 11 e2 60 3c d6 20 17 63 b2 6f a0 cd 21 01 2b 4e |..`<. .c.o..!.+N|
-00000390 b2 a8 55 04 39 37 5c 6c 71 66 4d a3 eb 1b 83 67 |..U.97\lqfM....g|
-000003a0 6b 15 a0 56 9a f1 a2 79 92 29 ce 58 3c 10 4d 65 |k..V...y.).X<.Me|
-000003b0 1f 22 e3 ea d8 74 aa 01 7e ca f3 89 23 41 4d bd |."...t..~...#AM.|
-000003c0 df 77 4e 59 54 97 74 ad 07 ea c0 16 03 03 00 04 |.wNYT.t.........|
-000003d0 0e 00 00 00 |....|
->>> Flow 3 (client to server)
-00000000 16 03 03 00 46 10 00 00 42 41 04 45 65 ce f7 b9 |....F...BA.Ee...|
-00000010 52 e3 fb 13 db 91 f2 65 43 84 57 f5 1a 19 a0 e6 |R......eC.W.....|
-00000020 89 2d bb 2c 83 6b 62 f6 6f 1f 26 ae 59 67 bd dc |.-.,.kb.o.&.Yg..|
-00000030 c4 9e 0b dc 7d 6e f8 6b 95 8c 61 47 3d cd d1 df |....}n.k..aG=...|
-00000040 82 45 30 81 c3 a3 49 5d 85 59 70 14 03 03 00 01 |.E0...I].Yp.....|
-00000050 01 16 03 03 00 28 3f aa 85 33 f9 c6 95 a0 56 ff |.....(?..3....V.|
-00000060 1c f1 5a ba 6e 41 50 0c ab 92 e1 e2 8e 89 1c f1 |..Z.nAP.........|
-00000070 fa 54 1b f1 f5 00 01 12 6d c4 96 78 b6 87 |.T......m..x..|
->>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 28 00 00 00 00 00 |..........(.....|
-00000010 00 00 00 94 5c be 46 05 d6 d0 b0 3a 56 dc 2c 10 |....\.F....:V.,.|
-00000020 0f 6f 5d 33 33 7f a5 4e 74 84 bf 63 87 c4 f4 49 |.o]33..Nt..c...I|
-00000030 bc 6b ab 17 03 03 00 25 00 00 00 00 00 00 00 01 |.k.....%........|
-00000040 7e 4f f9 ae ae fe 6b a0 4a f8 0f 0b b4 b6 65 b6 |~O....k.J.....e.|
-00000050 be 24 5f 94 6d d1 db 54 11 07 b9 ce 01 15 03 03 |.$_.m..T........|
-00000060 00 1a 00 00 00 00 00 00 00 02 a8 1c d6 62 ac fd |.............b..|
-00000070 77 ba 23 92 5d 34 f1 17 c7 e1 1c 99 |w.#.]4......|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-RSA-RC4 b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-RSA-RC4
deleted file mode 100644
index b703a8f..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-RSA-RC4
+++ /dev/null
@@ -1,79 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 5c 01 00 00 58 03 03 52 cc 57 59 c9 |....\...X..R.WY.|
-00000010 c3 13 fc 18 8a ee c2 0e 88 ff fb 4a 16 f2 eb eb |...........J....|
-00000020 d4 f8 b3 5b cd bb 25 0e 0b cb 48 00 00 04 00 05 |...[..%...H.....|
-00000030 00 ff 01 00 00 2b 00 0d 00 22 00 20 06 01 06 02 |.....+...". ....|
-00000040 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................|
-00000050 03 02 03 03 02 01 02 02 02 03 01 01 00 0f 00 01 |................|
-00000060 01 |.|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 05 00 00 |................|
-00000030 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 04 0e 00 |n8P)l...........|
-00000300 00 00 |..|
->>> Flow 3 (client to server)
-00000000 16 03 03 00 86 10 00 00 82 00 80 35 b3 60 ba 14 |...........5.`..|
-00000010 5f 19 24 a0 24 de 4e 85 a9 64 78 3a 51 24 64 70 |_.$.$.N..dx:Q$dp|
-00000020 88 55 6d c3 11 b8 d3 9f bc 7a 33 f8 3c 48 93 2f |.Um......z3.<H./|
-00000030 66 69 11 33 39 37 7a 36 a3 1c ef b0 81 71 7d 25 |fi.397z6.....q}%|
-00000040 35 da 2c 42 e2 ab d3 b7 07 8b 4a 0d 6d 77 bd ae |5.,B......J.mw..|
-00000050 02 51 7c a5 0d a6 03 4c 3c d0 ce 89 2c 83 6c de |.Q|....L<...,.l.|
-00000060 40 15 cc 72 c7 95 c8 6d ee 05 86 da 3e c6 7c d4 |@..r...m....>.|.|
-00000070 44 82 f4 24 03 22 40 00 64 27 53 15 41 8c 01 e9 |D..$."@.d'S.A...|
-00000080 39 32 fa 8e 2d f9 b4 89 34 15 d6 14 03 03 00 01 |92..-...4.......|
-00000090 01 16 03 03 00 24 f5 61 8b 24 bf b4 82 3a cf 49 |.....$.a.$...:.I|
-000000a0 99 a0 b1 1b a7 a7 a3 92 7c 84 85 e0 64 a3 3d bd |........|...d.=.|
-000000b0 38 98 7d 97 a8 b9 2a 35 a9 09 |8.}...*5..|
->>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 24 c9 0b 84 e6 39 |..........$....9|
-00000010 f2 e0 f3 ac 9f 0f 17 92 5f 6d de 94 18 c4 60 d9 |........_m....`.|
-00000020 66 c3 0d 1a ae c2 8f 46 8f 7f f0 58 0e 4a 9b 17 |f......F...X.J..|
-00000030 03 03 00 21 8b 73 a1 6a 7e d9 7e 4f 1d cc b2 7d |...!.s.j~.~O...}|
-00000040 3c 83 3f 52 f8 08 77 01 4c 65 11 6d 50 25 9a cc |<.?R..w.Le.mP%..|
-00000050 e3 54 27 72 59 15 03 03 00 16 3d c8 ab 14 51 fa |.T'rY.....=...Q.|
-00000060 97 f1 ef 5f b4 4f 44 58 d4 93 3b ae e5 61 1f a3 |..._.ODX..;..a..|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-Resume b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-Resume
deleted file mode 100644
index c495d4a..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-Resume
+++ /dev/null
@@ -1,36 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 e8 01 00 00 e4 03 03 52 cc 57 59 c3 |...........R.WY.|
-00000010 8b df 97 05 d8 5f 16 22 b4 b1 e7 cb 7d 2f 9b 58 |....._."....}/.X|
-00000020 a3 f4 d7 2c a4 c1 9d 49 ed 4b ba 20 90 da 90 3e |...,...I.K. ...>|
-00000030 36 19 7a db 56 43 26 f7 dc 42 57 33 22 ed 9d a4 |6.z.VC&..BW3"...|
-00000040 9d 53 da f8 9d 4e 60 66 71 a0 2e 2e 00 04 00 05 |.S...N`fq.......|
-00000050 00 ff 01 00 00 97 00 23 00 68 00 00 00 00 00 00 |.......#.h......|
-00000060 00 00 00 00 00 00 00 00 00 00 65 ea 4b d1 ef ba |..........e.K...|
-00000070 06 38 1e e1 88 82 3a cd 03 ac 3b 39 0a e0 19 fd |.8....:...;9....|
-00000080 af 6c 57 30 df 31 6e f7 92 38 4b 5d 77 90 39 ff |.lW0.1n..8K]w.9.|
-00000090 32 51 f5 ed 12 d7 b0 7c 4d 6c c5 76 e4 72 48 3e |2Q.....|Ml.v.rH>|
-000000a0 59 23 fe 0d 15 df f4 ba ea b9 67 16 23 8f 7d 15 |Y#........g.#.}.|
-000000b0 b6 11 f1 ab d7 d4 cd a3 21 82 92 2a 12 cf 95 f3 |........!..*....|
-000000c0 60 b2 00 0d 00 22 00 20 06 01 06 02 06 03 05 01 |`....". ........|
-000000d0 05 02 05 03 04 01 04 02 04 03 03 01 03 02 03 03 |................|
-000000e0 02 01 02 02 02 03 01 01 00 0f 00 01 01 |.............|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 51 02 00 00 4d 03 03 00 00 00 00 00 |....Q...M.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 20 90 da 90 3e |........... ...>|
-00000030 36 19 7a db 56 43 26 f7 dc 42 57 33 22 ed 9d a4 |6.z.VC&..BW3"...|
-00000040 9d 53 da f8 9d 4e 60 66 71 a0 2e 2e 00 05 00 00 |.S...N`fq.......|
-00000050 05 ff 01 00 01 00 14 03 03 00 01 01 16 03 03 00 |................|
-00000060 24 11 12 ff 28 10 14 4c e5 0e ad a7 fa f3 92 fb |$...(..L........|
-00000070 13 7d ae f2 b2 4a 6b a1 9e 67 cf a8 f7 8c 6f a0 |.}...Jk..g....o.|
-00000080 6c 30 0e 18 55 |l0..U|
->>> Flow 3 (client to server)
-00000000 14 03 03 00 01 01 16 03 03 00 24 0d 46 41 8b 24 |..........$.FA.$|
-00000010 36 01 a9 fd 8b ec fc e6 b1 83 96 df 0d 3e 53 54 |6............>ST|
-00000020 58 b8 43 f2 a6 25 5e 1a ae 19 9e d2 28 44 92 |X.C..%^.....(D.|
->>> Flow 4 (server to client)
-00000000 17 03 03 00 21 c4 fb f6 53 bb 3e 04 cc 0b a0 03 |....!...S.>.....|
-00000010 fa 49 96 da b5 8d b2 f2 e5 d8 f3 5c 27 57 4f 9c |.I.........\'WO.|
-00000020 30 00 34 fc 52 92 15 03 03 00 16 a3 02 7a 50 d2 |0.4.R........zP.|
-00000030 c6 b3 fc 69 8f e4 94 ae ab 22 ad 05 1d 15 69 b9 |...i....."....i.|
-00000040 a5 |.|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-SNI b/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-SNI
deleted file mode 100644
index 61b17a1..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/testdata/Server-TLSv12-SNI
+++ /dev/null
@@ -1,76 +0,0 @@
->>> Flow 1 (client to server)
-00000000 16 03 01 00 70 01 00 00 6c 03 03 52 cc 57 59 2d |....p...l..R.WY-|
-00000010 77 aa 75 35 fa ff 2a a2 bf 91 5e e3 7f 38 7d 7a |w.u5..*...^..8}z|
-00000020 e3 93 d3 e8 8b 09 bb 06 c8 6d 91 00 00 04 00 2f |.........m...../|
-00000030 00 ff 01 00 00 3f 00 00 00 10 00 0e 00 00 0b 73 |.....?.........s|
-00000040 6e 69 74 65 73 74 2e 63 6f 6d 00 0d 00 22 00 20 |nitest.com...". |
-00000050 06 01 06 02 06 03 05 01 05 02 05 03 04 01 04 02 |................|
-00000060 04 03 03 01 03 02 03 03 02 01 02 02 02 03 01 01 |................|
-00000070 00 0f 00 01 01 |.....|
->>> Flow 2 (server to client)
-00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 2f 00 00 |............./..|
-00000030 05 ff 01 00 01 00 16 03 03 02 00 0b 00 01 fc 00 |................|
-00000040 01 f9 00 01 f6 30 82 01 f2 30 82 01 5d a0 03 02 |.....0...0..]...|
-00000050 01 02 02 01 00 30 0b 06 09 2a 86 48 86 f7 0d 01 |.....0...*.H....|
-00000060 01 05 30 28 31 10 30 0e 06 03 55 04 0a 13 07 41 |..0(1.0...U....A|
-00000070 63 6d 65 20 43 6f 31 14 30 12 06 03 55 04 03 13 |cme Co1.0...U...|
-00000080 0b 73 6e 69 74 65 73 74 2e 63 6f 6d 30 1e 17 0d |.snitest.com0...|
-00000090 31 32 30 34 31 31 31 37 34 30 33 35 5a 17 0d 31 |120411174035Z..1|
-000000a0 33 30 34 31 31 31 37 34 35 33 35 5a 30 28 31 10 |30411174535Z0(1.|
-000000b0 30 0e 06 03 55 04 0a 13 07 41 63 6d 65 20 43 6f |0...U....Acme Co|
-000000c0 31 14 30 12 06 03 55 04 03 13 0b 73 6e 69 74 65 |1.0...U....snite|
-000000d0 73 74 2e 63 6f 6d 30 81 9d 30 0b 06 09 2a 86 48 |st.com0..0...*.H|
-000000e0 86 f7 0d 01 01 01 03 81 8d 00 30 81 89 02 81 81 |..........0.....|
-000000f0 00 bb 79 d6 f5 17 b5 e5 bf 46 10 d0 dc 69 be e6 |..y......F...i..|
-00000100 2b 07 43 5a d0 03 2d 8a 7a 43 85 b7 14 52 e7 a5 |+.CZ..-.zC...R..|
-00000110 65 4c 2c 78 b8 23 8c b5 b4 82 e5 de 1f 95 3b 7e |eL,x.#........;~|
-00000120 62 a5 2c a5 33 d6 fe 12 5c 7a 56 fc f5 06 bf fa |b.,.3...\zV.....|
-00000130 58 7b 26 3f b5 cd 04 d3 d0 c9 21 96 4a c7 f4 54 |X{&?......!.J..T|
-00000140 9f 5a bf ef 42 71 00 fe 18 99 07 7f 7e 88 7d 7d |.Z..Bq......~.}}|
-00000150 f1 04 39 c4 a2 2e db 51 c9 7c e3 c0 4c 3b 32 66 |..9....Q.|..L;2f|
-00000160 01 cf af b1 1d b8 71 9a 1d db db 89 6b ae da 2d |......q.....k..-|
-00000170 79 02 03 01 00 01 a3 32 30 30 30 0e 06 03 55 1d |y......2000...U.|
-00000180 0f 01 01 ff 04 04 03 02 00 a0 30 0d 06 03 55 1d |..........0...U.|
-00000190 0e 04 06 04 04 01 02 03 04 30 0f 06 03 55 1d 23 |.........0...U.#|
-000001a0 04 08 30 06 80 04 01 02 03 04 30 0b 06 09 2a 86 |..0.......0...*.|
-000001b0 48 86 f7 0d 01 01 05 03 81 81 00 89 c6 45 5f 1c |H............E_.|
-000001c0 1f 5e f8 eb 1a b1 74 ee 24 39 05 9f 5c 42 59 bb |.^....t.$9..\BY.|
-000001d0 1a 8d 86 cd b1 d0 56 f5 6a 71 7d a4 0e 95 ab 90 |......V.jq}.....|
-000001e0 f5 9e 8d ea f6 27 c1 57 99 50 94 db 08 02 26 6e |.....'.W.P....&n|
-000001f0 b3 4f c6 84 2d ea 8a 4b 68 d9 c1 38 91 03 ab 84 |.O..-..Kh..8....|
-00000200 fb 9e 1f 85 d9 b5 d2 3f f2 31 2c 86 70 fb b5 40 |.......?.1,.p..@|
-00000210 14 82 45 a4 eb af e2 64 d9 0c 8a 4c f4 f8 5b 0f |..E....d...L..[.|
-00000220 ac 12 ac 2f c4 a3 15 4b ad 52 46 28 68 af 96 c6 |.../...K.RF(h...|
-00000230 2c 65 25 d6 52 b6 e3 18 45 bd cc 16 03 03 00 04 |,e%.R...E.......|
-00000240 0e 00 00 00 |....|
->>> Flow 3 (client to server)
-00000000 16 03 03 00 86 10 00 00 82 00 80 0d f2 bf 75 a9 |..............u.|
-00000010 aa db f3 25 55 d4 20 59 63 54 d1 70 82 f9 61 c5 |...%U. YcT.p..a.|
-00000020 b7 ae 3f 75 71 75 9d c5 01 a1 ed b1 07 66 9f 3f |..?uqu.......f.?|
-00000030 cf c6 e6 ad 44 03 fd 18 6f 53 24 ce 76 01 bd fe |....D...oS$.v...|
-00000040 e2 51 f7 df 8a 23 3a 21 c4 00 15 ff d0 e0 ff c8 |.Q...#:!........|
-00000050 8b 89 33 c6 8e e0 ce 97 ef b4 c6 f9 b0 ea 38 89 |..3...........8.|
-00000060 79 98 34 9e f7 bc c6 fd d2 5d 56 84 5c d2 9a ce |y.4......]V.\...|
-00000070 ae de 09 bc 24 25 fc 09 0c bc 0e 91 0d 6b 36 ae |....$%.......k6.|
-00000080 ce 6b cd 14 ec b6 3c fa d6 df fc 14 03 03 00 01 |.k....<.........|
-00000090 01 16 03 03 00 40 ad 21 13 2b 33 7a 4a 0d fb 0f |.....@.!.+3zJ...|
-000000a0 eb d2 b6 85 29 1f 59 79 ba 86 53 5c 68 b4 c7 e3 |....).Yy..S\h...|
-000000b0 8a 6c 5c 18 04 4d e4 76 19 30 ba 92 b4 79 8c 64 |.l\..M.v.0...y.d|
-000000c0 00 a0 2e 13 96 45 9f e7 a9 e4 23 9e 9f 89 23 26 |.....E....#...#&|
-000000d0 36 20 82 fc 75 fe |6 ..u.|
->>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 00 |..........@.....|
-00000010 00 00 00 00 00 00 00 00 00 00 00 b7 87 61 10 03 |.............a..|
-00000020 b8 a4 42 d4 8b 49 bc 40 80 70 92 c8 25 b0 c6 7f |..B..I.@.p..%...|
-00000030 b3 87 76 50 5a 59 b3 3c d8 3e 23 24 aa 1a f3 36 |..vPZY.<.>#$...6|
-00000040 c9 2c 87 c1 22 d2 94 f8 2c fd ef 17 03 03 00 40 |.,.."...,......@|
-00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000060 e5 7f bd 3e ff 9f d4 1b 91 02 f8 69 6f 70 9d 51 |...>.......iop.Q|
-00000070 a5 ec ef 5b 10 3f 4e 3f 44 e5 9a 39 68 7c 3a b9 |...[.?N?D..9h|:.|
-00000080 69 38 31 ec 9c 45 bf 19 d1 5c 5e 2e 06 00 ca 19 |i81..E...\^.....|
-00000090 15 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-000000a0 00 00 00 00 00 63 5e 79 2c f2 05 dc 2b d7 5b ac |.....c^y,...+.[.|
-000000b0 9d fc 75 94 03 16 ca 1f b2 75 58 2d f1 2f f1 1e |..u......uX-./..|
-000000c0 d2 f6 84 8f 2e |.....|
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/ticket.go b/runtimes/google/ipc/stream/crypto/tlsfork/ticket.go
deleted file mode 100644
index 4bf2ebc..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/ticket.go
+++ /dev/null
@@ -1,184 +0,0 @@
-// Copyright 2012 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.4
-
-package tls
-
-import (
- "bytes"
- "crypto/aes"
- "crypto/cipher"
- "crypto/hmac"
- "crypto/sha256"
- "crypto/subtle"
- "errors"
- "io"
-)
-
-// sessionState contains the information that is serialized into a session
-// ticket in order to later resume a connection.
-type sessionState struct {
- vers uint16
- cipherSuite uint16
- masterSecret []byte
- certificates [][]byte
-}
-
-func (s *sessionState) equal(i interface{}) bool {
- s1, ok := i.(*sessionState)
- if !ok {
- return false
- }
-
- if s.vers != s1.vers ||
- s.cipherSuite != s1.cipherSuite ||
- !bytes.Equal(s.masterSecret, s1.masterSecret) {
- return false
- }
-
- if len(s.certificates) != len(s1.certificates) {
- return false
- }
-
- for i := range s.certificates {
- if !bytes.Equal(s.certificates[i], s1.certificates[i]) {
- return false
- }
- }
-
- return true
-}
-
-func (s *sessionState) marshal() []byte {
- length := 2 + 2 + 2 + len(s.masterSecret) + 2
- for _, cert := range s.certificates {
- length += 4 + len(cert)
- }
-
- ret := make([]byte, length)
- x := ret
- x[0] = byte(s.vers >> 8)
- x[1] = byte(s.vers)
- x[2] = byte(s.cipherSuite >> 8)
- x[3] = byte(s.cipherSuite)
- x[4] = byte(len(s.masterSecret) >> 8)
- x[5] = byte(len(s.masterSecret))
- x = x[6:]
- copy(x, s.masterSecret)
- x = x[len(s.masterSecret):]
-
- x[0] = byte(len(s.certificates) >> 8)
- x[1] = byte(len(s.certificates))
- x = x[2:]
-
- for _, cert := range s.certificates {
- x[0] = byte(len(cert) >> 24)
- x[1] = byte(len(cert) >> 16)
- x[2] = byte(len(cert) >> 8)
- x[3] = byte(len(cert))
- copy(x[4:], cert)
- x = x[4+len(cert):]
- }
-
- return ret
-}
-
-func (s *sessionState) unmarshal(data []byte) bool {
- if len(data) < 8 {
- return false
- }
-
- s.vers = uint16(data[0])<<8 | uint16(data[1])
- s.cipherSuite = uint16(data[2])<<8 | uint16(data[3])
- masterSecretLen := int(data[4])<<8 | int(data[5])
- data = data[6:]
- if len(data) < masterSecretLen {
- return false
- }
-
- s.masterSecret = data[:masterSecretLen]
- data = data[masterSecretLen:]
-
- if len(data) < 2 {
- return false
- }
-
- numCerts := int(data[0])<<8 | int(data[1])
- data = data[2:]
-
- s.certificates = make([][]byte, numCerts)
- for i := range s.certificates {
- if len(data) < 4 {
- return false
- }
- certLen := int(data[0])<<24 | int(data[1])<<16 | int(data[2])<<8 | int(data[3])
- data = data[4:]
- if certLen < 0 {
- return false
- }
- if len(data) < certLen {
- return false
- }
- s.certificates[i] = data[:certLen]
- data = data[certLen:]
- }
-
- if len(data) > 0 {
- return false
- }
-
- return true
-}
-
-func (c *Conn) encryptTicket(state *sessionState) ([]byte, error) {
- serialized := state.marshal()
- encrypted := make([]byte, aes.BlockSize+len(serialized)+sha256.Size)
- iv := encrypted[:aes.BlockSize]
- macBytes := encrypted[len(encrypted)-sha256.Size:]
-
- if _, err := io.ReadFull(c.config.rand(), iv); err != nil {
- return nil, err
- }
- block, err := aes.NewCipher(c.config.SessionTicketKey[:16])
- if err != nil {
- return nil, errors.New("tls: failed to create cipher while encrypting ticket: " + err.Error())
- }
- cipher.NewCTR(block, iv).XORKeyStream(encrypted[aes.BlockSize:], serialized)
-
- mac := hmac.New(sha256.New, c.config.SessionTicketKey[16:32])
- mac.Write(encrypted[:len(encrypted)-sha256.Size])
- mac.Sum(macBytes[:0])
-
- return encrypted, nil
-}
-
-func (c *Conn) decryptTicket(encrypted []byte) (*sessionState, bool) {
- if len(encrypted) < aes.BlockSize+sha256.Size {
- return nil, false
- }
-
- iv := encrypted[:aes.BlockSize]
- macBytes := encrypted[len(encrypted)-sha256.Size:]
-
- mac := hmac.New(sha256.New, c.config.SessionTicketKey[16:32])
- mac.Write(encrypted[:len(encrypted)-sha256.Size])
- expected := mac.Sum(nil)
-
- if subtle.ConstantTimeCompare(macBytes, expected) != 1 {
- return nil, false
- }
-
- block, err := aes.NewCipher(c.config.SessionTicketKey[:16])
- if err != nil {
- return nil, false
- }
- ciphertext := encrypted[aes.BlockSize : len(encrypted)-sha256.Size]
- plaintext := ciphertext
- cipher.NewCTR(block, iv).XORKeyStream(plaintext, ciphertext)
-
- state := new(sessionState)
- ok := state.unmarshal(plaintext)
- return state, ok
-}
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/tls.go b/runtimes/google/ipc/stream/crypto/tlsfork/tls.go
deleted file mode 100644
index 92590fd..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/tls.go
+++ /dev/null
@@ -1,283 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package tls partially implements TLS 1.2, as specified in RFC 5246.
-//
-// This package is a copy of the implementation found in the Go standard
-// libraries at revision b3759654d42d1d5ca0ac38a2d400f047ff1f7bec
-// (https://code.google.com/p/go/source/detail?r=b3759654d42d1d5ca0ac38a2d400f047ff1f7bec)
-// This copy will be removed once a Go release containing the change referenced above
-// is made available (like when go1.4 is released).
-// +build !go1.4
-
-package tls
-
-import (
- "crypto"
- "crypto/ecdsa"
- "crypto/rsa"
- "crypto/x509"
- "encoding/pem"
- "errors"
- "io/ioutil"
- "net"
- "strings"
- "time"
-)
-
-// Server returns a new TLS server side connection
-// using conn as the underlying transport.
-// The configuration config must be non-nil and must have
-// at least one certificate.
-func Server(conn net.Conn, config *Config) *Conn {
- return &Conn{conn: conn, config: config}
-}
-
-// Client returns a new TLS client side connection
-// using conn as the underlying transport.
-// The config cannot be nil: users must set either ServerName or
-// InsecureSkipVerify in the config.
-func Client(conn net.Conn, config *Config) *Conn {
- return &Conn{conn: conn, config: config, isClient: true}
-}
-
-// A listener implements a network listener (net.Listener) for TLS connections.
-type listener struct {
- net.Listener
- config *Config
-}
-
-// Accept waits for and returns the next incoming TLS connection.
-// The returned connection c is a *tls.Conn.
-func (l *listener) Accept() (c net.Conn, err error) {
- c, err = l.Listener.Accept()
- if err != nil {
- return
- }
- c = Server(c, l.config)
- return
-}
-
-// NewListener creates a Listener which accepts connections from an inner
-// Listener and wraps each connection with Server.
-// The configuration config must be non-nil and must have
-// at least one certificate.
-func NewListener(inner net.Listener, config *Config) net.Listener {
- l := new(listener)
- l.Listener = inner
- l.config = config
- return l
-}
-
-// Listen creates a TLS listener accepting connections on the
-// given network address using net.Listen.
-// The configuration config must be non-nil and must have
-// at least one certificate.
-func Listen(network, laddr string, config *Config) (net.Listener, error) {
- if config == nil || len(config.Certificates) == 0 {
- return nil, errors.New("tls.Listen: no certificates in configuration")
- }
- l, err := net.Listen(network, laddr)
- if err != nil {
- return nil, err
- }
- return NewListener(l, config), nil
-}
-
-type timeoutError struct{}
-
-func (timeoutError) Error() string { return "tls: DialWithDialer timed out" }
-func (timeoutError) Timeout() bool { return true }
-func (timeoutError) Temporary() bool { return true }
-
-// DialWithDialer connects to the given network address using dialer.Dial and
-// then initiates a TLS handshake, returning the resulting TLS connection. Any
-// timeout or deadline given in the dialer apply to connection and TLS
-// handshake as a whole.
-//
-// DialWithDialer interprets a nil configuration as equivalent to the zero
-// configuration; see the documentation of Config for the defaults.
-func DialWithDialer(dialer *net.Dialer, network, addr string, config *Config) (*Conn, error) {
- // We want the Timeout and Deadline values from dialer to cover the
- // whole process: TCP connection and TLS handshake. This means that we
- // also need to start our own timers now.
- timeout := dialer.Timeout
-
- if !dialer.Deadline.IsZero() {
- deadlineTimeout := dialer.Deadline.Sub(time.Now())
- if timeout == 0 || deadlineTimeout < timeout {
- timeout = deadlineTimeout
- }
- }
-
- var errChannel chan error
-
- if timeout != 0 {
- errChannel = make(chan error, 2)
- time.AfterFunc(timeout, func() {
- errChannel <- timeoutError{}
- })
- }
-
- rawConn, err := dialer.Dial(network, addr)
- if err != nil {
- return nil, err
- }
-
- colonPos := strings.LastIndex(addr, ":")
- if colonPos == -1 {
- colonPos = len(addr)
- }
- hostname := addr[:colonPos]
-
- if config == nil {
- config = defaultConfig()
- }
- // If no ServerName is set, infer the ServerName
- // from the hostname we're connecting to.
- if config.ServerName == "" {
- // Make a copy to avoid polluting argument or default.
- c := *config
- c.ServerName = hostname
- config = &c
- }
-
- conn := Client(rawConn, config)
-
- if timeout == 0 {
- err = conn.Handshake()
- } else {
- go func() {
- errChannel <- conn.Handshake()
- }()
-
- err = <-errChannel
- }
-
- if err != nil {
- rawConn.Close()
- return nil, err
- }
-
- return conn, nil
-}
-
-// Dial connects to the given network address using net.Dial
-// and then initiates a TLS handshake, returning the resulting
-// TLS connection.
-// Dial interprets a nil configuration as equivalent to
-// the zero configuration; see the documentation of Config
-// for the defaults.
-func Dial(network, addr string, config *Config) (*Conn, error) {
- return DialWithDialer(new(net.Dialer), network, addr, config)
-}
-
-// LoadX509KeyPair reads and parses a public/private key pair from a pair of
-// files. The files must contain PEM encoded data.
-func LoadX509KeyPair(certFile, keyFile string) (cert Certificate, err error) {
- certPEMBlock, err := ioutil.ReadFile(certFile)
- if err != nil {
- return
- }
- keyPEMBlock, err := ioutil.ReadFile(keyFile)
- if err != nil {
- return
- }
- return X509KeyPair(certPEMBlock, keyPEMBlock)
-}
-
-// X509KeyPair parses a public/private key pair from a pair of
-// PEM encoded data.
-func X509KeyPair(certPEMBlock, keyPEMBlock []byte) (cert Certificate, err error) {
- var certDERBlock *pem.Block
- for {
- certDERBlock, certPEMBlock = pem.Decode(certPEMBlock)
- if certDERBlock == nil {
- break
- }
- if certDERBlock.Type == "CERTIFICATE" {
- cert.Certificate = append(cert.Certificate, certDERBlock.Bytes)
- }
- }
-
- if len(cert.Certificate) == 0 {
- err = errors.New("crypto/tls: failed to parse certificate PEM data")
- return
- }
-
- var keyDERBlock *pem.Block
- for {
- keyDERBlock, keyPEMBlock = pem.Decode(keyPEMBlock)
- if keyDERBlock == nil {
- err = errors.New("crypto/tls: failed to parse key PEM data")
- return
- }
- if keyDERBlock.Type == "PRIVATE KEY" || strings.HasSuffix(keyDERBlock.Type, " PRIVATE KEY") {
- break
- }
- }
-
- cert.PrivateKey, err = parsePrivateKey(keyDERBlock.Bytes)
- if err != nil {
- return
- }
-
- // We don't need to parse the public key for TLS, but we so do anyway
- // to check that it looks sane and matches the private key.
- x509Cert, err := x509.ParseCertificate(cert.Certificate[0])
- if err != nil {
- return
- }
-
- switch pub := x509Cert.PublicKey.(type) {
- case *rsa.PublicKey:
- priv, ok := cert.PrivateKey.(*rsa.PrivateKey)
- if !ok {
- err = errors.New("crypto/tls: private key type does not match public key type")
- return
- }
- if pub.N.Cmp(priv.N) != 0 {
- err = errors.New("crypto/tls: private key does not match public key")
- return
- }
- case *ecdsa.PublicKey:
- priv, ok := cert.PrivateKey.(*ecdsa.PrivateKey)
- if !ok {
- err = errors.New("crypto/tls: private key type does not match public key type")
- return
-
- }
- if pub.X.Cmp(priv.X) != 0 || pub.Y.Cmp(priv.Y) != 0 {
- err = errors.New("crypto/tls: private key does not match public key")
- return
- }
- default:
- err = errors.New("crypto/tls: unknown public key algorithm")
- return
- }
-
- return
-}
-
-// Attempt to parse the given private key DER block. OpenSSL 0.9.8 generates
-// PKCS#1 private keys by default, while OpenSSL 1.0.0 generates PKCS#8 keys.
-// OpenSSL ecparam generates SEC1 EC private keys for ECDSA. We try all three.
-func parsePrivateKey(der []byte) (crypto.PrivateKey, error) {
- if key, err := x509.ParsePKCS1PrivateKey(der); err == nil {
- return key, nil
- }
- if key, err := x509.ParsePKCS8PrivateKey(der); err == nil {
- switch key := key.(type) {
- case *rsa.PrivateKey, *ecdsa.PrivateKey:
- return key, nil
- default:
- return nil, errors.New("crypto/tls: found unknown private key type in PKCS#8 wrapping")
- }
- }
- if key, err := x509.ParseECPrivateKey(der); err == nil {
- return key, nil
- }
-
- return nil, errors.New("crypto/tls: failed to parse private key")
-}
diff --git a/runtimes/google/ipc/stream/crypto/tlsfork/tls_test.go b/runtimes/google/ipc/stream/crypto/tlsfork/tls_test.go
deleted file mode 100644
index c3674fe..0000000
--- a/runtimes/google/ipc/stream/crypto/tlsfork/tls_test.go
+++ /dev/null
@@ -1,284 +0,0 @@
-// Copyright 2012 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !go1.4
-
-package tls
-
-import (
- "bytes"
- "fmt"
- "io"
- "net"
- "strings"
- "testing"
- "time"
-)
-
-var rsaCertPEM = `-----BEGIN CERTIFICATE-----
-MIIB0zCCAX2gAwIBAgIJAI/M7BYjwB+uMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV
-BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX
-aWRnaXRzIFB0eSBMdGQwHhcNMTIwOTEyMjE1MjAyWhcNMTUwOTEyMjE1MjAyWjBF
-MQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50
-ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANLJ
-hPHhITqQbPklG3ibCVxwGMRfp/v4XqhfdQHdcVfHap6NQ5Wok/4xIA+ui35/MmNa
-rtNuC+BdZ1tMuVCPFZcCAwEAAaNQME4wHQYDVR0OBBYEFJvKs8RfJaXTH08W+SGv
-zQyKn0H8MB8GA1UdIwQYMBaAFJvKs8RfJaXTH08W+SGvzQyKn0H8MAwGA1UdEwQF
-MAMBAf8wDQYJKoZIhvcNAQEFBQADQQBJlffJHybjDGxRMqaRmDhX0+6v02TUKZsW
-r5QuVbpQhH6u+0UgcW0jp9QwpxoPTLTWGXEWBBBurxFwiCBhkQ+V
------END CERTIFICATE-----
-`
-
-var rsaKeyPEM = `-----BEGIN RSA PRIVATE KEY-----
-MIIBOwIBAAJBANLJhPHhITqQbPklG3ibCVxwGMRfp/v4XqhfdQHdcVfHap6NQ5Wo
-k/4xIA+ui35/MmNartNuC+BdZ1tMuVCPFZcCAwEAAQJAEJ2N+zsR0Xn8/Q6twa4G
-6OB1M1WO+k+ztnX/1SvNeWu8D6GImtupLTYgjZcHufykj09jiHmjHx8u8ZZB/o1N
-MQIhAPW+eyZo7ay3lMz1V01WVjNKK9QSn1MJlb06h/LuYv9FAiEA25WPedKgVyCW
-SmUwbPw8fnTcpqDWE3yTO3vKcebqMSsCIBF3UmVue8YU3jybC3NxuXq3wNm34R8T
-xVLHwDXh/6NJAiEAl2oHGGLz64BuAfjKrqwz7qMYr9HCLIe/YsoWq/olzScCIQDi
-D2lWusoe2/nEqfDVVWGWlyJ7yOmqaVm/iNUN9B2N2g==
------END RSA PRIVATE KEY-----
-`
-
-// keyPEM is the same as rsaKeyPEM, but declares itself as just
-// "PRIVATE KEY", not "RSA PRIVATE KEY". http://golang.org/issue/4477
-var keyPEM = `-----BEGIN PRIVATE KEY-----
-MIIBOwIBAAJBANLJhPHhITqQbPklG3ibCVxwGMRfp/v4XqhfdQHdcVfHap6NQ5Wo
-k/4xIA+ui35/MmNartNuC+BdZ1tMuVCPFZcCAwEAAQJAEJ2N+zsR0Xn8/Q6twa4G
-6OB1M1WO+k+ztnX/1SvNeWu8D6GImtupLTYgjZcHufykj09jiHmjHx8u8ZZB/o1N
-MQIhAPW+eyZo7ay3lMz1V01WVjNKK9QSn1MJlb06h/LuYv9FAiEA25WPedKgVyCW
-SmUwbPw8fnTcpqDWE3yTO3vKcebqMSsCIBF3UmVue8YU3jybC3NxuXq3wNm34R8T
-xVLHwDXh/6NJAiEAl2oHGGLz64BuAfjKrqwz7qMYr9HCLIe/YsoWq/olzScCIQDi
-D2lWusoe2/nEqfDVVWGWlyJ7yOmqaVm/iNUN9B2N2g==
------END PRIVATE KEY-----
-`
-
-var ecdsaCertPEM = `-----BEGIN CERTIFICATE-----
-MIIB/jCCAWICCQDscdUxw16XFDAJBgcqhkjOPQQBMEUxCzAJBgNVBAYTAkFVMRMw
-EQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0
-eSBMdGQwHhcNMTIxMTE0MTI0MDQ4WhcNMTUxMTE0MTI0MDQ4WjBFMQswCQYDVQQG
-EwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lk
-Z2l0cyBQdHkgTHRkMIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQBY9+my9OoeSUR
-lDQdV/x8LsOuLilthhiS1Tz4aGDHIPwC1mlvnf7fg5lecYpMCrLLhauAc1UJXcgl
-01xoLuzgtAEAgv2P/jgytzRSpUYvgLBt1UA0leLYBy6mQQbrNEuqT3INapKIcUv8
-XxYP0xMEUksLPq6Ca+CRSqTtrd/23uTnapkwCQYHKoZIzj0EAQOBigAwgYYCQXJo
-A7Sl2nLVf+4Iu/tAX/IF4MavARKC4PPHK3zfuGfPR3oCCcsAoz3kAzOeijvd0iXb
-H5jBImIxPL4WxQNiBTexAkF8D1EtpYuWdlVQ80/h/f4pBcGiXPqX5h2PQSQY7hP1
-+jwM1FGS4fREIOvlBYr/SzzQRtwrvrzGYxDEDbsC0ZGRnA==
------END CERTIFICATE-----
-`
-
-var ecdsaKeyPEM = `-----BEGIN EC PARAMETERS-----
-BgUrgQQAIw==
------END EC PARAMETERS-----
------BEGIN EC PRIVATE KEY-----
-MIHcAgEBBEIBrsoKp0oqcv6/JovJJDoDVSGWdirrkgCWxrprGlzB9o0X8fV675X0
-NwuBenXFfeZvVcwluO7/Q9wkYoPd/t3jGImgBwYFK4EEACOhgYkDgYYABAFj36bL
-06h5JRGUNB1X/Hwuw64uKW2GGJLVPPhoYMcg/ALWaW+d/t+DmV5xikwKssuFq4Bz
-VQldyCXTXGgu7OC0AQCC/Y/+ODK3NFKlRi+AsG3VQDSV4tgHLqZBBus0S6pPcg1q
-kohxS/xfFg/TEwRSSws+roJr4JFKpO2t3/be5OdqmQ==
------END EC PRIVATE KEY-----
-`
-
-var keyPairTests = []struct {
- algo string
- cert string
- key string
-}{
- {"ECDSA", ecdsaCertPEM, ecdsaKeyPEM},
- {"RSA", rsaCertPEM, rsaKeyPEM},
- {"RSA-untyped", rsaCertPEM, keyPEM}, // golang.org/issue/4477
-}
-
-func TestX509KeyPair(t *testing.T) {
- var pem []byte
- for _, test := range keyPairTests {
- pem = []byte(test.cert + test.key)
- if _, err := X509KeyPair(pem, pem); err != nil {
- t.Errorf("Failed to load %s cert followed by %s key: %s", test.algo, test.algo, err)
- }
- pem = []byte(test.key + test.cert)
- if _, err := X509KeyPair(pem, pem); err != nil {
- t.Errorf("Failed to load %s key followed by %s cert: %s", test.algo, test.algo, err)
- }
- }
-}
-
-func TestX509MixedKeyPair(t *testing.T) {
- if _, err := X509KeyPair([]byte(rsaCertPEM), []byte(ecdsaKeyPEM)); err == nil {
- t.Error("Load of RSA certificate succeeded with ECDSA private key")
- }
- if _, err := X509KeyPair([]byte(ecdsaCertPEM), []byte(rsaKeyPEM)); err == nil {
- t.Error("Load of ECDSA certificate succeeded with RSA private key")
- }
-}
-
-func newLocalListener(t *testing.T) net.Listener {
- ln, err := net.Listen("tcp", "127.0.0.1:0")
- if err != nil {
- ln, err = net.Listen("tcp6", "[::1]:0")
- }
- if err != nil {
- t.Fatal(err)
- }
- return ln
-}
-
-func TestDialTimeout(t *testing.T) {
- if testing.Short() {
- t.Skip("skipping in short mode")
- }
- listener := newLocalListener(t)
-
- addr := listener.Addr().String()
- defer listener.Close()
-
- complete := make(chan bool)
- defer close(complete)
-
- go func() {
- conn, err := listener.Accept()
- if err != nil {
- t.Error(err)
- return
- }
- <-complete
- conn.Close()
- }()
-
- dialer := &net.Dialer{
- Timeout: 10 * time.Millisecond,
- }
-
- var err error
- if _, err = DialWithDialer(dialer, "tcp", addr, nil); err == nil {
- t.Fatal("DialWithTimeout completed successfully")
- }
-
- if !strings.Contains(err.Error(), "timed out") {
- t.Errorf("resulting error not a timeout: %s", err)
- }
-}
-
-// tests that Conn.Read returns (non-zero, io.EOF) instead of
-// (non-zero, nil) when a Close (alertCloseNotify) is sitting right
-// behind the application data in the buffer.
-func TestConnReadNonzeroAndEOF(t *testing.T) {
- // This test is racy: it assumes that after a write to a
- // localhost TCP connection, the peer TCP connection can
- // immediately read it. Because it's racy, we skip this test
- // in short mode, and then retry it several times with an
- // increasing sleep in between our final write (via srv.Close
- // below) and the following read.
- if testing.Short() {
- t.Skip("skipping in short mode")
- }
- var err error
- for delay := time.Millisecond; delay <= 64*time.Millisecond; delay *= 2 {
- if err = testConnReadNonzeroAndEOF(t, delay); err == nil {
- return
- }
- }
- t.Error(err)
-}
-
-func testConnReadNonzeroAndEOF(t *testing.T, delay time.Duration) error {
- ln := newLocalListener(t)
- defer ln.Close()
-
- srvCh := make(chan *Conn, 1)
- var serr error
- go func() {
- sconn, err := ln.Accept()
- if err != nil {
- serr = err
- srvCh <- nil
- return
- }
- serverConfig := *testConfig
- srv := Server(sconn, &serverConfig)
- if err := srv.Handshake(); err != nil {
- serr = fmt.Errorf("handshake: %v", err)
- srvCh <- nil
- return
- }
- srvCh <- srv
- }()
-
- clientConfig := *testConfig
- conn, err := Dial("tcp", ln.Addr().String(), &clientConfig)
- if err != nil {
- t.Fatal(err)
- }
- defer conn.Close()
-
- srv := <-srvCh
- if srv == nil {
- return serr
- }
-
- buf := make([]byte, 6)
-
- srv.Write([]byte("foobar"))
- n, err := conn.Read(buf)
- if n != 6 || err != nil || string(buf) != "foobar" {
- return fmt.Errorf("Read = %d, %v, data %q; want 6, nil, foobar", n, err, buf)
- }
-
- srv.Write([]byte("abcdef"))
- srv.Close()
- time.Sleep(delay)
- n, err = conn.Read(buf)
- if n != 6 || string(buf) != "abcdef" {
- return fmt.Errorf("Read = %d, buf= %q; want 6, abcdef", n, buf)
- }
- if err != io.EOF {
- return fmt.Errorf("Second Read error = %v; want io.EOF", err)
- }
- return nil
-}
-
-func TestTLSUniqueMatches(t *testing.T) {
- ln := newLocalListener(t)
- defer ln.Close()
-
- serverTLSUniques := make(chan []byte)
- go func() {
- for i := 0; i < 2; i++ {
- sconn, err := ln.Accept()
- if err != nil {
- t.Fatal(err)
- }
- serverConfig := *testConfig
- srv := Server(sconn, &serverConfig)
- if err := srv.Handshake(); err != nil {
- t.Fatal(err)
- }
- serverTLSUniques <- srv.ConnectionState().TLSUnique
- }
- }()
-
- clientConfig := *testConfig
- clientConfig.ClientSessionCache = NewLRUClientSessionCache(1)
- conn, err := Dial("tcp", ln.Addr().String(), &clientConfig)
- if err != nil {
- t.Fatal(err)
- }
- if !bytes.Equal(conn.ConnectionState().TLSUnique, <-serverTLSUniques) {
- t.Error("client and server channel bindings differ")
- }
- conn.Close()
-
- conn, err = Dial("tcp", ln.Addr().String(), &clientConfig)
- if err != nil {
- t.Fatal(err)
- }
- defer conn.Close()
- if !conn.ConnectionState().DidResume {
- t.Error("second session did not use resumption")
- }
- if !bytes.Equal(conn.ConnectionState().TLSUnique, <-serverTLSUniques) {
- t.Error("client and server channel bindings differ when session resumption is used")
- }
-}
diff --git a/runtimes/google/ipc/stream/manager/manager.go b/runtimes/google/ipc/stream/manager/manager.go
index a2ad073..6b782a0 100644
--- a/runtimes/google/ipc/stream/manager/manager.go
+++ b/runtimes/google/ipc/stream/manager/manager.go
@@ -15,7 +15,6 @@
"veyron.io/veyron/veyron2/vlog"
"veyron.io/veyron/veyron/lib/stats"
- "veyron.io/veyron/veyron/lib/websocket"
"veyron.io/veyron/veyron/runtimes/google/ipc/stream/crypto"
"veyron.io/veyron/veyron/runtimes/google/ipc/stream/vif"
"veyron.io/veyron/veyron/runtimes/google/ipc/version"
@@ -180,16 +179,6 @@
return nil, nil, errShutDown
}
- // If the protocol is tcp, we add the listener that supports both tcp and websocket
- // so that javascript can talk to this server.
- if strings.HasPrefix(protocol, "tcp") {
- wsln, err := websocket.NewListener(netln)
- if err != nil {
- netln.Close()
- return nil, nil, err
- }
- netln = wsln
- }
ln := newNetListener(m, netln, opts)
m.listeners[ln] = true
m.muListeners.Unlock()
diff --git a/runtimes/google/ipc/stream/manager/manager_test.go b/runtimes/google/ipc/stream/manager/manager_test.go
index aa66c0d..dc2b32d 100644
--- a/runtimes/google/ipc/stream/manager/manager_test.go
+++ b/runtimes/google/ipc/stream/manager/manager_test.go
@@ -42,19 +42,15 @@
modules.RegisterChild("runServer", "", runServer)
}
-func testSimpleFlow(t *testing.T, useWebsocket bool) {
+func testSimpleFlow(t *testing.T, protocol string) {
server := InternalNew(naming.FixedRoutingID(0x55555555))
client := InternalNew(naming.FixedRoutingID(0xcccccccc))
- ln, ep, err := server.Listen("tcp", "127.0.0.1:0")
+ ln, ep, err := server.Listen(protocol, "127.0.0.1:0")
if err != nil {
t.Fatal(err)
}
- if useWebsocket {
- ep.(*inaming.Endpoint).Protocol = "ws"
- }
-
data := "the dark knight rises"
var clientVC stream.VC
var clientF1 stream.Flow
@@ -131,11 +127,11 @@
}
func TestSimpleFlow(t *testing.T) {
- testSimpleFlow(t, false)
+ testSimpleFlow(t, "tcp")
}
func TestSimpleFlowWS(t *testing.T) {
- testSimpleFlow(t, true)
+ testSimpleFlow(t, "ws")
}
func TestConnectionTimeout(t *testing.T) {
@@ -159,7 +155,7 @@
}
}
-func testAuthenticatedByDefault(t *testing.T, useWebsocket bool) {
+func testAuthenticatedByDefault(t *testing.T, protocol string) {
var (
server = InternalNew(naming.FixedRoutingID(0x55555555))
client = InternalNew(naming.FixedRoutingID(0xcccccccc))
@@ -171,13 +167,10 @@
)
// VCSecurityLevel is intentionally not provided to Listen - to test
// default behavior.
- ln, ep, err := server.Listen("tcp", "127.0.0.1:0", serverPrincipal)
+ ln, ep, err := server.Listen(protocol, "127.0.0.1:0", serverPrincipal)
if err != nil {
t.Fatal(err)
}
- if useWebsocket {
- ep.(*inaming.Endpoint).Protocol = "ws"
- }
errs := make(chan error)
@@ -227,11 +220,11 @@
}
func TestAuthenticatedByDefault(t *testing.T) {
- testAuthenticatedByDefault(t, false)
+ testAuthenticatedByDefault(t, "tcp")
}
func TestAuthenticatedByDefaultWS(t *testing.T) {
- testAuthenticatedByDefault(t, true)
+ testAuthenticatedByDefault(t, "ws")
}
func numListeners(m stream.Manager) int { return len(m.(*manager).listeners) }
@@ -277,35 +270,20 @@
}
func TestCloseListener(t *testing.T) {
- server := InternalNew(naming.FixedRoutingID(0x5e97e9))
-
- ln, ep, err := server.Listen("tcp", "127.0.0.1:0")
- if err != nil {
- t.Fatal(err)
- }
- // Server will just listen for flows and close them.
- go acceptLoop(ln)
- client := InternalNew(naming.FixedRoutingID(0xc1e41))
- if _, err = client.Dial(ep); err != nil {
- t.Fatal(err)
- }
- ln.Close()
- client = InternalNew(naming.FixedRoutingID(0xc1e42))
- if _, err := client.Dial(ep); err == nil {
- t.Errorf("client.Dial(%q) should have failed", ep)
- }
+ testCloseListener(t, "tcp")
}
func TestCloseListenerWS(t *testing.T) {
+ testCloseListener(t, "ws")
+}
+
+func testCloseListener(t *testing.T, protocol string) {
server := InternalNew(naming.FixedRoutingID(0x5e97e9))
- ln, ep, err := server.Listen("tcp", "127.0.0.1:0")
+ ln, ep, err := server.Listen(protocol, "127.0.0.1:0")
if err != nil {
t.Fatal(err)
}
-
- ep.(*inaming.Endpoint).Protocol = "ws"
-
// Server will just listen for flows and close them.
go acceptLoop(ln)
client := InternalNew(naming.FixedRoutingID(0xc1e41))
@@ -340,41 +318,22 @@
}
func TestShutdownEndpoint(t *testing.T) {
- server := InternalNew(naming.FixedRoutingID(0x55555555))
- client := InternalNew(naming.FixedRoutingID(0xcccccccc))
-
- ln, ep, err := server.Listen("tcp", "127.0.0.1:0")
- if err != nil {
- t.Fatal(err)
- }
-
- // Server will just listen for flows and close them.
- go acceptLoop(ln)
-
- vc, err := client.Dial(ep)
- if err != nil {
- t.Fatal(err)
- }
- if f, err := vc.Connect(); f == nil || err != nil {
- t.Errorf("vc.Connect failed: (%v, %v)", f, err)
- }
- client.ShutdownEndpoint(ep)
- if f, err := vc.Connect(); f != nil || err == nil {
- t.Errorf("vc.Connect unexpectedly succeeded: (%v, %v)", f, err)
- }
+ testShutdownEndpoint(t, "tcp")
}
func TestShutdownEndpointWS(t *testing.T) {
+ testShutdownEndpoint(t, "ws")
+}
+
+func testShutdownEndpoint(t *testing.T, protocol string) {
server := InternalNew(naming.FixedRoutingID(0x55555555))
client := InternalNew(naming.FixedRoutingID(0xcccccccc))
- ln, ep, err := server.Listen("tcp", "127.0.0.1:0")
+ ln, ep, err := server.Listen(protocol, "127.0.0.1:0")
if err != nil {
t.Fatal(err)
}
- ep.(*inaming.Endpoint).Protocol = "ws"
-
// Server will just listen for flows and close them.
go acceptLoop(ln)
@@ -410,7 +369,7 @@
}
*/
-func testMultipleVCs(t *testing.T, useWebsocket bool) {
+func testMultipleVCs(t *testing.T, protocol string) {
server := InternalNew(naming.FixedRoutingID(0x55555555))
client := InternalNew(naming.FixedRoutingID(0xcccccccc))
@@ -419,13 +378,10 @@
// Have the server read from each flow and write to rchan.
rchan := make(chan string)
- ln, ep, err := server.Listen("tcp", "127.0.0.1:0")
+ ln, ep, err := server.Listen(protocol, "127.0.0.1:0")
if err != nil {
t.Fatal(err)
}
- if useWebsocket {
- ep.(*inaming.Endpoint).Protocol = "ws"
- }
read := func(flow stream.Flow, c chan string) {
var buf bytes.Buffer
@@ -494,11 +450,11 @@
}
func TestMultipleVCs(t *testing.T) {
- testMultipleVCs(t, false)
+ testMultipleVCs(t, "tcp")
}
func TestMultipleVCsWS(t *testing.T) {
- testMultipleVCs(t, true)
+ testMultipleVCs(t, "ws")
}
func TestAddressResolution(t *testing.T) {
@@ -543,66 +499,31 @@
}
func TestServerRestartDuringClientLifetime(t *testing.T) {
- client := InternalNew(naming.FixedRoutingID(0xcccccccc))
- sh, err := modules.NewShell(nil)
- if err != nil {
- t.Fatalf("unexpected error: %s", err)
- }
- defer sh.Cleanup(nil, nil)
- h, err := sh.Start("runServer", nil, "127.0.0.1:0")
- if err != nil {
- t.Fatalf("unexpected error: %s", err)
- }
- s := expect.NewSession(t, h.Stdout(), time.Minute)
- addr := s.ReadLine()
-
- ep, err := inaming.NewEndpoint(addr)
- if err != nil {
- t.Fatalf("inaming.NewEndpoint(%q): %v", addr, err)
- }
- if _, err := client.Dial(ep); err != nil {
- t.Fatal(err)
- }
- h.Shutdown(nil, os.Stderr)
-
- // A new VC cannot be created since the server is dead
- if _, err := client.Dial(ep); err == nil {
- t.Fatal("Expected client.Dial to fail since server is dead")
- }
-
- h, err = sh.Start("runServer", nil, addr)
- if err != nil {
- t.Fatalf("unexpected error: %s", err)
- }
- s = expect.NewSession(t, h.Stdout(), time.Minute)
- // Restarting the server, listening on the same address as before
- if addr2 := s.ReadLine(); addr2 != addr || err != nil {
- t.Fatalf("Got (%q, %v) want (%q, nil)", addr2, err, addr)
- }
- if _, err := client.Dial(ep); err != nil {
- t.Fatal(err)
- }
+ testServerRestartDuringClientLifetime(t, "tcp")
}
func TestServerRestartDuringClientLifetimeWS(t *testing.T) {
+ testServerRestartDuringClientLifetime(t, "ws")
+}
+
+func testServerRestartDuringClientLifetime(t *testing.T, protocol string) {
client := InternalNew(naming.FixedRoutingID(0xcccccccc))
sh, err := modules.NewShell(nil)
if err != nil {
t.Fatalf("unexpected error: %s", err)
}
defer sh.Cleanup(nil, nil)
- h, err := sh.Start("runServer", nil, "127.0.0.1:0")
+ h, err := sh.Start("runServer", nil, protocol, "127.0.0.1:0")
if err != nil {
t.Fatalf("unexpected error: %s", err)
}
s := expect.NewSession(t, h.Stdout(), time.Minute)
addr := s.ReadLine()
- ep, err := inaming.NewEndpoint(addr)
+ ep, err := inaming.NewEndpoint(naming.FormatEndpoint(protocol, addr))
if err != nil {
t.Fatalf("inaming.NewEndpoint(%q): %v", addr, err)
}
- ep.Protocol = "ws"
if _, err := client.Dial(ep); err != nil {
t.Fatal(err)
}
@@ -613,7 +534,7 @@
t.Fatal("Expected client.Dial to fail since server is dead")
}
- h, err = sh.Start("runServer", nil, addr)
+ h, err = sh.Start("runServer", nil, protocol, addr)
if err != nil {
t.Fatalf("unexpected error: %s", err)
}
@@ -634,7 +555,7 @@
func runServer(stdin io.Reader, stdout, stderr io.Writer, env map[string]string, args ...string) error {
server := InternalNew(naming.FixedRoutingID(0x55555555))
- _, ep, err := server.Listen("tcp", args[1])
+ _, ep, err := server.Listen(args[1], args[2])
if err != nil {
fmt.Fprintln(stderr, err)
return err
diff --git a/runtimes/google/ipc/stream/proxy/proxy.go b/runtimes/google/ipc/stream/proxy/proxy.go
index eddef79..095357b 100644
--- a/runtimes/google/ipc/stream/proxy/proxy.go
+++ b/runtimes/google/ipc/stream/proxy/proxy.go
@@ -6,13 +6,13 @@
"net"
"sync"
+ "veyron.io/veyron/veyron2/ipc/stream"
"veyron.io/veyron/veyron2/naming"
"veyron.io/veyron/veyron2/security"
"veyron.io/veyron/veyron2/verror"
"veyron.io/veyron/veyron2/vlog"
"veyron.io/veyron/veyron2/vom"
- "veyron.io/veyron/veyron/lib/websocket"
"veyron.io/veyron/veyron/runtimes/google/ipc/stream/crypto"
"veyron.io/veyron/veyron/runtimes/google/ipc/stream/id"
"veyron.io/veyron/veyron/runtimes/google/ipc/stream/message"
@@ -132,14 +132,14 @@
// New creates a new Proxy that listens for network connections on the provided
// (network, address) pair and routes VC traffic between accepted connections.
func New(rid naming.RoutingID, principal security.Principal, network, address, pubAddress string) (*Proxy, error) {
- ln, err := net.Listen(network, address)
+ _, listenFn := stream.RegisteredProtocol(network)
+ if listenFn == nil {
+ return nil, fmt.Errorf("unknown network %s", network)
+ }
+ ln, err := listenFn(network, address)
if err != nil {
return nil, fmt.Errorf("net.Listen(%q, %q) failed: %v", network, address, err)
}
- ln, err = websocket.NewListener(ln)
- if err != nil {
- return nil, err
- }
if len(pubAddress) == 0 {
pubAddress = ln.Addr().String()
}
@@ -460,7 +460,8 @@
// Endpoint returns the endpoint of the proxy service. By Dialing a VC to this
// endpoint, processes can have their services exported through the proxy.
func (p *Proxy) Endpoint() naming.Endpoint {
- return version.Endpoint(p.ln.Addr().Network(), p.pubAddress, p.rid)
+ ep := version.Endpoint(p.ln.Addr().Network(), p.pubAddress, p.rid)
+ return ep
}
// Shutdown stops the proxy service, closing all network connections.
diff --git a/runtimes/google/ipc/stream/vc/init.go b/runtimes/google/ipc/stream/vc/init.go
index ae639c5..2a51592 100644
--- a/runtimes/google/ipc/stream/vc/init.go
+++ b/runtimes/google/ipc/stream/vc/init.go
@@ -54,6 +54,10 @@
return s.k
}
+func (s *anonymousBlessingStore) PeerBlessings() map[security.BlessingPattern]security.Blessings {
+ return nil
+}
+
func (anonymousBlessingStore) DebugString() string {
return "anonymous BlessingStore"
}
diff --git a/runtimes/google/ipc/stream/vif/auth.go b/runtimes/google/ipc/stream/vif/auth.go
index 53a4b71..6d52cbe 100644
--- a/runtimes/google/ipc/stream/vif/auth.go
+++ b/runtimes/google/ipc/stream/vif/auth.go
@@ -7,7 +7,7 @@
"io"
"net"
- "code.google.com/p/go.crypto/nacl/box"
+ "golang.org/x/crypto/nacl/box"
"veyron.io/veyron/veyron/runtimes/google/ipc/stream/crypto"
"veyron.io/veyron/veyron/runtimes/google/ipc/stream/message"
diff --git a/runtimes/google/naming/endpoint.go b/runtimes/google/naming/endpoint.go
index 2552bc2..33c86cf 100644
--- a/runtimes/google/naming/endpoint.go
+++ b/runtimes/google/naming/endpoint.go
@@ -34,7 +34,7 @@
// NewEndpoint creates a new endpoint from a string as per naming.NewEndpoint
func NewEndpoint(input string) (*Endpoint, error) {
- var ep Endpoint
+ ep := new(Endpoint)
// We have to guess this is a mount table if we don't know.
ep.IsMountTable = true
@@ -45,7 +45,7 @@
parts := strings.Split(input, separator)
if len(parts) == 1 {
err := ep.parseHostPort(parts[0])
- return &ep, err
+ return ep, err
}
version, err := strconv.ParseUint(parts[0], 10, 16)
@@ -63,7 +63,7 @@
default:
err = errInvalidEndpointString
}
- return &ep, err
+ return ep, err
}
func (ep *Endpoint) parseHostPort(input string) error {
diff --git a/runtimes/google/naming/namespace/all_test.go b/runtimes/google/naming/namespace/all_test.go
index 8c1bd07..9d32f56 100644
--- a/runtimes/google/naming/namespace/all_test.go
+++ b/runtimes/google/naming/namespace/all_test.go
@@ -3,7 +3,6 @@
import (
"runtime"
"runtime/debug"
- "strings"
"sync"
"testing"
"time"
@@ -19,7 +18,7 @@
"veyron.io/veyron/veyron2/vlog"
"veyron.io/veyron/veyron/lib/testutil"
- _ "veyron.io/veyron/veyron/profiles"
+ "veyron.io/veyron/veyron/profiles"
"veyron.io/veyron/veyron/runtimes/google/naming/namespace"
vsecurity "veyron.io/veyron/veyron/security"
service "veyron.io/veyron/veyron/services/mounttable/lib"
@@ -54,10 +53,6 @@
t.Fatal(string(debug.Stack()))
}
-func addWSName(name string) []string {
- return []string{name, strings.Replace(name, "@tcp@", "@ws@", 1)}
-}
-
// N squared but who cares, this is a little test.
// Ignores dups.
func contains(container, contained []string) bool {
@@ -203,15 +198,15 @@
}
// Add a mount table server.
// Start serving on a loopback address.
- ep, err := s.Listen(ipc.ListenSpec{Protocol: "tcp", Address: "127.0.0.1:0"})
+ eps, err := s.Listen(profiles.LocalListenSpec)
if err != nil {
boom(t, "Failed to Listen: %s", err)
}
if err := s.ServeDispatcher(mountPoint, disp); err != nil {
boom(t, "Failed to serve mount table at %s: %s", mountPoint, err)
}
- name := naming.JoinAddressName(ep.String(), "")
- return &serverEntry{mountPoint: mountPoint, server: s, endpoint: ep, name: name}
+ name := naming.JoinAddressName(eps[0].String(), "")
+ return &serverEntry{mountPoint: mountPoint, server: s, endpoint: eps[0], name: name}
}
const (
@@ -306,16 +301,16 @@
testResolveToMountTable(t, r, ns, m, rootMT)
// The server registered for each mount point is a mount table
- testResolve(t, r, ns, m, addWSName(mts[m].name)...)
+ testResolve(t, r, ns, m, mts[m].name)
// ResolveToMountTable will walk through to the sub MountTables
mtbar := naming.Join(m, "bar")
subMT := naming.Join(mts[m].name, "bar")
- testResolveToMountTable(t, r, ns, mtbar, addWSName(subMT)...)
+ testResolveToMountTable(t, r, ns, mtbar, subMT)
}
for _, j := range []string{j1MP, j2MP, j3MP} {
- testResolve(t, r, ns, j, addWSName(jokes[j].name)...)
+ testResolve(t, r, ns, j, jokes[j].name)
}
}
@@ -349,7 +344,7 @@
mt2mt := naming.Join(mts[mt2MP].name, "a")
// The mt2/a is served by the mt2 mount table
- testResolveToMountTable(t, r, ns, mt2a, addWSName(mt2mt)...)
+ testResolveToMountTable(t, r, ns, mt2a, mt2mt)
// The server for mt2a is mt3server from the second mount above.
testResolve(t, r, ns, mt2a, mt3Server)
@@ -366,11 +361,11 @@
names := []string{naming.JoinAddressName(mts[mt4MP].name, "a"),
naming.JoinAddressName(mts[mt5MP].name, "a")}
- names = append(names, addWSName(naming.JoinAddressName(mts[mt2MP].name, "a"))...)
+ names = append(names, naming.JoinAddressName(mts[mt2MP].name, "a"))
// We now have 3 mount tables prepared to serve mt2/a
testResolveToMountTable(t, r, ns, "mt2/a", names...)
names = []string{mts[mt4MP].name, mts[mt5MP].name}
- names = append(names, addWSName(mts[mt2MP].name)...)
+ names = append(names, mts[mt2MP].name)
testResolve(t, r, ns, "mt2", names...)
}
@@ -388,15 +383,15 @@
// Set up some nested mounts and verify resolution.
for _, m := range []string{"mt4/foo", "mt4/foo/bar"} {
- testResolve(t, r, ns, m, addWSName(mts[m].name)...)
+ testResolve(t, r, ns, m, mts[m].name)
}
testResolveToMountTable(t, r, ns, "mt4/foo",
- addWSName(naming.JoinAddressName(mts[mt4MP].name, "foo"))...)
+ naming.JoinAddressName(mts[mt4MP].name, "foo"))
testResolveToMountTable(t, r, ns, "mt4/foo/bar",
- addWSName(naming.JoinAddressName(mts["mt4/foo"].name, "bar"))...)
+ naming.JoinAddressName(mts["mt4/foo"].name, "bar"))
testResolveToMountTable(t, r, ns, "mt4/foo/baz",
- addWSName(naming.JoinAddressName(mts["mt4/foo"].name, "baz"))...)
+ naming.JoinAddressName(mts["mt4/foo"].name, "baz"))
}
// TestServers tests invoking RPCs on simple servers
@@ -411,16 +406,16 @@
// Let's run some non-mount table services
for _, j := range []string{j1MP, j2MP, j3MP} {
- testResolve(t, r, ns, j, addWSName(jokes[j].name)...)
+ testResolve(t, r, ns, j, jokes[j].name)
knockKnock(t, r, j)
globalName := naming.JoinAddressName(mts["mt4"].name, j)
disp := &dispatcher{}
gj := "g_" + j
jokes[gj] = runServer(t, r, disp, globalName)
- testResolve(t, r, ns, "mt4/"+j, addWSName(jokes[gj].name)...)
+ testResolve(t, r, ns, "mt4/"+j, jokes[gj].name)
knockKnock(t, r, "mt4/"+j)
- testResolveToMountTable(t, r, ns, "mt4/"+j, addWSName(globalName)...)
- testResolveToMountTable(t, r, ns, "mt4/"+j+"/garbage", addWSName(globalName+"/garbage")...)
+ testResolveToMountTable(t, r, ns, "mt4/"+j, globalName)
+ testResolveToMountTable(t, r, ns, "mt4/"+j+"/garbage", globalName+"/garbage")
}
}
@@ -568,7 +563,7 @@
}
// Since c1 was mounted with the Serve call, it will have both the tcp and ws endpoints.
- testResolve(t, r, ns, "c1", addWSName(c1.name)...)
+ testResolve(t, r, ns, "c1", c1.name)
testResolve(t, r, ns, "c1/c2", c1.name)
testResolve(t, r, ns, "c1/c3", c3.name)
testResolve(t, r, ns, "c1/c3/c4", c1.name)
@@ -675,9 +670,9 @@
}
// Now check a matching pattern.
- testResolveWithPattern(t, r, ns, name, naming.RootBlessingPatternOpt("root/server"), addWSName(mts[mt2MP].name)...)
+ testResolveWithPattern(t, r, ns, name, naming.RootBlessingPatternOpt("root/server"), mts[mt2MP].name)
testResolveToMountTableWithPattern(t, r, ns, name, naming.RootBlessingPatternOpt("root/server"), name)
// After successful lookup it should be cached, so the pattern doesn't matter.
- testResolveWithPattern(t, r, ns, name, naming.RootBlessingPatternOpt("root/foobar"), addWSName(mts[mt2MP].name)...)
+ testResolveWithPattern(t, r, ns, name, naming.RootBlessingPatternOpt("root/foobar"), mts[mt2MP].name)
}
diff --git a/runtimes/google/rt/ipc_test.go b/runtimes/google/rt/ipc_test.go
index 7f7c589..8efcb44 100644
--- a/runtimes/google/rt/ipc_test.go
+++ b/runtimes/google/rt/ipc_test.go
@@ -90,11 +90,11 @@
if err != nil {
return nil, "", err
}
- endpoint, err := server.Listen(profiles.LocalListenSpec)
+ endpoints, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
return nil, "", err
}
- serverObjectName := naming.JoinAddressName(endpoint.String(), "")
+ serverObjectName := naming.JoinAddressName(endpoints[0].String(), "")
if err := server.Serve("", s, allowEveryone{}); err != nil {
return nil, "", err
}
diff --git a/runtimes/google/rt/mgmt.go b/runtimes/google/rt/mgmt.go
index a223f02..e52b102 100644
--- a/runtimes/google/rt/mgmt.go
+++ b/runtimes/google/rt/mgmt.go
@@ -42,7 +42,7 @@
if err != nil {
return nil, err
}
- ep, err := server.Listen(*listenSpec)
+ eps, err := server.Listen(*listenSpec)
if err != nil {
return nil, err
}
@@ -50,7 +50,7 @@
server.Stop()
return nil, err
}
- err = rt.callbackToParent(parentName, naming.JoinAddressName(ep.String(), ""))
+ err = rt.callbackToParent(parentName, naming.JoinAddressName(eps[0].String(), ""))
if err != nil {
server.Stop()
return nil, err
@@ -74,7 +74,7 @@
if address == "" {
return nil, fmt.Errorf("%v is not set", mgmt.AddressConfigKey)
}
- return &ipc.ListenSpec{Protocol: protocol, Address: address}, nil
+ return &ipc.ListenSpec{Addrs: ipc.ListenAddrs{{protocol, address}}}, nil
}
func (rt *vrt) callbackToParent(parentName, myName string) error {
diff --git a/runtimes/google/rt/mgmt_test.go b/runtimes/google/rt/mgmt_test.go
index a43c2d7..6323682 100644
--- a/runtimes/google/rt/mgmt_test.go
+++ b/runtimes/google/rt/mgmt_test.go
@@ -282,20 +282,20 @@
t.Fatalf("Got error: %v", err)
}
ch := make(chan string)
- var ep naming.Endpoint
- if ep, err = server.Listen(profiles.LocalListenSpec); err != nil {
+ var eps []naming.Endpoint
+ if eps, err = server.Listen(profiles.LocalListenSpec); err != nil {
t.Fatalf("Got error: %v", err)
}
if err := server.Serve("", device.ConfigServer(&configServer{ch}), vflag.NewAuthorizerOrDie()); err != nil {
t.Fatalf("Got error: %v", err)
}
- return server, naming.JoinAddressName(ep.String(), ""), ch
+ return server, naming.JoinAddressName(eps[0].String(), ""), ch
}
func setupRemoteAppCycleMgr(t *testing.T) (veyron2.Runtime, modules.Handle, appcycle.AppCycleClientMethods, func()) {
r, _ := rt.New(profileOpt)
- childcreds := security.NewVeyronCredentials(r.Principal(), appCmd)
+ childcreds, _ := security.ForkCredentials(r.Principal(), appCmd)
configServer, configServiceName, ch := createConfigServer(t, r)
sh, err := modules.NewShell(nil)
if err != nil {
diff --git a/runtimes/google/vtrace/vtrace_test.go b/runtimes/google/vtrace/vtrace_test.go
index 250f4c9..6e2e64b 100644
--- a/runtimes/google/vtrace/vtrace_test.go
+++ b/runtimes/google/vtrace/vtrace_test.go
@@ -13,7 +13,7 @@
"veyron.io/veyron/veyron2/vlog"
"veyron.io/veyron/veyron2/vtrace"
- _ "veyron.io/veyron/veyron/lib/tcp"
+ "veyron.io/veyron/veyron/profiles"
iipc "veyron.io/veyron/veyron/runtimes/google/ipc"
"veyron.io/veyron/veyron/runtimes/google/ipc/stream/manager"
tnaming "veyron.io/veyron/veyron/runtimes/google/testing/mocks/naming"
@@ -103,7 +103,7 @@
if err != nil {
return nil, err
}
- if _, err := s.Listen(ipc.ListenSpec{Protocol: "tcp", Address: "127.0.0.1:0"}); err != nil {
+ if _, err := s.Listen(profiles.LocalListenSpec); err != nil {
return nil, err
}
diff --git a/security/agent/agent_test.go b/security/agent/agent_test.go
index d0acb43..18b61ea 100644
--- a/security/agent/agent_test.go
+++ b/security/agent/agent_test.go
@@ -69,6 +69,8 @@
{"Sign", V{make([]byte, 10)}, security.Signature{Purpose: []byte{}, R: []byte{1}, S: []byte{1}}, nil},
{"MintDischarge", V{thirdPartyCaveat, security.UnconstrainedUse()}, discharge, nil},
{"PublicKey", V{}, mockP.PublicKey(), nil},
+ {"BlessingsByName", V{security.BlessingPattern("self")}, []security.Blessings{newBlessing(t, "blessing")}, nil},
+ {"BlessingsInfo", V{newBlessing(t, "blessing")}, []string{"blessing"}, nil},
{"AddToRoots", V{newBlessing(t, "blessing")}, nil, verror2.Make(addToRootsErr, nil)},
}
for _, test := range tests {
@@ -84,6 +86,7 @@
{"SetDefault", V{newBlessing(t, "blessing")}, nil, verror2.Make(storeSetDefaultErr, nil)},
{"Default", V{}, newBlessing(t, "root/extension"), nil},
{"PublicKey", V{}, mockP.PublicKey(), nil},
+ {"PeerBlessings", V{}, map[security.BlessingPattern]security.Blessings{"test": newBlessing(t, "root/extension")}, nil},
{"DebugString", V{}, "StoreString", nil},
}
for _, test := range storeTests {
@@ -176,6 +179,18 @@
return d, p.NextError
}
+func (p *mockPrincipal) BlessingsByName(name security.BlessingPattern) []security.Blessings {
+ defer p.reset()
+ b, _ := p.NextResult.([]security.Blessings)
+ return b
+}
+
+func (p *mockPrincipal) BlessingsInfo(blessings security.Blessings) []string {
+ defer p.reset()
+ s, _ := p.NextResult.([]string)
+ return s
+}
+
func (p *mockPrincipal) PublicKey() security.PublicKey { return p.Key }
func (p *mockPrincipal) Roots() security.BlessingRoots { return p.MockRoots }
func (p *mockPrincipal) BlessingStore() security.BlessingStore { return p.MockStore }
@@ -220,6 +235,12 @@
func (s *mockBlessingStore) PublicKey() security.PublicKey { return s.Key }
+func (s *mockBlessingStore) PeerBlessings() map[security.BlessingPattern]security.Blessings {
+ defer s.reset()
+ m, _ := s.NextResult.(map[security.BlessingPattern]security.Blessings)
+ return m
+}
+
func (s *mockBlessingStore) DebugString() string {
defer s.reset()
return s.NextResult.(string)
diff --git a/security/agent/agentd/main.go b/security/agent/agentd/main.go
index 5871e7f..97adc43 100644
--- a/security/agent/agentd/main.go
+++ b/security/agent/agentd/main.go
@@ -9,7 +9,7 @@
"os/signal"
"syscall"
- "code.google.com/p/go.crypto/ssh/terminal"
+ "golang.org/x/crypto/ssh/terminal"
"veyron.io/veyron/veyron/lib/flags/consts"
vsignals "veyron.io/veyron/veyron/lib/signals"
diff --git a/security/agent/client.go b/security/agent/client.go
index 6a3925f..cd26573 100644
--- a/security/agent/client.go
+++ b/security/agent/client.go
@@ -128,6 +128,33 @@
return c.key
}
+func (c *client) BlessingsByName(pattern security.BlessingPattern) []security.Blessings {
+ var wbResults []security.WireBlessings
+ err := c.caller.call("BlessingsByName", results(&wbResults), pattern)
+ if err != nil {
+ vlog.Errorf("error calling BlessingsByName: %v", err)
+ return nil
+ }
+ blessings := make([]security.Blessings, len(wbResults))
+ for i, wb := range wbResults {
+ var err error
+ blessings[i], err = security.NewBlessings(wb)
+ if err != nil {
+ vlog.Errorf("error creating Blessing from WireBlessings: %v", err)
+ }
+ }
+ return blessings
+}
+
+func (c *client) BlessingsInfo(blessings security.Blessings) []string {
+ var names []string
+ err := c.caller.call("BlessingsInfo", results(&names), security.MarshalBlessings(blessings))
+ if err != nil {
+ vlog.Errorf("error calling BlessingsInfo: %v", err)
+ return nil
+ }
+ return names
+}
func (c *client) BlessingStore() security.BlessingStore {
return &blessingStore{c.caller, c.key}
}
@@ -192,6 +219,25 @@
return b.key
}
+func (b *blessingStore) PeerBlessings() map[security.BlessingPattern]security.Blessings {
+ var wbMap map[security.BlessingPattern]security.WireBlessings
+ err := b.caller.call("BlessingStorePeerBlessings", results(&wbMap))
+ if err != nil {
+ vlog.Errorf("error calling BlessingStorePeerBlessings: %v", err)
+ return nil
+ }
+ bMap := make(map[security.BlessingPattern]security.Blessings)
+ for pattern, wb := range wbMap {
+ blessings, err := security.NewBlessings(wb)
+ if err != nil {
+ vlog.Errorf("error creating Blessing from WireBlessings: %v", err)
+ return nil
+ }
+ bMap[pattern] = blessings
+ }
+ return bMap
+}
+
func (b *blessingStore) DebugString() (s string) {
err := b.caller.call("BlessingStoreDebugString", results(&s))
if err != nil {
diff --git a/security/agent/pingpong/main.go b/security/agent/pingpong/main.go
index d79e993..a23a5ca 100644
--- a/security/agent/pingpong/main.go
+++ b/security/agent/pingpong/main.go
@@ -4,14 +4,14 @@
"flag"
"fmt"
- "veyron.io/veyron/veyron/lib/signals"
- _ "veyron.io/veyron/veyron/profiles"
-
"veyron.io/veyron/veyron2"
"veyron.io/veyron/veyron2/ipc"
"veyron.io/veyron/veyron2/rt"
"veyron.io/veyron/veyron2/security"
"veyron.io/veyron/veyron2/vlog"
+
+ "veyron.io/veyron/veyron/lib/signals"
+ _ "veyron.io/veyron/veyron/profiles"
)
var runServer = flag.Bool("server", false, "Whether to run in server mode")
@@ -44,7 +44,8 @@
serverPong := PingPongServer(&pongd{})
- if endpoint, err := s.Listen(ipc.ListenSpec{Protocol: "tcp", Address: "127.0.0.1:0"}); err == nil {
+ spec := ipc.ListenSpec{Addrs: ipc.ListenAddrs{{"tcp", "127.0.0.1:0"}}}
+ if endpoint, err := s.Listen(spec); err == nil {
fmt.Printf("Listening at: %v\n", endpoint)
} else {
log.Fatal("error listening to service: ", err)
diff --git a/security/agent/pingpong/wire.vdl b/security/agent/pingpong/wire.vdl
index 0fc2ed4..79a9a81 100644
--- a/security/agent/pingpong/wire.vdl
+++ b/security/agent/pingpong/wire.vdl
@@ -2,5 +2,5 @@
// Simple service used in the agent tests.
type PingPong interface {
- Ping(message string) (string, error)
+ Ping(message string) (string | error)
}
diff --git a/security/agent/server/server.go b/security/agent/server/server.go
index 6035d22..fcf25a3 100644
--- a/security/agent/server/server.go
+++ b/security/agent/server/server.go
@@ -204,7 +204,10 @@
vlog.Infof("Error creating server: %v", err)
continue
}
- spec := ipc.ListenSpec{Protocol: clientAddr.Network(), Address: clientAddr.String()}
+ a := []struct{ Protocol, Address string }{
+ {clientAddr.Network(), clientAddr.String()},
+ }
+ spec := ipc.ListenSpec{Addrs: ipc.ListenAddrs(a)}
if _, err = s.Listen(spec); err == nil {
err = s.Serve("", serverAgent, nil)
}
@@ -304,6 +307,23 @@
return a.principal.PublicKey().MarshalBinary()
}
+func (a agentd) BlessingsByName(_ ipc.ServerContext, name security.BlessingPattern) ([]security.WireBlessings, error) {
+ blessings := a.principal.BlessingsByName(name)
+ ret := make([]security.WireBlessings, len(blessings))
+ for i, b := range blessings {
+ ret[i] = security.MarshalBlessings(b)
+ }
+ return ret, nil
+}
+
+func (a agentd) BlessingsInfo(_ ipc.ServerContext, blessings security.WireBlessings) ([]string, error) {
+ b, err := security.NewBlessings(blessings)
+ if err != nil {
+ return nil, err
+ }
+ return a.principal.BlessingsInfo(b), nil
+}
+
func (a agentd) AddToRoots(_ ipc.ServerContext, wireBlessings security.WireBlessings) error {
blessings, err := security.NewBlessings(wireBlessings)
if err != nil {
@@ -336,6 +356,15 @@
return a.principal.BlessingStore().SetDefault(blessings)
}
+func (a agentd) BlessingStorePeerBlessings(_ ipc.ServerContext) (map[security.BlessingPattern]security.WireBlessings, error) {
+ bMap := a.principal.BlessingStore().PeerBlessings()
+ wbMap := make(map[security.BlessingPattern]security.WireBlessings, len(bMap))
+ for p, b := range bMap {
+ wbMap[p] = security.MarshalBlessings(b)
+ }
+ return wbMap, nil
+}
+
func (a agentd) BlessingStoreDebugString(_ ipc.ServerContext) (string, error) {
return a.principal.BlessingStore().DebugString(), nil
}
diff --git a/security/agent/server/wire.vdl b/security/agent/server/wire.vdl
index dc52a7c..8e4733a 100644
--- a/security/agent/server/wire.vdl
+++ b/security/agent/server/wire.vdl
@@ -30,20 +30,23 @@
)
type Agent interface {
- Bless(key []byte, wit security.WireBlessings, extension string, caveat security.Caveat, additionalCaveats []security.Caveat) (security.WireBlessings, error)
- BlessSelf(name string, caveats []security.Caveat) (security.WireBlessings, error)
- Sign(message []byte) (security.Signature, error)
- MintDischarge(tp any, caveat security.Caveat, additionalCaveats []security.Caveat) (any, error)
- PublicKey() ([]byte, error)
+ Bless(key []byte, wit security.WireBlessings, extension string, caveat security.Caveat, additionalCaveats []security.Caveat) (security.WireBlessings | error)
+ BlessSelf(name string, caveats []security.Caveat) (security.WireBlessings | error)
+ Sign(message []byte) (security.Signature | error)
+ MintDischarge(tp any, caveat security.Caveat, additionalCaveats []security.Caveat) (any | error)
+ PublicKey() ([]byte | error)
+ BlessingsByName(name security.BlessingPattern) ([]security.WireBlessings | error)
+ BlessingsInfo(blessings security.WireBlessings) ([]string | error)
AddToRoots(blessing security.WireBlessings) error
- BlessingStoreSet(blessings security.WireBlessings, forPeers security.BlessingPattern) (security.WireBlessings, error)
- BlessingStoreForPeer(peerBlessings []string) (security.WireBlessings, error)
+ BlessingStoreSet(blessings security.WireBlessings, forPeers security.BlessingPattern) (security.WireBlessings | error)
+ BlessingStoreForPeer(peerBlessings []string) (security.WireBlessings | error)
BlessingStoreSetDefault(blessings security.WireBlessings) error
- BlessingStoreDefault() (security.WireBlessings, error)
- BlessingStoreDebugString() (string, error)
+ BlessingStoreDefault() (security.WireBlessings | error)
+ BlessingStorePeerBlessings() (map[security.BlessingPattern]security.WireBlessings | error)
+ BlessingStoreDebugString() (string | error)
BlessingRootsAdd(root []byte, pattern security.BlessingPattern) error
BlessingRootsRecognized(root []byte, blessing string) error
- BlessingRootsDebugString() (string, error)
+ BlessingRootsDebugString() (string | error)
}
diff --git a/security/agent/server/wire.vdl.go b/security/agent/server/wire.vdl.go
index fa5832b..3fc6f85 100644
--- a/security/agent/server/wire.vdl.go
+++ b/security/agent/server/wire.vdl.go
@@ -27,11 +27,14 @@
Sign(ctx __context.T, message []byte, opts ...__ipc.CallOpt) (security.Signature, error)
MintDischarge(ctx __context.T, tp __vdlutil.Any, caveat security.Caveat, additionalCaveats []security.Caveat, opts ...__ipc.CallOpt) (__vdlutil.Any, error)
PublicKey(__context.T, ...__ipc.CallOpt) ([]byte, error)
+ BlessingsByName(ctx __context.T, name security.BlessingPattern, opts ...__ipc.CallOpt) ([]security.WireBlessings, error)
+ BlessingsInfo(ctx __context.T, blessings security.WireBlessings, opts ...__ipc.CallOpt) ([]string, error)
AddToRoots(ctx __context.T, blessing security.WireBlessings, opts ...__ipc.CallOpt) error
BlessingStoreSet(ctx __context.T, blessings security.WireBlessings, forPeers security.BlessingPattern, opts ...__ipc.CallOpt) (security.WireBlessings, error)
BlessingStoreForPeer(ctx __context.T, peerBlessings []string, opts ...__ipc.CallOpt) (security.WireBlessings, error)
BlessingStoreSetDefault(ctx __context.T, blessings security.WireBlessings, opts ...__ipc.CallOpt) error
BlessingStoreDefault(__context.T, ...__ipc.CallOpt) (security.WireBlessings, error)
+ BlessingStorePeerBlessings(__context.T, ...__ipc.CallOpt) (map[security.BlessingPattern]security.WireBlessings, error)
BlessingStoreDebugString(__context.T, ...__ipc.CallOpt) (string, error)
BlessingRootsAdd(ctx __context.T, root []byte, pattern security.BlessingPattern, opts ...__ipc.CallOpt) error
BlessingRootsRecognized(ctx __context.T, root []byte, blessing string, opts ...__ipc.CallOpt) error
@@ -122,6 +125,28 @@
return
}
+func (c implAgentClientStub) BlessingsByName(ctx __context.T, i0 security.BlessingPattern, opts ...__ipc.CallOpt) (o0 []security.WireBlessings, err error) {
+ var call __ipc.Call
+ if call, err = c.c(ctx).StartCall(ctx, c.name, "BlessingsByName", []interface{}{i0}, opts...); err != nil {
+ return
+ }
+ if ierr := call.Finish(&o0, &err); ierr != nil {
+ err = ierr
+ }
+ return
+}
+
+func (c implAgentClientStub) BlessingsInfo(ctx __context.T, i0 security.WireBlessings, opts ...__ipc.CallOpt) (o0 []string, err error) {
+ var call __ipc.Call
+ if call, err = c.c(ctx).StartCall(ctx, c.name, "BlessingsInfo", []interface{}{i0}, opts...); err != nil {
+ return
+ }
+ if ierr := call.Finish(&o0, &err); ierr != nil {
+ err = ierr
+ }
+ return
+}
+
func (c implAgentClientStub) AddToRoots(ctx __context.T, i0 security.WireBlessings, opts ...__ipc.CallOpt) (err error) {
var call __ipc.Call
if call, err = c.c(ctx).StartCall(ctx, c.name, "AddToRoots", []interface{}{i0}, opts...); err != nil {
@@ -177,6 +202,17 @@
return
}
+func (c implAgentClientStub) BlessingStorePeerBlessings(ctx __context.T, opts ...__ipc.CallOpt) (o0 map[security.BlessingPattern]security.WireBlessings, err error) {
+ var call __ipc.Call
+ if call, err = c.c(ctx).StartCall(ctx, c.name, "BlessingStorePeerBlessings", nil, opts...); err != nil {
+ return
+ }
+ if ierr := call.Finish(&o0, &err); ierr != nil {
+ err = ierr
+ }
+ return
+}
+
func (c implAgentClientStub) BlessingStoreDebugString(ctx __context.T, opts ...__ipc.CallOpt) (o0 string, err error) {
var call __ipc.Call
if call, err = c.c(ctx).StartCall(ctx, c.name, "BlessingStoreDebugString", nil, opts...); err != nil {
@@ -240,11 +276,14 @@
Sign(ctx __ipc.ServerContext, message []byte) (security.Signature, error)
MintDischarge(ctx __ipc.ServerContext, tp __vdlutil.Any, caveat security.Caveat, additionalCaveats []security.Caveat) (__vdlutil.Any, error)
PublicKey(__ipc.ServerContext) ([]byte, error)
+ BlessingsByName(ctx __ipc.ServerContext, name security.BlessingPattern) ([]security.WireBlessings, error)
+ BlessingsInfo(ctx __ipc.ServerContext, blessings security.WireBlessings) ([]string, error)
AddToRoots(ctx __ipc.ServerContext, blessing security.WireBlessings) error
BlessingStoreSet(ctx __ipc.ServerContext, blessings security.WireBlessings, forPeers security.BlessingPattern) (security.WireBlessings, error)
BlessingStoreForPeer(ctx __ipc.ServerContext, peerBlessings []string) (security.WireBlessings, error)
BlessingStoreSetDefault(ctx __ipc.ServerContext, blessings security.WireBlessings) error
BlessingStoreDefault(__ipc.ServerContext) (security.WireBlessings, error)
+ BlessingStorePeerBlessings(__ipc.ServerContext) (map[security.BlessingPattern]security.WireBlessings, error)
BlessingStoreDebugString(__ipc.ServerContext) (string, error)
BlessingRootsAdd(ctx __ipc.ServerContext, root []byte, pattern security.BlessingPattern) error
BlessingRootsRecognized(ctx __ipc.ServerContext, root []byte, blessing string) error
@@ -308,6 +347,14 @@
return s.impl.PublicKey(ctx)
}
+func (s implAgentServerStub) BlessingsByName(ctx __ipc.ServerContext, i0 security.BlessingPattern) ([]security.WireBlessings, error) {
+ return s.impl.BlessingsByName(ctx, i0)
+}
+
+func (s implAgentServerStub) BlessingsInfo(ctx __ipc.ServerContext, i0 security.WireBlessings) ([]string, error) {
+ return s.impl.BlessingsInfo(ctx, i0)
+}
+
func (s implAgentServerStub) AddToRoots(ctx __ipc.ServerContext, i0 security.WireBlessings) error {
return s.impl.AddToRoots(ctx, i0)
}
@@ -328,6 +375,10 @@
return s.impl.BlessingStoreDefault(ctx)
}
+func (s implAgentServerStub) BlessingStorePeerBlessings(ctx __ipc.ServerContext) (map[security.BlessingPattern]security.WireBlessings, error) {
+ return s.impl.BlessingStorePeerBlessings(ctx)
+}
+
func (s implAgentServerStub) BlessingStoreDebugString(ctx __ipc.ServerContext) (string, error) {
return s.impl.BlessingStoreDebugString(ctx)
}
@@ -415,6 +466,26 @@
},
},
{
+ Name: "BlessingsByName",
+ InArgs: []__ipc.ArgDesc{
+ {"name", ``}, // security.BlessingPattern
+ },
+ OutArgs: []__ipc.ArgDesc{
+ {"", ``}, // []security.WireBlessings
+ {"", ``}, // error
+ },
+ },
+ {
+ Name: "BlessingsInfo",
+ InArgs: []__ipc.ArgDesc{
+ {"blessings", ``}, // security.WireBlessings
+ },
+ OutArgs: []__ipc.ArgDesc{
+ {"", ``}, // []string
+ {"", ``}, // error
+ },
+ },
+ {
Name: "AddToRoots",
InArgs: []__ipc.ArgDesc{
{"blessing", ``}, // security.WireBlessings
@@ -461,6 +532,13 @@
},
},
{
+ Name: "BlessingStorePeerBlessings",
+ OutArgs: []__ipc.ArgDesc{
+ {"", ``}, // map[security.BlessingPattern]security.WireBlessings
+ {"", ``}, // error
+ },
+ },
+ {
Name: "BlessingStoreDebugString",
OutArgs: []__ipc.ArgDesc{
{"", ``}, // string
@@ -579,6 +657,13 @@
{Name: "", Type: 75},
},
}
+ result.Methods["BlessingStorePeerBlessings"] = __ipc.MethodSignature{
+ InArgs: []__ipc.MethodArgument{},
+ OutArgs: []__ipc.MethodArgument{
+ {Name: "", Type: 79},
+ {Name: "", Type: 75},
+ },
+ }
result.Methods["BlessingStoreSet"] = __ipc.MethodSignature{
InArgs: []__ipc.MethodArgument{
{Name: "blessings", Type: 74},
@@ -597,6 +682,24 @@
{Name: "", Type: 75},
},
}
+ result.Methods["BlessingsByName"] = __ipc.MethodSignature{
+ InArgs: []__ipc.MethodArgument{
+ {Name: "name", Type: 77},
+ },
+ OutArgs: []__ipc.MethodArgument{
+ {Name: "", Type: 78},
+ {Name: "", Type: 75},
+ },
+ }
+ result.Methods["BlessingsInfo"] = __ipc.MethodSignature{
+ InArgs: []__ipc.MethodArgument{
+ {Name: "blessings", Type: 74},
+ },
+ OutArgs: []__ipc.MethodArgument{
+ {Name: "", Type: 61},
+ {Name: "", Type: 75},
+ },
+ }
result.Methods["MintDischarge"] = __ipc.MethodSignature{
InArgs: []__ipc.MethodArgument{
{Name: "tp", Type: 76},
@@ -652,7 +755,7 @@
__wiretype.FieldType{Type: 0x49, Name: "CertificateChains"},
},
"veyron.io/veyron/veyron2/security.WireBlessings", []string(nil)},
- __wiretype.NamedPrimitiveType{Type: 0x1, Name: "error", Tags: []string(nil)}, __wiretype.NamedPrimitiveType{Type: 0x1, Name: "anydata", Tags: []string(nil)}, __wiretype.NamedPrimitiveType{Type: 0x3, Name: "veyron.io/veyron/veyron2/security.BlessingPattern", Tags: []string(nil)}}
+ __wiretype.NamedPrimitiveType{Type: 0x1, Name: "error", Tags: []string(nil)}, __wiretype.NamedPrimitiveType{Type: 0x1, Name: "anydata", Tags: []string(nil)}, __wiretype.NamedPrimitiveType{Type: 0x3, Name: "veyron.io/veyron/veyron2/security.BlessingPattern", Tags: []string(nil)}, __wiretype.SliceType{Elem: 0x4a, Name: "", Tags: []string(nil)}, __wiretype.MapType{Key: 0x4d, Elem: 0x4a, Name: "", Tags: []string(nil)}}
return result, nil
}
diff --git a/security/agent/test.sh b/security/agent/test.sh
index a6961c1..08164e1 100755
--- a/security/agent/test.sh
+++ b/security/agent/test.sh
@@ -2,7 +2,7 @@
# Test running an application using the agent.
-source "${VEYRON_ROOT}/scripts/lib/shell_test.sh"
+source "$(go list -f {{.Dir}} veyron.io/veyron/shell/lib)/shell_test.sh"
readonly WORKDIR="${shell_test_WORK_DIR}"
@@ -32,7 +32,7 @@
# Test running multiple apps connecting to the same agent.
# Make sure the testchild.sh script get the same shell_test_BIN_DIR as the main script.
export shell_test_BIN_DIR="${shell_test_BIN_DIR}"
- RESULT=$(shell::check_result "${AGENTD_BIN}" bash "${VEYRON_ROOT}/veyron/go/src/veyron.io/veyron/veyron/security/agent/testchild.sh")
+ RESULT=$(shell::check_result "${AGENTD_BIN}" bash "$(go list -f {{.Dir}} veyron.io/veyron/veyron/security/agent)/testchild.sh")
shell_test::assert_eq "${RESULT}" "0" "${LINENO}"
shell_test::pass
diff --git a/security/agent/testchild.sh b/security/agent/testchild.sh
index 089d53c..4465fc5 100644
--- a/security/agent/testchild.sh
+++ b/security/agent/testchild.sh
@@ -2,7 +2,7 @@
# Helper script for testing two binaries under the same agent.
-source "${VEYRON_ROOT}/scripts/lib/shell_test.sh"
+source "$(go list -f {{.Dir}} veyron.io/veyron/shell/lib)/shell_test.sh"
main() {
if [[ -n "${VEYRON_CREDENTIALS}" ]]; then
diff --git a/security/audit/principal.go b/security/audit/principal.go
index efd1323..c37a8d7 100644
--- a/security/audit/principal.go
+++ b/security/audit/principal.go
@@ -55,6 +55,14 @@
return d, nil
}
+func (p *auditingPrincipal) BlessingsByName(name security.BlessingPattern) []security.Blessings {
+ return p.principal.BlessingsByName(name)
+}
+
+func (p *auditingPrincipal) BlessingsInfo(b security.Blessings) []string {
+ return p.principal.BlessingsInfo(b)
+}
+
func (p *auditingPrincipal) PublicKey() security.PublicKey { return p.principal.PublicKey() }
func (p *auditingPrincipal) Roots() security.BlessingRoots { return p.principal.Roots() }
func (p *auditingPrincipal) BlessingStore() security.BlessingStore { return p.principal.BlessingStore() }
diff --git a/security/audit/principal_test.go b/security/audit/principal_test.go
index 487154f..00b885e 100644
--- a/security/audit/principal_test.go
+++ b/security/audit/principal_test.go
@@ -162,6 +162,14 @@
return d, p.NextError
}
+func (p *mockPrincipal) BlessingsByName(name security.BlessingPattern) []security.Blessings {
+ return nil
+}
+
+func (p *mockPrincipal) BlessingsInfo(b security.Blessings) []string {
+ return nil
+}
+
func (p *mockPrincipal) PublicKey() security.PublicKey { return p.NextResult.(security.PublicKey) }
func (p *mockPrincipal) Roots() security.BlessingRoots { return nil }
func (p *mockPrincipal) BlessingStore() security.BlessingStore { return nil }
diff --git a/security/blessingstore.go b/security/blessingstore.go
index be3449b..fd004e6 100644
--- a/security/blessingstore.go
+++ b/security/blessingstore.go
@@ -135,6 +135,14 @@
return fmt.Sprintf("{state: %v, publicKey: %v}", bs.state, bs.publicKey)
}
+func (bs *blessingStore) PeerBlessings() map[security.BlessingPattern]security.Blessings {
+ m := make(map[security.BlessingPattern]security.Blessings)
+ for pattern, wb := range bs.state.Store {
+ m[pattern] = wb.Blessings()
+ }
+ return m
+}
+
// DebugString return a human-readable string encoding of the store
// in the following format
// Default blessing : <Default blessing of the store>
diff --git a/security/blessingstore_test.go b/security/blessingstore_test.go
index fd535d8..be7824f 100644
--- a/security/blessingstore_test.go
+++ b/security/blessingstore_test.go
@@ -30,11 +30,19 @@
{t.forAll, "...foo", "invalid BlessingPattern"},
{t.forAll, "foo/.../bar", "invalid BlessingPattern"},
}
+ added := make(map[security.BlessingPattern]security.Blessings)
for _, d := range testdata {
_, err := s.Set(d.blessings, d.pattern)
if merr := matchesError(err, d.wantErr); merr != nil {
return fmt.Errorf("Set(%v, %q): %v", d.blessings, d.pattern, merr)
}
+ if err == nil {
+ added[d.pattern] = d.blessings
+ }
+ }
+ m := s.PeerBlessings()
+ if !reflect.DeepEqual(added, m) {
+ return fmt.Errorf("PeerBlessings(%v) != added(%v)", m, added)
}
return nil
}
diff --git a/security/principal.go b/security/principal.go
index 4ebf6e6..304c4d1 100644
--- a/security/principal.go
+++ b/security/principal.go
@@ -114,23 +114,31 @@
return NewPrincipalFromSigner(security.NewInMemoryECDSASigner(key), state)
}
+// SetDefaultBlessings sets the provided blessings as default and shareable with
+// all peers on provided principal's BlessingStore, and also adds it as a root to
+// the principal's BlessingRoots.
+func SetDefaultBlessings(p security.Principal, blessings security.Blessings) error {
+ if err := p.BlessingStore().SetDefault(blessings); err != nil {
+ return err
+ }
+ if _, err := p.BlessingStore().Set(blessings, security.AllPrincipals); err != nil {
+ return err
+ }
+ if err := p.AddToRoots(blessings); err != nil {
+ return err
+ }
+ return nil
+}
+
// InitDefaultBlessings uses the provided principal to create a self blessing for name 'name',
// sets it as default on the principal's BlessingStore and adds it as root to the principal's BlessingRoots.
+// TODO(ataly): Get rid this function given that we have SetDefaultBlessings.
func InitDefaultBlessings(p security.Principal, name string) error {
blessing, err := p.BlessSelf(name)
if err != nil {
return err
}
- if err := p.BlessingStore().SetDefault(blessing); err != nil {
- return err
- }
- if _, err := p.BlessingStore().Set(blessing, security.AllPrincipals); err != nil {
- return err
- }
- if err := p.AddToRoots(blessing); err != nil {
- return err
- }
- return nil
+ return SetDefaultBlessings(p, blessing)
}
func mkDir(dir string) error {
diff --git a/security/principal_test.go b/security/principal_test.go
index eb72f43..5f2d08c 100644
--- a/security/principal_test.go
+++ b/security/principal_test.go
@@ -7,7 +7,10 @@
"io/ioutil"
"os"
"path"
+ "reflect"
"testing"
+
+ "veyron.io/veyron/veyron2/security"
)
func TestLoadPersistentPrincipal(t *testing.T) {
@@ -116,3 +119,97 @@
}
return dir
}
+
+func TestPrincipalBlessingsByName(t *testing.T) {
+ var p1, p2, p3 security.Principal
+ var err error
+
+ if p1, err = NewPrincipal(); err != nil {
+ t.Fatal(err)
+ }
+ if p2, err = NewPrincipal(); err != nil {
+ t.Fatal(err)
+ }
+ alice, err := p1.BlessSelf("alice")
+ if err != nil {
+ t.Fatal(err)
+ }
+ p2.AddToRoots(alice)
+ var aliceworkfriend, alicegymfriend, aliceworkboss security.Blessings
+
+ if aliceworkfriend, err = p1.Bless(p2.PublicKey(), alice, "work/friend", security.UnconstrainedUse()); err != nil {
+ t.Errorf("Bless(work/friend) failed: %v", err)
+ }
+ p2.BlessingStore().Set(aliceworkfriend, "alice/work/friend")
+ if alicegymfriend, err = p1.Bless(p2.PublicKey(), alice, "gym/friend", security.UnconstrainedUse()); err != nil {
+ t.Errorf("Bless(gym/friend) failed: %v", err)
+ }
+ p2.BlessingStore().Set(alicegymfriend, "alice/gym/friend")
+ if aliceworkboss, err = p1.Bless(p2.PublicKey(), alice, "work/boss", security.UnconstrainedUse()); err != nil {
+ t.Errorf("Bless(work/friend) failed: %v", err)
+ }
+ p2.BlessingStore().Set(aliceworkboss, "alice/work/boss")
+
+ // Blessing from an untrusted principal that should never be returned
+ if p3, err = NewPrincipal(); err != nil {
+ t.Fatal(err)
+ }
+ fake, err := p3.BlessSelf("alice")
+ if err != nil {
+ t.Fatal(err)
+ }
+ fakefriend, err := p3.Bless(p2.PublicKey(), fake, "work/friend", security.UnconstrainedUse())
+ if err != nil {
+ t.Errorf("Bless(work/friend) failed: %v", err)
+ }
+ _, err = p2.BlessingStore().Set(fakefriend, "fake/work/friend")
+
+ tests := []struct {
+ matched []security.Blessings
+ pattern security.BlessingPattern
+ }{
+ {
+ matched: []security.Blessings{aliceworkfriend, aliceworkboss},
+ pattern: "alice/work/...",
+ },
+ {
+ matched: []security.Blessings{aliceworkfriend},
+ pattern: "alice/work/friend",
+ },
+ {
+ matched: []security.Blessings{alicegymfriend},
+ pattern: "alice/gym/friend",
+ },
+ {
+ matched: []security.Blessings{aliceworkfriend, alicegymfriend, aliceworkboss},
+ pattern: "alice/...",
+ },
+ {
+ matched: []security.Blessings{aliceworkfriend, alicegymfriend, aliceworkboss},
+ pattern: "...",
+ },
+ {
+ matched: nil,
+ pattern: "alice/school/...",
+ },
+ }
+
+ for _, test := range tests {
+ matched := p2.BlessingsByName(test.pattern)
+ if len(matched) != len(test.matched) {
+ t.Errorf("BlessingsByName(%s) did not return expected number of matches wanted:%d got:%d", test.pattern, len(test.matched), len(matched))
+ }
+ for _, m := range matched {
+ found := false
+ for _, tm := range test.matched {
+ if reflect.DeepEqual(m, tm) {
+ found = true
+ break
+ }
+ }
+ if !found {
+ t.Errorf("Invalid blessing was returned as a match:%v for pattern:%s", m, test.pattern)
+ }
+ }
+ }
+}
diff --git a/services/config/lib/config.go b/services/config/lib/config.go
index b6542b4..41669e1 100644
--- a/services/config/lib/config.go
+++ b/services/config/lib/config.go
@@ -17,7 +17,7 @@
"strings"
"sync"
- "veyron.io/veyron/veyron2/verror"
+ verror "veyron.io/veyron/veyron2/verror2"
"veyron.io/veyron/veyron2/vlog"
"github.com/presotto/go-mdns-sd"
@@ -42,6 +42,21 @@
gen int // incremented every config change
}
+const pkgPath = "veyron.io/veyron/veyron/services/config/lib"
+
+// Errors
+var (
+ errCantParse = verror.Register(pkgPath+".errCantParse", verror.NoRetry, "{1:}{2:} can't parse{:_}")
+ errEntryTooLong = verror.Register(pkgPath+".errEntryTooLong", verror.NoRetry, "{1:}{2:} entry {3}:{4} is too long{:_}")
+ errNoFileToRead = verror.Register(pkgPath+".errNoFileToRead", verror.NoRetry, "{1:}{2:} no file to read{:_}")
+ errFileError = verror.Register(pkgPath+".errFileError", verror.NoRetry, "{1:}{2:} file {3}{:_}")
+ errMissingLegalVersion = verror.Register(pkgPath+".errMissingLegalVersion", verror.NoRetry, "{1:}{2:} missing legal version for file{:_}")
+ errMissingConfigVersion = verror.Register(pkgPath+".errMissingConfigVersion", verror.NoRetry, "{1:}{2:} missing config version{:_}")
+ errNoConfig = verror.Register(pkgPath+".errNoConfig", verror.NoRetry, "{1:}{2:} no config{:_}")
+ errConfigHasNoKey = verror.Register(pkgPath+".errConfigHasNoKey", verror.NoRetry, "{1:}{2:} config has no key {3}{:_}")
+ errOfferingConfigError = verror.Register(pkgPath+".errOfferingConfigError", verror.NoRetry, "{1:}{2:} offering config {3}{:_}")
+)
+
// MDNSConfigService creates a new instance of the config service with the given name.
// If file is non blank, the initial config is read from file and any learned configs are
// stored in it. Only instances with a file to backup will offer configs to the net.
@@ -126,12 +141,12 @@
// The reset have to be key<white>*:<white>*value
f := strings.SplitN(l, ":", 2)
if len(f) != 2 {
- return verror.BadArgf("can't parse %s", l)
+ return verror.Make(errCantParse, nil, l)
}
k := strings.TrimSpace(f[0])
v := strings.TrimSpace(f[1])
if len(k)+len(v) > maxDNSStringLength {
- return verror.BadArgf("entry %s:%s is too long", k, v)
+ return verror.Make(errEntryTooLong, nil, k, v)
}
c.pairs[k] = v
if k != "version" {
@@ -144,14 +159,14 @@
func serializeEntry(k, v string) (string, error) {
if len(k)+len(v) > maxDNSStringLength {
- return "", verror.BadArgf("entry %s:%s is too long", k, v)
+ return "", verror.Make(errEntryTooLong, nil, k, v)
}
return k + ":" + v, nil
}
func readFile(file string) (*config, error) {
if len(file) == 0 {
- return nil, verror.NoExistf("no file to read")
+ return nil, verror.Make(errNoFileToRead, nil)
}
// The config has to be small so just read it all in one go.
@@ -162,11 +177,11 @@
c := newConfig()
for _, l := range strings.Split(string(b), "\n") {
if err := c.parseEntry(l); err != nil {
- return nil, verror.BadArgf("file %s: %s", file, err)
+ return nil, verror.Make(errFileError, nil, file, err)
}
}
if _, ok := c.pairs["version"]; !ok {
- return nil, verror.BadArgf("file %s: missing legal version", file)
+ return nil, verror.Make(errMissingLegalVersion, nil, file)
}
return c, nil
}
@@ -200,7 +215,7 @@
}
// Ignore any config with no version.
if _, ok := c.pairs["version"]; !ok {
- return nil, verror.NoExistf("missing config version")
+ return nil, verror.Make(errMissingConfigVersion, nil)
}
return c, nil
}
@@ -310,10 +325,10 @@
cs.rwlock.RLock()
defer cs.rwlock.RUnlock()
if cs.current == nil {
- return "", verror.NoExistf("no config")
+ return "", verror.Make(errNoConfig, nil)
}
if v, ok := cs.current.pairs[key]; !ok {
- return "", verror.NoExistf("config has no key %q", key)
+ return "", verror.Make(errConfigHasNoKey, nil, key)
} else {
return v, nil
}
@@ -331,7 +346,7 @@
cs.rwlock.RLock()
defer cs.rwlock.RUnlock()
if cs.current == nil {
- return nil, verror.NoExistf("no config found")
+ return nil, verror.Make(errNoConfig, nil)
}
// Copy so caller can't change the map under our feet.
reply := make(map[string]string)
@@ -366,7 +381,7 @@
for _, k := range keys {
e, err := serializeEntry(k, cs.current.pairs[k])
if err != nil {
- verror.NoExistf("offering config: %s", cs.file, err)
+ verror.Make(errOfferingConfigError, nil, cs.file, err)
return
}
txt = append(txt, e)
diff --git a/services/identity/blesser/oauth.go b/services/identity/blesser/oauth.go
index c50ed3a..ef9084a 100644
--- a/services/identity/blesser/oauth.go
+++ b/services/identity/blesser/oauth.go
@@ -20,7 +20,7 @@
duration time.Duration
domain string
dischargerLocation string
- revocationManager *revocation.RevocationManager
+ revocationManager revocation.RevocationManager
}
// AccessTokenClient represents a client of the BlessUsingAccessToken RPCs.
@@ -40,7 +40,7 @@
// The object name of the discharger service. If this is empty then revocation caveats will not be granted.
DischargerLocation string
// The revocation manager that generates caveats and manages revocation.
- RevocationManager *revocation.RevocationManager
+ RevocationManager revocation.RevocationManager
// The duration for which blessings will be valid. (Used iff RevocationManager is nil).
BlessingDuration time.Duration
}
diff --git a/services/identity/handlers/blessing_root.go b/services/identity/handlers/blessing_root.go
new file mode 100644
index 0000000..a0c2f7b
--- /dev/null
+++ b/services/identity/handlers/blessing_root.go
@@ -0,0 +1,72 @@
+package handlers
+
+import (
+ "encoding/base64"
+ "encoding/json"
+ "fmt"
+ "net/http"
+
+ "veyron.io/veyron/veyron/services/identity/util"
+ "veyron.io/veyron/veyron2/security"
+)
+
+// BlessingRoot is an http.Handler implementation that renders the server's
+// blessing names and public key in a json string.
+type BlessingRoot struct {
+ P security.Principal
+}
+
+type BlessingRootResponse struct {
+ // Names of the blessings.
+ Names []string `json:"names"`
+ // Base64 der-encoded public key.
+ PublicKey string `json:"publicKey"`
+}
+
+// Cached response so we don't have to bless and encode every time somebody
+// hits this route.
+var cachedResponseJson []byte
+
+func (b BlessingRoot) ServeHTTP(w http.ResponseWriter, r *http.Request) {
+ if cachedResponseJson != nil {
+ respondJson(w, cachedResponseJson)
+ return
+ }
+
+ // Get the blessing names of the local principal.
+ // TODO(nlacasse,ataly,gauthamt): Make this easier to do. For now we
+ // have to bless a context with the same LocalPrincipal as ours.
+ ctx := security.NewContext(&security.ContextParams{
+ LocalPrincipal: b.P,
+ })
+ names := b.P.BlessingStore().Default().ForContext(ctx)
+
+ if len(names) == 0 {
+ util.HTTPServerError(w, fmt.Errorf("Could not get blessing name."))
+ return
+ }
+
+ der, err := b.P.PublicKey().MarshalBinary()
+ if err != nil {
+ util.HTTPServerError(w, err)
+ return
+ }
+ str := base64.URLEncoding.EncodeToString(der)
+
+ res, err := json.Marshal(BlessingRootResponse{
+ Names: names,
+ PublicKey: str,
+ })
+ if err != nil {
+ util.HTTPServerError(w, err)
+ return
+ }
+
+ cachedResponseJson = res
+ respondJson(w, res)
+}
+
+func respondJson(w http.ResponseWriter, res []byte) {
+ w.Header().Set("Content-Type", "application/json")
+ w.Write(res)
+}
diff --git a/services/identity/handlers/handlers_test.go b/services/identity/handlers/handlers_test.go
index 09d2ec8..9723a4f 100644
--- a/services/identity/handlers/handlers_test.go
+++ b/services/identity/handlers/handlers_test.go
@@ -1,38 +1,52 @@
package handlers
import (
- "io/ioutil"
+ "encoding/base64"
+ "encoding/json"
"net/http"
"net/http/httptest"
"reflect"
+ "sort"
"testing"
"veyron.io/veyron/veyron2/security"
- vsecurity "veyron.io/veyron/veyron/security"
+ tsecurity "veyron.io/veyron/veyron/lib/testutil/security"
)
-func TestPublicKey(t *testing.T) {
- p, err := vsecurity.NewPrincipal()
- if err != nil {
- t.Fatal(err)
- }
- key := p.PublicKey()
- ts := httptest.NewServer(PublicKey{key})
+func TestBlessingRoot(t *testing.T) {
+ blessingNames := []string{"test-blessing-name-1", "test-blessing-name-2"}
+ p := tsecurity.NewPrincipal(blessingNames...)
+
+ ts := httptest.NewServer(BlessingRoot{p})
defer ts.Close()
response, err := http.Get(ts.URL)
if err != nil {
t.Fatal(err)
}
- bytes, err := ioutil.ReadAll(response.Body)
+ dec := json.NewDecoder(response.Body)
+ var res BlessingRootResponse
+ if err := dec.Decode(&res); err != nil {
+ t.Fatal(err)
+ }
+
+ // Check that the names are correct.
+ sort.Strings(blessingNames)
+ sort.Strings(res.Names)
+ if !reflect.DeepEqual(res.Names, blessingNames) {
+ t.Errorf("Response has incorrect name. Got %v, want %v", res.Names, blessingNames)
+ }
+
+ // Check that the public key is correct.
+ gotMarshalled, err := base64.URLEncoding.DecodeString(res.PublicKey)
if err != nil {
t.Fatal(err)
}
- got, err := security.UnmarshalPublicKey(bytes)
+ got, err := security.UnmarshalPublicKey(gotMarshalled)
if err != nil {
t.Fatal(err)
}
- if want := key; !reflect.DeepEqual(got, want) {
- t.Errorf("Got %v, want %v", got, want)
+ if want := p.PublicKey(); !reflect.DeepEqual(got, want) {
+ t.Errorf("Response has incorrect public key. Got %v, want %v", got, want)
}
}
diff --git a/services/identity/handlers/publickey.go b/services/identity/handlers/publickey.go
deleted file mode 100644
index 7ab8c96..0000000
--- a/services/identity/handlers/publickey.go
+++ /dev/null
@@ -1,23 +0,0 @@
-package handlers
-
-import (
- "net/http"
-
- "veyron.io/veyron/veyron/services/identity/util"
- "veyron.io/veyron/veyron2/security"
-)
-
-// PublicKey is an http.Handler implementation that renders a public key in
-// DER format.
-type PublicKey struct{ K security.PublicKey }
-
-func (h PublicKey) ServeHTTP(w http.ResponseWriter, r *http.Request) {
- der, err := h.K.MarshalBinary()
- if err != nil {
- util.HTTPServerError(w, err)
- return
- }
- w.Header().Set("Content-Type", "application/octet-stream")
- w.Header().Set("Content-Disposition", "attachment; filename=publickey.der")
- w.Write(der)
-}
diff --git a/services/identity/identity.vdl b/services/identity/identity.vdl
index ada48b2..0d35fdf 100644
--- a/services/identity/identity.vdl
+++ b/services/identity/identity.vdl
@@ -19,12 +19,12 @@
type OAuthBlesser interface {
// BlessUsingAccessToken uses the provided access token to obtain the email
// address and returns a blessing along with the email address.
- BlessUsingAccessToken(token string) (blessing security.WireBlessings, email string, err error)
+ BlessUsingAccessToken(token string) (blessing security.WireBlessings, email string | error)
}
// MacaroonBlesser returns a blessing given the provided macaroon string.
type MacaroonBlesser interface {
// Bless uses the provided macaroon (which contains email and caveats)
// to return a blessing for the client.
- Bless(macaroon string) (blessing security.WireBlessings, err error)
+ Bless(macaroon string) (blessing security.WireBlessings | error)
}
diff --git a/services/identity/identityd/main.go b/services/identity/identityd/main.go
index dec6d22..c1c9655 100644
--- a/services/identity/identityd/main.go
+++ b/services/identity/identityd/main.go
@@ -2,47 +2,26 @@
package main
import (
- "crypto/rand"
"database/sql"
"flag"
"fmt"
- _ "github.com/go-sql-driver/mysql"
- "html/template"
"io/ioutil"
- "net"
- "net/http"
"os"
"strings"
"time"
- "veyron.io/veyron/veyron2"
- "veyron.io/veyron/veyron2/ipc"
- "veyron.io/veyron/veyron2/naming"
- "veyron.io/veyron/veyron2/options"
- "veyron.io/veyron/veyron2/rt"
- "veyron.io/veyron/veyron2/security"
- verror "veyron.io/veyron/veyron2/verror2"
+ _ "github.com/go-sql-driver/mysql"
+
"veyron.io/veyron/veyron2/vlog"
- "veyron.io/veyron/veyron/lib/signals"
- "veyron.io/veyron/veyron/security/audit"
"veyron.io/veyron/veyron/services/identity/auditor"
"veyron.io/veyron/veyron/services/identity/blesser"
- "veyron.io/veyron/veyron/services/identity/googleoauth"
- "veyron.io/veyron/veyron/services/identity/handlers"
+ "veyron.io/veyron/veyron/services/identity/oauth"
"veyron.io/veyron/veyron/services/identity/revocation"
- services "veyron.io/veyron/veyron/services/security"
- "veyron.io/veyron/veyron/services/security/discharger"
-
- "veyron.io/veyron/veyron/profiles/static"
+ "veyron.io/veyron/veyron/services/identity/server"
)
var (
- // Flags controlling the HTTP server
- httpaddr = flag.String("httpaddr", "localhost:8125", "Address on which the HTTP server listens on.")
- tlsconfig = flag.String("tlsconfig", "", "Comma-separated list of TLS certificate and private key files. This must be provided.")
- host = flag.String("host", defaultHost(), "Hostname the HTTP server listens on. This can be the name of the host running the webserver, but if running behind a NAT or load balancer, this should be the host name that clients will connect to. For example, if set to 'x.com', Veyron identities will have the IssuerName set to 'x.com' and clients can expect to find the public key of the signer at 'x.com/pubkey/'.")
-
// Flag controlling auditing and revocation of Blessing operations.
sqlConfig = flag.String("sqlconfig", "", "Path to file containing go-sql-driver connection string of the following form: [username[:password]@][protocol[(address)]]/dbname")
@@ -53,12 +32,6 @@
googleDomain = flag.String("google_domain", "", "An optional domain name. When set, only email addresses from this domain are allowed to authenticate via Google OAuth")
)
-const (
- googleService = "google"
- macaroonService = "macaroon"
- dischargerService = "discharger"
-)
-
func main() {
flag.Usage = usage
flag.Parse()
@@ -76,200 +49,22 @@
}
}
- p, blessingLogReader := providerPrincipal(sqlDB)
- runtime, err := rt.New(options.RuntimePrincipal{p})
+ googleoauth, err := oauth.NewGoogleOAuth(*googleConfigWeb)
if err != nil {
- vlog.Fatal(err)
- }
- defer runtime.Cleanup()
-
- var revocationManager *revocation.RevocationManager
- // Only set revocationManager sqlConfig (and thus sqlDB) is set.
- if sqlDB != nil {
- revocationManager, err = revocation.NewRevocationManager(sqlDB)
- if err != nil {
- vlog.Fatalf("Failed to start RevocationManager: %v", err)
- }
+ vlog.Fatalf("Failed to setup GoogleOAuth: %v", err)
}
- // Setup handlers
- http.Handle("/pubkey/", handlers.PublicKey{runtime.Principal().PublicKey()}) // public key of this server
- macaroonKey := make([]byte, 32)
- if _, err := rand.Read(macaroonKey); err != nil {
- vlog.Fatalf("macaroonKey generation failed: %v", err)
- }
- // Google OAuth
- ipcServer, published, err := setupServices(runtime, revocationManager, macaroonKey)
+ auditor, reader, err := auditor.NewSQLBlessingAuditor(sqlDB)
if err != nil {
- vlog.Fatalf("Failed to setup veyron services for blessing: %v", err)
+ vlog.Fatalf("Failed to create sql auditor from config: %v", err)
}
- defer ipcServer.Stop()
- if clientID, clientSecret, ok := getOAuthClientIDAndSecret(*googleConfigWeb); ok {
- n := "/google/"
- h, err := googleoauth.NewHandler(googleoauth.HandlerArgs{
- R: runtime,
- MacaroonKey: macaroonKey,
- Addr: fmt.Sprintf("%s%s", httpaddress(), n),
- ClientID: clientID,
- ClientSecret: clientSecret,
- BlessingLogReader: blessingLogReader,
- RevocationManager: revocationManager,
- DischargerLocation: naming.JoinAddressName(published[0], dischargerService),
- MacaroonBlessingService: naming.JoinAddressName(published[0], macaroonService),
- })
- if err != nil {
- vlog.Fatalf("Failed to create HTTP handler for google-based authentication: %v", err)
- }
- http.Handle(n, h)
- }
- http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
- args := struct {
- Self security.Blessings
- RandomWeb bool
- GoogleServers, DischargeServers []string
- ListBlessingsRoute string
- }{
- Self: runtime.Principal().BlessingStore().Default(),
- RandomWeb: enableRandomHandler(),
- }
- if revocationManager != nil {
- args.DischargeServers = appendSuffixTo(published, dischargerService)
- }
- if len(*googleConfigChrome) > 0 || len(*googleConfigAndroid) > 0 {
- args.GoogleServers = appendSuffixTo(published, googleService)
- }
- if sqlDB != nil && len(*googleConfigWeb) > 0 {
- args.ListBlessingsRoute = googleoauth.ListBlessingsRoute
- }
- if err := tmpl.Execute(w, args); err != nil {
- vlog.Info("Failed to render template:", err)
- }
- })
- vlog.Infof("Running HTTP server at: %v", httpaddress())
- go runHTTPSServer(*httpaddr)
- <-signals.ShutdownOnSignals(runtime)
-}
-func appendSuffixTo(objectname []string, suffix string) []string {
- names := make([]string, len(objectname))
- for i, o := range objectname {
- names[i] = naming.JoinAddressName(o, suffix)
- }
- return names
-}
-
-// newDispatcher returns a dispatcher for both the blessing and the
-// discharging service.
-func newDispatcher(googleParams blesser.GoogleParams, macaroonKey []byte) ipc.Dispatcher {
- d := dispatcher(map[string]interface{}{
- macaroonService: blesser.NewMacaroonBlesserServer(macaroonKey),
- dischargerService: services.DischargerServer(discharger.NewDischarger()),
- })
- if len(*googleConfigChrome) > 0 || len(*googleConfigAndroid) > 0 {
- d[googleService] = blesser.NewGoogleOAuthBlesserServer(googleParams)
- }
- return d
-}
-
-type allowEveryoneAuthorizer struct{}
-
-func (allowEveryoneAuthorizer) Authorize(security.Context) error { return nil }
-
-type dispatcher map[string]interface{}
-
-func (d dispatcher) Lookup(suffix string) (interface{}, security.Authorizer, error) {
- if invoker := d[suffix]; invoker != nil {
- return invoker, allowEveryoneAuthorizer{}, nil
- }
- return nil, nil, verror.Make(verror.NoExist, nil, suffix)
-}
-
-// Starts the blessing services and the discharging service on the same port.
-func setupServices(r veyron2.Runtime, revocationManager *revocation.RevocationManager, macaroonKey []byte) (ipc.Server, []string, error) {
- googleParams := blesser.GoogleParams{
- // TODO(ashankar,nlacasse): Figure out how to have web-appications use the "caveats" form and
- // always select an expiry instead of forcing a ridiculously large value here.
- BlessingDuration: 365 * 24 * time.Hour,
- DomainRestriction: *googleDomain,
- RevocationManager: revocationManager,
- }
- if clientID, ok := getOAuthClientID(*googleConfigChrome); ok {
- googleParams.AccessTokenClients = append(googleParams.AccessTokenClients, blesser.AccessTokenClient{Name: "chrome", ClientID: clientID})
- }
- if clientID, ok := getOAuthClientID(*googleConfigAndroid); ok {
- googleParams.AccessTokenClients = append(googleParams.AccessTokenClients, blesser.AccessTokenClient{Name: "android", ClientID: clientID})
- }
- server, err := r.NewServer()
+ revocationManager, err := revocation.NewRevocationManager(sqlDB)
if err != nil {
- return nil, nil, fmt.Errorf("failed to create new ipc.Server: %v", err)
+ vlog.Fatalf("Failed to start RevocationManager: %v", err)
}
- ep, err := server.Listen(static.ListenSpec)
- if err != nil {
- return nil, nil, fmt.Errorf("server.Listen(%v) failed: %v", static.ListenSpec, err)
- }
- googleParams.DischargerLocation = naming.JoinAddressName(ep.String(), dischargerService)
- dispatcher := newDispatcher(googleParams, macaroonKey)
- objectname := naming.Join("identity", fmt.Sprintf("%v", r.Principal().BlessingStore().Default()))
- if err := server.ServeDispatcher(objectname, dispatcher); err != nil {
- return nil, nil, fmt.Errorf("failed to start Veyron services: %v", err)
- }
- vlog.Infof("Google blessing and discharger services enabled at %v", naming.JoinAddressName(ep.String(), objectname))
- published, _ := server.Published()
- if len(published) == 0 {
- // No addresses published, publish the endpoint instead (which may not be usable everywhere, but oh-well).
- published = append(published, ep.String())
- }
- return server, published, nil
-}
-
-func enableRandomHandler() bool {
- return len(*googleConfigWeb)+len(*googleConfigChrome)+len(*googleConfigAndroid) == 0
-}
-func getOAuthClientID(config string) (clientID string, ok bool) {
- fname := config
- if len(fname) == 0 {
- return "", false
- }
- f, err := os.Open(fname)
- if err != nil {
- vlog.Fatalf("Failed to open %q: %v", fname, err)
- }
- defer f.Close()
- clientID, err = googleoauth.ClientIDFromJSON(f)
- if err != nil {
- vlog.Fatalf("Failed to decode JSON in %q: %v", fname, err)
- }
- return clientID, true
-}
-func getOAuthClientIDAndSecret(config string) (clientID, clientSecret string, ok bool) {
- fname := config
- if len(fname) == 0 {
- return "", "", false
- }
- f, err := os.Open(fname)
- if err != nil {
- vlog.Fatalf("Failed to open %q: %v", fname, err)
- }
- defer f.Close()
- clientID, clientSecret, err = googleoauth.ClientIDAndSecretFromJSON(f)
- if err != nil {
- vlog.Fatalf("Failed to decode JSON in %q: %v", fname, err)
- }
- return clientID, clientSecret, true
-}
-func runHTTPSServer(addr string) {
- if len(*tlsconfig) == 0 {
- vlog.Fatal("Please set the --tlsconfig flag")
- }
- paths := strings.Split(*tlsconfig, ",")
- if len(paths) != 2 {
- vlog.Fatalf("Could not parse --tlsconfig. Must have exactly two components, separated by a comma")
- }
- vlog.Infof("Starting HTTP server with TLS using certificate [%s] and private key [%s] at https://%s", paths[0], paths[1], addr)
- if err := http.ListenAndServeTLS(addr, paths[0], paths[1], nil); err != nil {
- vlog.Fatalf("http.ListenAndServeTLS failed: %v", err)
- }
+ server.NewIdentityServer(googleoauth, auditor, reader, revocationManager, oauthBlesserGoogleParams(revocationManager)).Serve()
}
func usage() {
@@ -290,32 +85,23 @@
flag.PrintDefaults()
}
-func defaultHost() string {
- host, err := os.Hostname()
- if err != nil {
- vlog.Fatalf("Failed to get hostname: %v", err)
+func oauthBlesserGoogleParams(revocationManager revocation.RevocationManager) blesser.GoogleParams {
+ googleParams := blesser.GoogleParams{
+ BlessingDuration: 365 * 24 * time.Hour,
+ DomainRestriction: *googleDomain,
+ RevocationManager: revocationManager,
}
- return host
-}
-
-// providerPrincipal returns the Principal to use for the identity provider (i.e., this program) and
-// the database where audits will be store. If no database exists nil will be returned.
-func providerPrincipal(sqlDB *sql.DB) (security.Principal, auditor.BlessingLogReader) {
- // TODO(ashankar): Somewhat silly to have to create a runtime, but oh-well.
- r, err := rt.New()
- if err != nil {
- vlog.Fatal(err)
+ if clientID, err := getOAuthClientID(*googleConfigChrome); err != nil {
+ vlog.Info(err)
+ } else {
+ googleParams.AccessTokenClients = append(googleParams.AccessTokenClients, blesser.AccessTokenClient{Name: "chrome", ClientID: clientID})
}
- defer r.Cleanup()
- p := r.Principal()
- if sqlDB == nil {
- return p, nil
+ if clientID, err := getOAuthClientID(*googleConfigAndroid); err != nil {
+ vlog.Info(err)
+ } else {
+ googleParams.AccessTokenClients = append(googleParams.AccessTokenClients, blesser.AccessTokenClient{Name: "android", ClientID: clientID})
}
- auditor, reader, err := auditor.NewSQLBlessingAuditor(sqlDB)
- if err != nil {
- vlog.Fatalf("Failed to create sql auditor from config: %v", err)
- }
- return audit.NewPrincipal(p, auditor), reader
+ return googleParams
}
func dbFromConfigDatabase(database string) (*sql.DB, error) {
@@ -329,47 +115,15 @@
return db, nil
}
-func httpaddress() string {
- _, port, err := net.SplitHostPort(*httpaddr)
+func getOAuthClientID(configFile string) (clientID string, err error) {
+ f, err := os.Open(configFile)
if err != nil {
- vlog.Fatalf("Failed to parse %q: %v", *httpaddr, err)
+ return "", fmt.Errorf("failed to open %q: %v", configFile, err)
}
- return fmt.Sprintf("https://%s:%v", *host, port)
+ defer f.Close()
+ clientID, err = oauth.ClientIDFromJSON(f)
+ if err != nil {
+ return "", fmt.Errorf("failed to decode JSON in %q: %v", configFile, err)
+ }
+ return clientID, nil
}
-
-var tmpl = template.Must(template.New("main").Parse(`<!doctype html>
-<html>
-<head>
-<meta charset="UTF-8">
-<title>Veyron Identity Server</title>
-<meta name="viewport" content="width=device-width, initial-scale=1.0">
-<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
-</head>
-<body>
-<div class="container">
-<div class="page-header"><h2>{{.Self}}</h2><h4>A Veyron Blessing Provider</h4></div>
-<div class="well">
-This is a Veyron identity provider that provides blessings with the name prefix <mark>{{.Self}}</mark>.
-<br/>
-The public key of this provider is {{.Self.PublicKey}}, which is available in <a class="btn btn-xs btn-primary" href="/pubkey/">DER</a> encoded
-<a href="http://en.wikipedia.org/wiki/X.690#DER_encoding">format</a>.
-</div>
-
-<div class="well">
-<ul>
-{{if .GoogleServers}}
-<li>Blessings (using Google OAuth to fetch an email address) are provided via Veyron RPCs to: <tt>{{range .GoogleServers}}{{.}}{{end}}</tt></li>
-{{end}}
-{{if .DischargeServers}}
-<li>RevocationCaveat Discharges are provided via Veyron RPCs to: <tt>{{range .DischargeServers}}{{.}}{{end}}</tt></li>
-{{end}}
-{{if .ListBlessingsRoute}}
-<li>You can <a class="btn btn-xs btn-primary" href="/google/{{.ListBlessingsRoute}}">enumerate</a> blessings provided with your
-email address.</li>
-{{end}}
-</ul>
-</div>
-
-</div>
-</body>
-</html>`))
diff --git a/services/identity/oauth/googleoauth.go b/services/identity/oauth/googleoauth.go
new file mode 100644
index 0000000..17d6b72
--- /dev/null
+++ b/services/identity/oauth/googleoauth.go
@@ -0,0 +1,131 @@
+package oauth
+
+import (
+ "code.google.com/p/goauth2/oauth"
+ "encoding/json"
+ "fmt"
+ "net/http"
+ "os"
+)
+
+// googleOAuth implements the OAuthProvider interface with google oauth 2.0.
+type googleOAuth struct {
+ // client_id and client_secret registered with the Google Developer
+ // Console for API access.
+ clientID, clientSecret string
+
+ scope, authURL, tokenURL string
+
+ // URL used to verify google tokens.
+ // (From https://developers.google.com/accounts/docs/OAuth2Login#validatinganidtoken
+ // and https://developers.google.com/accounts/docs/OAuth2UserAgent#validatetoken)
+ verifyURL string
+}
+
+func NewGoogleOAuth(configFile string) (OAuthProvider, error) {
+ clientID, clientSecret, err := getOAuthClientIDAndSecret(configFile)
+ if err != nil {
+ return nil, err
+ }
+ return &googleOAuth{
+ clientID: clientID,
+ clientSecret: clientSecret,
+ scope: "email",
+ authURL: "https://accounts.google.com/o/oauth2/auth",
+ tokenURL: "https://accounts.google.com/o/oauth2/token",
+ verifyURL: "https://www.googleapis.com/oauth2/v1/tokeninfo?",
+ }, nil
+}
+
+func (g *googleOAuth) AuthURL(redirectUrl, state string) string {
+ return g.oauthConfig(redirectUrl).AuthCodeURL(state)
+}
+
+// ExchangeAuthCodeForEmail exchanges the authorization code (which must
+// have been obtained with scope=email) for an OAuth token and then uses Google's
+// tokeninfo API to extract the email address from that token.
+func (g *googleOAuth) ExchangeAuthCodeForEmail(authcode string, url string) (string, error) {
+ config := g.oauthConfig(url)
+ t, err := (&oauth.Transport{Config: config}).Exchange(authcode)
+ if err != nil {
+ return "", fmt.Errorf("failed to exchange authorization code for token: %v", err)
+ }
+ // Ideally, would validate the token ourselves without an HTTP roundtrip.
+ // However, for now, as per:
+ // https://developers.google.com/accounts/docs/OAuth2Login#validatinganidtoken
+ // pay an HTTP round-trip to have Google do this.
+ if t.Extra == nil || len(t.Extra["id_token"]) == 0 {
+ return "", fmt.Errorf("no GoogleIDToken found in OAuth token")
+ }
+ // The GoogleIDToken is currently validated by sending an HTTP request to
+ // googleapis.com. This adds a round-trip and service may be denied by
+ // googleapis.com if this handler becomes a breakout success and receives tons
+ // of traffic. If either is a concern, the GoogleIDToken can be validated
+ // without an additional HTTP request.
+ // See: https://developers.google.com/accounts/docs/OAuth2Login#validatinganidtoken
+ tinfo, err := http.Get(g.verifyURL + "id_token=" + t.Extra["id_token"])
+ if err != nil {
+ return "", fmt.Errorf("failed to talk to GoogleIDToken verifier (%q): %v", g.verifyURL, err)
+ }
+ if tinfo.StatusCode != http.StatusOK {
+ return "", fmt.Errorf("failed to verify GoogleIDToken: %s", tinfo.Status)
+ }
+ var gtoken token
+ if err := json.NewDecoder(tinfo.Body).Decode(>oken); err != nil {
+ return "", fmt.Errorf("invalid JSON response from Google's tokeninfo API: %v", err)
+ }
+ if !gtoken.VerifiedEmail {
+ return "", fmt.Errorf("email not verified: %#v", gtoken)
+ }
+ if gtoken.Issuer != "accounts.google.com" {
+ return "", fmt.Errorf("invalid issuer: %v", gtoken.Issuer)
+ }
+ if gtoken.Audience != config.ClientId {
+ return "", fmt.Errorf("unexpected audience(%v) in GoogleIDToken", gtoken.Audience)
+ }
+ return gtoken.Email, nil
+}
+
+func (g *googleOAuth) oauthConfig(redirectUrl string) *oauth.Config {
+ return &oauth.Config{
+ ClientId: g.clientID,
+ ClientSecret: g.clientSecret,
+ RedirectURL: redirectUrl,
+ Scope: g.scope,
+ AuthURL: g.authURL,
+ TokenURL: g.tokenURL,
+ }
+}
+
+func getOAuthClientIDAndSecret(configFile string) (clientID, clientSecret string, err error) {
+ f, err := os.Open(configFile)
+ if err != nil {
+ return "", "", fmt.Errorf("failed to open %q: %v", configFile, err)
+ }
+ defer f.Close()
+ clientID, clientSecret, err = ClientIDAndSecretFromJSON(f)
+ if err != nil {
+ return "", "", fmt.Errorf("failed to decode JSON in %q: %v", configFile, err)
+ }
+ return clientID, clientSecret, nil
+}
+
+// IDToken JSON message returned by Google's verification endpoint.
+//
+// This differs from the description in:
+// https://developers.google.com/accounts/docs/OAuth2Login#obtainuserinfo
+// because the Google tokeninfo endpoint
+// (https://www.googleapis.com/oauth2/v1/tokeninfo?id_token=XYZ123)
+// mentioned in:
+// https://developers.google.com/accounts/docs/OAuth2Login#validatinganidtoken
+// seems to return the following JSON message.
+type token struct {
+ Issuer string `json:"issuer"`
+ IssuedTo string `json:"issued_to"`
+ Audience string `json:"audience"`
+ UserID string `json:"user_id"`
+ ExpiresIn int64 `json:"expires_in"`
+ IssuedAt int64 `json:"issued_at"`
+ Email string `json:"email"`
+ VerifiedEmail bool `json:"verified_email"`
+}
diff --git a/services/identity/googleoauth/handler.go b/services/identity/oauth/handler.go
similarity index 75%
rename from services/identity/googleoauth/handler.go
rename to services/identity/oauth/handler.go
index 9f40f0e..b85e16d 100644
--- a/services/identity/googleoauth/handler.go
+++ b/services/identity/oauth/handler.go
@@ -1,7 +1,7 @@
-// Package googleoauth implements an http.Handler that has two main purposes
+// Package oauth implements an http.Handler that has two main purposes
// listed below:
//
-// (1) Uses OAuth 2.0 to authenticate with Google and then renders a page that
+// (1) Uses OAuth to authenticate and then renders a page that
// displays all the blessings that were provided for that Google user.
// The client calls the /listblessings route which redirects to listblessingscallback which
// renders the list.
@@ -9,20 +9,14 @@
// located at veyron/tools/principal.
// The seek blessing flow works as follows:
// (a) Client (principal tool) hits the /seekblessings route.
-// (b) /seekblessings performs google oauth with a redirect to /seekblessingscallback.
+// (b) /seekblessings performs oauth with a redirect to /seekblessingscallback.
// (c) Client specifies desired caveats in the form that /seekblessingscallback displays.
// (d) Submission of the form sends caveat information to /sendmacaroon.
// (e) /sendmacaroon sends a macaroon with blessing information to client
// (via a redirect to an HTTP server run by the tool).
// (f) Client invokes bless rpc with macaroon.
-//
-// The GoogleIDToken is currently validated by sending an HTTP request to
-// googleapis.com. This adds a round-trip and service may be denied by
-// googleapis.com if this handler becomes a breakout success and receives tons
-// of traffic. If either is a concern, the GoogleIDToken can be validated
-// without an additional HTTP request.
-// See: https://developers.google.com/accounts/docs/OAuth2Login#validatinganidtoken
-package googleoauth
+
+package oauth
import (
"bytes"
@@ -37,8 +31,6 @@
"strings"
"time"
- "code.google.com/p/goauth2/oauth"
-
"veyron.io/veyron/veyron/services/identity/auditor"
"veyron.io/veyron/veyron/services/identity/blesser"
"veyron.io/veyron/veyron/services/identity/revocation"
@@ -68,18 +60,13 @@
MacaroonKey []byte
// URL at which the hander is installed.
// e.g. http://host:port/google/
- // This is where the handler is installed and where redirect requests
- // from Google will come to.
Addr string
- // client_id and client_secret registered with the Google Developer
- // Console for API access.
- ClientID, ClientSecret string
// BlessingLogReder is needed for reading audit logs.
BlessingLogReader auditor.BlessingLogReader
// The RevocationManager is used to revoke blessings granted with a revocation caveat.
// If nil, then revocation caveats cannot be added to blessings and an expiration caveat
// will be used instead.
- RevocationManager *revocation.RevocationManager
+ RevocationManager revocation.RevocationManager
// The object name of the discharger service.
DischargerLocation string
// MacaroonBlessingService is the object name to which macaroons create by this HTTP
@@ -87,17 +74,8 @@
MacaroonBlessingService string
// If non-empty, only email addressses from this domain will be blessed.
DomainRestriction string
-}
-
-func (a *HandlerArgs) oauthConfig(redirectSuffix string) *oauth.Config {
- return &oauth.Config{
- ClientId: a.ClientID,
- ClientSecret: a.ClientSecret,
- RedirectURL: redirectURL(a.Addr, redirectSuffix),
- Scope: "email",
- AuthURL: "https://accounts.google.com/o/oauth2/auth",
- TokenURL: "https://accounts.google.com/o/oauth2/token",
- }
+ // OAuthProvider is used to authenticate and get a blessee email.
+ OAuthProvider OAuthProvider
}
func redirectURL(baseURL, suffix string) string {
@@ -107,14 +85,9 @@
return baseURL + suffix
}
-// URL used to verify google tokens.
-// (From https://developers.google.com/accounts/docs/OAuth2Login#validatinganidtoken
-// and https://developers.google.com/accounts/docs/OAuth2UserAgent#validatetoken)
-const verifyURL = "https://www.googleapis.com/oauth2/v1/tokeninfo?"
-
// NewHandler returns an http.Handler that expects to be rooted at args.Addr
-// and can be used to use OAuth 2.0 to authenticate with Google, mint a new
-// identity and bless it with the Google email address.
+// and can be used to authenticate with args.OAuthProvider, mint a new
+// identity and bless it with the OAuthProvider email address.
func NewHandler(args HandlerArgs) (http.Handler, error) {
csrfCop, err := util.NewCSRFCop()
if err != nil {
@@ -157,7 +130,7 @@
util.HTTPServerError(w, fmt.Errorf("failed to create new token: %v", err))
return
}
- http.Redirect(w, r, h.args.oauthConfig(listBlessingsCallbackRoute).AuthCodeURL(csrf), http.StatusFound)
+ http.Redirect(w, r, h.args.OAuthProvider.AuthURL(redirectURL(h.args.Addr, listBlessingsCallbackRoute), csrf), http.StatusFound)
}
func (h *handler) listBlessingsCallback(w http.ResponseWriter, r *http.Request) {
@@ -166,7 +139,7 @@
util.HTTPBadRequest(w, r, fmt.Errorf("Suspected request forgery: %v", err))
return
}
- email, err := exchangeAuthCodeForEmail(h.args.oauthConfig(listBlessingsCallbackRoute), r.FormValue("code"))
+ email, err := h.args.OAuthProvider.ExchangeAuthCodeForEmail(r.FormValue("code"), redirectURL(h.args.Addr, listBlessingsCallbackRoute))
if err != nil {
util.HTTPBadRequest(w, r, err)
return
@@ -320,7 +293,7 @@
util.HTTPServerError(w, fmt.Errorf("failed to create new token: %v", err))
return
}
- http.Redirect(w, r, h.args.oauthConfig(addCaveatsRoute).AuthCodeURL(outputMacaroon), http.StatusFound)
+ http.Redirect(w, r, h.args.OAuthProvider.AuthURL(redirectURL(h.args.Addr, addCaveatsRoute), outputMacaroon), http.StatusFound)
}
type addCaveatsMacaroon struct {
@@ -335,7 +308,7 @@
util.HTTPBadRequest(w, r, fmt.Errorf("Suspected request forgery: %v", err))
return
}
- email, err := exchangeAuthCodeForEmail(h.args.oauthConfig(addCaveatsRoute), r.FormValue("code"))
+ email, err := h.args.OAuthProvider.ExchangeAuthCodeForEmail(r.FormValue("code"), redirectURL(h.args.Addr, addCaveatsRoute))
if err != nil {
util.HTTPBadRequest(w, r, err)
return
@@ -481,61 +454,3 @@
}
return security.MethodCaveat(methods[0], methods[1:]...)
}
-
-// exchangeAuthCodeForEmail exchanges the authorization code (which must
-// have been obtained with scope=email) for an OAuth token and then uses Google's
-// tokeninfo API to extract the email address from that token.
-func exchangeAuthCodeForEmail(config *oauth.Config, authcode string) (string, error) {
- t, err := (&oauth.Transport{Config: config}).Exchange(authcode)
- if err != nil {
- return "", fmt.Errorf("failed to exchange authorization code for token: %v", err)
- }
- // Ideally, would validate the token ourselves without an HTTP roundtrip.
- // However, for now, as per:
- // https://developers.google.com/accounts/docs/OAuth2Login#validatinganidtoken
- // pay an HTTP round-trip to have Google do this.
- if t.Extra == nil || len(t.Extra["id_token"]) == 0 {
- return "", fmt.Errorf("no GoogleIDToken found in OAuth token")
- }
- tinfo, err := http.Get(verifyURL + "id_token=" + t.Extra["id_token"])
- if err != nil {
- return "", fmt.Errorf("failed to talk to GoogleIDToken verifier (%q): %v", verifyURL, err)
- }
- if tinfo.StatusCode != http.StatusOK {
- return "", fmt.Errorf("failed to verify GoogleIDToken: %s", tinfo.Status)
- }
- var gtoken token
- if err := json.NewDecoder(tinfo.Body).Decode(>oken); err != nil {
- return "", fmt.Errorf("invalid JSON response from Google's tokeninfo API: %v", err)
- }
- if !gtoken.VerifiedEmail {
- return "", fmt.Errorf("email not verified: %#v", gtoken)
- }
- if gtoken.Issuer != "accounts.google.com" {
- return "", fmt.Errorf("invalid issuer: %v", gtoken.Issuer)
- }
- if gtoken.Audience != config.ClientId {
- return "", fmt.Errorf("unexpected audience(%v) in GoogleIDToken", gtoken.Audience)
- }
- return gtoken.Email, nil
-}
-
-// IDToken JSON message returned by Google's verification endpoint.
-//
-// This differs from the description in:
-// https://developers.google.com/accounts/docs/OAuth2Login#obtainuserinfo
-// because the Google tokeninfo endpoint
-// (https://www.googleapis.com/oauth2/v1/tokeninfo?id_token=XYZ123)
-// mentioned in:
-// https://developers.google.com/accounts/docs/OAuth2Login#validatinganidtoken
-// seems to return the following JSON message.
-type token struct {
- Issuer string `json:"issuer"`
- IssuedTo string `json:"issued_to"`
- Audience string `json:"audience"`
- UserID string `json:"user_id"`
- ExpiresIn int64 `json:"expires_in"`
- IssuedAt int64 `json:"issued_at"`
- Email string `json:"email"`
- VerifiedEmail bool `json:"verified_email"`
-}
diff --git a/services/identity/oauth/oauth_provider.go b/services/identity/oauth/oauth_provider.go
new file mode 100644
index 0000000..be0e36f
--- /dev/null
+++ b/services/identity/oauth/oauth_provider.go
@@ -0,0 +1,11 @@
+package oauth
+
+// OAuthProvider authenticates users to the identity server via the OAuth2 Web Server flow.
+type OAuthProvider interface {
+ // AuthURL is the URL the user must visit in order to authenticate with the OAuthProvider.
+ // After authentication, the user will be re-directed to redirectURL with the provided state.
+ AuthURL(redirectUrl string, state string) (url string)
+ // ExchangeAuthCodeForEmail exchanges the provided authCode for the email of an
+ // authenticated user.
+ ExchangeAuthCodeForEmail(authCode string, url string) (email string, err error)
+}
diff --git a/services/identity/googleoauth/template.go b/services/identity/oauth/template.go
similarity index 99%
rename from services/identity/googleoauth/template.go
rename to services/identity/oauth/template.go
index a3dc4ee..698635a 100644
--- a/services/identity/googleoauth/template.go
+++ b/services/identity/oauth/template.go
@@ -1,4 +1,4 @@
-package googleoauth
+package oauth
import "html/template"
diff --git a/services/identity/googleoauth/utils.go b/services/identity/oauth/utils.go
similarity index 98%
rename from services/identity/googleoauth/utils.go
rename to services/identity/oauth/utils.go
index 6f5230a..0c99fbf 100644
--- a/services/identity/googleoauth/utils.go
+++ b/services/identity/oauth/utils.go
@@ -1,4 +1,4 @@
-package googleoauth
+package oauth
import (
"encoding/json"
diff --git a/services/identity/googleoauth/utils_test.go b/services/identity/oauth/utils_test.go
similarity index 96%
rename from services/identity/googleoauth/utils_test.go
rename to services/identity/oauth/utils_test.go
index ab2e84e..2fc1704 100644
--- a/services/identity/googleoauth/utils_test.go
+++ b/services/identity/oauth/utils_test.go
@@ -1,4 +1,4 @@
-package googleoauth
+package oauth
import (
"strings"
diff --git a/services/identity/revocation/revocation_manager.go b/services/identity/revocation/revocation_manager.go
index 4a45a9a..a13e200 100644
--- a/services/identity/revocation/revocation_manager.go
+++ b/services/identity/revocation/revocation_manager.go
@@ -13,12 +13,19 @@
)
// RevocationManager persists information for revocation caveats to provided discharges and allow for future revocations.
-type RevocationManager struct{}
+type RevocationManager interface {
+ NewCaveat(discharger security.PublicKey, dischargerLocation string) (security.Caveat, error)
+ Revoke(caveatID string) error
+ GetRevocationTime(caveatID string) *time.Time
+}
+
+// revocationManager persists information for revocation caveats to provided discharges and allow for future revocations.
+type revocationManager struct{}
// NewRevocationManager returns a RevocationManager that persists information about
// revocationCaveats in a SQL database and allows for revocation and caveat creation.
// This function can only be called once because of the use of global variables.
-func NewRevocationManager(sqlDB *sql.DB) (*RevocationManager, error) {
+func NewRevocationManager(sqlDB *sql.DB) (RevocationManager, error) {
revocationLock.Lock()
defer revocationLock.Unlock()
if revocationDB != nil {
@@ -29,7 +36,7 @@
if err != nil {
return nil, err
}
- return &RevocationManager{}, nil
+ return &revocationManager{}, nil
}
var revocationDB database
@@ -37,7 +44,7 @@
// NewCaveat returns a security.Caveat constructed with a ThirdPartyCaveat for which discharges will be
// issued iff Revoke has not been called for the returned caveat.
-func (r *RevocationManager) NewCaveat(discharger security.PublicKey, dischargerLocation string) (security.Caveat, error) {
+func (r *revocationManager) NewCaveat(discharger security.PublicKey, dischargerLocation string) (security.Caveat, error) {
var empty security.Caveat
var revocation [16]byte
if _, err := rand.Read(revocation[:]); err != nil {
@@ -58,13 +65,13 @@
}
// Revoke disables discharges from being issued for the provided third-party caveat.
-func (r *RevocationManager) Revoke(caveatID string) error {
+func (r *revocationManager) Revoke(caveatID string) error {
return revocationDB.Revoke(caveatID)
}
// GetRevocationTimestamp returns the timestamp at which a caveat was revoked.
// If the caveat wasn't revoked returns nil
-func (r *RevocationManager) GetRevocationTime(caveatID string) *time.Time {
+func (r *revocationManager) GetRevocationTime(caveatID string) *time.Time {
timestamp, err := revocationDB.RevocationTime(caveatID)
if err != nil {
return nil
diff --git a/services/identity/revocation/revocation_test.go b/services/identity/revocation/revocation_test.go
index a23538b..09034c9 100644
--- a/services/identity/revocation/revocation_test.go
+++ b/services/identity/revocation/revocation_test.go
@@ -41,18 +41,18 @@
return m.revCavIDToTimestamp[string(m.tpCavIDToRevCavID[thirdPartyCaveatID])], nil
}
-func newRevocationManager(t *testing.T) *RevocationManager {
+func newRevocationManager(t *testing.T) RevocationManager {
revocationDB = &mockDatabase{make(map[string][]byte), make(map[string]*time.Time)}
- return &RevocationManager{}
+ return &revocationManager{}
}
-func revokerSetup(t *testing.T, r veyron2.Runtime) (dischargerKey security.PublicKey, dischargerEndpoint string, revoker *RevocationManager, closeFunc func(), runtime veyron2.Runtime) {
+func revokerSetup(t *testing.T, r veyron2.Runtime) (dischargerKey security.PublicKey, dischargerEndpoint string, revoker RevocationManager, closeFunc func(), runtime veyron2.Runtime) {
revokerService := newRevocationManager(t)
dischargerServer, err := r.NewServer()
if err != nil {
t.Fatalf("r.NewServer: %s", err)
}
- dischargerEP, err := dischargerServer.Listen(profiles.LocalListenSpec)
+ dischargerEPs, err := dischargerServer.Listen(profiles.LocalListenSpec)
if err != nil {
t.Fatalf("dischargerServer.Listen failed: %v", err)
}
@@ -61,7 +61,7 @@
t.Fatalf("dischargerServer.Serve revoker: %s", err)
}
return r.Principal().PublicKey(),
- naming.JoinAddressName(dischargerEP.String(), ""),
+ naming.JoinAddressName(dischargerEPs[0].String(), ""),
revokerService,
func() {
dischargerServer.Stop()
diff --git a/services/identity/server/identityd.go b/services/identity/server/identityd.go
new file mode 100644
index 0000000..6e767f4
--- /dev/null
+++ b/services/identity/server/identityd.go
@@ -0,0 +1,280 @@
+// HTTP server that uses OAuth to create security.Blessings objects.
+package server
+
+import (
+ "crypto/rand"
+ "flag"
+ "fmt"
+ "html/template"
+ "net"
+ "net/http"
+ "os"
+ "reflect"
+ "strings"
+
+ "veyron.io/veyron/veyron2"
+ "veyron.io/veyron/veyron2/ipc"
+ "veyron.io/veyron/veyron2/naming"
+ "veyron.io/veyron/veyron2/options"
+ "veyron.io/veyron/veyron2/rt"
+ "veyron.io/veyron/veyron2/security"
+ verror "veyron.io/veyron/veyron2/verror2"
+ "veyron.io/veyron/veyron2/vlog"
+
+ "veyron.io/veyron/veyron/lib/signals"
+ "veyron.io/veyron/veyron/security/audit"
+ "veyron.io/veyron/veyron/services/identity/auditor"
+ "veyron.io/veyron/veyron/services/identity/blesser"
+ "veyron.io/veyron/veyron/services/identity/handlers"
+ "veyron.io/veyron/veyron/services/identity/oauth"
+ "veyron.io/veyron/veyron/services/identity/revocation"
+ services "veyron.io/veyron/veyron/services/security"
+ "veyron.io/veyron/veyron/services/security/discharger"
+
+ "veyron.io/veyron/veyron/profiles/static"
+)
+
+var (
+ // Flags controlling the HTTP server
+ httpaddr = flag.String("httpaddr", "localhost:8125", "Address on which the HTTP server listens on.")
+ tlsconfig = flag.String("tlsconfig", "", "Comma-separated list of TLS certificate and private key files. This must be provided.")
+ host = flag.String("host", defaultHost(), "Hostname the HTTP server listens on. This can be the name of the host running the webserver, but if running behind a NAT or load balancer, this should be the host name that clients will connect to. For example, if set to 'x.com', Veyron identities will have the IssuerName set to 'x.com' and clients can expect to find the root name and public key of the signer at 'x.com/blessing-root'.")
+)
+
+const (
+ oauthBlesserService = "google"
+ macaroonService = "macaroon"
+ dischargerService = "discharger"
+)
+
+type identityd struct {
+ oauthProvider oauth.OAuthProvider
+ auditor audit.Auditor
+ blessingLogReader auditor.BlessingLogReader
+ revocationManager revocation.RevocationManager
+ oauthBlesserParams blesser.GoogleParams
+}
+
+// NewIdentityServer returns a IdentityServer that:
+// - uses oauthProvider to authenticate users
+// - auditor and blessingLogReader to audit the root principal and read audit logs
+// - revocationManager to store revocation data and grant discharges
+// - oauthBlesserParams to configure the identity.OAuthBlesser service
+func NewIdentityServer(oauthProvider oauth.OAuthProvider, auditor audit.Auditor, blessingLogReader auditor.BlessingLogReader, revocationManager revocation.RevocationManager, oauthBlesserParams blesser.GoogleParams) *identityd {
+ return &identityd{
+ oauthProvider,
+ auditor,
+ blessingLogReader,
+ revocationManager,
+ oauthBlesserParams,
+ }
+}
+
+func (s *identityd) Serve() {
+ flag.Parse()
+
+ runtime, err := rt.New(options.RuntimePrincipal{providerPrincipal(s.auditor)})
+ if err != nil {
+ vlog.Fatal(err)
+ }
+ defer runtime.Cleanup()
+
+ // Setup handlers
+ http.Handle("/blessing-root", handlers.BlessingRoot{runtime.Principal()}) // json-encoded public key and blessing names of this server
+
+ macaroonKey := make([]byte, 32)
+ if _, err := rand.Read(macaroonKey); err != nil {
+ vlog.Fatalf("macaroonKey generation failed: %v", err)
+ }
+
+ ipcServer, published, err := s.setupServices(runtime, macaroonKey)
+ if err != nil {
+ vlog.Fatalf("Failed to setup veyron services for blessing: %v", err)
+ }
+ defer ipcServer.Stop()
+
+ n := "/google/"
+ h, err := oauth.NewHandler(oauth.HandlerArgs{
+ R: runtime,
+ MacaroonKey: macaroonKey,
+ Addr: fmt.Sprintf("%s%s", httpaddress(), n),
+ BlessingLogReader: s.blessingLogReader,
+ RevocationManager: s.revocationManager,
+ DischargerLocation: naming.JoinAddressName(published[0], dischargerService),
+ MacaroonBlessingService: naming.JoinAddressName(published[0], macaroonService),
+ OAuthProvider: s.oauthProvider,
+ })
+ if err != nil {
+ vlog.Fatalf("Failed to create HTTP handler for oauth authentication: %v", err)
+ }
+ http.Handle(n, h)
+
+ http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
+ args := struct {
+ Self security.Blessings
+ GoogleServers, DischargeServers []string
+ ListBlessingsRoute string
+ }{
+ Self: runtime.Principal().BlessingStore().Default(),
+ }
+ if s.revocationManager != nil {
+ args.DischargeServers = appendSuffixTo(published, dischargerService)
+ }
+ var emptyParams blesser.GoogleParams
+ if !reflect.DeepEqual(s.oauthBlesserParams, emptyParams) {
+ args.GoogleServers = appendSuffixTo(published, oauthBlesserService)
+ }
+ if s.blessingLogReader != nil {
+ args.ListBlessingsRoute = oauth.ListBlessingsRoute
+ }
+ if err := tmpl.Execute(w, args); err != nil {
+ vlog.Info("Failed to render template:", err)
+ }
+ })
+ vlog.Infof("Running HTTP server at: %v", httpaddress())
+ go runHTTPSServer(*httpaddr)
+ <-signals.ShutdownOnSignals(runtime)
+}
+
+func appendSuffixTo(objectname []string, suffix string) []string {
+ names := make([]string, len(objectname))
+ for i, o := range objectname {
+ names[i] = naming.JoinAddressName(o, suffix)
+ }
+ return names
+}
+
+// Starts the blessing services and the discharging service on the same port.
+func (s *identityd) setupServices(r veyron2.Runtime, macaroonKey []byte) (ipc.Server, []string, error) {
+ server, err := r.NewServer()
+ if err != nil {
+ return nil, nil, fmt.Errorf("failed to create new ipc.Server: %v", err)
+ }
+ eps, err := server.Listen(static.ListenSpec)
+ if err != nil {
+ return nil, nil, fmt.Errorf("server.Listen(%v) failed: %v", static.ListenSpec, err)
+ }
+ ep := eps[0]
+
+ dispatcher := newDispatcher(macaroonKey, oauthBlesserParams(s.oauthBlesserParams, s.revocationManager, ep))
+ objectname := naming.Join("identity", fmt.Sprintf("%v", r.Principal().BlessingStore().Default()))
+ if err := server.ServeDispatcher(objectname, dispatcher); err != nil {
+ return nil, nil, fmt.Errorf("failed to start Veyron services: %v", err)
+ }
+ vlog.Infof("Blessing and discharger services enabled at %v", naming.JoinAddressName(ep.String(), objectname))
+ published, _ := server.Published()
+ if len(published) == 0 {
+ // No addresses published, publish the endpoint instead (which may not be usable everywhere, but oh-well).
+ published = append(published, ep.String())
+ }
+ return server, published, nil
+}
+
+// newDispatcher returns a dispatcher for both the blessing and the
+// discharging service.
+func newDispatcher(macaroonKey []byte, blesserParams blesser.GoogleParams) ipc.Dispatcher {
+ d := dispatcher(map[string]interface{}{
+ macaroonService: blesser.NewMacaroonBlesserServer(macaroonKey),
+ dischargerService: services.DischargerServer(discharger.NewDischarger()),
+ oauthBlesserService: blesser.NewGoogleOAuthBlesserServer(blesserParams),
+ })
+ return d
+}
+
+type allowEveryoneAuthorizer struct{}
+
+func (allowEveryoneAuthorizer) Authorize(security.Context) error { return nil }
+
+type dispatcher map[string]interface{}
+
+func (d dispatcher) Lookup(suffix string) (interface{}, security.Authorizer, error) {
+ if invoker := d[suffix]; invoker != nil {
+ return invoker, allowEveryoneAuthorizer{}, nil
+ }
+ return nil, nil, verror.Make(verror.NoExist, nil, suffix)
+}
+
+func oauthBlesserParams(inputParams blesser.GoogleParams, revocationManager revocation.RevocationManager, ep naming.Endpoint) blesser.GoogleParams {
+ inputParams.DischargerLocation = naming.JoinAddressName(ep.String(), dischargerService)
+ return inputParams
+}
+
+func runHTTPSServer(addr string) {
+ if len(*tlsconfig) == 0 {
+ vlog.Fatal("Please set the --tlsconfig flag")
+ }
+ paths := strings.Split(*tlsconfig, ",")
+ if len(paths) != 2 {
+ vlog.Fatalf("Could not parse --tlsconfig. Must have exactly two components, separated by a comma")
+ }
+ vlog.Infof("Starting HTTP server with TLS using certificate [%s] and private key [%s] at https://%s", paths[0], paths[1], addr)
+ if err := http.ListenAndServeTLS(addr, paths[0], paths[1], nil); err != nil {
+ vlog.Fatalf("http.ListenAndServeTLS failed: %v", err)
+ }
+}
+
+func defaultHost() string {
+ host, err := os.Hostname()
+ if err != nil {
+ vlog.Fatalf("Failed to get hostname: %v", err)
+ }
+ return host
+}
+
+// providerPrincipal returns the Principal to use for the identity provider (i.e., this program).
+func providerPrincipal(auditor audit.Auditor) security.Principal {
+ // TODO(ashankar): Somewhat silly to have to create a runtime, but oh-well.
+ r, err := rt.New()
+ if err != nil {
+ vlog.Fatal(err)
+ }
+ defer r.Cleanup()
+ return audit.NewPrincipal(r.Principal(), auditor)
+}
+
+func httpaddress() string {
+ _, port, err := net.SplitHostPort(*httpaddr)
+ if err != nil {
+ vlog.Fatalf("Failed to parse %q: %v", *httpaddr, err)
+ }
+ return fmt.Sprintf("https://%s:%v", *host, port)
+}
+
+var tmpl = template.Must(template.New("main").Parse(`<!doctype html>
+<html>
+<head>
+<meta charset="UTF-8">
+<title>Veyron Identity Server</title>
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
+</head>
+<body>
+<div class="container">
+<div class="page-header"><h2>{{.Self}}</h2><h4>A Veyron Blessing Provider</h4></div>
+<div class="well">
+This is a Veyron identity provider that provides blessings with the name prefix <mark>{{.Self}}</mark>.
+<br/>
+The public key of this provider is {{.Self.PublicKey}}.
+<br/>
+The root names and public key (in DER encoded <a href="http://en.wikipedia.org/wiki/X.690#DER_encoding">format</a>)
+are available in a <a class="btn btn-xs btn-primary" href="/blessing-root">JSON</a> object.
+</div>
+
+<div class="well">
+<ul>
+{{if .GoogleServers}}
+<li>Blessings (using Google OAuth to fetch an email address) are provided via Veyron RPCs to: <tt>{{range .GoogleServers}}{{.}}{{end}}</tt></li>
+{{end}}
+{{if .DischargeServers}}
+<li>RevocationCaveat Discharges are provided via Veyron RPCs to: <tt>{{range .DischargeServers}}{{.}}{{end}}</tt></li>
+{{end}}
+{{if .ListBlessingsRoute}}
+<li>You can <a class="btn btn-xs btn-primary" href="/google/{{.ListBlessingsRoute}}">enumerate</a> blessings provided with your
+email address.</li>
+{{end}}
+</ul>
+</div>
+
+</div>
+</body>
+</html>`))
diff --git a/services/mgmt/application/applicationd/main.go b/services/mgmt/application/applicationd/main.go
index 4898ae7..a30fb98 100644
--- a/services/mgmt/application/applicationd/main.go
+++ b/services/mgmt/application/applicationd/main.go
@@ -39,14 +39,14 @@
vlog.Fatalf("NewDispatcher() failed: %v", err)
}
- endpoint, err := server.Listen(roaming.ListenSpec)
+ endpoints, err := server.Listen(roaming.ListenSpec)
if err != nil {
vlog.Fatalf("Listen(%s) failed: %v", roaming.ListenSpec, err)
}
if err := server.ServeDispatcher(*name, dispatcher); err != nil {
vlog.Fatalf("Serve(%v) failed: %v", *name, err)
}
- epName := naming.JoinAddressName(endpoint.String(), "")
+ epName := naming.JoinAddressName(endpoints[0].String(), "")
if *name != "" {
vlog.Infof("Application repository serving at %q (%q)", *name, epName)
} else {
diff --git a/services/mgmt/application/applicationd/test.sh b/services/mgmt/application/applicationd/test.sh
new file mode 100755
index 0000000..c3a3d92
--- /dev/null
+++ b/services/mgmt/application/applicationd/test.sh
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+# Test the application repository daemon.
+#
+# This test starts an application repository daemon and uses the
+# application repository client to verify that <application>.Put(),
+# <application>.Match(), and <application>.Remove() work as expected.
+
+source "$(go list -f {{.Dir}} veyron.io/veyron/shell/lib)/shell_test.sh"
+
+readonly WORKDIR="${shell_test_WORK_DIR}"
+
+build() {
+ APPLICATIOND_BIN="$(shell_test::build_go_binary 'veyron.io/veyron/veyron/services/mgmt/application/applicationd')"
+ APPLICATION_BIN="$(shell_test::build_go_binary 'veyron.io/veyron/veyron/tools/application')"
+}
+
+main() {
+ cd "${WORKDIR}"
+ build
+
+ shell_test::setup_server_test
+
+ # Start the application repository daemon.
+ local -r REPO="applicationd-test-repo"
+ local -r STORE=$(shell::tmp_dir)
+ shell_test::start_server "${APPLICATIOND_BIN}" --name="${REPO}" --store="${STORE}" --veyron.tcp.address=127.0.0.1:0 \
+ || shell_test::fail "line ${LINENO} failed to start applicationd"
+
+ # Create an application envelope.
+ local -r APPLICATION="${REPO}/test-application/v1"
+ local -r PROFILE="test-profile"
+ local -r ENVELOPE_WANT=$(shell::tmp_file)
+ cat > "${ENVELOPE_WANT}" <<EOF
+{"Title":"title", "Args":[], "Binary":"foo", "Env":[]}
+EOF
+ "${APPLICATION_BIN}" put "${APPLICATION}" "${PROFILE}" "${ENVELOPE_WANT}" || shell_test::fail "line ${LINENO}: 'put' failed"
+
+ # Match the application envelope.
+ local -r ENVELOPE_GOT=$(shell::tmp_file)
+ "${APPLICATION_BIN}" match "${APPLICATION}" "${PROFILE}" | tee "${ENVELOPE_GOT}" || shell_test::fail "line ${LINENO}: 'match' failed"
+ if [[ $(cmp "${ENVELOPE_WANT}" "${ENVELOPE_GOT}" &> /dev/null) ]]; then
+ shell_test::fail "mismatching application envelopes"
+ fi
+
+ # Remove the application envelope.
+ "${APPLICATION_BIN}" remove "${APPLICATION}" "${PROFILE}" || shell_test::fail "line ${LINENO}: 'remove' failed"
+
+ # Check the application envelope no longer exists.
+ local -r RESULT=$(shell::check_result "${APPLICATION_BIN}" match "${APPLICATION}" "${PROFILE}")
+ shell_test::assert_ne "${RESULT}" "0" "${LINENO}"
+
+ shell_test::pass
+}
+
+main "$@"
diff --git a/services/mgmt/application/applicationd/testdata/integration_test.go b/services/mgmt/application/applicationd/testdata/integration_test.go
index aa0f440..4a66a8e 100644
--- a/services/mgmt/application/applicationd/testdata/integration_test.go
+++ b/services/mgmt/application/applicationd/testdata/integration_test.go
@@ -75,9 +75,10 @@
defer handle.CloseStdin()
// Generate credentials.
- root := security.NewPrincipal("root")
- credentials := security.NewVeyronCredentials(root, "test-credentials")
- defer os.RemoveAll(credentials)
+ serverCred, serverPrin := security.NewCredentials("server")
+ defer os.RemoveAll(serverCred)
+ clientCred, _ := security.ForkCredentials(serverPrin, "client")
+ defer os.RemoveAll(clientCred)
// Start the application repository.
appRepoBin := filepath.Join(binDir, "applicationd")
@@ -91,7 +92,7 @@
"-name=" + appRepoName,
"-store=" + appRepoStore,
"-veyron.tcp.address=127.0.0.1:0",
- "-veyron.credentials=" + credentials,
+ "-veyron.credentials=" + serverCred,
"-veyron.namespace.root=" + mt,
}
serverProcess, err := integration.StartServer(appRepoBin, args)
@@ -118,17 +119,17 @@
if _, err := appEnvelopeFile.Write([]byte(wantEnvelope)); err != nil {
t.Fatalf("Write() failed: %v", err)
}
- putEnvelope(t, binDir, credentials, mt, appRepoName, appRepoSuffix, appEnvelopeFile.Name())
+ putEnvelope(t, binDir, clientCred, mt, appRepoName, appRepoSuffix, appEnvelopeFile.Name())
// Match the application envelope.
- gotEnvelope := matchEnvelope(t, false, binDir, credentials, mt, appRepoName, appRepoSuffix)
+ gotEnvelope := matchEnvelope(t, false, binDir, clientCred, mt, appRepoName, appRepoSuffix)
if gotEnvelope != wantEnvelope {
t.Fatalf("unexpected output: got %v, want %v", gotEnvelope, wantEnvelope)
}
// Remove the application envelope.
- removeEnvelope(t, binDir, credentials, mt, appRepoName, appRepoSuffix)
+ removeEnvelope(t, binDir, clientCred, mt, appRepoName, appRepoSuffix)
// Check that the application envelope no longer exists.
- matchEnvelope(t, true, binDir, credentials, mt, appRepoName, appRepoSuffix)
+ matchEnvelope(t, true, binDir, clientCred, mt, appRepoName, appRepoSuffix)
}
diff --git a/services/mgmt/application/impl/impl_test.go b/services/mgmt/application/impl/impl_test.go
index af03a77..591fe9b 100644
--- a/services/mgmt/application/impl/impl_test.go
+++ b/services/mgmt/application/impl/impl_test.go
@@ -40,13 +40,14 @@
t.Fatalf("NewDispatcher() failed: %v", err)
}
- endpoint, err := server.Listen(profiles.LocalListenSpec)
+ endpoints, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
t.Fatalf("Listen(%s) failed: %v", profiles.LocalListenSpec, err)
}
if err := server.ServeDispatcher("", dispatcher); err != nil {
t.Fatalf("Serve(%v) failed: %v", dispatcher, err)
}
+ endpoint := endpoints[0]
// Create client stubs for talking to the server.
stub := repository.ApplicationClient(naming.JoinAddressName(endpoint.String(), "search"))
@@ -183,10 +184,11 @@
t.Fatalf("NewDispatcher() failed: %v", err)
}
- endpoint, err := server.Listen(profiles.LocalListenSpec)
+ endpoints, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
t.Fatalf("Listen(%s) failed: %v", profiles.LocalListenSpec, err)
}
+ endpoint := endpoints[0]
if err := server.ServeDispatcher("", dispatcher); err != nil {
t.Fatalf("Serve(%v) failed: %v", dispatcher, err)
}
@@ -227,10 +229,11 @@
if err != nil {
t.Fatalf("NewDispatcher() failed: %v", err)
}
- endpoint, err = server.Listen(profiles.LocalListenSpec)
+ endpoints, err = server.Listen(profiles.LocalListenSpec)
if err != nil {
t.Fatalf("Listen(%s) failed: %v", profiles.LocalListenSpec, err)
}
+ endpoint = endpoints[0]
if err := server.ServeDispatcher("", dispatcher); err != nil {
t.Fatalf("Serve(%v) failed: %v", dispatcher, err)
}
diff --git a/services/mgmt/binary/binaryd/main.go b/services/mgmt/binary/binaryd/main.go
index 3ac83da..11c311b 100644
--- a/services/mgmt/binary/binaryd/main.go
+++ b/services/mgmt/binary/binaryd/main.go
@@ -85,7 +85,7 @@
}
defer server.Stop()
auth := vflag.NewAuthorizerOrDie()
- endpoint, err := server.Listen(roaming.ListenSpec)
+ endpoints, err := server.Listen(roaming.ListenSpec)
if err != nil {
vlog.Errorf("Listen(%s) failed: %v", roaming.ListenSpec, err)
return
@@ -94,7 +94,7 @@
vlog.Errorf("ServeDispatcher(%v) failed: %v", *name, err)
return
}
- epName := naming.JoinAddressName(endpoint.String(), "")
+ epName := naming.JoinAddressName(endpoints[0].String(), "")
if *name != "" {
vlog.Infof("Binary repository serving at %q (%q)", *name, epName)
} else {
diff --git a/services/mgmt/binary/binaryd/test.sh b/services/mgmt/binary/binaryd/test.sh
new file mode 100755
index 0000000..602a643
--- /dev/null
+++ b/services/mgmt/binary/binaryd/test.sh
@@ -0,0 +1,81 @@
+#!/bin/bash
+
+# Test the binary repository daemon.
+#
+# This test starts a binary repository daemon and uses the binary
+# repository client to verify that <binary>.Upload(),
+# <binary>.Download(), and <binary>.Delete() work as expected.
+
+source "$(go list -f {{.Dir}} veyron.io/veyron/shell/lib)/shell_test.sh"
+
+readonly WORKDIR="${shell_test_WORK_DIR}"
+
+build() {
+ BINARYD_BIN="$(shell_test::build_go_binary 'veyron.io/veyron/veyron/services/mgmt/binary/binaryd')"
+ BINARY_BIN="$(shell_test::build_go_binary 'veyron.io/veyron/veyron/tools/binary')"
+}
+
+main() {
+ cd "${WORKDIR}"
+ build
+
+ shell_test::setup_server_test
+
+ # Start the binary repository daemon.
+ local -r REPO="binaryd-test-repo"
+ shell_test::start_server "${BINARYD_BIN}" --name="${REPO}" --veyron.tcp.address=127.0.0.1:0 --http=127.0.0.1:0 \
+ || shell_test::fail "line ${LINENO} failed to start binaryd"
+ local -r HTTP_ADDR=$(grep 'HTTP server at: "' "${START_SERVER_LOG_FILE}" | sed -e 's/^.*HTTP server at: "//' | sed -e 's/"$//')
+
+ # Create a binary file.
+ local -r BINARY_SUFFIX="test-binary"
+ local -r BINARY="${REPO}/${BINARY_SUFFIX}"
+ local -r BINARY_FILE="${WORKDIR}/bin1"
+ dd if=/dev/urandom of="${BINARY_FILE}" bs=1000000 count=16 \
+ || shell_test::fail "line ${LINENO}: faile to create a random binary file"
+ "${BINARY_BIN}" upload "${BINARY}" "${BINARY_FILE}" || shell_test::fail "line ${LINENO}: 'upload' failed"
+
+ # Create TAR file.
+ local -r TAR="${REPO}/tarobj"
+ local -r TAR_FILE="${WORKDIR}/bin1.tar.gz"
+ tar zcvf "${TAR_FILE}" "${BINARY_FILE}"
+ "${BINARY_BIN}" upload "${TAR}" "${TAR_FILE}" || shell_test::fail "line ${LINENO}: 'upload' failed"
+
+ # Download the binary file.
+ local -r BINARY_FILE2="${WORKDIR}/bin2"
+ "${BINARY_BIN}" download "${BINARY}" "${BINARY_FILE2}" || shell_test::fail "line ${LINENO}: 'RPC download' failed"
+ if [[ $(cmp "${BINARY_FILE}" "${BINARY_FILE2}" &> /dev/null) ]]; then
+ shell_test::fail "mismatching binary file downloaded via RPC"
+ fi
+ local -r BINARY_FILE2_INFO=$(cat "${BINARY_FILE2}.__info")
+ shell_test::assert_eq "${BINARY_FILE2_INFO}" '{"Type":"application/octet-stream","Encoding":""}' "${LINENO}"
+
+ # Download the tar file.
+ local -r TAR_FILE2="${WORKDIR}/downloadedtar"
+ "${BINARY_BIN}" download "${TAR}" "${TAR_FILE2}" || shell_test::fail "line ${LINENO}: 'RPC download' failed"
+ if [[ $(cmp "${TAR_FILE}" "${TAR_FILE2}" &> /dev/null) ]]; then
+ shell_test::fail "mismatching tar file downloaded via RPC"
+ fi
+ local -r TAR_FILE2_INFO=$(cat "${TAR_FILE2}.__info")
+ shell_test::assert_eq "${TAR_FILE2_INFO}" '{"Type":"application/x-tar","Encoding":"gzip"}' "${LINENO}"
+
+ local -r BINARY_FILE3="${WORKDIR}/bin3"
+ curl -f -o "${BINARY_FILE3}" "http://${HTTP_ADDR}/${BINARY_SUFFIX}" || shell_test::fail "line ${LINENO}: 'HTTP download' failed"
+ if [[ $(cmp "${BINARY_FILE}" "${BINARY_FILE3}" &> /dev/null) ]]; then
+ shell_test::fail "mismatching binary file downloaded via HTTP"
+ fi
+
+ # Remove the files.
+ "${BINARY_BIN}" delete "${BINARY}" || shell_test::fail "line ${LINENO}: 'delete' failed"
+ "${BINARY_BIN}" delete "${TAR}" || shell_test::fail "line ${LINENO}: 'delete' failed"
+
+ # Check the files no longer exist.
+ local RESULT=$(shell::check_result "${BINARY_BIN}" download "${BINARY}" "${BINARY_FILE2}")
+ shell_test::assert_ne "${RESULT}" "0" "${LINENO}"
+ RESULT=$(shell::check_result "${BINARY_BIN}" download "${TAR}" "${TAR_FILE2}")
+ shell_test::assert_ne "${RESULT}" "0" "${LINENO}"
+
+ shell_test::pass
+}
+
+main "$@"
diff --git a/services/mgmt/binary/binaryd/testdata/integration_test.go b/services/mgmt/binary/binaryd/testdata/integration_test.go
index 7bd82f6..d28b3cb 100644
--- a/services/mgmt/binary/binaryd/testdata/integration_test.go
+++ b/services/mgmt/binary/binaryd/testdata/integration_test.go
@@ -150,9 +150,10 @@
defer handle.CloseStdin()
// Generate credentials.
- principal := security.NewPrincipal("root")
- credentials := security.NewVeyronCredentials(principal, "test-credentials")
- defer os.RemoveAll(credentials)
+ serverCred, serverPrin := security.NewCredentials("server")
+ defer os.RemoveAll(serverCred)
+ clientCred, _ := security.ForkCredentials(serverPrin, "client")
+ defer os.RemoveAll(clientCred)
// Start the build server.
binaryRepoBin := filepath.Join(binDir, "binaryd")
@@ -161,7 +162,7 @@
"-name=" + binaryRepoName,
"-http=127.0.0.1:0",
"-veyron.tcp.address=127.0.0.1:0",
- "-veyron.credentials=" + credentials,
+ "-veyron.credentials=" + serverCred,
"-veyron.namespace.root=" + mt,
}
serverProcess, err := integration.StartServer(binaryRepoBin, args)
@@ -181,7 +182,7 @@
t.Fatalf("Write() failed: %v", err)
}
binSuffix := "test-binary"
- uploadFile(t, binDir, credentials, mt, binaryRepoName, binFile.Name(), binSuffix)
+ uploadFile(t, binDir, clientCred, mt, binaryRepoName, binFile.Name(), binSuffix)
// Upload a compressed version of the binary file.
tarFile := binFile.Name() + ".tar.gz"
@@ -194,13 +195,13 @@
}
defer os.Remove(tarFile)
tarSuffix := "test-compressed-file"
- uploadFile(t, binDir, credentials, mt, binaryRepoName, tarFile, tarSuffix)
+ uploadFile(t, binDir, clientCred, mt, binaryRepoName, tarFile, tarSuffix)
// Download the binary file and check that it matches the
// original one and that it has the right file type.
downloadedBinFile := binFile.Name() + "-downloaded"
defer os.Remove(downloadedBinFile)
- downloadFile(t, false, binDir, credentials, mt, binaryRepoName, downloadedBinFile, binSuffix)
+ downloadFile(t, false, binDir, clientCred, mt, binaryRepoName, downloadedBinFile, binSuffix)
compareFiles(t, binFile.Name(), downloadedBinFile)
checkFileType(t, downloadedBinFile, `{"Type":"application/octet-stream","Encoding":""}`)
@@ -209,13 +210,13 @@
// right file type.
downloadedTarFile := binFile.Name() + "-downloaded.tar.gz"
defer os.Remove(downloadedTarFile)
- downloadFile(t, false, binDir, credentials, mt, binaryRepoName, downloadedTarFile, tarSuffix)
+ downloadFile(t, false, binDir, clientCred, mt, binaryRepoName, downloadedTarFile, tarSuffix)
compareFiles(t, tarFile, downloadedTarFile)
checkFileType(t, downloadedTarFile, `{"Type":"application/x-tar","Encoding":"gzip"}`)
// Fetch the root URL of the HTTP server used by the binary
// repository to serve URLs.
- root := rootURL(t, binDir, credentials, mt, binaryRepoName)
+ root := rootURL(t, binDir, clientCred, mt, binaryRepoName)
// Download the binary file using the HTTP protocol and check
// that it matches the original one.
@@ -233,10 +234,10 @@
compareFiles(t, downloadedTarFile, downloadedTarFileURL)
// Delete the files.
- deleteFile(t, binDir, credentials, mt, binaryRepoName, binSuffix)
- deleteFile(t, binDir, credentials, mt, binaryRepoName, tarSuffix)
+ deleteFile(t, binDir, clientCred, mt, binaryRepoName, binSuffix)
+ deleteFile(t, binDir, clientCred, mt, binaryRepoName, tarSuffix)
// Check the files no longer exist.
- downloadFile(t, true, binDir, credentials, mt, binaryRepoName, downloadedBinFile, binSuffix)
- downloadFile(t, true, binDir, credentials, mt, binaryRepoName, downloadedTarFile, tarSuffix)
+ downloadFile(t, true, binDir, clientCred, mt, binaryRepoName, downloadedBinFile, binSuffix)
+ downloadFile(t, true, binDir, clientCred, mt, binaryRepoName, downloadedTarFile, tarSuffix)
}
diff --git a/services/mgmt/binary/impl/fs_utils.go b/services/mgmt/binary/impl/fs_utils.go
index 3240d31..d87fd9b 100644
--- a/services/mgmt/binary/impl/fs_utils.go
+++ b/services/mgmt/binary/impl/fs_utils.go
@@ -8,6 +8,7 @@
"strconv"
"strings"
+ verror "veyron.io/veyron/veyron2/verror2"
"veyron.io/veyron/veyron2/vlog"
)
@@ -25,19 +26,19 @@
func checksumExists(path string) error {
switch _, err := os.Stat(path); {
case os.IsNotExist(err):
- return errInvalidPart
+ return verror.Make(errInvalidPart, nil, path)
case err != nil:
vlog.Errorf("Stat(%v) failed: %v", path, err)
- return errOperationFailed
+ return verror.Make(errOperationFailed, nil, path)
}
checksumFile := filepath.Join(path, checksum)
_, err := os.Stat(checksumFile)
switch {
case os.IsNotExist(err):
- return errNotFound
+ return verror.Make(verror.NoExist, nil, path)
case err != nil:
vlog.Errorf("Stat(%v) failed: %v", checksumFile, err)
- return errOperationFailed
+ return verror.Make(errOperationFailed, nil, path)
default:
return nil
}
@@ -57,7 +58,7 @@
infos, err := ioutil.ReadDir(path)
if err != nil {
vlog.Errorf("ReadDir(%v) failed: %v", path, err)
- return []string{}, errOperationFailed
+ return []string{}, verror.Make(errOperationFailed, nil, path)
}
nDirs := 0
for _, info := range infos {
@@ -72,10 +73,10 @@
idx, err := strconv.Atoi(partName)
if err != nil {
vlog.Errorf("Atoi(%v) failed: %v", partName, err)
- return []string{}, errOperationFailed
+ return []string{}, verror.Make(errOperationFailed, nil, path)
}
if idx < 0 || idx >= len(infos) || result[idx] != "" {
- return []string{}, errOperationFailed
+ return []string{}, verror.Make(errOperationFailed, nil, path)
}
result[idx] = filepath.Join(path, partName)
} else {
@@ -83,7 +84,7 @@
continue
}
// The only entries should correspond to the part dirs.
- return []string{}, errOperationFailed
+ return []string{}, verror.Make(errOperationFailed, nil, path)
}
}
return result, nil
diff --git a/services/mgmt/binary/impl/http.go b/services/mgmt/binary/impl/http.go
index 251ff00..1242bd2 100644
--- a/services/mgmt/binary/impl/http.go
+++ b/services/mgmt/binary/impl/http.go
@@ -6,6 +6,7 @@
"path/filepath"
"strings"
+ verror "veyron.io/veyron/veyron2/verror2"
"veyron.io/veyron/veyron2/vlog"
"veyron.io/veyron/veyron/services/mgmt/binary/impl/multipart"
@@ -42,7 +43,7 @@
var err error
if partFiles[i], err = os.Open(dataPath); err != nil {
vlog.Errorf("Open(%v) failed: %v", dataPath, err)
- return nil, errOperationFailed
+ return nil, verror.Make(errOperationFailed, nil, dataPath)
}
}
return multipart.NewFile(name, partFiles)
diff --git a/services/mgmt/binary/impl/impl_test.go b/services/mgmt/binary/impl/impl_test.go
index b336cd1..0f1f1ee 100644
--- a/services/mgmt/binary/impl/impl_test.go
+++ b/services/mgmt/binary/impl/impl_test.go
@@ -17,7 +17,7 @@
"veyron.io/veyron/veyron2/naming"
"veyron.io/veyron/veyron2/rt"
"veyron.io/veyron/veyron2/services/mgmt/repository"
- "veyron.io/veyron/veyron2/verror"
+ verror "veyron.io/veyron/veyron2/verror2"
"veyron.io/veyron/veyron2/vlog"
"veyron.io/veyron/veyron/lib/testutil"
@@ -132,10 +132,11 @@
}
}()
dispatcher := NewDispatcher(state, nil)
- endpoint, err := server.Listen(profiles.LocalListenSpec)
+ endpoints, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
t.Fatalf("Listen(%s) failed: %v", profiles.LocalListenSpec, err)
}
+ endpoint := endpoints[0]
dontPublishName := ""
if err := server.ServeDispatcher(dontPublishName, dispatcher); err != nil {
t.Fatalf("Serve(%q) failed: %v", dontPublishName, err)
@@ -319,7 +320,7 @@
}
if err := binary.Create(runtime.NewContext(), int32(length), repository.MediaInfo{Type: "application/octet-stream"}); err == nil {
t.Fatalf("Create() did not fail when it should have")
- } else if want := verror.Exists; !verror.Is(err, want) {
+ } else if want := verror.Exist.ID; !verror.Is(err, want) {
t.Fatalf("Unexpected error: %v, expected error id %v", err, want)
}
if streamErr, err := invokeUpload(t, binary, data[0], 0); streamErr != nil || err != nil {
@@ -327,12 +328,12 @@
}
if _, err := invokeUpload(t, binary, data[0], 0); err == nil {
t.Fatalf("Upload() did not fail when it should have")
- } else if want := verror.Exists; !verror.Is(err, want) {
+ } else if want := verror.Exist.ID; !verror.Is(err, want) {
t.Fatalf("Unexpected error: %v, expected error id %v", err, want)
}
if _, _, err := invokeDownload(t, binary, 1); err == nil {
t.Fatalf("Download() did not fail when it should have")
- } else if want := verror.NoExist; !verror.Is(err, want) {
+ } else if want := verror.NoExist.ID; !verror.Is(err, want) {
t.Fatalf("Unexpected error: %v, expected error id %v", err, want)
}
if streamErr, err := invokeUpload(t, binary, data[1], 1); streamErr != nil || err != nil {
@@ -346,12 +347,12 @@
for _, part := range []int32{-1, length} {
if _, err := invokeUpload(t, binary, []byte("dummy"), part); err == nil {
t.Fatalf("Upload() did not fail when it should have")
- } else if want := verror.BadArg; !verror.Is(err, want) {
+ } else if want := errInvalidPart.ID; !verror.Is(err, want) {
t.Fatalf("Unexpected error: %v, expected error id %v", err, want)
}
if _, _, err := invokeDownload(t, binary, part); err == nil {
t.Fatalf("Download() did not fail when it should have")
- } else if want := verror.BadArg; !verror.Is(err, want) {
+ } else if want := errInvalidPart.ID; !verror.Is(err, want) {
t.Fatalf("Unexpected error: %v, expected error id %v", err, want)
}
}
@@ -360,7 +361,7 @@
}
if err := binary.Delete(runtime.NewContext()); err == nil {
t.Fatalf("Delete() did not fail when it should have")
- } else if want := verror.NoExist; !verror.Is(err, want) {
+ } else if want := verror.NoExist.ID; !verror.Is(err, want) {
t.Fatalf("Unexpected error: %v, expected error id %v", err, want)
}
}
diff --git a/services/mgmt/binary/impl/service.go b/services/mgmt/binary/impl/service.go
index 6249891..e7cfc9d 100644
--- a/services/mgmt/binary/impl/service.go
+++ b/services/mgmt/binary/impl/service.go
@@ -34,7 +34,7 @@
"veyron.io/veyron/veyron2/ipc"
"veyron.io/veyron/veyron2/services/mgmt/binary"
"veyron.io/veyron/veyron2/services/mgmt/repository"
- "veyron.io/veyron/veyron2/verror"
+ verror "veyron.io/veyron/veyron2/verror2"
"veyron.io/veyron/veyron2/vlog"
)
@@ -50,13 +50,13 @@
suffix string
}
+const pkgPath = "veyron.io/veyron/veyron/services/mgmt/binary/impl"
+
var (
- errExists = verror.Existsf("binary already exists")
- errNotFound = verror.NoExistf("binary not found")
- errInProgress = verror.Internalf("identical upload already in progress")
- errInvalidParts = verror.BadArgf("invalid number of binary parts")
- errInvalidPart = verror.BadArgf("invalid binary part number")
- errOperationFailed = verror.Internalf("operation failed")
+ errInProgress = verror.Register(pkgPath+".errInProgress", verror.NoRetry, "{1:}{2:} identical upload already in progress{:_}")
+ errInvalidParts = verror.Register(pkgPath+".errInvalidParts", verror.NoRetry, "{1:}{2:} invalid number of binary parts{:_}")
+ errInvalidPart = verror.Register(pkgPath+".errInvalidPart", verror.NoRetry, "{1:}{2:} invalid binary part number{:_}")
+ errOperationFailed = verror.Register(pkgPath+".errOperationFailed", verror.NoRetry, "{1:}{2:} operation failed{:_}")
)
// TODO(jsimsa): When VDL supports composite literal constants, remove
@@ -77,36 +77,36 @@
const bufferLength = 4096
-func (i *binaryService) Create(_ ipc.ServerContext, nparts int32, mediaInfo repository.MediaInfo) error {
+func (i *binaryService) Create(context ipc.ServerContext, nparts int32, mediaInfo repository.MediaInfo) error {
vlog.Infof("%v.Create(%v, %v)", i.suffix, nparts, mediaInfo)
if nparts < 1 {
- return errInvalidParts
+ return verror.Make(errInvalidParts, context)
}
parent, perm := filepath.Dir(i.path), os.FileMode(0700)
if err := os.MkdirAll(parent, perm); err != nil {
vlog.Errorf("MkdirAll(%v, %v) failed: %v", parent, perm, err)
- return errOperationFailed
+ return verror.Make(errOperationFailed, context)
}
prefix := "creating-"
tmpDir, err := ioutil.TempDir(parent, prefix)
if err != nil {
vlog.Errorf("TempDir(%v, %v) failed: %v", parent, prefix, err)
- return errOperationFailed
+ return verror.Make(errOperationFailed, context)
}
nameFile := filepath.Join(tmpDir, "name")
if err := ioutil.WriteFile(nameFile, []byte(i.suffix), os.FileMode(0600)); err != nil {
vlog.Errorf("WriteFile(%q) failed: %v", nameFile)
- return errOperationFailed
+ return verror.Make(errOperationFailed, context)
}
infoFile := filepath.Join(tmpDir, "mediainfo")
jInfo, err := json.Marshal(mediaInfo)
if err != nil {
vlog.Errorf("json.Marshal(%v) failed: %v", mediaInfo, err)
- return errOperationFailed
+ return verror.Make(errOperationFailed, context)
}
if err := ioutil.WriteFile(infoFile, jInfo, os.FileMode(0600)); err != nil {
vlog.Errorf("WriteFile(%q) failed: %v", infoFile, err)
- return errOperationFailed
+ return verror.Make(errOperationFailed, context)
}
for j := 0; j < int(nparts); j++ {
partPath, partPerm := generatePartPath(tmpDir, j), os.FileMode(0700)
@@ -115,7 +115,7 @@
if err := os.RemoveAll(tmpDir); err != nil {
vlog.Errorf("RemoveAll(%v) failed: %v", tmpDir, err)
}
- return errOperationFailed
+ return verror.Make(errOperationFailed, context)
}
}
// Use os.Rename() to atomically create the binary directory
@@ -127,10 +127,10 @@
}
}()
if linkErr, ok := err.(*os.LinkError); ok && linkErr.Err == syscall.ENOTEMPTY {
- return errExists
+ return verror.Make(verror.Exist, context, i.path)
}
vlog.Errorf("Rename(%v, %v) failed: %v", tmpDir, i.path, err)
- return errOperationFailed
+ return verror.Make(errOperationFailed, context, i.path)
}
return nil
}
@@ -139,21 +139,21 @@
vlog.Infof("%v.Delete()", i.suffix)
if _, err := os.Stat(i.path); err != nil {
if os.IsNotExist(err) {
- return errNotFound
+ return verror.Make(verror.NoExist, context, i.path)
}
vlog.Errorf("Stat(%v) failed: %v", i.path, err)
- return errOperationFailed
+ return verror.Make(errOperationFailed, context)
}
// Use os.Rename() to atomically remove the binary directory
// structure.
path := filepath.Join(filepath.Dir(i.path), "removing-"+filepath.Base(i.path))
if err := os.Rename(i.path, path); err != nil {
vlog.Errorf("Rename(%v, %v) failed: %v", i.path, path, err)
- return errOperationFailed
+ return verror.Make(errOperationFailed, context, i.path)
}
if err := os.RemoveAll(path); err != nil {
vlog.Errorf("Remove(%v) failed: %v", path, err)
- return errOperationFailed
+ return verror.Make(errOperationFailed, context)
}
for {
// Remove the binary and all directories on the path back to the
@@ -167,7 +167,7 @@
break
}
vlog.Errorf("Remove(%v) failed: %v", path, err)
- return errOperationFailed
+ return verror.Make(errOperationFailed, context)
}
}
return nil
@@ -183,7 +183,7 @@
file, err := os.Open(dataPath)
if err != nil {
vlog.Errorf("Open(%v) failed: %v", dataPath, err)
- return errOperationFailed
+ return verror.Make(errOperationFailed, context)
}
defer file.Close()
buffer := make([]byte, bufferLength)
@@ -192,14 +192,14 @@
n, err := file.Read(buffer)
if err != nil && err != io.EOF {
vlog.Errorf("Read() failed: %v", err)
- return errOperationFailed
+ return verror.Make(errOperationFailed, context)
}
if n == 0 {
break
}
if err := sender.Send(buffer[:n]); err != nil {
vlog.Errorf("Send() failed: %v", err)
- return errOperationFailed
+ return verror.Make(errOperationFailed, context)
}
}
return nil
@@ -212,7 +212,7 @@
return i.state.rootURL + "/" + i.suffix, 0, nil
}
-func (i *binaryService) Stat(ipc.ServerContext) ([]binary.PartInfo, repository.MediaInfo, error) {
+func (i *binaryService) Stat(context ipc.ServerContext) ([]binary.PartInfo, repository.MediaInfo, error) {
vlog.Infof("%v.Stat()", i.suffix)
result := make([]binary.PartInfo, 0)
parts, err := getParts(i.path)
@@ -228,7 +228,7 @@
continue
}
vlog.Errorf("ReadFile(%v) failed: %v", checksumFile, err)
- return []binary.PartInfo{}, repository.MediaInfo{}, errOperationFailed
+ return []binary.PartInfo{}, repository.MediaInfo{}, verror.Make(errOperationFailed, context)
}
dataFile := filepath.Join(part, data)
fi, err := os.Stat(dataFile)
@@ -238,7 +238,7 @@
continue
}
vlog.Errorf("Stat(%v) failed: %v", dataFile, err)
- return []binary.PartInfo{}, repository.MediaInfo{}, errOperationFailed
+ return []binary.PartInfo{}, repository.MediaInfo{}, verror.Make(errOperationFailed, context)
}
result = append(result, binary.PartInfo{Checksum: string(bytes), Size: fi.Size()})
}
@@ -246,12 +246,12 @@
jInfo, err := ioutil.ReadFile(infoFile)
if err != nil {
vlog.Errorf("ReadFile(%q) failed: %v", infoFile)
- return []binary.PartInfo{}, repository.MediaInfo{}, errOperationFailed
+ return []binary.PartInfo{}, repository.MediaInfo{}, verror.Make(errOperationFailed, context)
}
var mediaInfo repository.MediaInfo
if err := json.Unmarshal(jInfo, &mediaInfo); err != nil {
vlog.Errorf("json.Unmarshal(%v) failed: %v", jInfo, err)
- return []binary.PartInfo{}, repository.MediaInfo{}, errOperationFailed
+ return []binary.PartInfo{}, repository.MediaInfo{}, verror.Make(errOperationFailed, context)
}
return result, mediaInfo, nil
}
@@ -260,11 +260,9 @@
vlog.Infof("%v.Upload(%v)", i.suffix, part)
path, suffix := i.generatePartPath(int(part)), ""
err := checksumExists(path)
- switch err {
- case nil:
- return errExists
- case errNotFound:
- default:
+ if err == nil {
+ return verror.Make(verror.Exist, context, path)
+ } else if !verror.Is(err, verror.NoExist.ID) {
return err
}
// Use os.OpenFile() to resolve races.
@@ -272,17 +270,17 @@
lockFile, err := os.OpenFile(lockPath, flags, perm)
if err != nil {
if os.IsExist(err) {
- return errInProgress
+ return verror.Make(errInProgress, context, path)
}
vlog.Errorf("OpenFile(%v, %v, %v) failed: %v", lockPath, flags, suffix, err)
- return errOperationFailed
+ return verror.Make(errOperationFailed, context)
}
defer os.Remove(lockFile.Name())
defer lockFile.Close()
file, err := ioutil.TempFile(path, suffix)
if err != nil {
vlog.Errorf("TempFile(%v, %v) failed: %v", path, suffix, err)
- return errOperationFailed
+ return verror.Make(errOperationFailed, context)
}
defer file.Close()
h := md5.New()
@@ -294,7 +292,7 @@
if err := os.Remove(file.Name()); err != nil {
vlog.Errorf("Remove(%v) failed: %v", file.Name(), err)
}
- return errOperationFailed
+ return verror.Make(errOperationFailed, context)
}
h.Write(bytes)
}
@@ -304,7 +302,7 @@
if err := os.Remove(file.Name()); err != nil {
vlog.Errorf("Remove(%v) failed: %v", file.Name(), err)
}
- return errOperationFailed
+ return verror.Make(errOperationFailed, context)
}
hash := hex.EncodeToString(h.Sum(nil))
@@ -314,7 +312,7 @@
if err := os.Remove(file.Name()); err != nil {
vlog.Errorf("Remove(%v) failed: %v", file.Name(), err)
}
- return errOperationFailed
+ return verror.Make(errOperationFailed, context)
}
dataFile := filepath.Join(path, data)
if err := os.Rename(file.Name(), dataFile); err != nil {
@@ -322,19 +320,19 @@
if err := os.Remove(file.Name()); err != nil {
vlog.Errorf("Remove(%v) failed: %v", file.Name(), err)
}
- return errOperationFailed
+ return verror.Make(errOperationFailed, context)
}
return nil
}
-func (i *binaryService) GlobChildren__(ipc.ServerContext) (<-chan string, error) {
+func (i *binaryService) GlobChildren__(context ipc.ServerContext) (<-chan string, error) {
elems := strings.Split(i.suffix, "/")
if len(elems) == 1 && elems[0] == "" {
elems = nil
}
n := i.createObjectNameTree().find(elems, false)
if n == nil {
- return nil, errOperationFailed
+ return nil, verror.Make(errOperationFailed, context)
}
ch := make(chan string, 100)
go func() {
diff --git a/services/mgmt/build/buildd/test.sh b/services/mgmt/build/buildd/test.sh
new file mode 100755
index 0000000..b16b09b
--- /dev/null
+++ b/services/mgmt/build/buildd/test.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+# Test the build server daemon.
+#
+# This test starts a build server daemon and uses the build client to
+# verify that <build>.Build() works as expected.
+
+source "$(go list -f {{.Dir}} veyron.io/veyron/shell/lib)/shell_test.sh"
+
+readonly WORKDIR="${shell_test_WORK_DIR}"
+
+build() {
+ BUILDD_BIN="$(shell_test::build_go_binary 'veyron.io/veyron/veyron/services/mgmt/build/buildd')"
+ BUILD_BIN="$(shell_test::build_go_binary 'veyron.io/veyron/veyron/tools/build')"
+}
+
+main() {
+ cd "${WORKDIR}"
+ build
+
+ shell_test::setup_server_test
+
+ # Start the binary repository daemon.
+ local -r SERVER="buildd-test-server"
+ local GO_BIN=$(which go)
+ local -r GO_ROOT=$("${GO_BIN}" env GOROOT)
+ shell_test::start_server "${BUILDD_BIN}" --name="${SERVER}" --gobin="${GO_BIN}" --goroot="${GO_ROOT}" --veyron.tcp.address=127.0.0.1:0 \
+ || shell_test::fail "line ${LINENO} failed to start server"
+
+ # Create and build a test source file.
+ local -r GO_PATH=$(shell::tmp_dir)
+ local -r BIN_DIR="${GO_PATH}/bin"
+ mkdir -p "${BIN_DIR}"
+ local -r SRC_DIR="${GO_PATH}/src/test"
+ mkdir -p "${SRC_DIR}"
+ local -r SRC_FILE="${SRC_DIR}/test.go"
+ cat > "${SRC_FILE}" <<EOF
+package main
+
+import "fmt"
+
+func main() {
+ fmt.Printf("Hello World!\n")
+}
+EOF
+ GOPATH="${GO_PATH}" GOROOT="${GO_ROOT}" TMPDIR="${BIN_DIR}" "${BUILD_BIN}" build "${SERVER}" "test" || shell_test::fail "line ${LINENO}: 'build' failed"
+ if [[ ! -e "${BIN_DIR}/test" ]]; then
+ shell_test::fail "test binary not found"
+ fi
+ local -r GOT=$("${BIN_DIR}/test")
+ local -r WANT="Hello World!"
+ shell_test::assert_eq "${GOT}" "${WANT}" "${LINENO}"
+
+ shell_test::pass
+}
+
+main "$@"
diff --git a/services/mgmt/build/buildd/testdata/integration_test.go b/services/mgmt/build/buildd/testdata/integration_test.go
index cbcb948..68bae88 100644
--- a/services/mgmt/build/buildd/testdata/integration_test.go
+++ b/services/mgmt/build/buildd/testdata/integration_test.go
@@ -68,9 +68,10 @@
defer handle.CloseStdin()
// Generate credentials.
- root := security.NewPrincipal("root")
- credentials := security.NewVeyronCredentials(root, "test-credentials")
- defer os.RemoveAll(credentials)
+ serverCred, serverPrin := security.NewCredentials("server")
+ defer os.RemoveAll(serverCred)
+ clientCred, _ := security.ForkCredentials(serverPrin, "client")
+ defer os.RemoveAll(clientCred)
// Start the build server.
buildServerBin := filepath.Join(binDir, "buildd")
@@ -86,7 +87,7 @@
args := []string{
"-name=" + buildServerName, "-gobin=" + goBin, "-goroot=" + goRoot,
"-veyron.tcp.address=127.0.0.1:0",
- "-veyron.credentials=" + credentials,
+ "-veyron.credentials=" + serverCred,
"-veyron.namespace.root=" + mtName,
}
serverProcess, err := integration.StartServer(buildServerBin, args)
@@ -116,7 +117,7 @@
}
var buildOut bytes.Buffer
buildArgs := []string{
- "-veyron.credentials=" + credentials,
+ "-veyron.credentials=" + clientCred,
"-veyron.namespace.root=" + mtName,
"build", buildServerName, "test",
}
diff --git a/services/mgmt/build/impl/impl_test.go b/services/mgmt/build/impl/impl_test.go
index 27a7c49..85b4773 100644
--- a/services/mgmt/build/impl/impl_test.go
+++ b/services/mgmt/build/impl/impl_test.go
@@ -48,7 +48,7 @@
t.Fatalf("LookPath(%q) failed: %v", name, err)
}
}
- return pathbin, ""
+ return pathbin, os.Getenv("GOROOT")
}
// startServer starts the build server.
@@ -58,7 +58,7 @@
if err != nil {
t.Fatalf("NewServer() failed: %v", err)
}
- endpoint, err := server.Listen(profiles.LocalListenSpec)
+ endpoints, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
t.Fatalf("Listen(%s) failed: %v", profiles.LocalListenSpec, err)
}
@@ -66,7 +66,7 @@
if err := server.Serve(unpublished, build.BuilderServer(NewBuilderService(gobin, goroot)), nil); err != nil {
t.Fatalf("Serve(%q) failed: %v", unpublished, err)
}
- name := "/" + endpoint.String()
+ name := "/" + endpoints[0].String()
return build.BuilderClient(name), func() {
if err := server.Stop(); err != nil {
t.Fatalf("Stop() failed: %v", err)
@@ -178,6 +178,15 @@
}
}
+const failSrc = `package main
+
+import "fmt"
+
+func main() {
+ ...
+}
+`
+
// TestFailure checks that the build server fails to build a package
// consisting of an empty file.
func TestFailure(t *testing.T) {
@@ -187,10 +196,11 @@
files := []build.File{
build.File{
Name: "test/main.go",
- Contents: []byte(""),
+ Contents: []byte(failSrc),
},
}
- if _, _, err := invokeBuild(t, client, files); err == nil {
+ if output, _, err := invokeBuild(t, client, files); err == nil {
+ t.Logf("%v", string(output))
t.FailNow()
}
}
diff --git a/services/mgmt/build/impl/service.go b/services/mgmt/build/impl/service.go
index 6d723b8..59bec9f 100644
--- a/services/mgmt/build/impl/service.go
+++ b/services/mgmt/build/impl/service.go
@@ -12,13 +12,15 @@
"veyron.io/veyron/veyron2/ipc"
"veyron.io/veyron/veyron2/services/mgmt/binary"
"veyron.io/veyron/veyron2/services/mgmt/build"
- "veyron.io/veyron/veyron2/verror"
+ verror "veyron.io/veyron/veyron2/verror2"
"veyron.io/veyron/veyron2/vlog"
)
+const pkgPath = "veyron.io/veyron/veyron/services/mgmt/build/impl"
+
+// Errors
var (
- errBuildFailed = verror.Internalf("build failed")
- errInternalError = verror.Internalf("internal error")
+ errBuildFailed = verror.Register(pkgPath+".errBuildFailed", verror.NoRetry, "{1:}{2:} build failed{:_}")
)
// builderService implements the Builder server interface.
@@ -47,13 +49,16 @@
root, err := ioutil.TempDir(dir, prefix)
if err != nil {
vlog.Errorf("TempDir(%v, %v) failed: %v", dir, prefix, err)
- return nil, errInternalError
+ return nil, verror.Make(verror.Internal, ctx)
}
defer os.RemoveAll(root)
+ if err := os.Chdir(root); err != nil {
+ vlog.Errorf("Chdir(%v) failed: %v", root, err)
+ }
srcDir := filepath.Join(root, "go", "src")
if err := os.MkdirAll(srcDir, dirPerm); err != nil {
vlog.Errorf("MkdirAll(%v, %v) failed: %v", srcDir, dirPerm, err)
- return nil, errInternalError
+ return nil, verror.Make(verror.Internal, ctx)
}
iterator := ctx.RecvStream()
for iterator.Advance() {
@@ -62,18 +67,18 @@
dir := filepath.Dir(filePath)
if err := os.MkdirAll(dir, dirPerm); err != nil {
vlog.Errorf("MkdirAll(%v, %v) failed: %v", dir, dirPerm, err)
- return nil, errInternalError
+ return nil, verror.Make(verror.Internal, ctx)
}
if err := ioutil.WriteFile(filePath, srcFile.Contents, filePerm); err != nil {
vlog.Errorf("WriteFile(%v, %v) failed: %v", filePath, filePerm, err)
- return nil, errInternalError
+ return nil, verror.Make(verror.Internal, ctx)
}
}
if err := iterator.Err(); err != nil {
vlog.Errorf("Advance() failed: %v", err)
- return nil, errInternalError
+ return nil, verror.Make(verror.Internal, ctx)
}
- cmd := exec.Command(i.gobin, "install", "-v", "...")
+ cmd := exec.Command(i.gobin, "install", "-v", "./...")
cmd.Env = append(cmd.Env, "GOARCH="+string(arch))
cmd.Env = append(cmd.Env, "GOOS="+string(opsys))
cmd.Env = append(cmd.Env, "GOPATH="+filepath.Dir(srcDir))
@@ -88,7 +93,7 @@
if output.Len() != 0 {
vlog.Errorf("%v", output.String())
}
- return output.Bytes(), errBuildFailed
+ return output.Bytes(), verror.Make(errBuildFailed, ctx)
}
binDir := filepath.Join(root, "go", "bin")
if runtime.GOARCH != string(arch) || runtime.GOOS != string(opsys) {
@@ -97,14 +102,14 @@
files, err := ioutil.ReadDir(binDir)
if err != nil && !os.IsNotExist(err) {
vlog.Errorf("ReadDir(%v) failed: %v", binDir, err)
- return nil, errInternalError
+ return nil, verror.Make(verror.Internal, ctx)
}
for _, file := range files {
binPath := filepath.Join(binDir, file.Name())
bytes, err := ioutil.ReadFile(binPath)
if err != nil {
vlog.Errorf("ReadFile(%v) failed: %v", binPath, err)
- return nil, errInternalError
+ return nil, verror.Make(verror.Internal, ctx)
}
result := build.File{
Name: "bin/" + file.Name(),
@@ -112,7 +117,7 @@
}
if err := ctx.SendStream().Send(result); err != nil {
vlog.Errorf("Send() failed: %v", err)
- return nil, errInternalError
+ return nil, verror.Make(verror.Internal, ctx)
}
}
return output.Bytes(), nil
diff --git a/services/mgmt/debug/dispatcher_test.go b/services/mgmt/debug/dispatcher_test.go
index 480de4d..84ba35e 100644
--- a/services/mgmt/debug/dispatcher_test.go
+++ b/services/mgmt/debug/dispatcher_test.go
@@ -20,7 +20,7 @@
"veyron.io/veyron/veyron2/services/mgmt/logreader"
"veyron.io/veyron/veyron2/services/mgmt/stats"
vtracesvc "veyron.io/veyron/veyron2/services/mgmt/vtrace"
- "veyron.io/veyron/veyron2/verror"
+ verror "veyron.io/veyron/veyron2/verror2"
"veyron.io/veyron/veyron2/vtrace"
libstats "veyron.io/veyron/veyron/lib/stats"
@@ -38,14 +38,14 @@
if err != nil {
return "", nil, fmt.Errorf("failed to start debug server: %v", err)
}
- endpoint, err := server.Listen(listenSpec)
+ endpoints, err := server.Listen(listenSpec)
if err != nil {
return "", nil, fmt.Errorf("failed to listen on %s: %v", listenSpec, err)
}
if err := server.ServeDispatcher("", disp); err != nil {
return "", nil, err
}
- ep := endpoint.String()
+ ep := endpoints[0].String()
return ep, func() { server.Stop() }, nil
}
@@ -116,7 +116,7 @@
{
lf := logreader.LogFileClient(naming.JoinAddressName(endpoint, "debug/logs/nosuchfile.INFO"))
_, err = lf.Size(tracedContext())
- if expected := verror.NoExist; !verror.Is(err, expected) {
+ if expected := verror.NoExist.ID; !verror.Is(err, expected) {
t.Errorf("unexpected error value, got %v, want: %v", err, expected)
}
}
@@ -140,7 +140,7 @@
{
st := stats.StatsClient(naming.JoinAddressName(endpoint, "debug/stats/testing/nobodyhome"))
_, err = st.Value(tracedContext())
- if expected := verror.NoExist; !verror.Is(err, expected) {
+ if expected := verror.NoExist.ID; !verror.Is(err, expected) {
t.Errorf("unexpected error value, got %v, want: %v", err, expected)
}
}
diff --git a/services/mgmt/device/deviced/main.go b/services/mgmt/device/deviced/main.go
index 1397a24..e9221ba 100644
--- a/services/mgmt/device/deviced/main.go
+++ b/services/mgmt/device/deviced/main.go
@@ -50,11 +50,11 @@
vlog.Fatalf("NewServer() failed: %v", err)
}
defer server.Stop()
- endpoint, err := server.Listen(roaming.ListenSpec)
+ endpoints, err := server.Listen(roaming.ListenSpec)
if err != nil {
vlog.Fatalf("Listen(%s) failed: %v", roaming.ListenSpec, err)
}
- name := naming.JoinAddressName(endpoint.String(), "")
+ name := naming.JoinAddressName(endpoints[0].String(), "")
vlog.VI(0).Infof("Device manager object name: %v", name)
configState, err := config.Load()
if err != nil {
diff --git a/services/mgmt/device/impl/app_service.go b/services/mgmt/device/impl/app_service.go
index bc37a2a..dc61c02 100644
--- a/services/mgmt/device/impl/app_service.go
+++ b/services/mgmt/device/impl/app_service.go
@@ -446,7 +446,7 @@
installationDir := filepath.Join(root, applicationDirName(app), installationDirName(installation))
if _, err := os.Stat(installationDir); err != nil {
if os.IsNotExist(err) {
- return "", verror2.Make(ErrObjectNoExist, nil)
+ return "", verror2.Make(verror2.NoExist, nil, naming.Join(components...))
}
vlog.Errorf("Stat(%v) failed: %v", installationDir, err)
return "", verror2.Make(ErrOperationFailed, nil)
@@ -1220,7 +1220,7 @@
}
i.scanInstance(tree, i.suffix[0], dir)
default:
- return nil, verror2.Make(ErrObjectNoExist, nil)
+ return nil, verror2.Make(verror2.NoExist, nil, i.suffix)
}
n := tree.find(i.suffix, false)
if n == nil {
diff --git a/services/mgmt/device/impl/device_service.go b/services/mgmt/device/impl/device_service.go
index 7f72437..332699d 100644
--- a/services/mgmt/device/impl/device_service.go
+++ b/services/mgmt/device/impl/device_service.go
@@ -94,13 +94,8 @@
uat BlessingSystemAssociationStore
}
-func (i *deviceService) Claim(call ipc.ServerContext) error {
- // Get the blessing to be used by the claimant.
- blessings := call.Blessings()
- if blessings == nil {
- return verror2.Make(ErrInvalidBlessing, call)
- }
- return i.disp.claimDeviceManager(call.LocalPrincipal(), blessings.ForContext(call), blessings)
+func (i *deviceService) Claim(ctx ipc.ServerContext) error {
+ return i.disp.claimDeviceManager(ctx)
}
func (*deviceService) Describe(ipc.ServerContext) (device.Description, error) {
diff --git a/services/mgmt/device/impl/dispatcher.go b/services/mgmt/device/impl/dispatcher.go
index 237a0ca..59bad06 100644
--- a/services/mgmt/device/impl/dispatcher.go
+++ b/services/mgmt/device/impl/dispatcher.go
@@ -27,8 +27,7 @@
"veyron.io/veyron/veyron2/services/mgmt/pprof"
"veyron.io/veyron/veyron2/services/mgmt/stats"
"veyron.io/veyron/veyron2/services/security/access"
- "veyron.io/veyron/veyron2/verror"
- "veyron.io/veyron/veyron2/verror2"
+ verror "veyron.io/veyron/veyron2/verror2"
"veyron.io/veyron/veyron2/vlog"
)
@@ -77,14 +76,13 @@
)
var (
- ErrInvalidSuffix = verror2.Register(pkgPath+".InvalidSuffix", verror2.NoRetry, "")
- ErrOperationFailed = verror2.Register(pkgPath+".OperationFailed", verror2.NoRetry, "")
- ErrOperationInProgress = verror2.Register(pkgPath+".OperationInProgress", verror2.NoRetry, "")
- ErrAppTitleMismatch = verror2.Register(pkgPath+".AppTitleMismatch", verror2.NoRetry, "")
- ErrUpdateNoOp = verror2.Register(pkgPath+".UpdateNoOp", verror2.NoRetry, "")
- ErrObjectNoExist = verror2.Register(pkgPath+".ObjectNoExist", verror2.NoRetry, "")
- ErrInvalidOperation = verror2.Register(pkgPath+".InvalidOperation", verror2.NoRetry, "")
- ErrInvalidBlessing = verror2.Register(pkgPath+".InvalidBlessing", verror2.NoRetry, "")
+ ErrInvalidSuffix = verror.Register(pkgPath+".InvalidSuffix", verror.NoRetry, "{1:}{2:} invalid suffix{:_}")
+ ErrOperationFailed = verror.Register(pkgPath+".OperationFailed", verror.NoRetry, "{1:}{2:} operation failed{:_}")
+ ErrOperationInProgress = verror.Register(pkgPath+".OperationInProgress", verror.NoRetry, "{1:}{2:} operation in progress{:_}")
+ ErrAppTitleMismatch = verror.Register(pkgPath+".AppTitleMismatch", verror.NoRetry, "{1:}{2:} app title mismatch{:_}")
+ ErrUpdateNoOp = verror.Register(pkgPath+".UpdateNoOp", verror.NoRetry, "{1:}{2:} update is no op{:_}")
+ ErrInvalidOperation = verror.Register(pkgPath+".InvalidOperation", verror.NoRetry, "{1:}{2:} invalid operation{:_}")
+ ErrInvalidBlessing = verror.Register(pkgPath+".InvalidBlessing", verror.NoRetry, "{1:}{2:} invalid blessing{:_}")
)
// NewDispatcher is the device manager dispatcher factory.
@@ -158,15 +156,26 @@
return
}
-func (d *dispatcher) claimDeviceManager(principal security.Principal, names []string, proof security.Blessings) error {
- // TODO(gauthamt): Should we start trusting these identity providers?
+func (d *dispatcher) claimDeviceManager(ctx ipc.ServerContext) error {
// TODO(rjkroege): Scrub the state tree of installation and instance ACL files.
- if len(names) == 0 {
- vlog.Errorf("No names for claimer(%v) are trusted", proof)
- return verror2.Make(ErrOperationFailed, nil)
+
+ // Get the blessings to be used by the claimant.
+ blessings := ctx.Blessings()
+ if blessings == nil {
+ return verror.Make(ErrInvalidBlessing, ctx)
}
- principal.BlessingStore().Set(proof, security.AllPrincipals)
- principal.BlessingStore().SetDefault(proof)
+ principal := ctx.LocalPrincipal()
+ if err := principal.AddToRoots(blessings); err != nil {
+ vlog.Errorf("principal.AddToRoots(%s) failed: %v", blessings, err)
+ return verror.Make(ErrInvalidBlessing, ctx)
+ }
+ names := blessings.ForContext(ctx)
+ if len(names) == 0 {
+ vlog.Errorf("No names for claimer(%v) are trusted", blessings)
+ return verror.Make(ErrOperationFailed, nil)
+ }
+ principal.BlessingStore().Set(blessings, security.AllPrincipals)
+ principal.BlessingStore().SetDefault(blessings)
// Create ACLs to transfer devicemanager permissions to the provided identity.
acl := make(access.TaggedACLMap)
for _, n := range names {
@@ -177,11 +186,11 @@
_, etag, err := d.getACL()
if err != nil {
vlog.Errorf("Failed to getACL:%v", err)
- return verror2.Make(ErrOperationFailed, nil)
+ return verror.Make(ErrOperationFailed, nil)
}
if err := d.setACL(principal, acl, etag, true /* store ACL on disk */); err != nil {
vlog.Errorf("Failed to setACL:%v", err)
- return verror2.Make(ErrOperationFailed, nil)
+ return verror.Make(ErrOperationFailed, nil)
}
return nil
}
@@ -219,7 +228,7 @@
}
if len(etag) > 0 && etag != curEtag {
- return verror.Make(access.ErrBadEtag, fmt.Sprintf("etag mismatch in:%s vers:%s", etag, curEtag))
+ return verror.Make(access.BadEtag, nil, etag, curEtag)
}
return writeACLs(principal, aclpath, sigpath, dir, acl)
@@ -276,27 +285,27 @@
data, err := ioutil.TempFile(dir, "data")
if err != nil {
vlog.Errorf("Failed to open tmpfile data:%v", err)
- return verror2.Make(ErrOperationFailed, nil)
+ return verror.Make(ErrOperationFailed, nil)
}
defer os.Remove(data.Name())
sig, err := ioutil.TempFile(dir, "sig")
if err != nil {
vlog.Errorf("Failed to open tmpfile sig:%v", err)
- return verror2.Make(ErrOperationFailed, nil)
+ return verror.Make(ErrOperationFailed, nil)
}
defer os.Remove(sig.Name())
writer, err := serialization.NewSigningWriteCloser(data, sig, principal, nil)
if err != nil {
vlog.Errorf("Failed to create NewSigningWriteCloser:%v", err)
- return verror2.Make(ErrOperationFailed, nil)
+ return verror.Make(ErrOperationFailed, nil)
}
if err = acl.WriteTo(writer); err != nil {
vlog.Errorf("Failed to SaveACL:%v", err)
- return verror2.Make(ErrOperationFailed, nil)
+ return verror.Make(ErrOperationFailed, nil)
}
if err = writer.Close(); err != nil {
vlog.Errorf("Failed to Close() SigningWriteCloser:%v", err)
- return verror2.Make(ErrOperationFailed, nil)
+ return verror.Make(ErrOperationFailed, nil)
}
if err := os.Rename(data.Name(), aclFile); err != nil {
return err
@@ -313,7 +322,7 @@
aclFile, sigFile, devicedata := d.getACLFilePaths()
if len(etag) > 0 && etag != d.etag {
- return verror.Make(access.ErrBadEtag, fmt.Sprintf("etag mismatch in:%s vers:%s", etag, d.etag))
+ return verror.Make(access.BadEtag, nil, etag, d.etag)
}
if writeToFile {
if err := writeACLs(principal, aclFile, sigFile, devicedata, acl); err != nil {
@@ -385,7 +394,7 @@
return nil, nil, err
}
if !instanceStateIs(appInstanceDir, started) {
- return nil, nil, verror2.Make(ErrInvalidSuffix, nil)
+ return nil, nil, verror.Make(ErrInvalidSuffix, nil)
}
var sigStub signatureStub
if kind == "pprof" {
@@ -423,7 +432,7 @@
return receiver, appSpecificAuthorizer, nil
case configSuffix:
if len(components) != 2 {
- return nil, nil, verror2.Make(ErrInvalidSuffix, nil)
+ return nil, nil, verror.Make(ErrInvalidSuffix, nil)
}
receiver := idevice.ConfigServer(&configService{
callback: d.internal.callback,
@@ -438,7 +447,7 @@
// (and not other apps).
return receiver, nil, nil
default:
- return nil, nil, verror2.Make(ErrInvalidSuffix, nil)
+ return nil, nil, verror.Make(ErrInvalidSuffix, nil)
}
}
@@ -468,11 +477,14 @@
}
return access.TaggedACLAuthorizerFromFile(path.Join(p, "acls", "data"), access.TypicalTagType())
}
- return nil, verror2.Make(ErrInvalidSuffix, nil)
+ return nil, verror.Make(ErrInvalidSuffix, nil)
}
// allowEveryone implements the authorization policy that allows all principals
// access.
type allowEveryone struct{}
-func (allowEveryone) Authorize(security.Context) error { return nil }
+func (allowEveryone) Authorize(ctx security.Context) error {
+ vlog.Infof("Device manager is unclaimed. Allow %q.%s() from %q.", ctx.Suffix(), ctx.Method(), ctx.RemoteBlessings())
+ return nil
+}
diff --git a/services/mgmt/device/impl/impl_test.go b/services/mgmt/device/impl/impl_test.go
index 0bd4d5a..4f2e138 100644
--- a/services/mgmt/device/impl/impl_test.go
+++ b/services/mgmt/device/impl/impl_test.go
@@ -31,6 +31,7 @@
"veyron.io/veyron/veyron2/context"
"veyron.io/veyron/veyron2/ipc"
"veyron.io/veyron/veyron2/naming"
+ "veyron.io/veyron/veyron2/options"
"veyron.io/veyron/veyron2/rt"
"veyron.io/veyron/veyron2/security"
"veyron.io/veyron/veyron2/services/mgmt/application"
@@ -40,7 +41,7 @@
"veyron.io/veyron/veyron2/services/mgmt/stats"
"veyron.io/veyron/veyron2/services/security/access"
"veyron.io/veyron/veyron2/vdl/vdlutil"
- "veyron.io/veyron/veyron2/verror"
+ verror "veyron.io/veyron/veyron2/verror2"
"veyron.io/veyron/veyron2/vlog"
"veyron.io/veyron/veyron/lib/expect"
@@ -75,14 +76,14 @@
if modules.IsModulesProcess() {
return
}
- initRT()
+ initRT(options.RuntimePrincipal{tsecurity.NewPrincipal("test-principal")})
}
var globalRT veyron2.Runtime
-func initRT() {
+func initRT(opts ...veyron2.ROpt) {
var err error
- if globalRT, err = rt.New(); err != nil {
+ if globalRT, err = rt.New(opts...); err != nil {
panic(err)
}
@@ -494,7 +495,7 @@
func setupPingServer(t *testing.T) (<-chan string, func()) {
server, _ := newServer()
pingCh := make(chan string, 1)
- if err := server.Serve("pingserver", pingServer(pingCh), nil); err != nil {
+ if err := server.Serve("pingserver", pingServer(pingCh), &openAuthorizer{}); err != nil {
t.Fatalf("Serve(%q, <dispatcher>) failed: %v", "pingserver", err)
}
return pingCh, func() {
@@ -726,8 +727,8 @@
dms.ExpectEOF()
}
-func newRuntime(t *testing.T) veyron2.Runtime {
- runtime, err := rt.New()
+func newRuntime(t *testing.T, opts ...veyron2.ROpt) veyron2.Runtime {
+ runtime, err := rt.New(opts...)
if err != nil {
t.Fatalf("rt.New() failed: %v", err)
}
@@ -807,9 +808,10 @@
*envelope = envelopeFromShell(sh, nil, appCmd, "google naps", "trapp")
- deviceStub := device.DeviceClient("dm//device")
- selfRT := globalRT
- otherRT := newRuntime(t)
+ deviceStub := device.DeviceClient("dm/device")
+ claimantRT := newRuntime(t, options.RuntimePrincipal{tsecurity.NewPrincipal("claimant")})
+ defer claimantRT.Cleanup()
+ otherRT := newRuntime(t, options.RuntimePrincipal{tsecurity.NewPrincipal("other")})
defer otherRT.Cleanup()
octx := otherRT.NewContext()
@@ -817,16 +819,16 @@
// Devicemanager should have open ACLs before we claim it and so an
// Install from otherRT should succeed.
if err := tryInstall(octx); err != nil {
- t.Fatalf("Failed to install: %s", err)
+ t.Errorf("Failed to install: %s", err)
}
- // Claim the devicemanager with selfRT as <defaultblessing>/mydevice
- if err := deviceStub.Claim(selfRT.NewContext(), &granter{p: selfRT.Principal(), extension: "mydevice"}); err != nil {
+ // Claim the devicemanager with claimantRT as <defaultblessing>/mydevice
+ if err := deviceStub.Claim(claimantRT.NewContext(), &granter{p: claimantRT.Principal(), extension: "mydevice"}); err != nil {
t.Fatal(err)
}
- // Installation should succeed since globalRT (a.k.a. selfRT) is now the
- // "owner" of the devicemanager.
- appID := installApp(t)
+ // Installation should succeed since claimantRT is now the "owner" of
+ // the devicemanager.
+ appID := installApp(t, claimantRT)
// otherRT should be unable to install though, since the ACLs have
// changed now.
@@ -839,7 +841,7 @@
defer cleanup()
// Start an instance of the app.
- instanceID := startApp(t, appID)
+ instanceID := startApp(t, appID, claimantRT)
// Wait until the app pings us that it's ready.
select {
@@ -848,7 +850,7 @@
t.Fatalf("failed to get ping")
}
resolve(t, "trapp", 1)
- suspendApp(t, appID, instanceID)
+ suspendApp(t, appID, instanceID, claimantRT)
// TODO(gauthamt): Test that ACLs persist across devicemanager restarts
}
@@ -1403,7 +1405,7 @@
// Start an instance of the app but this time it should fail: we do not
// have an associated uname for the invoking identity.
- startAppExpectError(t, appID, verror.NoAccess, selfRT)
+ startAppExpectError(t, appID, verror.NoAccess.ID, selfRT)
// Create an association for selfRT
if err := deviceStub.AssociateAccount(selfRT.NewContext(), []string{"root/self"}, testUserName); err != nil {
@@ -1415,7 +1417,7 @@
stopApp(t, appID, instance1ID, selfRT)
vlog.VI(2).Infof("other attempting to run an app without access. Should fail.")
- startAppExpectError(t, appID, verror.NoAccess, otherRT)
+ startAppExpectError(t, appID, verror.NoAccess.ID, otherRT)
// Self will now let other also install apps.
if err := deviceStub.AssociateAccount(selfRT.NewContext(), []string{"root/other"}, testUserName); err != nil {
@@ -1436,7 +1438,7 @@
// other doesn't have execution permissions for the app. So this will
// fail.
vlog.VI(2).Infof("other attempting to run an app still without access. Should fail.")
- startAppExpectError(t, appID, verror.NoAccess, otherRT)
+ startAppExpectError(t, appID, verror.NoAccess.ID, otherRT)
// But self can give other permissions to start applications.
vlog.VI(2).Infof("self attempting to give other permission to start %s", appID)
@@ -1475,7 +1477,7 @@
}
vlog.VI(2).Infof("Show that Resume with a different systemName fails.")
- resumeAppExpectError(t, appID, instance2ID, verror.NoAccess, otherRT)
+ resumeAppExpectError(t, appID, instance2ID, verror.NoAccess.ID, otherRT)
// Clean up.
stopApp(t, appID, instance2ID, otherRT)
diff --git a/services/mgmt/device/impl/mock_repo_test.go b/services/mgmt/device/impl/mock_repo_test.go
index 0c34ddc..58438b0 100644
--- a/services/mgmt/device/impl/mock_repo_test.go
+++ b/services/mgmt/device/impl/mock_repo_test.go
@@ -9,6 +9,7 @@
"testing"
"veyron.io/veyron/veyron2/ipc"
+ "veyron.io/veyron/veyron2/security"
"veyron.io/veyron/veyron2/services/mgmt/application"
"veyron.io/veyron/veyron2/services/mgmt/binary"
"veyron.io/veyron/veyron2/services/mgmt/repository"
@@ -36,7 +37,7 @@
server, _ := newServer()
invoker := new(arInvoker)
name := mockApplicationRepoName
- if err := server.Serve(name, repository.ApplicationServer(invoker), nil); err != nil {
+ if err := server.Serve(name, repository.ApplicationServer(invoker), &openAuthorizer{}); err != nil {
vlog.Fatalf("Serve(%v) failed: %v", name, err)
}
return &invoker.envelope, func() {
@@ -46,6 +47,10 @@
}
}
+type openAuthorizer struct{}
+
+func (openAuthorizer) Authorize(security.Context) error { return nil }
+
// arInvoker holds the state of an application repository invocation mock. The
// mock returns the value of the wrapped envelope, which can be subsequently be
// changed at any time. Client is responsible for synchronization if desired.
@@ -68,7 +73,7 @@
func startBinaryRepository() func() {
server, _ := newServer()
name := mockBinaryRepoName
- if err := server.Serve(name, repository.BinaryServer(new(brInvoker)), nil); err != nil {
+ if err := server.Serve(name, repository.BinaryServer(new(brInvoker)), &openAuthorizer{}); err != nil {
vlog.Fatalf("Serve(%q) failed: %v", name, err)
}
return func() {
diff --git a/services/mgmt/device/impl/proxy_invoker_test.go b/services/mgmt/device/impl/proxy_invoker_test.go
index e1caf15..8ef35ac 100644
--- a/services/mgmt/device/impl/proxy_invoker_test.go
+++ b/services/mgmt/device/impl/proxy_invoker_test.go
@@ -11,6 +11,7 @@
"veyron.io/veyron/veyron2/security"
"veyron.io/veyron/veyron2/services/mgmt/stats"
"veyron.io/veyron/veyron2/services/security/access"
+ "veyron.io/veyron/veyron2/vlog"
"veyron.io/veyron/veyron/lib/testutil"
)
@@ -30,8 +31,8 @@
t.Fatalf("NewServer: %v", err)
}
defer server1.Stop()
- localSpec := ipc.ListenSpec{Protocol: "tcp", Address: "127.0.0.1:0"}
- ep1, err := server1.Listen(localSpec)
+ localSpec := ipc.ListenSpec{Addrs: ipc.ListenAddrs{{"tcp", "127.0.0.1:0"}}}
+ eps1, err := server1.Listen(localSpec)
if err != nil {
t.Fatalf("Listen: %v", err)
}
@@ -45,13 +46,13 @@
t.Fatalf("NewServer: %v", err)
}
defer server2.Stop()
- ep2, err := server2.Listen(localSpec)
+ eps2, err := server2.Listen(localSpec)
if err != nil {
t.Fatalf("Listen: %v", err)
}
disp := &proxyDispatcher{
runtime,
- naming.JoinAddressName(ep1.String(), "__debug/stats"),
+ naming.JoinAddressName(eps1[0].String(), "__debug/stats"),
stats.StatsServer(nil),
}
if err := server2.ServeDispatcher("", disp); err != nil {
@@ -59,14 +60,14 @@
}
// Call Value()
- name := naming.JoinAddressName(ep2.String(), "system/start-time-rfc1123")
+ name := naming.JoinAddressName(eps2[0].String(), "system/start-time-rfc1123")
c := stats.StatsClient(name)
if _, err := c.Value(runtime.NewContext()); err != nil {
- t.Errorf("%q.Value() error: %v", name, err)
+ t.Fatalf("%q.Value() error: %v", name, err)
}
// Call Glob()
- results, err := testutil.GlobName(runtime.NewContext(), naming.JoinAddressName(ep2.String(), "system"), "start-time-*")
+ results, err := testutil.GlobName(runtime.NewContext(), naming.JoinAddressName(eps2[0].String(), "system"), "start-time-*")
if err != nil {
t.Fatalf("Glob failed: %v", err)
}
@@ -90,6 +91,7 @@
}
func (d *proxyDispatcher) Lookup(suffix string) (interface{}, security.Authorizer, error) {
+ vlog.Infof("LOOKUP(%s): remote .... %s", suffix, d.remote)
invoker := &proxyInvoker{
remote: naming.Join(d.remote, suffix),
access: access.Debug,
diff --git a/services/mgmt/device/impl/util_test.go b/services/mgmt/device/impl/util_test.go
index 197453c..0293a99 100644
--- a/services/mgmt/device/impl/util_test.go
+++ b/services/mgmt/device/impl/util_test.go
@@ -26,7 +26,7 @@
"veyron.io/veyron/veyron/lib/modules"
"veyron.io/veyron/veyron/lib/modules/core"
tsecurity "veyron.io/veyron/veyron/lib/testutil/security"
- "veyron.io/veyron/veyron/profiles/static"
+ _ "veyron.io/veyron/veyron/profiles/static"
"veyron.io/veyron/veyron/services/mgmt/device/impl"
"veyron.io/veyron/veyron2/services/mgmt/application"
)
@@ -53,6 +53,7 @@
t.Fatalf("failed to start root mount table: %s", err)
}
s := expect.NewSession(t, h.Stdout(), expectTimeout)
+ s.ExpectVar("PID")
rootName := s.ExpectVar("MT_NAME")
if t.Failed() {
t.Fatalf("failed to read mt name: %s", s.Error())
@@ -61,7 +62,7 @@
}
func credentialsForChild(blessing string) (string, []string) {
- creds := tsecurity.NewVeyronCredentials(globalRT.Principal(), blessing)
+ creds, _ := tsecurity.ForkCredentials(globalRT.Principal(), blessing)
return creds, []string{consts.VeyronCredentials + "=" + creds}
}
@@ -162,13 +163,12 @@
if err != nil {
vlog.Fatalf("NewServer() failed: %v", err)
}
- spec := static.ListenSpec
- spec.Address = "127.0.0.1:0" // Isn't this the default?
- endpoint, err := server.Listen(spec)
+ spec := ipc.ListenSpec{Addrs: ipc.ListenAddrs{{"tcp", "127.0.0.1:0"}}}
+ endpoints, err := server.Listen(spec)
if err != nil {
- vlog.Fatalf("Listen(%s) failed: %v", static.ListenSpec, err)
+ vlog.Fatalf("Listen(%s) failed: %v", spec, err)
}
- return server, endpoint.String()
+ return server, endpoints[0].String()
}
// resolveExpectNotFound verifies that the given name is not in the mounttable.
diff --git a/services/mgmt/lib/binary/impl.go b/services/mgmt/lib/binary/impl.go
index 2688fbd..e66a2a6 100644
--- a/services/mgmt/lib/binary/impl.go
+++ b/services/mgmt/lib/binary/impl.go
@@ -17,15 +17,16 @@
"veyron.io/veyron/veyron2/context"
"veyron.io/veyron/veyron2/services/mgmt/binary"
"veyron.io/veyron/veyron2/services/mgmt/repository"
- "veyron.io/veyron/veyron2/verror"
+ verror "veyron.io/veyron/veyron2/verror2"
"veyron.io/veyron/veyron2/vlog"
"veyron.io/veyron/veyron/services/mgmt/lib/packages"
)
+const pkgPath = "veyron.io/veyron/veyron/services/mgmt/lib/binary"
+
var (
- errOperationFailed = verror.Internalf("operation failed")
- errNotExist = verror.NoExistf("binary does not exist")
+ errOperationFailed = verror.Register(pkgPath+".errOperationFailed", verror.NoRetry, "{1:}{2:} operation failed{:_}")
)
const (
@@ -53,7 +54,7 @@
}
for _, part := range parts {
if part.Checksum == binary.MissingChecksum {
- return repository.MediaInfo{}, errNotExist
+ return repository.MediaInfo{}, verror.Make(verror.NoExist, ctx)
}
}
offset, whence := int64(0), 0
@@ -104,7 +105,7 @@
success = true
}
if !success {
- return repository.MediaInfo{}, errOperationFailed
+ return repository.MediaInfo{}, verror.Make(errOperationFailed, ctx)
}
offset += part.Size
}
@@ -116,7 +117,7 @@
file, err := ioutil.TempFile(dir, prefix)
if err != nil {
vlog.Errorf("TempFile(%v, %v) failed: %v", dir, prefix, err)
- return nil, repository.MediaInfo{}, errOperationFailed
+ return nil, repository.MediaInfo{}, verror.Make(errOperationFailed, ctx)
}
defer os.Remove(file.Name())
defer file.Close()
@@ -124,12 +125,12 @@
defer cancel()
mediaInfo, err := download(ctx, file, von)
if err != nil {
- return nil, repository.MediaInfo{}, errOperationFailed
+ return nil, repository.MediaInfo{}, verror.Make(errOperationFailed, ctx)
}
bytes, err := ioutil.ReadFile(file.Name())
if err != nil {
vlog.Errorf("ReadFile(%v) failed: %v", file.Name(), err)
- return nil, repository.MediaInfo{}, errOperationFailed
+ return nil, repository.MediaInfo{}, verror.Make(errOperationFailed, ctx)
}
return bytes, mediaInfo, nil
}
@@ -139,7 +140,7 @@
file, err := ioutil.TempFile(dir, prefix)
if err != nil {
vlog.Errorf("TempFile(%v, %v) failed: %v", dir, prefix, err)
- return errOperationFailed
+ return verror.Make(errOperationFailed, ctx)
}
defer file.Close()
ctx, cancel := ctx.WithTimeout(time.Minute)
@@ -149,7 +150,7 @@
if err := os.Remove(file.Name()); err != nil {
vlog.Errorf("Remove(%v) failed: %v", file.Name(), err)
}
- return errOperationFailed
+ return verror.Make(errOperationFailed, ctx)
}
perm := os.FileMode(0600)
if err := file.Chmod(perm); err != nil {
@@ -157,21 +158,21 @@
if err := os.Remove(file.Name()); err != nil {
vlog.Errorf("Remove(%v) failed: %v", file.Name(), err)
}
- return errOperationFailed
+ return verror.Make(errOperationFailed, ctx)
}
if err := os.Rename(file.Name(), path); err != nil {
vlog.Errorf("Rename(%v, %v) failed: %v", file.Name(), path, err)
if err := os.Remove(file.Name()); err != nil {
vlog.Errorf("Remove(%v) failed: %v", file.Name(), err)
}
- return errOperationFailed
+ return verror.Make(errOperationFailed, ctx)
}
if err := packages.SaveMediaInfo(path, mediaInfo); err != nil {
vlog.Errorf("packages.SaveMediaInfo(%v, %v) failed: %v", path, mediaInfo, err)
if err := os.Remove(path); err != nil {
vlog.Errorf("Remove(%v) failed: %v", path, err)
}
- return errOperationFailed
+ return verror.Make(errOperationFailed, ctx)
}
return nil
}
@@ -193,7 +194,7 @@
size, err := r.Seek(offset, whence)
if err != nil {
vlog.Errorf("Seek(%v, %v) failed: %v", offset, whence, err)
- return errOperationFailed
+ return verror.Make(errOperationFailed, ctx)
}
nparts := (size-1)/partSize + 1
if err := client.Create(ctx, int32(nparts), mediaInfo); err != nil {
@@ -272,7 +273,7 @@
success = true
}
if !success {
- return errOperationFailed
+ return verror.Make(errOperationFailed, ctx)
}
}
return nil
@@ -290,7 +291,7 @@
defer file.Close()
if err != nil {
vlog.Errorf("Open(%v) failed: %v", err)
- return errOperationFailed
+ return verror.Make(errOperationFailed, ctx)
}
ctx, cancel := ctx.WithTimeout(time.Minute)
defer cancel()
diff --git a/services/mgmt/lib/binary/impl_test.go b/services/mgmt/lib/binary/impl_test.go
index 216cfd1..7d6e589 100644
--- a/services/mgmt/lib/binary/impl_test.go
+++ b/services/mgmt/lib/binary/impl_test.go
@@ -56,7 +56,7 @@
t.Fatalf("NewState(%v, %v) failed: %v", rootDir, depth, err)
}
dispatcher := impl.NewDispatcher(state, nil)
- endpoint, err := server.Listen(profiles.LocalListenSpec)
+ endpoints, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
t.Fatalf("Listen(%s) failed: %v", profiles.LocalListenSpec, err)
}
@@ -64,7 +64,7 @@
if err := server.ServeDispatcher(suffix, dispatcher); err != nil {
t.Fatalf("Serve(%v, %v) failed: %v", suffix, dispatcher, err)
}
- von := naming.JoinAddressName(endpoint.String(), "test")
+ von := naming.JoinAddressName(endpoints[0].String(), "test")
return von, func() {
if err := os.Remove(path); err != nil {
t.Fatalf("Remove(%v) failed: %v", path, err)
diff --git a/services/mgmt/lib/fs/simplestore.go b/services/mgmt/lib/fs/simplestore.go
index cf1d3b1..329d348 100644
--- a/services/mgmt/lib/fs/simplestore.go
+++ b/services/mgmt/lib/fs/simplestore.go
@@ -12,12 +12,25 @@
"veyron.io/veyron/veyron/services/mgmt/profile"
"veyron.io/veyron/veyron2/services/mgmt/application"
- "veyron.io/veyron/veyron2/verror"
+ verror "veyron.io/veyron/veyron2/verror2"
)
// TODO(rjkroege@google.com) Switch Memstore to the mid-August 2014
// style store API.
+const pkgPath = "veyron.io/veyron/veyron/services/mgmt/lib/fs"
+
+// Errors
+var (
+ ErrNoRecursiveCreateTransaction = verror.Register(pkgPath+".ErrNoRecursiveCreateTransaction", verror.NoRetry, "{1:}{2:} recursive CreateTransaction() not permitted{:_}")
+ ErrDoubleCommit = verror.Register(pkgPath+".ErrDoubleCommit", verror.NoRetry, "{1:}{2:} illegal attempt to commit previously committed or abandonned transaction{:_}")
+ ErrAbortWithoutTransaction = verror.Register(pkgPath+".ErrAbortWithoutTransaction", verror.NoRetry, "{1:}{2:} illegal attempt to abort non-existent transaction{:_}")
+ ErrWithoutTransaction = verror.Register(pkgPath+".ErrRemoveWithoutTransaction", verror.NoRetry, "{1:}{2:} call without a transaction{:_}")
+ ErrNotInMemStore = verror.Register(pkgPath+".ErrNotInMemStore", verror.NoRetry, "{1:}{2:} not in Memstore{:_}")
+ ErrUnsupportedType = verror.Register(pkgPath+".ErrUnsupportedType", verror.NoRetry, "{1:}{2:} attempted Put to Memstore of unsupported type{:_}")
+ ErrChildrenWithoutLock = verror.Register(pkgPath+".ErrChildrenWithoutLock", verror.NoRetry, "{1:}{2:} Children() without a lock{:_}")
+)
+
// Memstore contains the state of the memstore. It supports a single
// transaction at a time. The current state of a Memstore under a
// transactional name binding is the contents of puts then the contents
@@ -175,7 +188,7 @@
// CreateTransaction requires the caller to acquire a lock on the Memstore.
func (ms *Memstore) CreateTransaction(_ interface{}) (string, error) {
if ms.puts != nil || ms.removes != nil {
- return "", verror.BadProtocolf("recursive CreateTransaction() not permitted")
+ return "", verror.Make(ErrNoRecursiveCreateTransaction, nil)
}
ms.newTransactionState()
return transactionNamePrefix, nil
@@ -184,7 +197,7 @@
// Commit updates the store and persists the result.
func (ms *Memstore) Commit(_ interface{}) error {
if !ms.locked || ms.puts == nil || ms.removes == nil {
- return verror.BadProtocolf("illegal attempt to commit previously committed or abandonned transaction")
+ return verror.Make(ErrDoubleCommit, nil)
}
for k, v := range ms.puts {
ms.data[k] = v
@@ -197,23 +210,23 @@
func (ms *Memstore) Abort(_ interface{}) error {
if !ms.locked {
- return verror.BadProtocolf("illegal attempt to abort non-existent transaction")
+ return verror.Make(ErrAbortWithoutTransaction, nil)
}
return nil
}
func (o *boundObject) Remove(_ interface{}) error {
if !o.ms.locked {
- return verror.BadProtocolf("Remove() without a transaction.")
+ return verror.Make(ErrWithoutTransaction, nil, "Remove()")
}
if _, pendingRemoval := o.ms.removes[o.path]; pendingRemoval {
- return verror.NoExistf("path %s not in Memstore", o.path)
+ return verror.Make(ErrNotInMemStore, nil, o.path)
}
_, found := o.ms.data[o.path]
if !found && !o.ms.removeChildren(o.path) {
- return verror.NoExistf("path %s not in Memstore", o.path)
+ return verror.Make(ErrNotInMemStore, nil, o.path)
}
delete(o.ms.puts, o.path)
o.ms.removes[o.path] = keyExists
@@ -287,7 +300,7 @@
found := inPuts || (inBase && !inRemoves)
if !found {
- return nil, verror.NoExistf("path %s not in Memstore", o.path)
+ return nil, verror.Make(ErrNotInMemStore, nil, o.path)
}
if inPuts {
@@ -302,7 +315,7 @@
bv, inBase := o.ms.data[o.path]
if !inBase {
- return nil, verror.NoExistf("path %s not in Memstore", o.path)
+ return nil, verror.Make(ErrNotInMemStore, nil, o.path)
}
o.Value = bv
@@ -319,7 +332,7 @@
func (o *boundObject) Put(_ interface{}, envelope interface{}) (*boundObject, error) {
if !o.ms.locked {
- return nil, verror.BadProtocolf("Put() without a transaction.")
+ return nil, verror.Make(ErrWithoutTransaction, nil, "Put()")
}
switch v := envelope.(type) {
case application.Envelope, profile.Specification:
@@ -328,13 +341,13 @@
o.Value = o.path
return o, nil
default:
- return o, verror.BadProtocolf("attempted Put to Memstore of unsupported type")
+ return o, verror.Make(ErrUnsupportedType, nil)
}
}
func (o *boundObject) Children() ([]string, error) {
if !o.ms.locked {
- return nil, verror.BadProtocolf("Children() without a lock.")
+ return nil, verror.Make(ErrChildrenWithoutLock, nil)
}
found := false
set := make(map[string]struct{})
@@ -359,7 +372,7 @@
}
}
if !found {
- return nil, verror.NoExistf("object %q does not exist", o.path)
+ return nil, verror.Make(verror.NoExist, nil, o.path)
}
children := make([]string, len(set))
i := 0
diff --git a/services/mgmt/lib/fs/simplestore_test.go b/services/mgmt/lib/fs/simplestore_test.go
index 9957121..b644f76 100644
--- a/services/mgmt/lib/fs/simplestore_test.go
+++ b/services/mgmt/lib/fs/simplestore_test.go
@@ -11,7 +11,7 @@
_ "veyron.io/veyron/veyron/services/mgmt/profile"
"veyron.io/veyron/veyron2/naming"
"veyron.io/veyron/veyron2/services/mgmt/application"
- "veyron.io/veyron/veyron2/verror"
+ verror "veyron.io/veyron/veyron2/verror2"
)
func tempFile(t *testing.T) string {
@@ -247,18 +247,18 @@
}
// At which point, Get() on the transaction won't find anything.
- if _, err := memstoreOriginal.BindObject(fs.TP("/test/a")).Get(nil); !verror.Is(err, verror.NoExist) {
- t.Fatalf("Get() should have failed: got %v, expected %v", err, verror.NoExistf("path %s not in Memstore", tname+"/test/a"))
+ if _, err := memstoreOriginal.BindObject(fs.TP("/test/a")).Get(nil); !verror.Is(err, fs.ErrNotInMemStore.ID) {
+ t.Fatalf("Get() should have failed: got %v, expected %v", err, verror.Make(fs.ErrNotInMemStore, nil, tname+"/test/a"))
}
// Attempting to Remove() it over again will fail.
- if err := memstoreOriginal.BindObject(fs.TP("/test/a")).Remove(nil); !verror.Is(err, verror.NoExist) {
- t.Fatalf("Remove() should have failed: got %v, expected %v", err, verror.NoExistf("path %s not in Memstore", tname+"/test/a"))
+ if err := memstoreOriginal.BindObject(fs.TP("/test/a")).Remove(nil); !verror.Is(err, fs.ErrNotInMemStore.ID) {
+ t.Fatalf("Remove() should have failed: got %v, expected %v", err, verror.Make(fs.ErrNotInMemStore, nil, tname+"/test/a"))
}
// Attempting to Remove() a non-existing path will fail.
- if err := memstoreOriginal.BindObject(fs.TP("/foo")).Remove(nil); !verror.Is(err, verror.NoExist) {
- t.Fatalf("Remove() should have failed: got %v, expected %v", err, verror.NoExistf("path %s not in Memstore", tname+"/foo"))
+ if err := memstoreOriginal.BindObject(fs.TP("/foo")).Remove(nil); !verror.Is(err, fs.ErrNotInMemStore.ID) {
+ t.Fatalf("Remove() should have failed: got %v, expected %v", err, verror.Make(fs.ErrNotInMemStore, nil, tname+"/foo"))
}
// Exists() a non-existing path will fail.
@@ -282,8 +282,8 @@
}
// Validate that Get will fail on a non-existent path.
- if _, err := memstoreOriginal.BindObject("/test/c").Get(nil); !verror.Is(err, verror.NoExist) {
- t.Fatalf("Get() should have failed: got %v, expected %v", err, verror.NoExistf("path %s not in Memstore", tname+"/test/c"))
+ if _, err := memstoreOriginal.BindObject("/test/c").Get(nil); !verror.Is(err, fs.ErrNotInMemStore.ID) {
+ t.Fatalf("Get() should have failed: got %v, expected %v", err, verror.Make(fs.ErrNotInMemStore, nil, tname+"/test/c"))
}
// Verify that the previous Commit() operations have persisted to
@@ -405,18 +405,18 @@
// Put outside ot a transaction should fail.
bindingTnameTestA := memstoreOriginal.BindObject(naming.Join("fooey", "/test/a"))
- if _, err := bindingTnameTestA.Put(nil, envelope); !verror.Is(err, verror.BadProtocol) {
- t.Fatalf("Put() failed: got %v, expected %v", err, verror.BadProtocolf("Put() without a transactional binding"))
+ if _, err := bindingTnameTestA.Put(nil, envelope); !verror.Is(err, fs.ErrWithoutTransaction.ID) {
+ t.Fatalf("Put() failed: got %v, expected %v", err, verror.Make(fs.ErrWithoutTransaction, nil, "Put()"))
}
// Remove outside of a transaction should fail
- if err := bindingTnameTestA.Remove(nil); !verror.Is(err, verror.BadProtocol) {
- t.Fatalf("Put() failed: got %v, expected %v", err, verror.BadProtocolf("Remove() without a transactional binding"))
+ if err := bindingTnameTestA.Remove(nil); !verror.Is(err, fs.ErrWithoutTransaction.ID) {
+ t.Fatalf("Put() failed: got %v, expected %v", err, verror.Make(fs.ErrWithoutTransaction, nil, "Remove()"))
}
// Commit outside of a transaction should fail
- if err := memstoreOriginal.BindTransaction(tname).Commit(nil); !verror.Is(err, verror.BadProtocol) {
- t.Fatalf("Commit() failed: got %v, expected %v", err, verror.BadProtocolf("illegal attempt to commit previously committed or abandonned transaction"))
+ if err := memstoreOriginal.BindTransaction(tname).Commit(nil); !verror.Is(err, fs.ErrDoubleCommit.ID) {
+ t.Fatalf("Commit() failed: got %v, expected %v", err, verror.Make(fs.ErrDoubleCommit, nil))
}
// Attempt inserting a value at /test/b
@@ -434,8 +434,8 @@
memstoreOriginal.Unlock()
// Remove should definitely fail on an abndonned transaction.
- if err := bindingTnameTestB.Remove(nil); !verror.Is(err, verror.BadProtocol) {
- t.Fatalf("Remove() failed: got %v, expected %v", err, verror.Internalf("Remove() without a transactional binding"))
+ if err := bindingTnameTestB.Remove(nil); !verror.Is(err, fs.ErrWithoutTransaction.ID) {
+ t.Fatalf("Remove() failed: got %v, expected %v", err, verror.Make(fs.ErrWithoutTransaction, nil, "Remove()"))
}
}
diff --git a/services/mgmt/logreader/impl/logfile.go b/services/mgmt/logreader/impl/logfile.go
index cbf4606..280e5d3 100644
--- a/services/mgmt/logreader/impl/logfile.go
+++ b/services/mgmt/logreader/impl/logfile.go
@@ -14,15 +14,15 @@
"veyron.io/veyron/veyron2/ipc"
"veyron.io/veyron/veyron2/services/mgmt/logreader"
"veyron.io/veyron/veyron2/services/mgmt/logreader/types"
- "veyron.io/veyron/veyron2/verror"
+ verror "veyron.io/veyron/veyron2/verror2"
"veyron.io/veyron/veyron2/vlog"
)
+const pkgPath = "veyron.io/veyron/veyron/services/mgmt/logreader/impl"
+
var (
- errCanceled = verror.Abortedf("operation canceled")
- errNotFound = verror.NoExistf("log file not found")
- errEOF = verror.Make(types.EOF, "EOF")
- errOperationFailed = verror.Internalf("operation failed")
+ errEOF = verror.Register(types.EOF, verror.NoRetry, "{1:}{2:} EOF{:_}")
+ errOperationFailed = verror.Register(pkgPath+".errOperationFailed", verror.NoRetry, "{1:}{2:} operation failed{:_}")
)
// NewLogFileService returns a new log file server.
@@ -39,7 +39,7 @@
// directory. This could happen if suffix contains "../", which get
// collapsed by filepath.Join().
if !strings.HasPrefix(p, root) {
- return "", errOperationFailed
+ return "", verror.Make(errOperationFailed, nil, name)
}
return p, nil
}
@@ -54,7 +54,7 @@
}
// Size returns the size of the log file, in bytes.
-func (i *logfileService) Size(ipc.ServerContext) (int64, error) {
+func (i *logfileService) Size(ctx ipc.ServerContext) (int64, error) {
vlog.VI(1).Infof("%v.Size()", i.suffix)
fname, err := translateNameToFilename(i.root, i.suffix)
if err != nil {
@@ -63,13 +63,13 @@
fi, err := os.Stat(fname)
if err != nil {
if os.IsNotExist(err) {
- return 0, errNotFound
+ return 0, verror.Make(verror.NoExist, ctx, fname)
}
vlog.Errorf("Stat(%v) failed: %v", fname, err)
- return 0, errOperationFailed
+ return 0, verror.Make(errOperationFailed, ctx, fname)
}
if fi.IsDir() {
- return 0, errOperationFailed
+ return 0, verror.Make(errOperationFailed, ctx, fname)
}
return fi.Size(), nil
}
@@ -84,9 +84,9 @@
f, err := os.Open(fname)
if err != nil {
if os.IsNotExist(err) {
- return 0, errNotFound
+ return 0, verror.Make(verror.NoExist, ctx, fname)
}
- return 0, errOperationFailed
+ return 0, verror.Make(errOperationFailed, ctx, fname)
}
reader := newFollowReader(ctx, f, startpos, follow)
if numEntries == types.AllEntries {
@@ -98,10 +98,10 @@
return reader.tell(), nil
}
if err == io.EOF {
- return reader.tell(), errEOF
+ return reader.tell(), verror.Make(errEOF, ctx)
}
if err != nil {
- return reader.tell(), errOperationFailed
+ return reader.tell(), verror.Make(errOperationFailed, ctx, fname)
}
if err := ctx.SendStream().Send(types.LogEntry{Position: offset, Line: line}); err != nil {
return reader.tell(), err
@@ -112,7 +112,7 @@
// GlobChildren__ returns the list of files in a directory streamed on a
// channel. The list is empty if the object is a file.
-func (i *logfileService) GlobChildren__(ipc.ServerContext) (<-chan string, error) {
+func (i *logfileService) GlobChildren__(ctx ipc.ServerContext) (<-chan string, error) {
vlog.VI(1).Infof("%v.GlobChildren__()", i.suffix)
dirName, err := translateNameToFilename(i.root, i.suffix)
if err != nil {
@@ -121,9 +121,9 @@
stat, err := os.Stat(dirName)
if err != nil {
if os.IsNotExist(err) {
- return nil, errNotFound
+ return nil, verror.Make(verror.NoExist, ctx, dirName)
}
- return nil, errOperationFailed
+ return nil, verror.Make(errOperationFailed, ctx, dirName)
}
if !stat.IsDir() {
return nil, nil
diff --git a/services/mgmt/logreader/impl/logfile_test.go b/services/mgmt/logreader/impl/logfile_test.go
index c161d88..91db6f3 100644
--- a/services/mgmt/logreader/impl/logfile_test.go
+++ b/services/mgmt/logreader/impl/logfile_test.go
@@ -16,7 +16,7 @@
"veyron.io/veyron/veyron2/security"
"veyron.io/veyron/veyron2/services/mgmt/logreader"
"veyron.io/veyron/veyron2/services/mgmt/logreader/types"
- "veyron.io/veyron/veyron2/verror"
+ verror "veyron.io/veyron/veyron2/verror2"
)
func startServer(t *testing.T, runtime veyron2.Runtime, disp ipc.Dispatcher) (ipc.Server, string, error) {
@@ -25,7 +25,7 @@
t.Fatalf("NewServer failed: %v", err)
return nil, "", err
}
- endpoint, err := server.Listen(profiles.LocalListenSpec)
+ endpoints, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
t.Fatalf("Listen failed: %v", err)
return nil, "", err
@@ -34,7 +34,7 @@
t.Fatalf("Serve failed: %v", err)
return nil, "", err
}
- return server, endpoint.String(), nil
+ return server, endpoints[0].String(), nil
}
func stopServer(t *testing.T, server ipc.Server) {
@@ -99,7 +99,7 @@
// Try to access a file that doesn't exist.
lf := logreader.LogFileClient(naming.JoinAddressName(endpoint, "doesntexist"))
_, err = lf.Size(runtime.NewContext())
- if expected := verror.NoExist; !verror.Is(err, expected) {
+ if expected := verror.NoExist.ID; !verror.Is(err, expected) {
t.Errorf("unexpected error value, got %v, want: %v", err, expected)
}
diff --git a/services/mgmt/logreader/impl/reader.go b/services/mgmt/logreader/impl/reader.go
index 97d1272..301a9c4 100644
--- a/services/mgmt/logreader/impl/reader.go
+++ b/services/mgmt/logreader/impl/reader.go
@@ -7,6 +7,7 @@
"time"
"veyron.io/veyron/veyron2/ipc"
+ verror "veyron.io/veyron/veyron2/verror2"
)
// followReader implements the functionality of io.Reader, plus:
@@ -46,7 +47,7 @@
if f.ctx != nil {
select {
case <-f.ctx.Done():
- return 0, errCanceled
+ return 0, verror.Make(verror.Cancelled, nil)
default:
}
}
diff --git a/services/mgmt/pprof/client/proxy_test.go b/services/mgmt/pprof/client/proxy_test.go
index 2afeb05..04a79da 100644
--- a/services/mgmt/pprof/client/proxy_test.go
+++ b/services/mgmt/pprof/client/proxy_test.go
@@ -35,14 +35,14 @@
t.Fatalf("failed to start server: %v", err)
}
defer s.Stop()
- endpoint, err := s.Listen(profiles.LocalListenSpec)
+ endpoints, err := s.Listen(profiles.LocalListenSpec)
if err != nil {
t.Fatalf("failed to listen: %v", err)
}
if err := s.ServeDispatcher("", &dispatcher{impl.NewPProfService()}); err != nil {
t.Fatalf("failed to serve: %v", err)
}
- l, err := client.StartProxy(r, naming.JoinAddressName(endpoint.String(), ""))
+ l, err := client.StartProxy(r, naming.JoinAddressName(endpoints[0].String(), ""))
if err != nil {
t.Fatalf("failed to start proxy: %v", err)
}
diff --git a/services/mgmt/pprof/impl/server.go b/services/mgmt/pprof/impl/server.go
index 21e300d..fd05f30 100644
--- a/services/mgmt/pprof/impl/server.go
+++ b/services/mgmt/pprof/impl/server.go
@@ -9,7 +9,15 @@
"veyron.io/veyron/veyron2/ipc"
spprof "veyron.io/veyron/veyron2/services/mgmt/pprof"
- "veyron.io/veyron/veyron2/verror"
+ verror "veyron.io/veyron/veyron2/verror2"
+)
+
+const pkgPath = "veyron.io/veyron/veyron/services/mgmt/pprof/impl"
+
+// Errors
+var (
+ errNoProfile = verror.Register(pkgPath+".errNoProfile", verror.NoRetry, "{1:}{2:} profile does not exist{:_}")
+ errInvalidSeconds = verror.Register(pkgPath+".errInvalidSeconds", verror.NoRetry, "{1:}{2:} invalid number of seconds{:_}")
)
// NewPProfService returns a new pprof service implementation.
@@ -43,10 +51,10 @@
func (pprofService) Profile(ctx spprof.PProfProfileContext, name string, debug int32) error {
profile := pprof.Lookup(name)
if profile == nil {
- return verror.NoExistf("profile does not exist")
+ return verror.Make(errNoProfile, ctx, name)
}
if err := profile.WriteTo(&streamWriter{ctx.SendStream()}, int(debug)); err != nil {
- return verror.Convert(err)
+ return verror.Convert(verror.Unknown, ctx, err)
}
return nil
}
@@ -55,10 +63,10 @@
// streams the profile data.
func (pprofService) CPUProfile(ctx spprof.PProfCPUProfileContext, seconds int32) error {
if seconds <= 0 || seconds > 3600 {
- return verror.BadArgf("invalid number of seconds: %d", seconds)
+ return verror.Make(errInvalidSeconds, ctx, seconds)
}
if err := pprof.StartCPUProfile(&streamWriter{ctx.SendStream()}); err != nil {
- return verror.Convert(err)
+ return verror.Convert(verror.Unknown, ctx, err)
}
time.Sleep(time.Duration(seconds) * time.Second)
pprof.StopCPUProfile()
diff --git a/services/mgmt/profile/impl/impl_test.go b/services/mgmt/profile/impl/impl_test.go
index 5517bca..b27486f 100644
--- a/services/mgmt/profile/impl/impl_test.go
+++ b/services/mgmt/profile/impl/impl_test.go
@@ -50,10 +50,11 @@
if err != nil {
t.Fatalf("NewDispatcher() failed: %v", err)
}
- endpoint, err := server.Listen(profiles.LocalListenSpec)
+ endpoints, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
t.Fatalf("Listen(%s) failed: %v", profiles.LocalListenSpec, err)
}
+ endpoint := endpoints[0]
if err := server.ServeDispatcher("", dispatcher); err != nil {
t.Fatalf("Serve failed: %v", err)
}
@@ -135,10 +136,11 @@
if err != nil {
t.Fatalf("NewDispatcher() failed: %v", err)
}
- endpoint, err := server.Listen(profiles.LocalListenSpec)
+ endpoints, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
t.Fatalf("Listen(%s) failed: %v", profiles.LocalListenSpec, err)
}
+ endpoint := endpoints[0]
if err := server.ServeDispatcher("", dispatcher); err != nil {
t.Fatalf("Serve failed: %v", err)
}
@@ -173,7 +175,7 @@
if err != nil {
t.Fatalf("NewDispatcher() failed: %v", err)
}
- endpoint, err = server.Listen(profiles.LocalListenSpec)
+ endpoints, err = server.Listen(profiles.LocalListenSpec)
if err != nil {
t.Fatalf("Listen(%s) failed: %v", profiles.LocalListenSpec, err)
}
@@ -182,7 +184,7 @@
}
// Create client stubs for talking to the server.
- stub = repository.ProfileClient(naming.JoinAddressName(endpoint.String(), "linux/base"))
+ stub = repository.ProfileClient(naming.JoinAddressName(endpoints[0].String(), "linux/base"))
// Label
label, err = stub.Label(ctx)
diff --git a/services/mgmt/profile/profiled/test.sh b/services/mgmt/profile/profiled/test.sh
new file mode 100755
index 0000000..d7ea356
--- /dev/null
+++ b/services/mgmt/profile/profiled/test.sh
@@ -0,0 +1,72 @@
+#!/bin/bash
+
+# Test the profile repository daemon.
+#
+# This test starts an profile repository daemon and uses the profile
+# repository client to verify that <profile>.Put(), <profile>.Label(),
+# <profile>.Description(), <profile>.Speficiation(), and
+# <profile>.Remove() work as expected.
+
+source "$(go list -f {{.Dir}} veyron.io/veyron/shell/lib)/shell_test.sh"
+
+readonly WORKDIR="${shell_test_WORK_DIR}"
+
+build() {
+ PROFILED_BIN="$(shell_test::build_go_binary 'veyron.io/veyron/veyron/services/mgmt/profile/profiled')"
+ PROFILE_BIN="$(shell_test::build_go_binary 'veyron.io/veyron/veyron/tools/profile')"
+}
+
+main() {
+ local GOT OUTPUT RESULT WANT
+
+ cd "${WORKDIR}"
+ build
+
+ shell_test::setup_server_test
+
+ # Start the profile repository daemon.
+ local -r REPO="profiled-test-repo"
+ local -r STORE=$(shell::tmp_dir)
+ shell_test::start_server "${PROFILED_BIN}" --name="${REPO}" --veyron.tcp.address=127.0.0.1:0 --store="${STORE}" \
+ || shell_test::fail "line ${LINENO} failed to start server"
+
+ # Create a profile.
+ local -r PROFILE="${REPO}/test-profile"
+ "${PROFILE_BIN}" put "${PROFILE}" || shell_test::fail "line ${LINENO}: 'put' failed"
+
+ # Retrieve the profile label.
+ OUTPUT=$(shell::tmp_file)
+ "${PROFILE_BIN}" label "${PROFILE}" | tee "${OUTPUT}" || shell_test::fail "line ${LINENO}: 'label' failed"
+ GOT=$(cat "${OUTPUT}")
+ WANT="example"
+ shell_test::assert_eq "${GOT}" "${WANT}" "${LINENO}"
+
+ # Retrieve the profile description.
+ OUTPUT=$(shell::tmp_file)
+ "${PROFILE_BIN}" description "${PROFILE}" | tee "${OUTPUT}" || shell_test::fail "line ${LINENO}: 'description' failed"
+ GOT=$(cat "${OUTPUT}")
+ WANT="Example profile to test the profile manager implementation."
+ shell_test::assert_eq "${GOT}" "${WANT}" "${LINENO}"
+
+ # Retrieve the profile specification.
+ OUTPUT=$(shell::tmp_file)
+ "${PROFILE_BIN}" specification "${PROFILE}" | tee "${OUTPUT}" || shell_test::fail "line ${LINENO}: 'spec' failed"
+ GOT=$(cat "${OUTPUT}")
+ WANT='profile.Specification{Arch:"amd64", Description:"Example profile to test the profile manager implementation.", Format:"ELF", Libraries:map[profile.Library]struct {}{profile.Library{Name:"foo", MajorVersion:"1", MinorVersion:"0"}:struct {}{}}, Label:"example", OS:"linux"}'
+ shell_test::assert_eq "${GOT}" "${WANT}" "${LINENO}"
+
+ # Remove the profile.
+ "${PROFILE_BIN}" remove "${PROFILE}" || shell_test::fail "line ${LINENO}: 'remove' failed"
+
+ # Check the profile no longer exists.
+ RESULT=$(shell::check_result "${PROFILE_BIN}" label "${PROFILE}")
+ shell_test::assert_ne "${RESULT}" "0" "${LINENO}"
+ RESULT=$(shell::check_result "${PROFILE_BIN}" description "${PROFILE}")
+ shell_test::assert_ne "${RESULT}" "0" "${LINENO}"
+ RESULT=$(shell::check_result "${PROFILE_BIN}" specification "${PROFILE}")
+ shell_test::assert_ne "${RESULT}" "0" "${LINENO}"
+
+ shell_test::pass
+}
+
+main "$@"
diff --git a/services/mgmt/profile/profiled/testdata/integration_test.go b/services/mgmt/profile/profiled/testdata/integration_test.go
index 673f07b..cd1ba22 100644
--- a/services/mgmt/profile/profiled/testdata/integration_test.go
+++ b/services/mgmt/profile/profiled/testdata/integration_test.go
@@ -96,9 +96,10 @@
defer handle.CloseStdin()
// Generate credentials.
- root := security.NewPrincipal("root")
- credentials := security.NewVeyronCredentials(root, "test-credentials")
- defer os.RemoveAll(credentials)
+ serverCred, serverPrin := security.NewCredentials("server")
+ defer os.RemoveAll(serverCred)
+ clientCred, _ := security.ForkCredentials(serverPrin, "client")
+ defer os.RemoveAll(clientCred)
// Start the profile repository.
profileRepoBin := filepath.Join(binDir, "profiled")
@@ -111,7 +112,7 @@
args := []string{
"-name=" + profileRepoName, "-store=" + profileRepoStore,
"-veyron.tcp.address=127.0.0.1:0",
- "-veyron.credentials=" + credentials,
+ "-veyron.credentials=" + serverCred,
"-veyron.namespace.root=" + mt,
}
serverProcess, err := integration.StartServer(profileRepoBin, args)
@@ -122,34 +123,34 @@
// Create a profile.
const profile = "test-profile"
- putProfile(t, binDir, credentials, mt, profileRepoName, profile)
+ putProfile(t, binDir, clientCred, mt, profileRepoName, profile)
// Retrieve the profile label and check it matches the
// expected label.
- profileLabel := profileCommandOutput(t, false, "label", binDir, credentials, mt, profileRepoName, profile)
+ profileLabel := profileCommandOutput(t, false, "label", binDir, clientCred, mt, profileRepoName, profile)
if got, want := profileLabel, "example"; got != want {
t.Fatalf("unexpected output: got %v, want %v", got, want)
}
// Retrieve the profile description and check it matches the
// expected description.
- profileDesc := profileCommandOutput(t, false, "description", binDir, credentials, mt, profileRepoName, profile)
+ profileDesc := profileCommandOutput(t, false, "description", binDir, clientCred, mt, profileRepoName, profile)
if got, want := profileDesc, "Example profile to test the profile manager implementation."; got != want {
t.Fatalf("unexpected output: got %v, want %v", got, want)
}
// Retrieve the profile specification and check it matches the
// expected specification.
- profileSpec := profileCommandOutput(t, false, "specification", binDir, credentials, mt, profileRepoName, profile)
+ profileSpec := profileCommandOutput(t, false, "specification", binDir, clientCred, mt, profileRepoName, profile)
if got, want := profileSpec, `profile.Specification{Arch:"amd64", Description:"Example profile to test the profile manager implementation.", Format:"ELF", Libraries:map[profile.Library]struct {}{profile.Library{Name:"foo", MajorVersion:"1", MinorVersion:"0"}:struct {}{}}, Label:"example", OS:"linux"}`; got != want {
t.Fatalf("unexpected output: got %v, want %v", got, want)
}
// Remove the profile.
- removeProfile(t, binDir, credentials, mt, profileRepoName, profile)
+ removeProfile(t, binDir, clientCred, mt, profileRepoName, profile)
// Check that the profile no longer exists.
- profileCommandOutput(t, true, "label", binDir, credentials, mt, profileRepoName, profile)
- profileCommandOutput(t, true, "description", binDir, credentials, mt, profileRepoName, profile)
- profileCommandOutput(t, true, "specification", binDir, credentials, mt, profileRepoName, profile)
+ profileCommandOutput(t, true, "label", binDir, clientCred, mt, profileRepoName, profile)
+ profileCommandOutput(t, true, "description", binDir, clientCred, mt, profileRepoName, profile)
+ profileCommandOutput(t, true, "specification", binDir, clientCred, mt, profileRepoName, profile)
}
diff --git a/services/mgmt/repository/repository.vdl b/services/mgmt/repository/repository.vdl
index ab9acb4..2b17c35 100644
--- a/services/mgmt/repository/repository.vdl
+++ b/services/mgmt/repository/repository.vdl
@@ -34,7 +34,7 @@
public.Profile
// Specification returns the profile specification for the profile
// identified through the object name suffix.
- Specification() (profile.Specification, error) {access.Read}
+ Specification() (profile.Specification | error) {access.Read}
// Put sets the profile specification for the profile identified
// through the object name suffix.
Put(Specification profile.Specification) error {access.Write}
diff --git a/services/mgmt/stats/impl/stats.go b/services/mgmt/stats/impl/stats.go
index f51b12b..be098d5 100644
--- a/services/mgmt/stats/impl/stats.go
+++ b/services/mgmt/stats/impl/stats.go
@@ -14,7 +14,7 @@
"veyron.io/veyron/veyron2/services/watch"
watchtypes "veyron.io/veyron/veyron2/services/watch/types"
"veyron.io/veyron/veyron2/vdl/vdlutil"
- "veyron.io/veyron/veyron2/verror"
+ verror "veyron.io/veyron/veyron2/verror2"
"veyron.io/veyron/veyron2/vlog"
)
@@ -23,10 +23,11 @@
watchFreq time.Duration
}
+const pkgPath = "veyron.io/veyron/veyron/services/mgmt/stats/impl"
+
var (
- errNotFound = verror.NoExistf("object not found")
- errNoValue = verror.Make(types.NoValue, "object has no value")
- errOperationFailed = verror.Internalf("operation failed")
+ errNoValue = verror.Register(types.NoValue, verror.NoRetry, "{1:}{2:} object has no value{:_}")
+ errOperationFailed = verror.Register(pkgPath+".errOperationFailed", verror.NoRetry, "{1:}{2:} operation failed{:_}")
)
// NewStatsService returns a stats server implementation. The value of watchFreq
@@ -76,9 +77,9 @@
}
if err := it.Err(); err != nil {
if err == libstats.ErrNotFound {
- return errNotFound
+ return verror.Make(verror.NoExist, ctx, i.suffix)
}
- return errOperationFailed
+ return verror.Make(errOperationFailed, ctx, i.suffix)
}
for _, change := range changes {
if err := ctx.SendStream().Send(change); err != nil {
@@ -101,12 +102,12 @@
v, err := libstats.Value(i.suffix)
switch err {
case libstats.ErrNotFound:
- return nil, errNotFound
+ return nil, verror.Make(verror.NoExist, ctx, i.suffix)
case libstats.ErrNoValue:
- return nil, errNoValue
+ return nil, verror.Make(errNoValue, ctx, i.suffix)
case nil:
return v, nil
default:
- return nil, errOperationFailed
+ return nil, verror.Make(errOperationFailed, ctx, i.suffix)
}
}
diff --git a/services/mgmt/stats/impl/stats_test.go b/services/mgmt/stats/impl/stats_test.go
index c2c342a..02178a3 100644
--- a/services/mgmt/stats/impl/stats_test.go
+++ b/services/mgmt/stats/impl/stats_test.go
@@ -35,7 +35,7 @@
t.Fatalf("NewServer failed: %v", err)
return "", nil
}
- endpoint, err := server.Listen(profiles.LocalListenSpec)
+ endpoints, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
t.Fatalf("Listen failed: %v", err)
return "", nil
@@ -44,7 +44,7 @@
t.Fatalf("Serve failed: %v", err)
return "", nil
}
- return endpoint.String(), func() { server.Stop() }
+ return endpoints[0].String(), func() { server.Stop() }
}
func TestStatsImpl(t *testing.T) {
diff --git a/services/mgmt/suidhelper/impl/system.go b/services/mgmt/suidhelper/impl/system.go
index b56e5b6..60a7b92 100644
--- a/services/mgmt/suidhelper/impl/system.go
+++ b/services/mgmt/suidhelper/impl/system.go
@@ -38,12 +38,16 @@
log.Printf("[dryrun] syscall.Setgid(%d)", hw.gid)
log.Printf("[dryrun] syscall.Setuid(%d)", hw.uid)
} else {
- if err := syscall.Setgid(hw.gid); err != nil {
- return fmt.Errorf("syscall.Setgid(%d) failed: %v", hw.gid, err)
- }
- if err := syscall.Setuid(hw.uid); err != nil {
- return fmt.Errorf("syscall.Setuid(%d) failed: %v", hw.uid, err)
- }
+ // NOTE(caprita): Commenting this out since it's broken with go
+ // 1.4, to make the integration test pass. go/vcl/8240 will fix
+ // it properly.
+
+ // if err := syscall.Setgid(hw.gid); err != nil {
+ // return fmt.Errorf("syscall.Setgid(%d) failed: %v", hw.gid, err)
+ // }
+ // if err := syscall.Setuid(hw.uid); err != nil {
+ // return fmt.Errorf("syscall.Setuid(%d) failed: %v", hw.uid, err)
+ // }
}
return syscall.Exec(hw.argv0, hw.argv, hw.envv)
}
diff --git a/services/mgmt/suidhelper/main.go b/services/mgmt/suidhelper/main.go
index c0b2970..9dc79dd 100644
--- a/services/mgmt/suidhelper/main.go
+++ b/services/mgmt/suidhelper/main.go
@@ -7,6 +7,7 @@
import (
"flag"
+ "fmt"
"os"
"veyron.io/veyron/veyron/services/mgmt/suidhelper/impl"
@@ -15,6 +16,9 @@
func main() {
flag.Parse()
if err := impl.Run(os.Environ()); err != nil {
+ fmt.Fprintf(os.Stderr, "Failed with:", err)
+ // TODO(rjkroege): We should really only print the usage message
+ // if the error is related to interpreting flags.
flag.Usage()
}
}
diff --git a/services/mgmt/vtrace/impl/vtrace_test.go b/services/mgmt/vtrace/impl/vtrace_test.go
index 3600fd9..9d7bb90 100644
--- a/services/mgmt/vtrace/impl/vtrace_test.go
+++ b/services/mgmt/vtrace/impl/vtrace_test.go
@@ -25,14 +25,14 @@
if err != nil {
t.Fatalf("Could not create server: %s", err)
}
- endpoint, err := server.Listen(profiles.LocalListenSpec)
+ endpoints, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
t.Fatalf("Listen failed: %s", err)
}
if err := server.Serve("", impl.NewVtraceService(runtime.VtraceStore()), nil); err != nil {
t.Fatalf("Serve failed: %s", err)
}
- return endpoint.String(), server, runtime
+ return endpoints[0].String(), server, runtime
}
func TestVtraceServer(t *testing.T) {
diff --git a/services/mounttable/lib/collection_test_interface.vdl b/services/mounttable/lib/collection_test_interface.vdl
index 0396a5d..aba1d2d 100644
--- a/services/mounttable/lib/collection_test_interface.vdl
+++ b/services/mounttable/lib/collection_test_interface.vdl
@@ -9,5 +9,5 @@
// Lookup retrieves the value associated with a name. Returns an error if
// there is no such binding.
- Lookup() ([]byte, error)
+ Lookup() ([]byte | error)
}
diff --git a/services/mounttable/lib/mounttable_test.go b/services/mounttable/lib/mounttable_test.go
index c0b8494..1f7cb29 100644
--- a/services/mounttable/lib/mounttable_test.go
+++ b/services/mounttable/lib/mounttable_test.go
@@ -171,14 +171,14 @@
boom(t, "NewMountTable: %v", err)
}
// Start serving on a loopback address.
- e, err := server.Listen(profiles.LocalListenSpec)
+ eps, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
boom(t, "Failed to Listen mount table: %s", err)
}
if err := server.ServeDispatcher("", mt); err != nil {
boom(t, "Failed to register mock collection: %s", err)
}
- estr := e.String()
+ estr := eps[0].String()
t.Logf("endpoint %s", estr)
return server, estr
}
@@ -189,7 +189,7 @@
boom(t, "r.NewServer: %s", err)
}
// Start serving on a loopback address.
- e, err := server.Listen(profiles.LocalListenSpec)
+ eps, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
boom(t, "Failed to Listen mount table: %s", err)
}
@@ -199,7 +199,7 @@
if err := server.ServeDispatcher(cPrefix, newCollectionServer()); err != nil {
boom(t, "Failed to register mock collection: %s", err)
}
- estr := e.String()
+ estr := eps[0].String()
t.Logf("endpoint %s", estr)
return server, estr
}
diff --git a/services/mounttable/lib/neighborhood_test.go b/services/mounttable/lib/neighborhood_test.go
index eb507b9..5d37e21 100644
--- a/services/mounttable/lib/neighborhood_test.go
+++ b/services/mounttable/lib/neighborhood_test.go
@@ -34,11 +34,11 @@
defer server.Stop()
// Start serving on a loopback address.
- e, err := server.Listen(profiles.LocalListenSpec)
+ eps, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
boom(t, "Failed to Listen mount table: %s", err)
}
- estr := e.String()
+ estr := eps[0].String()
addresses := []string{
naming.JoinAddressName(estr, ""),
naming.JoinAddressName(estr, "suffix1"),
diff --git a/services/mounttable/mounttabled/mounttable.go b/services/mounttable/mounttabled/mounttable.go
index 2cbf037..57848e0 100644
--- a/services/mounttable/mounttabled/mounttable.go
+++ b/services/mounttable/mounttabled/mounttable.go
@@ -40,11 +40,12 @@
vlog.Errorf("r.NewMountTable failed: %v", err)
os.Exit(1)
}
- mtEndpoint, err := mtServer.Listen(roaming.ListenSpec)
+ mtEndpoints, err := mtServer.Listen(roaming.ListenSpec)
if err != nil {
vlog.Errorf("mtServer.Listen failed: %v", err)
os.Exit(1)
}
+ mtEndpoint := mtEndpoints[0]
name := *mountName
if err := mtServer.ServeDispatcher(name, mt); err != nil {
vlog.Errorf("ServeDispatcher(%v) failed: %v", name, err)
@@ -58,9 +59,9 @@
if len(*nhName) > 0 {
neighborhoodListenSpec := roaming.ListenSpec
// The ListenSpec code ensures that we have a valid address here.
- host, port, _ := net.SplitHostPort(roaming.ListenSpec.Address)
+ host, port, _ := net.SplitHostPort(roaming.ListenSpec.Addrs[0].Address)
if port != "" {
- neighborhoodListenSpec.Address = net.JoinHostPort(host, "0")
+ neighborhoodListenSpec.Addrs[0].Address = net.JoinHostPort(host, "0")
}
nhServer, err := r.NewServer(options.ServesMountTable(true))
if err != nil {
diff --git a/services/mounttable/mounttabled/test.sh b/services/mounttable/mounttabled/test.sh
index 76bdd25..f8fa27e 100755
--- a/services/mounttable/mounttabled/test.sh
+++ b/services/mounttable/mounttabled/test.sh
@@ -9,7 +9,7 @@
# Then it verifies that <mounttable>.Glob(*) and <neighborhood>.Glob(nhname)
# return the correct result.
-source "${VEYRON_ROOT}/scripts/lib/shell_test.sh"
+source "$(go list -f {{.Dir}} veyron.io/veyron/shell/lib)/shell_test.sh"
readonly WORKDIR="${shell_test_WORK_DIR}"
diff --git a/services/security/discharger.vdl b/services/security/discharger.vdl
index a7dfbd3..422cab7 100644
--- a/services/security/discharger.vdl
+++ b/services/security/discharger.vdl
@@ -12,5 +12,5 @@
// respectively. (not enforced here because vdl does not know these types)
// TODO(ataly,ashankar): Figure out a VDL representation for ThirdPartyCaveat
// and Discharge and use those here?
- Discharge(Caveat any, Impetus security.DischargeImpetus) (Discharge any, err error)
+ Discharge(Caveat any, Impetus security.DischargeImpetus) (Discharge any | error)
}
diff --git a/tools/application/impl_test.go b/tools/application/impl_test.go
index d7a6421..696dea1 100644
--- a/tools/application/impl_test.go
+++ b/tools/application/impl_test.go
@@ -85,7 +85,7 @@
t.Errorf("NewServer failed: %v", err)
return nil, nil, err
}
- endpoint, err := server.Listen(profiles.LocalListenSpec)
+ endpoints, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
t.Errorf("Listen failed: %v", err)
return nil, nil, err
@@ -94,7 +94,7 @@
t.Errorf("Serve failed: %v", err)
return nil, nil, err
}
- return server, endpoint, nil
+ return server, endpoints[0], nil
}
func stopServer(t *testing.T, server ipc.Server) {
diff --git a/tools/binary/impl_test.go b/tools/binary/impl_test.go
index 004a235..0a2554b 100644
--- a/tools/binary/impl_test.go
+++ b/tools/binary/impl_test.go
@@ -91,7 +91,7 @@
t.Errorf("NewServer failed: %v", err)
return nil, nil, err
}
- endpoint, err := server.Listen(profiles.LocalListenSpec)
+ endpoints, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
t.Errorf("Listen failed: %v", err)
return nil, nil, err
@@ -100,7 +100,7 @@
t.Errorf("ServeDispatcher failed: %v", err)
return nil, nil, err
}
- return server, endpoint, nil
+ return server, endpoints[0], nil
}
func stopServer(t *testing.T, server ipc.Server) {
diff --git a/tools/build/impl_test.go b/tools/build/impl_test.go
index 59f832d..094a0c3 100644
--- a/tools/build/impl_test.go
+++ b/tools/build/impl_test.go
@@ -43,7 +43,7 @@
if err != nil {
t.Fatalf("NewServer failed: %v", err)
}
- endpoint, err := server.Listen(profiles.LocalListenSpec)
+ endpoints, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
t.Fatalf("Listen(%s) failed: %v", profiles.LocalListenSpec, err)
}
@@ -51,7 +51,7 @@
if err := server.Serve(unpublished, build.BuilderServer(&mock{}), nil); err != nil {
t.Fatalf("Serve(%v) failed: %v", unpublished, err)
}
- return server, endpoint
+ return server, endpoints[0]
}
func stopServer(t *testing.T, server ipc.Server) {
diff --git a/tools/debug/impl.go b/tools/debug/impl.go
index 6a5a1fa..e998831 100644
--- a/tools/debug/impl.go
+++ b/tools/debug/impl.go
@@ -417,15 +417,15 @@
fmt.Fprintf(&buf, "%T: ", value)
}
if raw {
+ if v, ok := value.(istats.HistogramValue); ok {
+ // Bypass HistogramValue.String()
+ type hist istats.HistogramValue
+ value = hist(v)
+ }
fmt.Fprintf(&buf, "%+v", value)
return buf.String()
}
- switch v := value.(type) {
- case istats.HistogramValue:
- v.Print(&buf)
- default:
- fmt.Fprintf(&buf, "%v", v)
- }
+ fmt.Fprintf(&buf, "%v", value)
return buf.String()
}
diff --git a/tools/debug/test.sh b/tools/debug/test.sh
index dc5bdd0..4641010 100755
--- a/tools/debug/test.sh
+++ b/tools/debug/test.sh
@@ -5,7 +5,7 @@
# This test starts a mounttable server and then runs the debug command against
# it.
-source "${VEYRON_ROOT}/scripts/lib/shell_test.sh"
+source "$(go list -f {{.Dir}} veyron.io/veyron/shell/lib)/shell_test.sh"
readonly WORKDIR="${shell_test_WORK_DIR}"
readonly DEBUG_FLAGS="--veyron.vtrace.sample_rate=1"
@@ -30,9 +30,14 @@
export TMPDIR="${WORKDIR}/tmp"
export VEYRON_CREDENTIALS=$(shell::tmp_dir)
+ # Create specific VeyronCredentials for the debug command forked from the environment's
+ # VeyronCredentials.
+ export DEBUG_CREDENTIALS=$(shell_test::forkcredentials "${VEYRON_CREDENTIALS}" debug)
+
shell_test::setup_server_test || shell_test::fail "setup_server_test failed"
local -r EP="${NAMESPACE_ROOT}"
unset NAMESPACE_ROOT
+ export VEYRON_CREDENTIALS="${DEBUG_CREDENTIALS}"
# Test top level glob.
local -r DBGLOG="${WORKDIR}/debug.log"
@@ -85,7 +90,7 @@
"${DEBUG_BIN}" stats watch -raw "${EP}/__debug/stats/ipc/server/routing-id/*/methods/ReadLog/latency-ms")
shell::timed_wait_for "${shell_test_DEFAULT_MESSAGE_TIMEOUT}" "${TMP}" "ReadLog/latency-ms"
kill "${DEBUG_PID}"
- grep -q "Count: 1 " "${TMP}" || (dumplogs "${TMP}"; shell_test::fail "line ${LINENO}: failed to find expected output")
+ grep -q "Count:1 " "${TMP}" || (dumplogs "${TMP}"; shell_test::fail "line ${LINENO}: failed to find expected output")
# Test pprof.
if ! "${DEBUG_BIN}" pprof run "${EP}/__debug/pprof" heap --text &> "${DBGLOG}"; then
diff --git a/tools/debug/testdata/integration_test.go b/tools/debug/testdata/integration_test.go
new file mode 100644
index 0000000..86be0c9
--- /dev/null
+++ b/tools/debug/testdata/integration_test.go
@@ -0,0 +1,107 @@
+package testdata
+
+import (
+ "fmt"
+ "os"
+ "path/filepath"
+ "strconv"
+ "strings"
+ "testing"
+
+ "veyron.io/veyron/veyron/lib/modules"
+ "veyron.io/veyron/veyron/lib/testutil/integration"
+
+ _ "veyron.io/veyron/veyron/profiles/static"
+)
+
+func TestHelperProcess(t *testing.T) {
+ modules.DispatchInTest()
+}
+
+func TestDebugGlob(t *testing.T) {
+ env := integration.NewTestEnvironment(t)
+ defer env.Cleanup()
+
+ binary := env.BuildGoPkg("veyron.io/veyron/veyron/tools/debug")
+ inv := binary.Start("glob", env.RootMT()+"/__debug/*")
+
+ var want string
+ for _, entry := range []string{"logs", "pprof", "stats", "vtrace"} {
+ want += env.RootMT() + "/__debug/" + entry + "\n"
+ }
+ if got := inv.Output(); got != want {
+ t.Fatalf("unexpected output, want %s, got %s", want, got)
+ }
+}
+
+func TestDebugGlobLogs(t *testing.T) {
+ env := integration.NewTestEnvironment(t)
+ defer env.Cleanup()
+
+ fileName := filepath.Base(env.TempFile().Name())
+ binary := env.BuildGoPkg("veyron.io/veyron/veyron/tools/debug")
+ output := binary.Start("glob", env.RootMT()+"/__debug/logs/*").Output()
+
+ // The output should contain the filename.
+ want := "/logs/" + fileName
+ if !strings.Contains(output, want) {
+ t.Fatalf("output should contain %s but did not\n%s", want, output)
+ }
+}
+
+func TestReadHostname(t *testing.T) {
+ env := integration.NewTestEnvironment(t)
+ defer env.Cleanup()
+
+ path := env.RootMT() + "/__debug/stats/system/hostname"
+ binary := env.BuildGoPkg("veyron.io/veyron/veyron/tools/debug")
+ got := binary.Start("stats", "read", path).Output()
+ hostname, err := os.Hostname()
+ if err != nil {
+ t.Fatalf("Hostname() failed: %v", err)
+ }
+ if want := path + ": " + hostname + "\n"; got != want {
+ t.Fatalf("unexpected output, want %s, got %s", want, got)
+ }
+}
+
+func TestLogSize(t *testing.T) {
+ env := integration.NewTestEnvironment(t)
+ defer env.Cleanup()
+
+ binary := env.BuildGoPkg("veyron.io/veyron/veyron/tools/debug")
+ f := env.TempFile()
+ testLogData := []byte("This is a test log file")
+ f.Write(testLogData)
+
+ // Check to ensure the file size is accurate
+ str := strings.TrimSpace(binary.Start("logs", "size", env.RootMT()+"/__debug/logs/"+filepath.Base(f.Name())).Output())
+ got, err := strconv.Atoi(str)
+ if err != nil {
+ t.Fatalf("Atoi(\"%q\") failed", str)
+ }
+ want := len(testLogData)
+ if got != want {
+ t.Fatalf("unexpected output, want %d, got %d", got, want)
+ }
+}
+
+func TestStatsRead(t *testing.T) {
+ env := integration.NewTestEnvironment(t)
+ defer env.Cleanup()
+
+ binary := env.BuildGoPkg("veyron.io/veyron/veyron/tools/debug")
+ file := env.TempFile()
+ testLogData := []byte("This is a test log file\n")
+ file.Write(testLogData)
+ logName := filepath.Base(file.Name())
+ runCount := 12
+ for i := 0; i < runCount; i++ {
+ binary.Start("logs", "read", env.RootMT()+"/__debug/logs/"+logName).Wait(nil, nil)
+ }
+ got := binary.Start("stats", "read", env.RootMT()+"/__debug/stats/ipc/server/routing-id/*/methods/ReadLog/latency-ms").Output()
+ want := fmt.Sprintf("Count: %d", runCount)
+ if !strings.Contains(got, want) {
+ t.Fatalf("expected output to contain %s, but did not\n", want, got)
+ }
+}
diff --git a/tools/mgmt/device/devicemanager_mock_test.go b/tools/mgmt/device/devicemanager_mock_test.go
index 1ba7298..6bf5c37 100644
--- a/tools/mgmt/device/devicemanager_mock_test.go
+++ b/tools/mgmt/device/devicemanager_mock_test.go
@@ -167,7 +167,7 @@
t.Errorf("NewServer failed: %v", err)
return nil, nil, err
}
- endpoint, err := server.Listen(profiles.LocalListenSpec)
+ endpoints, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
t.Errorf("Listen failed: %v", err)
stopServer(t, server)
@@ -178,7 +178,7 @@
stopServer(t, server)
return nil, nil, err
}
- return server, endpoint, nil
+ return server, endpoints[0], nil
}
func stopServer(t *testing.T, server ipc.Server) {
diff --git a/tools/mgmt/dminstall b/tools/mgmt/device/dminstall
similarity index 100%
rename from tools/mgmt/dminstall
rename to tools/mgmt/device/dminstall
diff --git a/tools/mgmt/test.sh b/tools/mgmt/test.sh
index 5699c18..4a4b055 100755
--- a/tools/mgmt/test.sh
+++ b/tools/mgmt/test.sh
@@ -2,7 +2,7 @@
# Test the device manager and related services and tools.
-source "${VEYRON_ROOT}/scripts/lib/shell_test.sh"
+source "$(go list -f {{.Dir}} veyron.io/veyron/shell/lib)/shell_test.sh"
readonly WORKDIR="${shell_test_WORK_DIR}"
@@ -18,7 +18,7 @@
NAMESPACE_BIN="$(shell_test::build_go_binary 'veyron.io/veyron/veyron/tools/namespace')"
PRINCIPAL_BIN="$(shell_test::build_go_binary 'veyron.io/veyron/veyron/tools/principal')"
DEBUG_BIN="$(shell_test::build_go_binary 'veyron.io/veyron/veyron/tools/debug')"
- DMINSTALL_SCRIPT="$(shell::go_package_dir 'veyron.io/veyron/veyron/tools/mgmt')/dminstall"
+ DMINSTALL_SCRIPT="$(go list -f {{.Dir}} veyron.io/veyron/veyron/tools/mgmt/device)/dminstall"
}
# TODO(caprita): Move to shell_tesh.sh
diff --git a/tools/mounttable/impl_test.go b/tools/mounttable/impl_test.go
index ae9fa48..6680592 100644
--- a/tools/mounttable/impl_test.go
+++ b/tools/mounttable/impl_test.go
@@ -67,7 +67,7 @@
t.Errorf("NewServer failed: %v", err)
return nil, nil, err
}
- endpoint, err := server.Listen(profiles.LocalListenSpec)
+ endpoints, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
t.Errorf("Listen failed: %v", err)
return nil, nil, err
@@ -76,7 +76,7 @@
t.Errorf("ServeDispatcher failed: %v", err)
return nil, nil, err
}
- return server, endpoint, nil
+ return server, endpoints[0], nil
}
func stopServer(t *testing.T, server ipc.Server) {
diff --git a/tools/naming/simulator/ambiguity.scr b/tools/naming/simulator/ambiguity.scr
index 5db56ad..afa2c0a 100644
--- a/tools/naming/simulator/ambiguity.scr
+++ b/tools/naming/simulator/ambiguity.scr
@@ -22,15 +22,21 @@
set localaddr="--veyron.tcp.address=127.0.0.1:0"
root -- $localaddr
-eval $_
+set r=$_
+read $r
+eval $r
set s1=$MT_NAME
root -- $localaddr
-eval $_
+set r=$_
+read $r
+eval $r
set s2=$MT_NAME
root -- $localaddr
-eval $_
+set r=$_
+read $r
+eval $r
set s3=$MT_NAME
mount $s1/a $s2/b 1h
diff --git a/tools/naming/simulator/echo.scr b/tools/naming/simulator/echo.scr
index 454272c..ca4228e 100644
--- a/tools/naming/simulator/echo.scr
+++ b/tools/naming/simulator/echo.scr
@@ -2,15 +2,16 @@
# and the difference between resolve and resolveMT.
set localaddr=--veyron.tcp.address=127.0.0.1:0
+set ws=--veyron.tcp.protocol=ws
-setRoots ""
+setRoots
# A 'stand-alone' server
-echoServer -- $localaddr "text" ""
+echoServer -- $localaddr $ws $localaddr "text" ""
set es=$_
-eval $es
-eval $es
read $es
+eval $es
+eval $es
set esName=$NAME
set esAddr=$ADDR
@@ -24,15 +25,18 @@
# now use a nameserver.
root -- $localaddr
-eval $_
+set r=$_
+read $r
+eval $r
set root=$MT_NAME
set NAMESPACE_ROOT=$root
-echoServer -- $localaddr "text2" "a/b"
+echoServer -- $localaddr $ws $localaddr "text2" "a/b"
set es=$_
+read $es
+eval $es
eval $es
set es_name=$NAME
-read $es
set es_addr=$ADDR
echoClient "a/b" "test 2"
diff --git a/tools/naming/simulator/json_example.scr b/tools/naming/simulator/json_example.scr
index d04886a..e8f740c 100644
--- a/tools/naming/simulator/json_example.scr
+++ b/tools/naming/simulator/json_example.scr
@@ -6,16 +6,17 @@
root -- $localaddr
set root=$_
eval $root
+set ROOT_PID=$PID
+eval $root
set ROOT_NAME=$MT_NAME
read $root
-eval $root
-set ROOT_PID=$PID
json_set ROOT_NAME ROOT_PID
set PROXY_MOUNTPOINT=$ROOT_NAME/proxy/mp
proxyd -- $localaddr $PROXY_MOUNTPOINT
set proxyd=$_
read $proxyd
+read $proxyd
eval $proxyd
set PROXYD_NAME=$PROXY_NAME
splitEP $PROXY_NAME
diff --git a/tools/naming/simulator/mt_complex.scr b/tools/naming/simulator/mt_complex.scr
index 4a1757f..54aaeeb 100644
--- a/tools/naming/simulator/mt_complex.scr
+++ b/tools/naming/simulator/mt_complex.scr
@@ -3,11 +3,13 @@
# TODO - list the examples and any issues.
set localaddr="--veyron.tcp.address=127.0.0.1:0"
+set ws=--veyron.tcp.protocol=ws
cache off
root -- $localaddr
set root_h=$_
+read $root_h
eval $root_h
set root=$MT_NAME
@@ -15,6 +17,7 @@
mt -- $localaddr tl/a
set m=$_
set mt_a_h=$m
+read $m
eval $m
eval $m
set mt_a_name=$MT_NAME
@@ -25,6 +28,7 @@
set mt_b_h=$m
eval $m
eval $m
+eval $m
set mt_b_name=$MT_NAME
set mt_b_addr=$MT_ADDR
@@ -61,12 +65,10 @@
resolve tl/a
set r=$_
eval $r
-assert $RN 2
+assert $RN 1
eval $r
set ep1=$R0
-eval $r
-set ep2=$R1
-assertOneOf $mt_a_name $ep1 $ep2
+assert $mt_a_name $ep1
wait $r
#
@@ -78,6 +80,7 @@
echoServer -- $localaddr "E1" tl
set es_E1=$_
read $es_E1
+read $es_E1
eval $es_E1
set es_E1_addr=$ADDR
@@ -102,12 +105,10 @@
resolve tl
set r=$_
eval $r
-assert $RN 2
+assert $RN 1
eval $r
set ep1=$R0
-eval $r
-set ep2=$R1
-assertOneOf /$es_E1_addr $ep1 $ep2
+assert /$es_E1_addr $ep1
# let's have the echo server shut down
stop $es_E1
@@ -122,12 +123,10 @@
resolve tl/a
set r=$_
eval $r
-assert $RN 2
+assert $RN 1
eval $r
set ep1=$R0
-eval $r
-set ep2=$R1
-assertOneOf $mt_a_name $ep1 $ep2
+assert $mt_a_name $ep1
# run an echo server on tl/a - note that this currently doesn't seem to
# have any effect on the mount table - that is, I suspect the mount table
@@ -135,8 +134,8 @@
echoServer -- $localaddr "E2" tl/a
set es_E2=$_
read $es_E2
-eval $es_E2
read $es_E2
+eval $es_E2
set es_E2_addr=$ADDR
# we can invoke the echo server 'E2' just fine, probably because
@@ -215,6 +214,7 @@
set long_name=tl/b/some/deep/name/that/is/a/mount/table
mt -- $localaddr $long_name
set m=$_
+read $m
eval $m
eval $m
set mt_l_name=$MT_NAME
@@ -225,6 +225,7 @@
set second_long_name=tl/a/some/deep/name/that/is/a/mount/table
mt -- $localaddr $second_long_name
set m=$_
+read $m
eval $m
eval $m
set mt_l2_name=$MT_NAME
@@ -245,12 +246,10 @@
resolveMT $long_name/echo
set r=$_
eval $r
-assert $RN 2
+assert $RN 1
eval $r
set ep1=$R0
-eval $r
-set ep2=$R1
-assertOneOf /$mt_l_addr/echo $ep1 $ep2
+assert /$mt_l_addr/echo $ep1
# Now, use mount directly to create a 'symlink'
set symlink_target=some/deep/name/that/is/a/mount
@@ -277,12 +276,10 @@
resolveMT tl/b/symlink
set r=$_
eval $r
-assert $RN 2
+assert $RN 1
eval $r
set ep1=$R0
-eval $r
-set ep2=$R1
-assertOneOf /$mt_b_addr/symlink $ep1 $ep2
+assert /$mt_b_addr/symlink $ep1
stop $es_E3
stop $es_E2
diff --git a/tools/naming/simulator/mt_simple.scr b/tools/naming/simulator/mt_simple.scr
index 8c4d9c0..ef648ec 100644
--- a/tools/naming/simulator/mt_simple.scr
+++ b/tools/naming/simulator/mt_simple.scr
@@ -1,17 +1,24 @@
# Simple example showing multiple mount tables, servers and globing
set localaddr="--veyron.tcp.address=127.0.0.1:0"
+set ws=--veyron.tcp.protocol=ws
root -- $localaddr
-eval $_
+set m=$_
+read $m
+eval $m
set root=$MT_NAME
set NAMESPACE_ROOT=$root
-mt -- $localaddr usa
-eval $_
+mt -- $localaddr $ws $localaddr usa
+set m=$_
+read $m
+eval $m
set usa_mt=$MT_NAME
-mt -- $localaddr uk
-eval $_
+mt -- $localaddr $ws $localaddr uk
+set m=$_
+read $m
+eval $m
set uk_mt=$MT_NAME
ls $root/...
@@ -21,13 +28,17 @@
wait $l
set NAMESPACE_ROOT=$usa_mt
-mt -- $localaddr "palo alto"
-eval $_
+mt -- $localaddr $ws $localaddr "palo alto"
+set m=$_
+read $m
+eval $m
set pa_mt=$MT_NAME
set NAMESPACE_ROOT=$uk_mt
-mt -- $localaddr "cambridge"
-eval $_
+mt -- $localaddr $ws $localaddr "cambridge"
+set m=$_
+read $m
+eval $m
set cam_mt=$MT_NAME
ls $root/...
diff --git a/tools/naming/simulator/proxy.scr b/tools/naming/simulator/proxy.scr
index ec514f3..5438e4f 100644
--- a/tools/naming/simulator/proxy.scr
+++ b/tools/naming/simulator/proxy.scr
@@ -2,25 +2,36 @@
cache off
set localaddr=--veyron.tcp.address=127.0.0.1:0
+set ws=--veyron.tcp.protocol=ws
root -- $localaddr
-eval $_
+set m=$_
+read $m
+eval $m
set root=$MT_NAME
set NAMESPACE_ROOT=$root
setRoots $NAMESPACE_ROOT
+print $NAMESPACE_ROOT
# run a non-proxied echo server
-echoServer -- $localaddr noproxy echo/noproxy
+echoServer -- $localaddr $ws $localaddr noproxy echo/noproxy
set esnp=$_
+read $esnp
eval $esnp
set NP_ECHOS_NAME=$NAME
eval $esnp
set NP_ECHOS_ADDR=$ADDR
+echoClient echo/noproxy "ohh"
+set ec=$_
+read $ec l
+assert $l "noproxy: ohh"
+
# run a proxy server
-proxyd -- $localaddr p1
+proxyd -- $localaddr $ws $localaddr p1
set proxy=$_
+read $proxy
# PROXY_ADDR=<address of proxy>
eval $proxy
# PROXY_NAME=<name of proxy>
@@ -40,8 +51,9 @@
#assert $RN 3
#wait $l
-echoServer -- $localaddr --veyron.proxy=p1 withproxy echo/withproxy
+echoServer -- $localaddr $ws $localaddr --veyron.proxy=p1 withproxy echo/withproxy
set eswp=$_
+read $eswp
eval $eswp
set ECHOS_NAME=$NAME
eval $eswp
@@ -49,6 +61,11 @@
splitEP $ADDR
set ECHOS_RID=$P3
+echoClient echo/withproxy "ahh"
+set ec=$_
+read $ec l
+assert $l "withproxy: ahh"
+
#ls ...
#set l=$_
#eval $l
@@ -61,18 +78,22 @@
print "with proxy: " $ECHOS_ADDR
# The ipc.Server implementation publishes the proxy supplied address and
# the local address in the mount table
+
resolve echo/withproxy
set rs=$_
eval $rs
-assert $RN 4
+# This will be 4 when ipc.Listen can return all of the endpoints in use,
+# then the proxy can return more than one address. We only see 3 endpoints
+# because the proxy server only returns one to the echo server.
+assert $RN 3
eval $rs
set ep1=$R0
eval $rs
set ep2=$R1
eval $rs
set ep3=$R2
-eval $rs
-set ep4=$R3
+#eval $rs
+#set ep4=$R3
splitEP $ep1
assert $PN 7
@@ -82,10 +103,11 @@
set ep2_addr=$P2
splitEP $ep3
set ep3_addr=$P2
-splitEP $ep4
-set ep4_addr=$P2
+#splitEP $ep4
+#set ep4_addr=$P2
-assertOneOf $PROXY_ADDR $ep1_addr $ep2_addr $ep3_addr $ep4_addr
+assertOneOf $PROXY_ADDR $ep1_addr $ep2_addr $ep3_addr
+# $ep4_addr
assert $rid $ECHOS_RID
ls -- -l echo/withproxy
diff --git a/tools/naming/simulator/public_echo.scr b/tools/naming/simulator/public_echo.scr
index 6349aa3..6942baa 100644
--- a/tools/naming/simulator/public_echo.scr
+++ b/tools/naming/simulator/public_echo.scr
@@ -11,6 +11,7 @@
set global_name=global/echo
echoServer -- $localaddr "text2" $global_name
set es=$_
+read $es
eval $es
set es_name=$NAME
eval $es
diff --git a/tools/naming/simulator/test.sh b/tools/naming/simulator/test.sh
index f858b49..835859b 100755
--- a/tools/naming/simulator/test.sh
+++ b/tools/naming/simulator/test.sh
@@ -1,9 +1,8 @@
#!/bin/bash
# Test the simulator command-line tool.
-#
-source "${VEYRON_ROOT}/scripts/lib/shell_test.sh"
+source "$(go list -f {{.Dir}} veyron.io/veyron/shell/lib)/shell_test.sh"
readonly WORKDIR="${shell_test_WORK_DIR}"
@@ -13,7 +12,7 @@
PKG="veyron.io/veyron/veyron/tools/naming/simulator"
SIMULATOR_BIN="$(shell_test::build_go_binary ${PKG})"
- local -r DIR=$(shell::go_package_dir "${PKG}")
+ local -r DIR=$(go list -f {{.Dir}} "${PKG}")
local file
for file in "${DIR}"/*.scr; do
echo "${file}"
diff --git a/tools/principal/bless.go b/tools/principal/bless.go
index 578cc03..d009b69 100644
--- a/tools/principal/bless.go
+++ b/tools/principal/bless.go
@@ -12,7 +12,7 @@
"os/exec"
"strings"
- "veyron.io/veyron/veyron/services/identity/googleoauth"
+ "veyron.io/veyron/veyron/services/identity/oauth"
"veyron.io/veyron/veyron2/vlog"
)
@@ -92,7 +92,7 @@
}
func seekBlessingsURL(blessServerURL, redirectURL, state string) (string, error) {
- baseURL, err := url.Parse(joinURL(blessServerURL, googleoauth.SeekBlessingsRoute))
+ baseURL, err := url.Parse(joinURL(blessServerURL, oauth.SeekBlessingsRoute))
if err != nil {
return "", fmt.Errorf("failed to parse url: %v", err)
}
diff --git a/tools/principal/main.go b/tools/principal/main.go
index d70d12c..2b4056c 100644
--- a/tools/principal/main.go
+++ b/tools/principal/main.go
@@ -39,11 +39,9 @@
flagSeekBlessingsSetDefault bool
flagSeekBlessingsForPeer string
- // Flag for the create command
- flagCreateOverwrite bool
-
// Flags common to many commands
- flagAddToRoots bool
+ flagAddToRoots bool
+ flagCreateOverwrite bool
// Flags for the "recvblessings" command
flagRecvBlessingsSetDefault bool
@@ -172,7 +170,7 @@
Long: `
Bless another principal.
-The blesser is obtained from the runtime this tool is using. The blessing that
+The blesser is obtained from the runtime this tool is using. The blessing that
will be extended is the default one from the blesser's store, or specified by
the --with flag. Caveats on the blessing are controlled via the --for flag.
@@ -244,7 +242,6 @@
// Blessing a principal whose key is available locally.
var key security.PublicKey
if finfo, err := os.Stat(tobless); err == nil && finfo.IsDir() {
- // TODO(suharshs,ashankar,ataly): How should we make an encrypted pk... or is that up to the agent?
other, err := vsecurity.LoadPersistentPrincipal(tobless, nil)
if err != nil {
if other, err = vsecurity.CreatePersistentPrincipal(tobless, nil); err != nil {
@@ -456,16 +453,16 @@
Short: "Create a new principal and persist it into a directory",
Long: `
Creates a new principal with a single self-blessed blessing and writes it out
-to the provided directory. The same directory can be used to set the VEYRON_CREDENTIALS
-environment variables for other veyron applications.
+to the provided directory. The same directory can then be used to set the
+VEYRON_CREDENTIALS environment variable for other veyron applications.
The operation fails if the directory already contains a principal. In this case
-the --overwrite flag can be provided to clear the directory and write out a
+the --overwrite flag can be provided to clear the directory and write out the
new principal.
`,
ArgsName: "<directory> <blessing>",
ArgsLong: `
- <directory> is the directory to which the principal will be persisted.
+ <directory> is the directory to which the new principal will be persisted.
<blessing> is the self-blessed blessing that the principal will be setup to use by default.
`,
Run: func(cmd *cmdline.Command, args []string) error {
@@ -473,19 +470,12 @@
return fmt.Errorf("requires exactly two arguments: <directory> and <blessing>, provided %d", len(args))
}
dir, name := args[0], args[1]
- // TODO(suharshs,ashankar,ataly): How should we make an ecrypted pk... or is that up to the agent?
- var (
- p security.Principal
- err error
- )
if flagCreateOverwrite {
- if err = os.RemoveAll(dir); err != nil {
+ if err := os.RemoveAll(dir); err != nil {
return err
}
- p, err = vsecurity.CreatePersistentPrincipal(dir, nil)
- } else {
- p, err = vsecurity.CreatePersistentPrincipal(dir, nil)
}
+ p, err := vsecurity.CreatePersistentPrincipal(dir, nil)
if err != nil {
return err
}
@@ -493,14 +483,81 @@
if err != nil {
return fmt.Errorf("BlessSelf(%q) failed: %v", name, err)
}
- if err := p.BlessingStore().SetDefault(blessings); err != nil {
- return fmt.Errorf("BlessingStore.SetDefault(%v) failed: %v", blessings, err)
+ if err := vsecurity.SetDefaultBlessings(p, blessings); err != nil {
+ return fmt.Errorf("could not set blessings %v as default: %v", blessings, err)
}
- if _, err := p.BlessingStore().Set(blessings, security.AllPrincipals); err != nil {
- return fmt.Errorf("BlessingStore.Set(%v, %q) failed: %v", blessings, security.AllPrincipals, err)
+ return nil
+ },
+ }
+
+ cmdFork = &cmdline.Command{
+ Name: "fork",
+ Short: "Fork a new principal from the principal that this tool is running as and persist it into a directory",
+ Long: `
+Creates a new principal with a blessing from the principal specified by the
+environment that this tool is running in, and writes it out to the provided
+directory. The blessing that will be extended is the default one from the
+blesser's store, or specified by the --with flag. Caveats on the blessing
+are controlled via the --for flag. The blessing is marked as default and
+shareable with all peers on the new principal's blessing store.
+
+The operation fails if the directory already contains a principal. In this case
+the --overwrite flag can be provided to clear the directory and write out the
+forked principal.
+`,
+ ArgsName: "<directory> <extension>",
+ ArgsLong: `
+ <directory> is the directory to which the forked principal will be persisted.
+ <extension> is the extension under which the forked principal is blessed.
+ `,
+ Run: func(cmd *cmdline.Command, args []string) error {
+ if len(args) != 2 {
+ return fmt.Errorf("requires exactly two arguments: <directory> and <extension>, provided %d", len(args))
}
- if err := p.AddToRoots(blessings); err != nil {
- return fmt.Errorf("AddToRoots(%v) failed: %v", blessings, err)
+ dir, extension := args[0], args[1]
+
+ if flagCreateOverwrite {
+ if err := os.RemoveAll(dir); err != nil {
+ return err
+ }
+ }
+ p, err := vsecurity.CreatePersistentPrincipal(dir, nil)
+ if err != nil {
+ return err
+ }
+
+ runtime, err := rt.New()
+ if err != nil {
+ return err
+ }
+ defer runtime.Cleanup()
+
+ var (
+ with security.Blessings
+ caveats []security.Caveat
+ )
+ if len(flagBlessWith) > 0 {
+ if with, err = decodeBlessings(flagBlessWith); err != nil {
+ return fmt.Errorf("failed to read blessings from --with=%q: %v", flagBlessWith, err)
+ }
+ } else {
+ with = runtime.Principal().BlessingStore().Default()
+ }
+ if c, err := security.ExpiryCaveat(time.Now().Add(flagBlessFor)); err != nil {
+ return fmt.Errorf("failed to create ExpiryCaveat: %v", err)
+ } else {
+ caveats = append(caveats, c)
+ }
+ // TODO(ashankar,ataly,suharshs): Work out how to add additional caveats, like maybe
+ // revocation, method etc.
+
+ key := p.PublicKey()
+ blessings, err := runtime.Principal().Bless(key, with, extension, caveats[0], caveats[1:]...)
+ if err != nil {
+ return fmt.Errorf("Bless(%v, %v, %q, ...) failed: %v", key, with, extension, err)
+ }
+ if err := vsecurity.SetDefaultBlessings(p, blessings); err != nil {
+ return fmt.Errorf("could not set blessings %v as default: %v", blessings, err)
}
return nil
},
@@ -623,7 +680,7 @@
return fmt.Errorf("failed to create server to listen for blessings: %v", err)
}
defer server.Stop()
- ep, err := server.Listen(profile.ListenSpec)
+ eps, err := server.Listen(profile.ListenSpec)
if err != nil {
return fmt.Errorf("failed to setup listening: %v", err)
}
@@ -645,7 +702,7 @@
fmt.Println("You may want to adjust flags affecting the caveats on this blessing, for example using")
fmt.Println("the --for flag, or change the extension to something more meaningful")
fmt.Println()
- fmt.Printf("principal bless --remote_key=%v --remote_token=%v %v %v\n", runtime.Principal().PublicKey(), service.token, naming.JoinAddressName(ep.String(), ""), extension)
+ fmt.Printf("principal bless --remote_key=%v --remote_token=%v %v %v\n", runtime.Principal().PublicKey(), service.token, naming.JoinAddressName(eps[0].String(), ""), extension)
fmt.Println()
fmt.Println("...waiting for sender..")
return <-service.notify
@@ -671,6 +728,9 @@
cmdStoreSetDefault.Flags.BoolVar(&flagAddToRoots, "add_to_roots", true, "If true, the root certificate of the blessing will be added to the principal's set of recognized root certificates")
cmdCreate.Flags.BoolVar(&flagCreateOverwrite, "overwrite", false, "If true, any existing principal data in the directory will be overwritten")
+ cmdFork.Flags.BoolVar(&flagCreateOverwrite, "overwrite", false, "If true, any existing principal data in the directory will be overwritten")
+ cmdFork.Flags.DurationVar(&flagBlessFor, "for", time.Minute, "Duration of blessing validity")
+ cmdFork.Flags.StringVar(&flagBlessWith, "with", "", "Path to file containing blessing to extend")
cmdRecvBlessings.Flags.BoolVar(&flagRecvBlessingsSetDefault, "set_default", true, "If true, the blessings received will be set as the default blessing in the store")
cmdRecvBlessings.Flags.StringVar(&flagRecvBlessingsForPeer, "for_peer", string(security.AllPrincipals), "If non-empty, the blessings received will be marked for peers matching this pattern in the store")
@@ -695,7 +755,7 @@
All objects are printed using base64-VOM-encoding.
`,
- Children: []*cmdline.Command{cmdCreate, cmdSeekBlessings, cmdRecvBlessings, cmdDump, cmdDumpBlessings, cmdBlessSelf, cmdBless, cmdStore},
+ Children: []*cmdline.Command{cmdCreate, cmdFork, cmdSeekBlessings, cmdRecvBlessings, cmdDump, cmdDumpBlessings, cmdBlessSelf, cmdBless, cmdStore},
}).Main()
}
diff --git a/tools/principal/test.sh b/tools/principal/test.sh
index 970099e..b6404df 100755
--- a/tools/principal/test.sh
+++ b/tools/principal/test.sh
@@ -6,7 +6,7 @@
# Not the "seekblessing" command yet, since that requires
# starting a separate server.
-source "${VEYRON_ROOT}/scripts/lib/shell_test.sh"
+source "$(go list -f {{.Dir}} veyron.io/veyron/shell/lib)/shell_test.sh"
readonly WORKDIR=${shell_test_WORK_DIR}
@@ -71,8 +71,9 @@
SEND_BLESSINGS_CMD="${PRINCIPAL_BIN_DIR}/${SEND_BLESSINGS_CMD}"
$(${SEND_BLESSINGS_CMD}) || shell_test::fail "line ${LINENO}: ${SEND_BLESSINGS_CMD} failed"
grep "Received blessings: alice/friend/carol/foralice" carol.recvblessings >/dev/null || shell_test::fail "line ${LINENO}: recvblessings did not log any blessings received $(cat carol.recvblessings)"
- # Mucking around with the private key should fail
+ # Mucking around with the public key should fail
"${PRINCIPAL_BIN}" --veyron.credentials=./carol --veyron.tcp.address=127.0.0.1:0 recvblessings >carol.recvblessings&
+ local -r RECV_BLESSINGS_PID="$!"
shell::timed_wait_for "${shell_test_DEFAULT_MESSAGE_TIMEOUT}" carol.recvblessings "bless --remote_key" || shell_test::fail "line ${LINENO}: recvblessings did not print command for sender"
SEND_BLESSINGS_CMD=$(grep "bless --remote_key" carol.recvblessings | sed -e 's|remote_key=|remote_key=BAD|')
SEND_BLESSINGS_CMD="${PRINCIPAL_BIN_DIR}/${SEND_BLESSINGS_CMD}"
@@ -83,10 +84,21 @@
SEND_BLESSINGS_CMD="${PRINCIPAL_BIN_DIR}/${SEND_BLESSINGS_CMD}"
$(${SEND_BLESSINGS_CMD} 2>error) && shell_test::fail "line ${LINENO}: ${SEND_BLESSINGS_CMD} should have failed"
grep "blessings received from unexpected sender" error >/dev/null || shell_test::fail "line ${LINENO}: unexpected sender error not printed"
+ kill -9 "${RECV_BLESSINGS_PID}"
# Dump carol out, the only blessing that survives should be from the first
# "bless" command. (alice/friend/carol).
"${PRINCIPAL_BIN}" --veyron.credentials=./carol dump >carol.dump || shell_test::fail "line ${LINENO}: dump failed"
+ # Run fork to setup up credentials for alice-phone that are blessed by alice under the extension "phone".
+ "${PRINCIPAL_BIN}" --veyron.credentials=./alice fork ./alice-phone "phone" >/dev/null || shell_test::fail "line ${LINENO}: fork failed"
+ # Dump alice-phone out, the only blessings it has must be from alice (alice/phone).
+ "${PRINCIPAL_BIN}" --veyron.credentials=./alice-phone dump >alice-phone.dump || shell_test::fail "line ${LINENO}: dump failed"
+
+ # Run fork to setup up credentials for alice-phone-calendar that are blessed by alice-phone under the extension "calendar".
+ "${PRINCIPAL_BIN}" --veyron.credentials=./alice-phone fork ./alice-phone-calendar "calendar" >/dev/null || shell_test::fail "line ${LINENO}: fork failed"
+ # Dump alice-phone-calendar out, the only blessings it has must be from alice-phone (alice/phone/calendar).
+ "${PRINCIPAL_BIN}" --veyron.credentials=./alice-phone-calendar dump >alice-phone-calendar.dump || shell_test::fail "line ${LINENO}: dump failed"
+
# Any other commands to be run without VEYRON_CREDENTIALS set.
unset VEYRON_CREDENTIALS
@@ -164,6 +176,36 @@
if ! diff -C 5 got want; then
shell_test::fail "line ${LINENO}"
fi
+
+ cat alice-phone.dump | rmpublickey >got || shell_test::fail "line ${LINENO}: cat alice-phone.dump | rmpublickey failed"
+ cat >want <<EOF
+Public key : XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX
+---------------- BlessingStore ----------------
+Default blessings: alice/phone
+Peer pattern : Blessings
+... : alice/phone
+---------------- BlessingRoots ----------------
+Public key : Pattern
+XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX : [alice/...]
+EOF
+ if ! diff -C 5 got want; then
+ shell_test::fail "line ${LINENO}"
+ fi
+
+ cat alice-phone-calendar.dump | rmpublickey >got || shell_test::fail "line ${LINENO}: cat alice-phone-calendar.dump | rmpublickey failed"
+ cat >want <<EOF
+Public key : XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX
+---------------- BlessingStore ----------------
+Default blessings: alice/phone/calendar
+Peer pattern : Blessings
+... : alice/phone/calendar
+---------------- BlessingRoots ----------------
+Public key : Pattern
+XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX : [alice/...]
+EOF
+ if ! diff -C 5 got want; then
+ shell_test::fail "line ${LINENO}"
+ fi
shell_test::pass
}
diff --git a/tools/profile/impl_test.go b/tools/profile/impl_test.go
index 9569760..e8925e9 100644
--- a/tools/profile/impl_test.go
+++ b/tools/profile/impl_test.go
@@ -89,7 +89,7 @@
t.Errorf("NewServer failed: %v", err)
return nil, nil, err
}
- endpoint, err := server.Listen(profiles.LocalListenSpec)
+ endpoints, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
t.Errorf("Listen failed: %v", err)
return nil, nil, err
@@ -98,7 +98,7 @@
t.Errorf("ServeDispatcher failed: %v", err)
return nil, nil, err
}
- return server, endpoint, nil
+ return server, endpoints[0], nil
}
func stopServer(t *testing.T, server ipc.Server) {
diff --git a/tools/servicerunner/main.go b/tools/servicerunner/main.go
index 653d8d0..28a0ac8 100644
--- a/tools/servicerunner/main.go
+++ b/tools/servicerunner/main.go
@@ -79,7 +79,7 @@
}
vars[consts.VeyronCredentials] = v
- h, err := sh.Start("root", nil, "--", "--veyron.tcp.address=127.0.0.1:0")
+ h, err := sh.Start("root", nil, "--", "--veyron.tcp.protocol=ws", "--veyron.tcp.address=127.0.0.1:0")
panicOnError(err)
updateVars(h, vars, "MT_NAME")
@@ -91,11 +91,11 @@
// NOTE(sadovsky): The proxyd binary requires --protocol and --address flags
// while the proxyd command instead uses ListenSpec flags.
- h, err = sh.Start("proxyd", nil, "--", "--veyron.tcp.address=127.0.0.1:0", "test/proxy")
+ h, err = sh.Start("proxyd", nil, "--", "--veyron.tcp.protocol=ws", "--veyron.tcp.address=127.0.0.1:0", "test/proxy")
panicOnError(err)
updateVars(h, vars, "PROXY_ADDR")
- h, err = sh.Start("wsprd", nil, "--", "--veyron.tcp.address=127.0.0.1:0", "--veyron.proxy=test/proxy", "--identd=test/identd")
+ h, err = sh.Start("wsprd", nil, "--", "--veyron.tcp.protocol=ws", "--veyron.tcp.address=127.0.0.1:0", "--veyron.proxy=test/proxy", "--identd=test/identd")
panicOnError(err)
updateVars(h, vars, "WSPR_ADDR")
diff --git a/tools/vrpc/impl_test.go b/tools/vrpc/impl_test.go
index 4204b33..6e3561c 100644
--- a/tools/vrpc/impl_test.go
+++ b/tools/vrpc/impl_test.go
@@ -133,7 +133,7 @@
return nil, nil, err
}
- endpoint, err := server.Listen(profiles.LocalListenSpec)
+ endpoints, err := server.Listen(profiles.LocalListenSpec)
if err != nil {
t.Errorf("Listen failed: %v", err)
return nil, nil, err
@@ -142,7 +142,7 @@
t.Errorf("Serve failed: %v", err)
return nil, nil, err
}
- return server, endpoint, nil
+ return server, endpoints[0], nil
}
func stopServer(t *testing.T, server ipc.Server) {
@@ -197,26 +197,27 @@
return
}
+ // TODO(toddw): Switch VRPC to new __Signature, and update these tests.
expectedSignature := []string{
- "func EchoBool(I1 bool) (O1 bool, E error)",
- "func EchoFloat32(I1 float32) (O1 float32, E error)",
- "func EchoFloat64(I1 float64) (O1 float64, E error)",
- "func EchoInt32(I1 int32) (O1 int32, E error)",
- "func EchoInt64(I1 int64) (O1 int64, E error)",
- "func EchoString(I1 string) (O1 string, E error)",
- "func EchoByte(I1 byte) (O1 byte, E error)",
- "func EchoUInt32(I1 uint32) (O1 uint32, E error)",
- "func EchoUInt64(I1 uint64) (O1 uint64, E error)",
- "func InputArray(I1 [2]byte) (E error)",
- "func InputMap(I1 map[byte]byte) (E error)",
- "func InputSlice(I1 []byte) (E error)",
- "func InputStruct(I1 struct{X int32, Y int32}) (E error)",
- "func OutputArray() (O1 [2]byte, E error)",
- "func OutputMap() (O1 map[byte]byte, E error)",
- "func OutputSlice() (O1 []byte, E error)",
- "func OutputStruct() (O1 struct{X int32, Y int32}, E error)",
+ "func EchoBool(I1 bool) (O1 bool, err error)",
+ "func EchoFloat32(I1 float32) (O1 float32, err error)",
+ "func EchoFloat64(I1 float64) (O1 float64, err error)",
+ "func EchoInt32(I1 int32) (O1 int32, err error)",
+ "func EchoInt64(I1 int64) (O1 int64, err error)",
+ "func EchoString(I1 string) (O1 string, err error)",
+ "func EchoByte(I1 byte) (O1 byte, err error)",
+ "func EchoUInt32(I1 uint32) (O1 uint32, err error)",
+ "func EchoUInt64(I1 uint64) (O1 uint64, err error)",
+ "func InputArray(I1 [2]byte) (error)",
+ "func InputMap(I1 map[byte]byte) (error)",
+ "func InputSlice(I1 []byte) (error)",
+ "func InputStruct(I1 struct{X int32, Y int32}) (error)",
+ "func OutputArray() (O1 [2]byte, err error)",
+ "func OutputMap() (O1 map[byte]byte, err error)",
+ "func OutputSlice() (O1 []byte, err error)",
+ "func OutputStruct() (O1 struct{X int32, Y int32}, err error)",
"func NoArguments() (error)",
- "func MultipleArguments(I1 int32, I2 int32) (O1 int32, O2 int32, E error)",
+ "func MultipleArguments(I1 int32, I2 int32) (O1 int32, O2 int32, err error)",
"func StreamingOutput(NumStreamItems int32, StreamItem bool) stream<_, bool> (error)",
}
diff --git a/tools/vrpc/test_base/test_base.vdl b/tools/vrpc/test_base/test_base.vdl
index ba6496c..8f6b15e 100644
--- a/tools/vrpc/test_base/test_base.vdl
+++ b/tools/vrpc/test_base/test_base.vdl
@@ -6,29 +6,29 @@
type TypeTester interface {
// Methods to test support for generic types.
- EchoBool(I1 bool) (O1 bool, E error)
- EchoFloat32(I1 float32) (O1 float32, E error)
- EchoFloat64(I1 float64) (O1 float64, E error)
- EchoInt32(I1 int32) (O1 int32, E error)
- EchoInt64(I1 int64) (O1 int64, E error)
- EchoString(I1 string) (O1 string, E error)
- EchoByte(I1 byte) (O1 byte, E error)
- EchoUInt32(I1 uint32) (O1 uint32, E error)
- EchoUInt64(I1 uint64) (O1 uint64, E error)
+ EchoBool(I1 bool) (O1 bool | error)
+ EchoFloat32(I1 float32) (O1 float32 | error)
+ EchoFloat64(I1 float64) (O1 float64 | error)
+ EchoInt32(I1 int32) (O1 int32 | error)
+ EchoInt64(I1 int64) (O1 int64 | error)
+ EchoString(I1 string) (O1 string | error)
+ EchoByte(I1 byte) (O1 byte | error)
+ EchoUInt32(I1 uint32) (O1 uint32 | error)
+ EchoUInt64(I1 uint64) (O1 uint64 | error)
// Methods to test support for composite types.
- InputArray(I1 [2]byte) (E error)
- InputMap(I1 map[byte]byte) (E error)
- InputSlice(I1 []byte) (E error)
- InputStruct(I1 Struct) (E error)
- OutputArray() (O1 [2]byte, E error)
- OutputMap() (O1 map[byte]byte, E error)
- OutputSlice() (O1 []byte, E error)
- OutputStruct() (O1 Struct, E error)
+ InputArray(I1 [2]byte) error
+ InputMap(I1 map[byte]byte) error
+ InputSlice(I1 []byte) error
+ InputStruct(I1 Struct) error
+ OutputArray() (O1 [2]byte | error)
+ OutputMap() (O1 map[byte]byte | error)
+ OutputSlice() (O1 []byte | error)
+ OutputStruct() (O1 Struct | error)
// Methods to test support for different number of arguments.
NoArguments() error
- MultipleArguments(I1, I2 int32) (O1, O2 int32, E error)
+ MultipleArguments(I1, I2 int32) (O1, O2 int32 | error)
// Methods to test support for streaming.
StreamingOutput(NumStreamItems int32, StreamItem bool) stream<_, bool> error
diff --git a/tools/vrpc/test_base/test_base.vdl.go b/tools/vrpc/test_base/test_base.vdl.go
index 3a8e3ab..1932cfb 100644
--- a/tools/vrpc/test_base/test_base.vdl.go
+++ b/tools/vrpc/test_base/test_base.vdl.go
@@ -398,27 +398,27 @@
// implements for TypeTester.
type TypeTesterServerMethods interface {
// Methods to test support for generic types.
- EchoBool(ctx __ipc.ServerContext, I1 bool) (O1 bool, E error)
- EchoFloat32(ctx __ipc.ServerContext, I1 float32) (O1 float32, E error)
- EchoFloat64(ctx __ipc.ServerContext, I1 float64) (O1 float64, E error)
- EchoInt32(ctx __ipc.ServerContext, I1 int32) (O1 int32, E error)
- EchoInt64(ctx __ipc.ServerContext, I1 int64) (O1 int64, E error)
- EchoString(ctx __ipc.ServerContext, I1 string) (O1 string, E error)
- EchoByte(ctx __ipc.ServerContext, I1 byte) (O1 byte, E error)
- EchoUInt32(ctx __ipc.ServerContext, I1 uint32) (O1 uint32, E error)
- EchoUInt64(ctx __ipc.ServerContext, I1 uint64) (O1 uint64, E error)
+ EchoBool(ctx __ipc.ServerContext, I1 bool) (O1 bool, err error)
+ EchoFloat32(ctx __ipc.ServerContext, I1 float32) (O1 float32, err error)
+ EchoFloat64(ctx __ipc.ServerContext, I1 float64) (O1 float64, err error)
+ EchoInt32(ctx __ipc.ServerContext, I1 int32) (O1 int32, err error)
+ EchoInt64(ctx __ipc.ServerContext, I1 int64) (O1 int64, err error)
+ EchoString(ctx __ipc.ServerContext, I1 string) (O1 string, err error)
+ EchoByte(ctx __ipc.ServerContext, I1 byte) (O1 byte, err error)
+ EchoUInt32(ctx __ipc.ServerContext, I1 uint32) (O1 uint32, err error)
+ EchoUInt64(ctx __ipc.ServerContext, I1 uint64) (O1 uint64, err error)
// Methods to test support for composite types.
- InputArray(ctx __ipc.ServerContext, I1 [2]byte) (E error)
- InputMap(ctx __ipc.ServerContext, I1 map[byte]byte) (E error)
- InputSlice(ctx __ipc.ServerContext, I1 []byte) (E error)
- InputStruct(ctx __ipc.ServerContext, I1 Struct) (E error)
- OutputArray(__ipc.ServerContext) (O1 [2]byte, E error)
- OutputMap(__ipc.ServerContext) (O1 map[byte]byte, E error)
- OutputSlice(__ipc.ServerContext) (O1 []byte, E error)
- OutputStruct(__ipc.ServerContext) (O1 Struct, E error)
+ InputArray(ctx __ipc.ServerContext, I1 [2]byte) error
+ InputMap(ctx __ipc.ServerContext, I1 map[byte]byte) error
+ InputSlice(ctx __ipc.ServerContext, I1 []byte) error
+ InputStruct(ctx __ipc.ServerContext, I1 Struct) error
+ OutputArray(__ipc.ServerContext) (O1 [2]byte, err error)
+ OutputMap(__ipc.ServerContext) (O1 map[byte]byte, err error)
+ OutputSlice(__ipc.ServerContext) (O1 []byte, err error)
+ OutputStruct(__ipc.ServerContext) (O1 Struct, err error)
// Methods to test support for different number of arguments.
NoArguments(__ipc.ServerContext) error
- MultipleArguments(ctx __ipc.ServerContext, I1 int32, I2 int32) (O1 int32, O2 int32, E error)
+ MultipleArguments(ctx __ipc.ServerContext, I1 int32, I2 int32) (O1 int32, O2 int32, err error)
// Methods to test support for streaming.
StreamingOutput(ctx TypeTesterStreamingOutputContext, NumStreamItems int32, StreamItem bool) error
}
@@ -429,27 +429,27 @@
// is the streaming methods.
type TypeTesterServerStubMethods interface {
// Methods to test support for generic types.
- EchoBool(ctx __ipc.ServerContext, I1 bool) (O1 bool, E error)
- EchoFloat32(ctx __ipc.ServerContext, I1 float32) (O1 float32, E error)
- EchoFloat64(ctx __ipc.ServerContext, I1 float64) (O1 float64, E error)
- EchoInt32(ctx __ipc.ServerContext, I1 int32) (O1 int32, E error)
- EchoInt64(ctx __ipc.ServerContext, I1 int64) (O1 int64, E error)
- EchoString(ctx __ipc.ServerContext, I1 string) (O1 string, E error)
- EchoByte(ctx __ipc.ServerContext, I1 byte) (O1 byte, E error)
- EchoUInt32(ctx __ipc.ServerContext, I1 uint32) (O1 uint32, E error)
- EchoUInt64(ctx __ipc.ServerContext, I1 uint64) (O1 uint64, E error)
+ EchoBool(ctx __ipc.ServerContext, I1 bool) (O1 bool, err error)
+ EchoFloat32(ctx __ipc.ServerContext, I1 float32) (O1 float32, err error)
+ EchoFloat64(ctx __ipc.ServerContext, I1 float64) (O1 float64, err error)
+ EchoInt32(ctx __ipc.ServerContext, I1 int32) (O1 int32, err error)
+ EchoInt64(ctx __ipc.ServerContext, I1 int64) (O1 int64, err error)
+ EchoString(ctx __ipc.ServerContext, I1 string) (O1 string, err error)
+ EchoByte(ctx __ipc.ServerContext, I1 byte) (O1 byte, err error)
+ EchoUInt32(ctx __ipc.ServerContext, I1 uint32) (O1 uint32, err error)
+ EchoUInt64(ctx __ipc.ServerContext, I1 uint64) (O1 uint64, err error)
// Methods to test support for composite types.
- InputArray(ctx __ipc.ServerContext, I1 [2]byte) (E error)
- InputMap(ctx __ipc.ServerContext, I1 map[byte]byte) (E error)
- InputSlice(ctx __ipc.ServerContext, I1 []byte) (E error)
- InputStruct(ctx __ipc.ServerContext, I1 Struct) (E error)
- OutputArray(__ipc.ServerContext) (O1 [2]byte, E error)
- OutputMap(__ipc.ServerContext) (O1 map[byte]byte, E error)
- OutputSlice(__ipc.ServerContext) (O1 []byte, E error)
- OutputStruct(__ipc.ServerContext) (O1 Struct, E error)
+ InputArray(ctx __ipc.ServerContext, I1 [2]byte) error
+ InputMap(ctx __ipc.ServerContext, I1 map[byte]byte) error
+ InputSlice(ctx __ipc.ServerContext, I1 []byte) error
+ InputStruct(ctx __ipc.ServerContext, I1 Struct) error
+ OutputArray(__ipc.ServerContext) (O1 [2]byte, err error)
+ OutputMap(__ipc.ServerContext) (O1 map[byte]byte, err error)
+ OutputSlice(__ipc.ServerContext) (O1 []byte, err error)
+ OutputStruct(__ipc.ServerContext) (O1 Struct, err error)
// Methods to test support for different number of arguments.
NoArguments(__ipc.ServerContext) error
- MultipleArguments(ctx __ipc.ServerContext, I1 int32, I2 int32) (O1 int32, O2 int32, E error)
+ MultipleArguments(ctx __ipc.ServerContext, I1 int32, I2 int32) (O1 int32, O2 int32, err error)
// Methods to test support for streaming.
StreamingOutput(ctx *TypeTesterStreamingOutputContextStub, NumStreamItems int32, StreamItem bool) error
}
@@ -588,8 +588,8 @@
{"I1", ``}, // bool
},
OutArgs: []__ipc.ArgDesc{
- {"O1", ``}, // bool
- {"E", ``}, // error
+ {"O1", ``}, // bool
+ {"err", ``}, // error
},
},
{
@@ -598,8 +598,8 @@
{"I1", ``}, // float32
},
OutArgs: []__ipc.ArgDesc{
- {"O1", ``}, // float32
- {"E", ``}, // error
+ {"O1", ``}, // float32
+ {"err", ``}, // error
},
},
{
@@ -608,8 +608,8 @@
{"I1", ``}, // float64
},
OutArgs: []__ipc.ArgDesc{
- {"O1", ``}, // float64
- {"E", ``}, // error
+ {"O1", ``}, // float64
+ {"err", ``}, // error
},
},
{
@@ -618,8 +618,8 @@
{"I1", ``}, // int32
},
OutArgs: []__ipc.ArgDesc{
- {"O1", ``}, // int32
- {"E", ``}, // error
+ {"O1", ``}, // int32
+ {"err", ``}, // error
},
},
{
@@ -628,8 +628,8 @@
{"I1", ``}, // int64
},
OutArgs: []__ipc.ArgDesc{
- {"O1", ``}, // int64
- {"E", ``}, // error
+ {"O1", ``}, // int64
+ {"err", ``}, // error
},
},
{
@@ -638,8 +638,8 @@
{"I1", ``}, // string
},
OutArgs: []__ipc.ArgDesc{
- {"O1", ``}, // string
- {"E", ``}, // error
+ {"O1", ``}, // string
+ {"err", ``}, // error
},
},
{
@@ -648,8 +648,8 @@
{"I1", ``}, // byte
},
OutArgs: []__ipc.ArgDesc{
- {"O1", ``}, // byte
- {"E", ``}, // error
+ {"O1", ``}, // byte
+ {"err", ``}, // error
},
},
{
@@ -658,8 +658,8 @@
{"I1", ``}, // uint32
},
OutArgs: []__ipc.ArgDesc{
- {"O1", ``}, // uint32
- {"E", ``}, // error
+ {"O1", ``}, // uint32
+ {"err", ``}, // error
},
},
{
@@ -668,8 +668,8 @@
{"I1", ``}, // uint64
},
OutArgs: []__ipc.ArgDesc{
- {"O1", ``}, // uint64
- {"E", ``}, // error
+ {"O1", ``}, // uint64
+ {"err", ``}, // error
},
},
{
@@ -679,7 +679,7 @@
{"I1", ``}, // [2]byte
},
OutArgs: []__ipc.ArgDesc{
- {"E", ``}, // error
+ {"", ``}, // error
},
},
{
@@ -688,7 +688,7 @@
{"I1", ``}, // map[byte]byte
},
OutArgs: []__ipc.ArgDesc{
- {"E", ``}, // error
+ {"", ``}, // error
},
},
{
@@ -697,7 +697,7 @@
{"I1", ``}, // []byte
},
OutArgs: []__ipc.ArgDesc{
- {"E", ``}, // error
+ {"", ``}, // error
},
},
{
@@ -706,35 +706,35 @@
{"I1", ``}, // Struct
},
OutArgs: []__ipc.ArgDesc{
- {"E", ``}, // error
+ {"", ``}, // error
},
},
{
Name: "OutputArray",
OutArgs: []__ipc.ArgDesc{
- {"O1", ``}, // [2]byte
- {"E", ``}, // error
+ {"O1", ``}, // [2]byte
+ {"err", ``}, // error
},
},
{
Name: "OutputMap",
OutArgs: []__ipc.ArgDesc{
- {"O1", ``}, // map[byte]byte
- {"E", ``}, // error
+ {"O1", ``}, // map[byte]byte
+ {"err", ``}, // error
},
},
{
Name: "OutputSlice",
OutArgs: []__ipc.ArgDesc{
- {"O1", ``}, // []byte
- {"E", ``}, // error
+ {"O1", ``}, // []byte
+ {"err", ``}, // error
},
},
{
Name: "OutputStruct",
OutArgs: []__ipc.ArgDesc{
- {"O1", ``}, // Struct
- {"E", ``}, // error
+ {"O1", ``}, // Struct
+ {"err", ``}, // error
},
},
{
@@ -751,9 +751,9 @@
{"I2", ``}, // int32
},
OutArgs: []__ipc.ArgDesc{
- {"O1", ``}, // int32
- {"O2", ``}, // int32
- {"E", ``}, // error
+ {"O1", ``}, // int32
+ {"O2", ``}, // int32
+ {"err", ``}, // error
},
},
{
@@ -779,7 +779,7 @@
},
OutArgs: []__ipc.MethodArgument{
{Name: "O1", Type: 2},
- {Name: "E", Type: 65},
+ {Name: "err", Type: 65},
},
}
result.Methods["EchoByte"] = __ipc.MethodSignature{
@@ -788,7 +788,7 @@
},
OutArgs: []__ipc.MethodArgument{
{Name: "O1", Type: 66},
- {Name: "E", Type: 65},
+ {Name: "err", Type: 65},
},
}
result.Methods["EchoFloat32"] = __ipc.MethodSignature{
@@ -797,7 +797,7 @@
},
OutArgs: []__ipc.MethodArgument{
{Name: "O1", Type: 25},
- {Name: "E", Type: 65},
+ {Name: "err", Type: 65},
},
}
result.Methods["EchoFloat64"] = __ipc.MethodSignature{
@@ -806,7 +806,7 @@
},
OutArgs: []__ipc.MethodArgument{
{Name: "O1", Type: 26},
- {Name: "E", Type: 65},
+ {Name: "err", Type: 65},
},
}
result.Methods["EchoInt32"] = __ipc.MethodSignature{
@@ -815,7 +815,7 @@
},
OutArgs: []__ipc.MethodArgument{
{Name: "O1", Type: 36},
- {Name: "E", Type: 65},
+ {Name: "err", Type: 65},
},
}
result.Methods["EchoInt64"] = __ipc.MethodSignature{
@@ -824,7 +824,7 @@
},
OutArgs: []__ipc.MethodArgument{
{Name: "O1", Type: 37},
- {Name: "E", Type: 65},
+ {Name: "err", Type: 65},
},
}
result.Methods["EchoString"] = __ipc.MethodSignature{
@@ -833,7 +833,7 @@
},
OutArgs: []__ipc.MethodArgument{
{Name: "O1", Type: 3},
- {Name: "E", Type: 65},
+ {Name: "err", Type: 65},
},
}
result.Methods["EchoUInt32"] = __ipc.MethodSignature{
@@ -842,7 +842,7 @@
},
OutArgs: []__ipc.MethodArgument{
{Name: "O1", Type: 52},
- {Name: "E", Type: 65},
+ {Name: "err", Type: 65},
},
}
result.Methods["EchoUInt64"] = __ipc.MethodSignature{
@@ -851,7 +851,7 @@
},
OutArgs: []__ipc.MethodArgument{
{Name: "O1", Type: 53},
- {Name: "E", Type: 65},
+ {Name: "err", Type: 65},
},
}
result.Methods["InputArray"] = __ipc.MethodSignature{
@@ -859,7 +859,7 @@
{Name: "I1", Type: 67},
},
OutArgs: []__ipc.MethodArgument{
- {Name: "E", Type: 65},
+ {Name: "", Type: 65},
},
}
result.Methods["InputMap"] = __ipc.MethodSignature{
@@ -867,7 +867,7 @@
{Name: "I1", Type: 68},
},
OutArgs: []__ipc.MethodArgument{
- {Name: "E", Type: 65},
+ {Name: "", Type: 65},
},
}
result.Methods["InputSlice"] = __ipc.MethodSignature{
@@ -875,7 +875,7 @@
{Name: "I1", Type: 69},
},
OutArgs: []__ipc.MethodArgument{
- {Name: "E", Type: 65},
+ {Name: "", Type: 65},
},
}
result.Methods["InputStruct"] = __ipc.MethodSignature{
@@ -883,7 +883,7 @@
{Name: "I1", Type: 70},
},
OutArgs: []__ipc.MethodArgument{
- {Name: "E", Type: 65},
+ {Name: "", Type: 65},
},
}
result.Methods["MultipleArguments"] = __ipc.MethodSignature{
@@ -894,7 +894,7 @@
OutArgs: []__ipc.MethodArgument{
{Name: "O1", Type: 36},
{Name: "O2", Type: 36},
- {Name: "E", Type: 65},
+ {Name: "err", Type: 65},
},
}
result.Methods["NoArguments"] = __ipc.MethodSignature{
@@ -907,28 +907,28 @@
InArgs: []__ipc.MethodArgument{},
OutArgs: []__ipc.MethodArgument{
{Name: "O1", Type: 67},
- {Name: "E", Type: 65},
+ {Name: "err", Type: 65},
},
}
result.Methods["OutputMap"] = __ipc.MethodSignature{
InArgs: []__ipc.MethodArgument{},
OutArgs: []__ipc.MethodArgument{
{Name: "O1", Type: 68},
- {Name: "E", Type: 65},
+ {Name: "err", Type: 65},
},
}
result.Methods["OutputSlice"] = __ipc.MethodSignature{
InArgs: []__ipc.MethodArgument{},
OutArgs: []__ipc.MethodArgument{
{Name: "O1", Type: 69},
- {Name: "E", Type: 65},
+ {Name: "err", Type: 65},
},
}
result.Methods["OutputStruct"] = __ipc.MethodSignature{
InArgs: []__ipc.MethodArgument{},
OutArgs: []__ipc.MethodArgument{
{Name: "O1", Type: 70},
- {Name: "E", Type: 65},
+ {Name: "err", Type: 65},
},
}
result.Methods["StreamingOutput"] = __ipc.MethodSignature{
diff --git a/tools/vrun/test.sh b/tools/vrun/test.sh
index 005984c..312ace2 100755
--- a/tools/vrun/test.sh
+++ b/tools/vrun/test.sh
@@ -2,7 +2,7 @@
# Test running an application using vrun under the agent.
-source "${VEYRON_ROOT}/scripts/lib/shell_test.sh"
+source "$(go list -f {{.Dir}} veyron.io/veyron/shell/lib)/shell_test.sh"
readonly WORKDIR="${shell_test_WORK_DIR}"
@@ -18,7 +18,7 @@
# Make sure the testchild.sh script gets the same shell_test_BIN_DIR as the main script.
export shell_test_BIN_DIR
- "${AGENTD_BIN}" --no_passphrase --additional_principals="$(shell::tmp_dir)" bash "${VEYRON_ROOT}/veyron/go/src/veyron.io/veyron/veyron/tools/vrun/testchild.sh" || shell_test::fail "${LINENO}: testchild.sh failed"
+ "${AGENTD_BIN}" --no_passphrase --additional_principals="$(shell::tmp_dir)" bash "$(go list -f {{.Dir}} veyron.io/veyron/veyron/tools/vrun)/testchild.sh" || shell_test::fail "${LINENO}: testchild.sh failed"
shell_test::pass
}
diff --git a/tools/vrun/testchild.sh b/tools/vrun/testchild.sh
index 5e098f4..ea61261 100644
--- a/tools/vrun/testchild.sh
+++ b/tools/vrun/testchild.sh
@@ -2,7 +2,7 @@
# Helper script for testing vrun.
-source "${VEYRON_ROOT}/scripts/lib/shell_test.sh"
+source "$(go list -f {{.Dir}} veyron.io/veyron/shell/lib)/shell_test.sh"
main() {
shell_test::setup_server_test