Skip to content

Commit 26128ca

Browse files
Grolleau-BenjaminGrom-
authored andcommitted
[api/certificate/stse_certificate_cypto.c] add missing parentheses and apply related clang format
1 parent 3eed908 commit 26128ca

1 file changed

Lines changed: 16 additions & 24 deletions

File tree

certificate/stse_certificate_crypto.c

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -46,37 +46,29 @@ stse_ReturnCode_t stse_certificate_verify_cert_signature(const stse_certificate_
4646
ret = STSE_OK;
4747
}
4848
#ifdef STSE_CONF_USE_COMPANION
49-
else if(stsafe_x509_parser_companion_handler != NULL
50-
&& stsafe_x509_parser_companion_handler->device_type == STSAFE_A120
49+
else if (stsafe_x509_parser_companion_handler != NULL &&
50+
stsafe_x509_parser_companion_handler->device_type == STSAFE_A120
5151
#ifdef STSE_CONF_HASH_SHA_256
52-
&& hash_algo >= STSE_SHA_256
53-
#endif
54-
{ /* Only STSAFE-A120 support Hash features */
55-
ret = stse_compute_hash(
56-
stsafe_x509_parser_companion_handler,
57-
hash_algo,
58-
(PLAT_UI8 *)child->tbs,
59-
child->tbsSize,
60-
digestPtr,
61-
(PLAT_UI16 *)&digestSize);
52+
&& hash_algo >= STSE_SHA_256
53+
#endif
54+
){ /* Only STSAFE-A120 support Hash features */
55+
ret = stse_compute_hash(stsafe_x509_parser_companion_handler, hash_algo,
56+
(PLAT_UI8 *)child->tbs, child->tbsSize, digestPtr,
57+
(PLAT_UI16 *)&digestSize);
6258
}
6359
#endif
64-
else
65-
{
66-
ret = stse_platform_hash_compute(
67-
hash_algo,
68-
(PLAT_UI8 *)child->tbs,
69-
child->tbsSize,
70-
digestPtr,
71-
&digestSize);
60+
else {
61+
ret = stse_platform_hash_compute(hash_algo, (PLAT_UI8 *)child->tbs, child->tbsSize,
62+
digestPtr, &digestSize);
7263
}
7364

74-
if(ret != STSE_OK)
75-
{
76-
return (ret);
65+
if (ret != STSE_OK) {
66+
return (ret);
7767
}
7868

79-
return(stse_certificate_verify_signature(parent, digestPtr, digestSize, child->Sign.pR, child->Sign.rSize, child->Sign.pS, child->Sign.sSize));
69+
return (stse_certificate_verify_signature(parent, digestPtr, digestSize, child->Sign.pR,
70+
child->Sign.rSize, child->Sign.pS,
71+
child->Sign.sSize));
8072
}
8173

8274
stse_ReturnCode_t stse_certificate_verify_signature(const stse_certificate_t *cert,

0 commit comments

Comments
 (0)