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

This commit is contained in:
cinap_lenrek 2015-08-16 02:38:44 +02:00
parent 5e07e5840a
commit aa2b5bc0e7

View file

@ -592,9 +592,10 @@ tlsServer2(int ctl, int hand, uchar *cert, int certlen, int (*trace)(char*fmt, .
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;
}