@@ -373,7 +373,7 @@ static OpensslStatus_t tlsHandshake( const ServerInfo_t * pServerInfo,
373
373
/*-----------------------------------------------------------*/
374
374
375
375
static int32_t setRootCaFromFile ( const SSL_CTX * pSslContext ,
376
- const char * pRootCaPath )
376
+ const char * pRootCaPath )
377
377
{
378
378
int32_t sslStatus = 1 ;
379
379
FILE * pRootCaFile = NULL ;
@@ -466,11 +466,13 @@ static int32_t loadCertificateFromPkcs11( X509 ** ppX509Cert,
466
466
const char * pCertURI )
467
467
{
468
468
int32_t sslStatus = 1 ;
469
+
469
470
struct
470
- {
471
- const char * pCertURI ;
472
- X509 * pX509Cert ;
473
- } loadCertParams ;
471
+ {
472
+ const char * pCertURI ;
473
+ X509 * pX509Cert ;
474
+ }
475
+ loadCertParams ;
474
476
475
477
assert ( ppX509Cert != NULL );
476
478
assert ( pEngine != NULL );
@@ -498,6 +500,7 @@ static int32_t loadCertificateFromPkcs11( X509 ** ppX509Cert,
498
500
{
499
501
* ppX509Cert = loadCertParams .pX509Cert ;
500
502
}
503
+
501
504
return sslStatus ;
502
505
}
503
506
/*-----------------------------------------------------------*/
@@ -690,9 +693,9 @@ static int32_t opensslError( void )
690
693
pFile , line , errorCode , pErrorString ) );
691
694
692
695
return errorCode ;
693
- #else
696
+ #else /* if LIBRARY_LOG_LEVEL >= LOG_ERROR */
694
697
return ( int32_t ) ERR_peek_last_error ();
695
- #endif
698
+ #endif /* if LIBRARY_LOG_LEVEL >= LOG_ERROR */
696
699
}
697
700
698
701
/*-----------------------------------------------------------*/
@@ -706,7 +709,7 @@ static int32_t initializePkcs11Engine( ENGINE ** ppEngine )
706
709
ENGINE_load_builtin_engines ();
707
710
708
711
/* Acquire a structural reference for the pkcs11 engine */
709
- pEngine = ENGINE_by_id (PKCS11_ENGINE_ID );
712
+ pEngine = ENGINE_by_id ( PKCS11_ENGINE_ID );
710
713
711
714
if ( pEngine == NULL )
712
715
{
@@ -717,7 +720,7 @@ static int32_t initializePkcs11Engine( ENGINE ** ppEngine )
717
720
/* Increase log level if necessary */
718
721
#if LIBRARY_LOG_LEVEL >= LOG_INFO
719
722
if ( ( sslStatus == 1 ) &&
720
- ( ENGINE_ctrl_cmd_string (pEngine , "VERBOSE" , NULL , 0 ) != 1 ) )
723
+ ( ENGINE_ctrl_cmd_string ( pEngine , "VERBOSE" , NULL , 0 ) != 1 ) )
721
724
{
722
725
LogError ( ( "Failed to increment the pkcs11 engine verbosity level." ) );
723
726
sslStatus = opensslError ();
@@ -781,7 +784,7 @@ static int32_t setCredentials( SSL_CTX * pSslContext,
781
784
certFromP11 = true;
782
785
}
783
786
784
- if ( pkeyFromP11 == true || certFromP11 == true || rootCaFromP11 == true )
787
+ if ( ( pkeyFromP11 == true ) || ( certFromP11 == true ) || ( rootCaFromP11 == true ) )
785
788
{
786
789
sslStatus = initializePkcs11Engine ( & pEngine );
787
790
}
0 commit comments