@@ -373,7 +373,7 @@ static OpensslStatus_t tlsHandshake( const ServerInfo_t * pServerInfo,
373373/*-----------------------------------------------------------*/
374374
375375static int32_t setRootCaFromFile ( const SSL_CTX * pSslContext ,
376- const char * pRootCaPath )
376+ const char * pRootCaPath )
377377{
378378 int32_t sslStatus = 1 ;
379379 FILE * pRootCaFile = NULL ;
@@ -466,11 +466,13 @@ static int32_t loadCertificateFromPkcs11( X509 ** ppX509Cert,
466466 const char * pCertURI )
467467{
468468 int32_t sslStatus = 1 ;
469+
469470 struct
470- {
471- const char * pCertURI ;
472- X509 * pX509Cert ;
473- } loadCertParams ;
471+ {
472+ const char * pCertURI ;
473+ X509 * pX509Cert ;
474+ }
475+ loadCertParams ;
474476
475477 assert ( ppX509Cert != NULL );
476478 assert ( pEngine != NULL );
@@ -498,6 +500,7 @@ static int32_t loadCertificateFromPkcs11( X509 ** ppX509Cert,
498500 {
499501 * ppX509Cert = loadCertParams .pX509Cert ;
500502 }
503+
501504 return sslStatus ;
502505}
503506/*-----------------------------------------------------------*/
@@ -690,9 +693,9 @@ static int32_t opensslError( void )
690693 pFile , line , errorCode , pErrorString ) );
691694
692695 return errorCode ;
693- #else
696+ #else /* if LIBRARY_LOG_LEVEL >= LOG_ERROR */
694697 return ( int32_t ) ERR_peek_last_error ();
695- #endif
698+ #endif /* if LIBRARY_LOG_LEVEL >= LOG_ERROR */
696699}
697700
698701/*-----------------------------------------------------------*/
@@ -706,7 +709,7 @@ static int32_t initializePkcs11Engine( ENGINE ** ppEngine )
706709 ENGINE_load_builtin_engines ();
707710
708711 /* Acquire a structural reference for the pkcs11 engine */
709- pEngine = ENGINE_by_id (PKCS11_ENGINE_ID );
712+ pEngine = ENGINE_by_id ( PKCS11_ENGINE_ID );
710713
711714 if ( pEngine == NULL )
712715 {
@@ -717,7 +720,7 @@ static int32_t initializePkcs11Engine( ENGINE ** ppEngine )
717720 /* Increase log level if necessary */
718721 #if LIBRARY_LOG_LEVEL >= LOG_INFO
719722 if ( ( sslStatus == 1 ) &&
720- ( ENGINE_ctrl_cmd_string (pEngine , "VERBOSE" , NULL , 0 ) != 1 ) )
723+ ( ENGINE_ctrl_cmd_string ( pEngine , "VERBOSE" , NULL , 0 ) != 1 ) )
721724 {
722725 LogError ( ( "Failed to increment the pkcs11 engine verbosity level." ) );
723726 sslStatus = opensslError ();
@@ -781,7 +784,7 @@ static int32_t setCredentials( SSL_CTX * pSslContext,
781784 certFromP11 = true;
782785 }
783786
784- if ( pkeyFromP11 == true || certFromP11 == true || rootCaFromP11 == true )
787+ if ( ( pkeyFromP11 == true ) || ( certFromP11 == true ) || ( rootCaFromP11 == true ) )
785788 {
786789 sslStatus = initializePkcs11Engine ( & pEngine );
787790 }
0 commit comments