add version to inchoate CHLO

This commit is contained in:
Marten Seemann
2016-11-08 16:32:13 +07:00
parent 214a37ac39
commit 17c5147aa4
2 changed files with 7 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ package handshake
import (
"bytes"
"encoding/binary"
"io"
"github.com/lucas-clemente/quic-go/crypto"
@@ -82,6 +83,10 @@ func (h *cryptoSetupClient) getInchoateCHLOValues() map[Tag][]byte {
tags[TagPDMD] = []byte("X509")
tags[TagPAD] = bytes.Repeat([]byte("0"), protocol.ClientHelloMinimumSize)
versionTag := make([]byte, 4, 4)
binary.LittleEndian.PutUint32(versionTag, protocol.VersionNumberToTag(h.version))
tags[TagVER] = versionTag
return tags
}