@@ -509,14 +509,14 @@ func TestHandshakeClientAES256GCMSHA384(t *testing.T) {
509
509
}
510
510
511
511
func TestHandshakeClientCertRSA (t * testing.T ) {
512
- config := * testConfig
512
+ config := testConfig . clone ()
513
513
cert , _ := X509KeyPair ([]byte (clientCertificatePEM ), []byte (clientKeyPEM ))
514
514
config .Certificates = []Certificate {cert }
515
515
516
516
test := & clientTest {
517
517
name : "ClientCert-RSA-RSA" ,
518
518
command : []string {"openssl" , "s_server" , "-cipher" , "RC4-SHA" , "-verify" , "1" },
519
- config : & config ,
519
+ config : config ,
520
520
}
521
521
522
522
runClientTestTLS10 (t , test )
@@ -525,7 +525,7 @@ func TestHandshakeClientCertRSA(t *testing.T) {
525
525
test = & clientTest {
526
526
name : "ClientCert-RSA-ECDSA" ,
527
527
command : []string {"openssl" , "s_server" , "-cipher" , "ECDHE-ECDSA-AES128-SHA" , "-verify" , "1" },
528
- config : & config ,
528
+ config : config ,
529
529
cert : testECDSACertificate ,
530
530
key : testECDSAPrivateKey ,
531
531
}
@@ -536,7 +536,7 @@ func TestHandshakeClientCertRSA(t *testing.T) {
536
536
test = & clientTest {
537
537
name : "ClientCert-RSA-AES256-GCM-SHA384" ,
538
538
command : []string {"openssl" , "s_server" , "-cipher" , "ECDHE-RSA-AES256-GCM-SHA384" , "-verify" , "1" },
539
- config : & config ,
539
+ config : config ,
540
540
cert : testRSACertificate ,
541
541
key : testRSAPrivateKey ,
542
542
}
@@ -545,14 +545,14 @@ func TestHandshakeClientCertRSA(t *testing.T) {
545
545
}
546
546
547
547
func TestHandshakeClientCertECDSA (t * testing.T ) {
548
- config := * testConfig
548
+ config := testConfig . clone ()
549
549
cert , _ := X509KeyPair ([]byte (clientECDSACertificatePEM ), []byte (clientECDSAKeyPEM ))
550
550
config .Certificates = []Certificate {cert }
551
551
552
552
test := & clientTest {
553
553
name : "ClientCert-ECDSA-RSA" ,
554
554
command : []string {"openssl" , "s_server" , "-cipher" , "RC4-SHA" , "-verify" , "1" },
555
- config : & config ,
555
+ config : config ,
556
556
}
557
557
558
558
runClientTestTLS10 (t , test )
@@ -561,7 +561,7 @@ func TestHandshakeClientCertECDSA(t *testing.T) {
561
561
test = & clientTest {
562
562
name : "ClientCert-ECDSA-ECDSA" ,
563
563
command : []string {"openssl" , "s_server" , "-cipher" , "ECDHE-ECDSA-AES128-SHA" , "-verify" , "1" },
564
- config : & config ,
564
+ config : config ,
565
565
cert : testECDSACertificate ,
566
566
key : testECDSAPrivateKey ,
567
567
}
@@ -691,15 +691,15 @@ func TestLRUClientSessionCache(t *testing.T) {
691
691
}
692
692
693
693
func TestHandshakeClientALPNMatch (t * testing.T ) {
694
- config := * testConfig
694
+ config := testConfig . clone ()
695
695
config .NextProtos = []string {"proto2" , "proto1" }
696
696
697
697
test := & clientTest {
698
698
name : "ALPN" ,
699
699
// Note that this needs OpenSSL 1.0.2 because that is the first
700
700
// version that supports the -alpn flag.
701
701
command : []string {"openssl" , "s_server" , "-alpn" , "proto1,proto2" },
702
- config : & config ,
702
+ config : config ,
703
703
validate : func (state ConnectionState ) error {
704
704
// The server's preferences should override the client.
705
705
if state .NegotiatedProtocol != "proto1" {
@@ -712,15 +712,15 @@ func TestHandshakeClientALPNMatch(t *testing.T) {
712
712
}
713
713
714
714
func TestHandshakeClientALPNNoMatch (t * testing.T ) {
715
- config := * testConfig
715
+ config := testConfig . clone ()
716
716
config .NextProtos = []string {"proto3" }
717
717
718
718
test := & clientTest {
719
719
name : "ALPN-NoMatch" ,
720
720
// Note that this needs OpenSSL 1.0.2 because that is the first
721
721
// version that supports the -alpn flag.
722
722
command : []string {"openssl" , "s_server" , "-alpn" , "proto1,proto2" },
723
- config : & config ,
723
+ config : config ,
724
724
validate : func (state ConnectionState ) error {
725
725
// There's no overlap so OpenSSL will not select a protocol.
726
726
if state .NegotiatedProtocol != "" {
@@ -736,7 +736,7 @@ func TestHandshakeClientALPNNoMatch(t *testing.T) {
736
736
const sctsBase64 = "ABIBaQFnAHUApLkJkLQYWBSHuxOizGdwCjw1mAT5G9+443fNDsgN3BAAAAFHl5nuFgAABAMARjBEAiAcS4JdlW5nW9sElUv2zvQyPoZ6ejKrGGB03gjaBZFMLwIgc1Qbbn+hsH0RvObzhS+XZhr3iuQQJY8S9G85D9KeGPAAdgBo9pj4H2SCvjqM7rkoHUz8cVFdZ5PURNEKZ6y7T0/7xAAAAUeX4bVwAAAEAwBHMEUCIDIhFDgG2HIuADBkGuLobU5a4dlCHoJLliWJ1SYT05z6AiEAjxIoZFFPRNWMGGIjskOTMwXzQ1Wh2e7NxXE1kd1J0QsAdgDuS723dc5guuFCaR+r4Z5mow9+X7By2IMAxHuJeqj9ywAAAUhcZIqHAAAEAwBHMEUCICmJ1rBT09LpkbzxtUC+Hi7nXLR0J+2PmwLp+sJMuqK+AiEAr0NkUnEVKVhAkccIFpYDqHOlZaBsuEhWWrYpg2RtKp0="
737
737
738
738
func TestHandshakClientSCTs (t * testing.T ) {
739
- config := * testConfig
739
+ config := testConfig . clone ()
740
740
741
741
scts , err := base64 .StdEncoding .DecodeString (sctsBase64 )
742
742
if err != nil {
@@ -748,7 +748,7 @@ func TestHandshakClientSCTs(t *testing.T) {
748
748
// Note that this needs OpenSSL 1.0.2 because that is the first
749
749
// version that supports the -serverinfo flag.
750
750
command : []string {"openssl" , "s_server" },
751
- config : & config ,
751
+ config : config ,
752
752
extensions : [][]byte {scts },
753
753
validate : func (state ConnectionState ) error {
754
754
expectedSCTs := [][]byte {
@@ -771,11 +771,11 @@ func TestHandshakClientSCTs(t *testing.T) {
771
771
}
772
772
773
773
func TestRenegotiationRejected (t * testing.T ) {
774
- config := * testConfig
774
+ config := testConfig . clone ()
775
775
test := & clientTest {
776
776
name : "RenegotiationRejected" ,
777
777
command : []string {"openssl" , "s_server" , "-state" },
778
- config : & config ,
778
+ config : config ,
779
779
numRenegotiations : 1 ,
780
780
renegotiationExpectedToFail : 1 ,
781
781
checkRenegotiationError : func (renegotiationNum int , err error ) error {
@@ -793,41 +793,41 @@ func TestRenegotiationRejected(t *testing.T) {
793
793
}
794
794
795
795
func TestRenegotiateOnce (t * testing.T ) {
796
- config := * testConfig
796
+ config := testConfig . clone ()
797
797
config .Renegotiation = RenegotiateOnceAsClient
798
798
799
799
test := & clientTest {
800
800
name : "RenegotiateOnce" ,
801
801
command : []string {"openssl" , "s_server" , "-state" },
802
- config : & config ,
802
+ config : config ,
803
803
numRenegotiations : 1 ,
804
804
}
805
805
806
806
runClientTestTLS12 (t , test )
807
807
}
808
808
809
809
func TestRenegotiateTwice (t * testing.T ) {
810
- config := * testConfig
810
+ config := testConfig . clone ()
811
811
config .Renegotiation = RenegotiateFreelyAsClient
812
812
813
813
test := & clientTest {
814
814
name : "RenegotiateTwice" ,
815
815
command : []string {"openssl" , "s_server" , "-state" },
816
- config : & config ,
816
+ config : config ,
817
817
numRenegotiations : 2 ,
818
818
}
819
819
820
820
runClientTestTLS12 (t , test )
821
821
}
822
822
823
823
func TestRenegotiateTwiceRejected (t * testing.T ) {
824
- config := * testConfig
824
+ config := testConfig . clone ()
825
825
config .Renegotiation = RenegotiateOnceAsClient
826
826
827
827
test := & clientTest {
828
828
name : "RenegotiateTwiceRejected" ,
829
829
command : []string {"openssl" , "s_server" , "-state" },
830
- config : & config ,
830
+ config : config ,
831
831
numRenegotiations : 2 ,
832
832
renegotiationExpectedToFail : 2 ,
833
833
checkRenegotiationError : func (renegotiationNum int , err error ) error {
0 commit comments