@@ -114,11 +114,11 @@ int WOLFSSL_VAULTIC_EccVerifyCb(WOLFSSL* ssl,
114114
115115 (void )ssl ;
116116 (void )ctx ;
117- * result = 0 ;
118117
119118 if (keyDer == NULL || sig == NULL || hash == NULL || result == NULL ) {
120119 return BAD_FUNC_ARG ;
121120 }
121+ * result = 0 ;
122122
123123 if ((err = wc_ecc_init (& key )) != 0 ) {
124124 WOLFSSL_MSG ("wc_ecc_init" );
@@ -369,7 +369,9 @@ int WOLFSSL_VAULTIC_LoadCertificates(WOLFSSL_CTX* ctx)
369369 }
370370
371371 WOLFSSL_MSG ("[Device certificate]" );
372+ #ifdef WOLFSSL_VAULTIC_DEBUG
372373 WOLFSSL_BUFFER (device_cert , sizeof_device_cert );
374+ #endif
373375
374376 /* Read CA certificate in VaultIC */
375377 WOLFSSL_MSG ("Read CA Certificate in VaultIC" );
@@ -391,19 +393,23 @@ int WOLFSSL_VAULTIC_LoadCertificates(WOLFSSL_CTX* ctx)
391393 }
392394
393395 WOLFSSL_MSG ("[CA certificate]" );
396+ #ifdef WOLFSSL_VAULTIC_DEBUG
394397 WOLFSSL_BUFFER (ca_cert , sizeof_ca_cert );
398+ #endif
395399
396400 /* Load CA certificate into WOLFSSL_CTX */
397- if (( ret = wolfSSL_CTX_load_verify_buffer (ctx , ca_cert ,
398- sizeof_ca_cert , WOLFSSL_FILETYPE_ASN1 )) != WOLFSSL_SUCCESS ) {
401+ if (wolfSSL_CTX_load_verify_buffer (ctx , ca_cert ,
402+ sizeof_ca_cert , WOLFSSL_FILETYPE_ASN1 ) != WOLFSSL_SUCCESS ) {
399403 WOLFSSL_MSG ("failed to load CA certificate" );
404+ ret = WC_HW_E ;
400405 goto free_cert_buffers ;
401406 }
402407
403408 /* Load Device certificate into WOLFSSL_CTX */
404- if (( ret = wolfSSL_CTX_use_certificate_buffer (ctx , device_cert ,
405- sizeof_device_cert , WOLFSSL_FILETYPE_ASN1 )) != WOLFSSL_SUCCESS ) {
409+ if (wolfSSL_CTX_use_certificate_buffer (ctx , device_cert ,
410+ sizeof_device_cert , WOLFSSL_FILETYPE_ASN1 ) != WOLFSSL_SUCCESS ) {
406411 WOLFSSL_MSG ("failed to load Device certificate" );
412+ ret = WC_HW_E ;
407413 goto free_cert_buffers ;
408414 }
409415
0 commit comments