require version tag in CHLOs

ref #360
This commit is contained in:
Marten Seemann
2016-12-02 16:48:44 +07:00
committed by Lucas Clemente
parent 0fc42896e0
commit f72154e30b
2 changed files with 30 additions and 0 deletions

View File

@@ -102,6 +102,11 @@ func (h *CryptoSetup) handleMessage(chloData []byte, cryptoData map[Tag][]byte)
return false, qerr.Error(qerr.CryptoMessageParameterNotFound, "SNI required")
}
_, ok = cryptoData[TagVER]
if !ok {
return false, qerr.Error(qerr.InvalidCryptoMessageParameter, "client hello missing version tag")
}
var reply []byte
var err error
if !h.isInchoateCHLO(cryptoData) {