Skip to content

Commit

Permalink
Fix typo in test
Browse files Browse the repository at this point in the history
HadnshakeCurves -> HandshakeCurves
  • Loading branch information
Sean-Der committed May 31, 2024
1 parent 494c1a3 commit cb62aac
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3036,22 +3036,22 @@ func TestEllipticCurveConfiguration(t *testing.T) {
for _, test := range []struct {
Name string
ConfigCurves []elliptic.Curve
HadnshakeCurves []elliptic.Curve
HandshakeCurves []elliptic.Curve
}{
{
Name: "Curve defaulting",
ConfigCurves: nil,
HadnshakeCurves: defaultCurves,
HandshakeCurves: defaultCurves,
},
{
Name: "Single curve",
ConfigCurves: []elliptic.Curve{elliptic.X25519},
HadnshakeCurves: []elliptic.Curve{elliptic.X25519},
HandshakeCurves: []elliptic.Curve{elliptic.X25519},
},
{
Name: "Multiple curves",
ConfigCurves: []elliptic.Curve{elliptic.P384, elliptic.X25519},
HadnshakeCurves: []elliptic.Curve{elliptic.P384, elliptic.X25519},
HandshakeCurves: []elliptic.Curve{elliptic.P384, elliptic.X25519},
},
} {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
Expand All @@ -3074,13 +3074,13 @@ func TestEllipticCurveConfiguration(t *testing.T) {
t.Fatalf("Server error: %v", err)
}

if len(test.ConfigCurves) == 0 && len(test.HadnshakeCurves) != len(server.fsm.cfg.ellipticCurves) {
t.Fatalf("Failed to default Elliptic curves, expected %d, got: %d", len(test.HadnshakeCurves), len(server.fsm.cfg.ellipticCurves))
if len(test.ConfigCurves) == 0 && len(test.HandshakeCurves) != len(server.fsm.cfg.ellipticCurves) {
t.Fatalf("Failed to default Elliptic curves, expected %d, got: %d", len(test.HandshakeCurves), len(server.fsm.cfg.ellipticCurves))
}

if len(test.ConfigCurves) != 0 {
if len(test.HadnshakeCurves) != len(server.fsm.cfg.ellipticCurves) {
t.Fatalf("Failed to configure Elliptic curves, expect %d, got %d", len(test.HadnshakeCurves), len(server.fsm.cfg.ellipticCurves))
if len(test.HandshakeCurves) != len(server.fsm.cfg.ellipticCurves) {
t.Fatalf("Failed to configure Elliptic curves, expect %d, got %d", len(test.HandshakeCurves), len(server.fsm.cfg.ellipticCurves))
}
for i, c := range test.ConfigCurves {
if c != server.fsm.cfg.ellipticCurves[i] {
Expand Down

0 comments on commit cb62aac

Please sign in to comment.