fix conversion of qtls.ClientHelloInfo in GetConfigForClient

This commit is contained in:
Marten Seemann
2020-04-08 15:56:30 +07:00
parent 799d80197f
commit 66d50b4289
3 changed files with 16 additions and 2 deletions

View File

@@ -95,4 +95,10 @@ var _ = Describe("Unsafe checks", func() {
Expect(c.config.MaxVersion).To(BeEquivalentTo(tls.VersionTLS12))
Expect(c.config.CurvePreferences).To(Equal([]tls.CurveID{19, 20, 21}))
})
It("converts a qtls.ClientHelloInfo to a tls.ClientHelloInfo, if no config is set", func() {
chi := &qtlsClientHelloInfo{CipherSuites: []uint16{13, 37}}
tlsCHI := toTLSClientHelloInfo((*qtls.ClientHelloInfo)(unsafe.Pointer(chi)))
Expect(tlsCHI.CipherSuites).To(Equal([]uint16{13, 37}))
})
})