git: 9front

Download patch

ref: 2c4a1eaf923b5158754ab7c49c1c879b2e4b28b5
parent: 6ef0d7c77d65765d5eb76e1c089ff44b82be2792
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Mar 28 16:12:54 EDT 2016

devtls: print the path of the underlying chan in status file

to figure out what network connection a particular tls
conversation refers to, we add the path of the underlying
we send the encrypted tls traffic over in the status file,
example:

term% grep -n '^Chan:' '#a'/tls/*/status
#a/tls/0/status:7: Chan: /net/tcp/6/data
#a/tls/1/status:7: Chan: /net/tcp/0/data

--- a/sys/src/9/port/devtls.c
+++ b/sys/src/9/port/devtls.c
@@ -1197,7 +1197,9 @@
 		if(tr->out.sec != nil)
 			s = seprint(s, e, "EncOut: %s\nHashOut: %s\n", tr->out.sec->encalg, tr->out.sec->hashalg);
 		if(tr->out.new != nil)
-			seprint(s, e, "NewEncOut: %s\nNewHashOut: %s\n", tr->out.new->encalg, tr->out.new->hashalg);
+			s = seprint(s, e, "NewEncOut: %s\nNewHashOut: %s\n", tr->out.new->encalg, tr->out.new->hashalg);
+		if(tr->c != nil)
+			seprint(s, e, "Chan: %s\n", chanpath(tr->c));
 		qunlock(&tr->in.seclock);
 		qunlock(&tr->out.seclock);
 		n = readstr(offset, a, n, buf);
--