forked from quic-go/quic-go
@@ -184,8 +184,8 @@ func (h *CryptoSetup) isInchoateCHLO(cryptoData map[Tag][]byte) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (h *CryptoSetup) handleInchoateCHLO(sni string, data []byte, cryptoData map[Tag][]byte) ([]byte, error) {
|
||||
if len(data) < protocol.ClientHelloMinimumSize {
|
||||
func (h *CryptoSetup) handleInchoateCHLO(sni string, chlo []byte, cryptoData map[Tag][]byte) ([]byte, error) {
|
||||
if len(chlo) < protocol.ClientHelloMinimumSize {
|
||||
return nil, qerr.Error(qerr.CryptoInvalidValueLength, "CHLO too small")
|
||||
}
|
||||
|
||||
@@ -200,12 +200,7 @@ func (h *CryptoSetup) handleInchoateCHLO(sni string, data []byte, cryptoData map
|
||||
}
|
||||
|
||||
if h.scfg.stkSource.VerifyToken(h.ip, cryptoData[TagSTK]) == nil {
|
||||
var chloOrNil []byte
|
||||
if h.version > protocol.Version30 {
|
||||
chloOrNil = data
|
||||
}
|
||||
|
||||
proof, err := h.scfg.Sign(sni, chloOrNil)
|
||||
proof, err := h.scfg.Sign(sni, chlo)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -228,13 +228,6 @@ var _ = Describe("Crypto setup", func() {
|
||||
Expect(signer.gotCHLO).To(BeTrue())
|
||||
})
|
||||
|
||||
It("generates REJ messages for version 30", func() {
|
||||
cs.version = protocol.Version30
|
||||
_, err := cs.handleInchoateCHLO("", sampleCHLO, nil)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(signer.gotCHLO).To(BeFalse())
|
||||
})
|
||||
|
||||
It("generates SHLO messages", func() {
|
||||
response, err := cs.handleCHLO("", []byte("chlo-data"), map[Tag][]byte{
|
||||
TagPUBS: []byte("pubs-c"),
|
||||
|
||||
Reference in New Issue
Block a user