Skip to content

Commit

Permalink
Rm kyber
Browse files Browse the repository at this point in the history
  • Loading branch information
mingyech committed Nov 28, 2024
1 parent 19f373e commit 86e116c
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions example/chat/dial/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,10 @@ func main() {
addr, err := net.ResolveUDPAddr("udp", *remoteAddr)
util.Check(err)

// pubkeyBytes, err := hex.DecodeString(*pubkey)
// util.Check(err)

pconn, err := net.ListenUDP("udp", nil)
util.Check(err)
quicSpec, err := quic.QUICID2Spec(quic.QUICFirefox_116)
util.Check(err)
for _, ext := range quicSpec.ClientHelloSpec.Extensions {
if ks, ok := ext.(*tls.KeyShareExtension); ok {
ks.KeyShares = []tls.KeyShare{
{
Group: tls.X25519Kyber768Draft00,
Data: []byte{},
},
}
break
}
}

tp := quic.UTransport{
Transport: &quic.Transport{
Expand All @@ -46,21 +32,9 @@ func main() {
QUICSpec: &quicSpec,
}

// tp := &quic.Transport{
// Conn: pconn,
// }

// econn1, err := tp.DialEarly(context.Background(), addr, &tls.Config{
// InsecureSkipVerify: true,
// NextProtos: []string{"h3"},
// }, &quic.Config{})
// util.Check(err)
// _ = econn1

econn, err := tp.DialEarly(context.Background(), addr, &tls.Config{
InsecureSkipVerify: true,
// CurvePreferences: []tls.CurveID{tls.X25519Kyber768Draft00},
NextProtos: []string{"h3"},
NextProtos: []string{"h3"},
}, &quic.Config{})
util.Check(err)

Expand Down

0 comments on commit 86e116c

Please sign in to comment.