11// Copyright 2024 Contributors to the Parsec project. 
22// SPDX-License-Identifier: Apache-2.0 
33use  e2e_tests:: * ; 
4+ const  RSA :  & [ u8 ;  8 ]  = b"RSA-PSS\0 " ; 
5+ const  ECDSA :  & [ u8 ;  3 ]  = b"EC\0 " ; 
6+ const  NONE :  & [ u8 ;  5 ]  = b"None\0 " ; 
47
58#[ test]  
69fn  test_handshake_no_authentication ( )  { 
@@ -16,7 +19,7 @@ fn test_handshake_no_authentication() {
1619    server. accept ( listener) ; 
1720
1821    let  client = Client :: new ( None ,  None ,  None ,  SslVerifyMode :: NONE ) ; 
19-     client. connect ( addr) ; 
22+     client. connect ( addr,   NONE ) ; 
2023} 
2124
2225#[ should_panic]  
@@ -34,7 +37,7 @@ fn test_handshake_server_authentication_no_client_ca() {
3437    server. accept ( listener) ; 
3538
3639    let  client = Client :: new ( None ,  None ,  None ,  SslVerifyMode :: PEER ) ; 
37-     client. connect ( addr) ; 
40+     client. connect ( addr,   NONE ) ; 
3841} 
3942
4043#[ test]  
@@ -56,7 +59,7 @@ fn test_handshake_server_authentication_with_client_ca() {
5659        Some ( String :: from ( "../../tests/tls/ca/ca_cert.pem" ) ) , 
5760        SslVerifyMode :: PEER , 
5861    ) ; 
59-     client. connect ( addr) ; 
62+     client. connect ( addr,   NONE ) ; 
6063} 
6164
6265#[ should_panic]  
@@ -79,7 +82,7 @@ fn test_handshake_client_authentication_with_no_client_settings() {
7982        Some ( String :: from ( "../../tests/tls/ca/ca_cert.pem" ) ) , 
8083        SslVerifyMode :: PEER , 
8184    ) ; 
82-     client. connect ( addr) ; 
85+     client. connect ( addr,   NONE ) ; 
8386} 
8487
8588#[ should_panic]  
@@ -102,7 +105,7 @@ fn test_handshake_client_authentication_with_no_rsa_client_key() {
102105        Some ( String :: from ( "../../tests/tls/ca/ca_cert.pem" ) ) , 
103106        SslVerifyMode :: PEER , 
104107    ) ; 
105-     client. connect ( addr) ; 
108+     client. connect ( addr,   RSA ) ; 
106109} 
107110
108111#[ should_panic]  
@@ -125,7 +128,7 @@ fn test_handshake_client_authentication_with_no_ecdsa_client_key() {
125128        Some ( String :: from ( "../../tests/tls/ca/ca_cert.pem" ) ) , 
126129        SslVerifyMode :: PEER , 
127130    ) ; 
128-     client. connect ( addr) ; 
131+     client. connect ( addr,   ECDSA ) ; 
129132} 
130133
131134#[ test]  
@@ -147,7 +150,7 @@ fn test_handshake_client_authentication_rsa() {
147150        Some ( String :: from ( "../../tests/tls/ca/ca_cert.pem" ) ) , 
148151        SslVerifyMode :: PEER , 
149152    ) ; 
150-     client. connect ( addr) ; 
153+     client. connect ( addr,   RSA ) ; 
151154} 
152155
153156#[ test]  
@@ -169,7 +172,7 @@ fn test_handshake_client_authentication_ecdsa() {
169172        Some ( String :: from ( "../../tests/tls/ca/ca_cert.pem" ) ) , 
170173        SslVerifyMode :: PEER , 
171174    ) ; 
172-     client. connect ( addr) ; 
175+     client. connect ( addr,   ECDSA ) ; 
173176} 
174177
175178#[ should_panic]  
@@ -192,7 +195,7 @@ fn test_handshake_client_authentication_with_fake_ca() {
192195        Some ( String :: from ( "../../tests/tls/fake_ca/ca_cert.pem" ) ) , 
193196        SslVerifyMode :: PEER , 
194197    ) ; 
195-     client. connect ( addr) ; 
198+     client. connect ( addr,   RSA ) ; 
196199} 
197200
198201// This is a negative test case. When a client is configured with a wrong certificate for a private 
@@ -203,6 +206,7 @@ fn test_client_with_mismatched_rsa_key_and_certificate() {
203206    check_mismatched_key_certificate ( 
204207        String :: from ( "PARSEC_TEST_RSA_KEY" ) , 
205208        String :: from ( "../../tests/tls/fake_client/parsec_rsa.pem" ) , 
209+         RSA , 
206210    ) ; 
207211} 
208212
@@ -214,5 +218,6 @@ fn test_client_with_mismatched_ecdsa_key_and_certificate() {
214218    check_mismatched_key_certificate ( 
215219        String :: from ( "PARSEC_TEST_ECDSA_KEY" ) , 
216220        String :: from ( "../../tests/tls/fake_client/parsec_ecdsa.pem" ) , 
221+         ECDSA , 
217222    ) ; 
218223} 
0 commit comments