@@ -114,7 +114,7 @@ void wolfSSL_TLS_client_init(const char* cipherlist)
114114 char * cert = "./certs/ca-cert.pem" ;
115115 #endif
116116 #else
117- #if defined(USE_ECC_CERT ) && defined(USE_CERT_BUFFERS_256 )
117+ #if defined(USE_ECC_CERT ) && defined(USE_CERT_BUFFERS_256 )
118118 const unsigned char * cert = ca_ecc_cert_der_256 ;
119119 #define SIZEOF_CERT sizeof_ca_ecc_cert_der_256
120120 #else
@@ -137,7 +137,7 @@ void wolfSSL_TLS_client_init(const char* cipherlist)
137137 if ((client_ctx = wolfSSL_CTX_new_ex (wolfSSLv23_client_method_ex (heapHint ),
138138 heapHint )) == NULL ) {
139139 printf ("ERROR: failed to create WOLFSSL_CTX\n" );
140- return ;
140+ return ;
141141 }
142142
143143 if ((wolfSSL_CTX_load_static_memory (& client_ctx , NULL , heapBufIO ,
@@ -149,7 +149,7 @@ void wolfSSL_TLS_client_init(const char* cipherlist)
149149#else
150150
151151 /* Create and initialize WOLFSSL_CTX */
152- if ((client_ctx =
152+ if ((client_ctx =
153153 wolfSSL_CTX_new (wolfSSLv23_client_method_ex ((void * )NULL ))) == NULL ) {
154154 printf ("ERROR: failed to create WOLFSSL_CTX\n" );
155155 return ;
@@ -168,8 +168,8 @@ void wolfSSL_TLS_client_init(const char* cipherlist)
168168 /* Root CA certificate */
169169 /*---------------------------------------------*/
170170
171- if (wolfSSL_CTX_load_verify_buffer (client_ctx , cert , SIZEOF_CERT ,
172- SSL_FILETYPE_ASN1 ) != SSL_SUCCESS ){
171+ if (wolfSSL_CTX_load_verify_buffer (client_ctx , cert , SIZEOF_CERT ,
172+ SSL_FILETYPE_ASN1 ) != WOLFSSL_SUCCESS ){
173173 printf ("ERROR: can't load certificate data\n" );
174174 return ;
175175 }
@@ -186,15 +186,15 @@ void wolfSSL_TLS_client_init(const char* cipherlist)
186186 /*---------------------------------------------*/
187187
188188 /* use specific cipher */
189- if (cipherlist != NULL &&
189+ if (cipherlist != NULL &&
190190 wolfSSL_CTX_set_cipher_list (client_ctx , cipherlist ) != WOLFSSL_SUCCESS ) {
191191 wolfSSL_CTX_free (client_ctx ); client_ctx = NULL ;
192192 printf ("client can't set cipher list" );
193193 return ;
194194 }
195-
195+
196196#if defined(WOLFSSL_TLS13 )
197- if (wolfSSL_CTX_UseSupportedCurve (client_ctx , WOLFSSL_ECC_SECP256R1 )
197+ if (wolfSSL_CTX_UseSupportedCurve (client_ctx , WOLFSSL_ECC_SECP256R1 )
198198 != WOLFSSL_SUCCESS ) {
199199 wolfSSL_CTX_free (client_ctx ); client_ctx = NULL ;
200200 printf ("client can't set use supported curves\n" );
@@ -213,19 +213,19 @@ void wolfSSL_TLS_client( )
213213
214214 #define BUFF_SIZE 256
215215 static const char sendBuff []= "Hello Server\n" ;
216-
216+
217217 char rcvBuff [BUFF_SIZE ] = {0 };
218-
218+
219219 static T_IPV4EP my_addr = { 0 , 0 };
220-
220+
221221 T_IPV4EP dst_addr ;
222222
223223 if ((dst_addr .ipaddr = getIPaddr (SIMPLE_TLSSEVER_IP )) == 0 ){
224224 printf ("ERROR: IP address\n" );
225225 goto out ;
226226 }
227227 if ((dst_addr .portno = getPort (SIMPLE_TLSSERVER_PORT )) == 0 ){
228- printf ("ERROR: IP address \n" );
228+ printf ("ERROR: Port number \n" );
229229 goto out ;
230230 }
231231
@@ -256,22 +256,22 @@ void wolfSSL_TLS_client( )
256256 /*---------------------------------------------*/
257257#ifdef USE_ECC_CERT
258258
259- /* ECDSA client certificate */
259+ /* ECDSA client certificate */
260260 if (wolfSSL_use_certificate_buffer (ssl , cliecc_cert_der_256 ,
261- sizeof_cliecc_cert_der_256 , WOLFSSL_FILETYPE_ASN1 ) != SSL_SUCCESS ) {
261+ sizeof_cliecc_cert_der_256 , WOLFSSL_FILETYPE_ASN1 ) != WOLFSSL_SUCCESS ) {
262262 printf ("ERROR wolfSSL_use_certificate_buffer: %d\n" ,
263263 wolfSSL_get_error (ssl , 0 ));
264- goto out ;
264+ goto out ;
265265 }
266266
267267#else
268268
269269 /* RSA client certificate */
270270 if (wolfSSL_use_certificate_buffer (ssl , client_cert_der_2048 ,
271- sizeof_client_cert_der_2048 , WOLFSSL_FILETYPE_ASN1 ) != SSL_SUCCESS ) {
271+ sizeof_client_cert_der_2048 , WOLFSSL_FILETYPE_ASN1 ) != WOLFSSL_SUCCESS ) {
272272 printf ("ERROR wolfSSL_use_certificate_buffer: %d\n" ,
273273 wolfSSL_get_error (ssl , 0 ));
274- goto out ;
274+ goto out ;
275275 }
276276
277277#endif /* USE_ECC_CERT */
@@ -292,17 +292,17 @@ void wolfSSL_TLS_client( )
292292 printf ("ERROR tsip_use_PrivateKey_buffer_TLS\n" );
293293 goto out ;
294294 }
295-
295+
296296 #else
297297
298298 /* DER format ECC private key */
299299 if (wolfSSL_use_PrivateKey_buffer (ssl ,
300300 ecc_clikey_der_256 ,
301- sizeof_ecc_clikey_der_256 ,
302- WOLFSSL_FILETYPE_ASN1 ) != SSL_SUCCESS ) {
301+ sizeof_ecc_clikey_der_256 ,
302+ WOLFSSL_FILETYPE_ASN1 ) != WOLFSSL_SUCCESS ) {
303303 printf ("ERROR wolfSSL_use_PrivateKey_buffer: %d\n" ,
304304 wolfSSL_get_error (ssl , 0 ));
305- goto out ;
305+ goto out ;
306306 }
307307
308308 #endif
@@ -334,10 +334,10 @@ void wolfSSL_TLS_client( )
334334 #else
335335
336336 if (wolfSSL_use_PrivateKey_buffer (ssl , client_key_der_2048 ,
337- sizeof_client_key_der_2048 , WOLFSSL_FILETYPE_ASN1 ) != SSL_SUCCESS ) {
337+ sizeof_client_key_der_2048 , WOLFSSL_FILETYPE_ASN1 ) != WOLFSSL_SUCCESS ) {
338338 printf ("ERROR wolfSSL_use_PrivateKey_buffer: %d\n" ,
339339 wolfSSL_get_error (ssl , 0 ));
340- goto out ;
340+ goto out ;
341341 }
342342
343343 #endif /* WOLFSSL_RENESAS_TSIP_TLS */
@@ -356,7 +356,7 @@ void wolfSSL_TLS_client( )
356356 /* TLS handshake */
357357 /*---------------------------------------------*/
358358
359- if (wolfSSL_connect (ssl ) != SSL_SUCCESS ) {
359+ if (wolfSSL_connect (ssl ) != WOLFSSL_SUCCESS ) {
360360 printf ("ERROR SSL connect: %d\n" , wolfSSL_get_error (ssl , 0 ));
361361 goto out ;
362362 }
0 commit comments