shithub: riscv

Download patch

ref: aa2b5bc0e721fb6c9d0c99e488c6ee93b72067a4
parent: 5e07e5840aced5826880a31ceac23f2d0c5046f9
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Aug 15 22:38:44 EDT 2015

libsec: fix mistake breaking tlsServer() (thanks sl)

--- a/sys/src/libsec/port/tlshand.c
+++ b/sys/src/libsec/port/tlshand.c
@@ -592,9 +592,10 @@
 		tlsError(c, EUnexpectedMessage, "expected a client hello");
 		goto Err;
 	}
+	c->clientVersion = m.u.clientHello.version;
 	if(trace)
-		trace("ClientHello version %x\n", m.u.clientHello.version);
-	if(setVersion(c, m.u.clientHello.version) < 0) {
+		trace("ClientHello version %x\n", c->clientVersion);
+	if(setVersion(c, c->clientVersion) < 0) {
 		tlsError(c, EIllegalParameter, "incompatible version");
 		goto Err;
 	}