Skip to content

Commit

Permalink
Flight3: respect curves configuration
Browse files Browse the repository at this point in the history
Reuse logic from Flight1 to ensure correct behaviour.

Signed-off-by: Vladislav Yarmak <[email protected]>
  • Loading branch information
Snawoot committed Oct 1, 2023
1 parent 744e27a commit dd4605b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions flight3handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,19 @@ func flight3Generate(_ flightConn, state *State, _ *handshakeCache, cfg *handsha
RenegotiatedConnection: 0,
},
}
if state.namedCurve != 0 {

var setEllipticCurveCryptographyClientHelloExtensions bool
for _, c := range cfg.localCipherSuites {
if c.ECC() {
setEllipticCurveCryptographyClientHelloExtensions = true
break
}
}

if setEllipticCurveCryptographyClientHelloExtensions {
extensions = append(extensions, []extension.Extension{
&extension.SupportedEllipticCurves{
EllipticCurves: []elliptic.Curve{elliptic.X25519, elliptic.P256, elliptic.P384},
EllipticCurves: cfg.ellipticCurves,
},
&extension.SupportedPointFormats{
PointFormats: []elliptic.CurvePointFormat{elliptic.CurvePointFormatUncompressed},
Expand Down

0 comments on commit dd4605b

Please sign in to comment.