--- sys/src/libsec/port/tlshand.c
+++ sys/src/libsec/port/tlshand.c
@@ -180,7 +180,12 @@ enum {
TLS11Version = 0x0302,
TLS12Version = 0x0303,
ProtocolVersion = TLS12Version, // maximum version we speak
- MinProtoVersion = 0x0300, // limits on version we accept
+ /*
+ * RFC 8996 (BCP 195) Sections 4 and 5: TLS 1.0 and TLS 1.1 must
+ * not be negotiated from any version. SSL 3.0 is refused in
+ * setVersion, so this floor is what rules out the other two.
+ */
+ MinProtoVersion = 0x0303, // limits on version we accept
MaxProtoVersion = 0x03ff,
};
@@ -663,7 +668,8 @@ tlsServer2(int ctl, int hand, TLSconn *conn)
if(trace)
trace("ClientHello version %x\n", c->clientVersion);
if(setVersion(c, m.u.clientHello.version) < 0) {
- tlsError(c, EIllegalParameter, "incompatible version");
+ /* RFC 8996 Sections 4 and 5 name this alert specifically */
+ tlsError(c, EProtocolVersion, "incompatible version");
goto Err;
}
@@ -1071,7 +1077,7 @@ tlsClient2(int ctl, int hand, uchar *csid, int ncsid,
goto Err;
}
if(setVersion(c, m.u.serverHello.version) < 0) {
- tlsError(c, EIllegalParameter, "incompatible version %r");
+ tlsError(c, EProtocolVersion, "incompatible version %r");
goto Err;
}
memmove(c->srandom, m.u.serverHello.random, RandomSize);
@@ -2148,8 +2154,6 @@ setVersion(TlsConnection *c, int version)
case SSL3Version:
c->finished.n = SSL3FinishedLen;
return -1;
- case TLS10Version:
- case TLS11Version:
case TLS12Version:
c->finished.n = TLSFinishedLen;
break;
@@ -3858,12 +3862,6 @@ setVers(TlsSec *sec, int v)
sec->setFinished = sslSetFinished;
sec->nfin = SSL3FinishedLen;
sec->prf = sslPRF;
- break;
- case TLS10Version:
- case TLS11Version:
- sec->setFinished = tlsSetFinished;
- sec->nfin = TLSFinishedLen;
- sec->prf = tlsPRF;
break;
case TLS12Version:
sec->setFinished = tls12SetFinished;
|