Skip to content

Commit 445fb4b

Browse files
committed
clang-scan: no functional changes
Signed-off-by: Stephan Mueller <smueller@chronox.de>
1 parent 2363957 commit 445fb4b

File tree

8 files changed

+32
-35
lines changed

8 files changed

+32
-35
lines changed

asn1/api/lc_pkcs7_common.h

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ struct lc_pkcs7_message {
122122
*/
123123
#define LC_PKCS7_MSG_SIZE(num_sinfo, num_x509) \
124124
sizeof(struct lc_pkcs7_message) + \
125-
num_sinfo * sizeof(struct lc_pkcs7_signed_info) + \
126-
num_x509 * sizeof(struct lc_x509_certificate)
125+
num_sinfo * sizeof(struct lc_pkcs7_signed_info) + \
126+
num_x509 * sizeof(struct lc_x509_certificate)
127127

128128
/**
129129
* @ingroup PKCS7
@@ -152,19 +152,22 @@ struct lc_pkcs7_message {
152152
_Pragma("GCC diagnostic push") _Pragma( \
153153
"GCC diagnostic ignored \"-Wdeclaration-after-statement\"") \
154154
_Pragma("GCC diagnostic ignored \"-Wcast-align\"") \
155-
LC_ALIGNED_BUFFER(name##_ctx_buf, \
156-
LC_PKCS7_MSG_SIZE(num_sinfo, num_x509), 8); \
155+
LC_ALIGNED_BUFFER( \
156+
name##_ctx_buf, \
157+
LC_PKCS7_MSG_SIZE(num_sinfo, num_x509), 8); \
157158
struct lc_pkcs7_message *name = \
158159
(struct lc_pkcs7_message *)name##_ctx_buf; \
159160
(name)->avail_preallocated_sinfo = num_sinfo; \
160161
(name)->preallocated_sinfo = \
161-
(struct lc_pkcs7_signed_info *)((uint8_t *)(name) + \
162-
sizeof(struct lc_pkcs7_message)); \
162+
(struct lc_pkcs7_signed_info \
163+
*)((uint8_t *)(name) + \
164+
sizeof(struct lc_pkcs7_message)); \
163165
(name)->avail_preallocated_x509 = num_x509; \
164166
(name)->preallocated_x509 = \
165-
(struct lc_x509_certificate *)((uint8_t *)(name) + \
166-
sizeof(struct lc_pkcs7_message) + \
167-
num_sinfo * sizeof(struct lc_pkcs7_signed_info)); \
167+
(struct lc_x509_certificate \
168+
*)((uint8_t *)(name) + \
169+
sizeof(struct lc_pkcs7_message) + \
170+
num_sinfo * sizeof(struct lc_pkcs7_signed_info)); \
168171
_Pragma("GCC diagnostic pop")
169172

170173
#ifdef __cplusplus

asn1/src/asym_key_dilithium.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ int public_key_generate_signature_dilithium(
130130
/*
131131
* Sign the hash
132132
*/
133-
CKINT(lc_dilithium_sign_ctx(&ws->dilithium_sig, ctx, sig->digest,
134-
sig->digest_size, dilithium_sk,
135-
lc_seeded_rng));
133+
CKINT(lc_dilithium_sign_ctx(&ws->dilithium_sig, ctx,
134+
sig->digest, sig->digest_size,
135+
dilithium_sk, lc_seeded_rng));
136136
} else {
137137
CKNULL(sig->raw_data, -EOPNOTSUPP);
138138

asn1/src/pkcs7_generator.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,8 +1062,7 @@ static inline int pkcs7_initialize_ctx(struct pkcs7_generate_context *ctx,
10621062
ctx->current_x509 = pkcs7->certs;
10631063
ctx->current_sinfo = pkcs7->list_head_sinfo;
10641064

1065-
for (sinfo = pkcs7->list_head_sinfo; sinfo;
1066-
sinfo = sinfo->next) {
1065+
for (sinfo = pkcs7->list_head_sinfo; sinfo; sinfo = sinfo->next) {
10671066
const struct lc_hash *hash;
10681067

10691068
if (!ctx->authattr_hash) {

asn1/src/pkcs7_parser.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -794,9 +794,8 @@ LC_INTERFACE_FUNCTION(void, lc_pkcs7_message_clear,
794794
}
795795
}
796796

797-
LC_INTERFACE_FUNCTION(int, lc_pkcs7_decode,
798-
struct lc_pkcs7_message *pkcs7, const uint8_t *data,
799-
size_t datalen)
797+
LC_INTERFACE_FUNCTION(int, lc_pkcs7_decode, struct lc_pkcs7_message *pkcs7,
798+
const uint8_t *data, size_t datalen)
800799
{
801800
struct pkcs7_parse_context ctx = { 0 };
802801
int ret;

asn1/src/pkcs7_verify.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,7 @@ LC_INTERFACE_FUNCTION(int, lc_pkcs7_verify, struct lc_pkcs7_message *pkcs7,
485485
return -ENODATA;
486486
}
487487

488-
for (sinfo = pkcs7->list_head_sinfo; sinfo;
489-
sinfo = sinfo->next) {
488+
for (sinfo = pkcs7->list_head_sinfo; sinfo; sinfo = sinfo->next) {
490489
ret = pkcs7_verify_one(pkcs7, trust_store, sinfo, verify_rules);
491490
switch (ret) {
492491
case -ENOKEY:

asn1/tests/asn1_enc_tester.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ static int x509_gen_cert(struct x509_checker_options *opts)
158158
gcert->san_ip_len, ws->pcert.san_ip_len);
159159
ret = -EINVAL;
160160
} else {
161-
if (memcmp(ws->pcert.san_ip, gcert->san_ip, gcert->san_ip_len)) {
161+
if (memcmp(ws->pcert.san_ip, gcert->san_ip,
162+
gcert->san_ip_len)) {
162163
bin2print(gcert->san_ip, gcert->san_ip_len, stdout,
163164
"SAN IP mismatch original");
164165
bin2print(ws->pcert.san_ip, ws->pcert.san_ip_len,
@@ -288,8 +289,8 @@ static int x509_gen_cert(struct x509_checker_options *opts)
288289
bin2print(gcert->raw_serial, gcert->raw_serial_size,
289290
stdout, "Serial mismatch original");
290291
bin2print(ws->pcert.raw_serial,
291-
ws->pcert.raw_serial_size,
292-
stdout, "Serial mismatch received");
292+
ws->pcert.raw_serial_size, stdout,
293+
"Serial mismatch received");
293294
ret = -EINVAL;
294295
} else {
295296
printf("Serial number matches\n");
@@ -613,13 +614,11 @@ int main(int argc, char *argv[])
613614
break;
614615
/* skid */
615616
case 6:
616-
CKINT(x509_enc_skid(&ws->parsed_opts,
617-
optarg));
617+
CKINT(x509_enc_skid(&ws->parsed_opts, optarg));
618618
break;
619619
/* akid */
620620
case 7:
621-
CKINT(x509_enc_akid(&ws->parsed_opts,
622-
optarg));
621+
CKINT(x509_enc_akid(&ws->parsed_opts, optarg));
623622
break;
624623
/* valid-from */
625624
case 8:

asn1/tests/asn1_extensions_enc_tester.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ static int x509_gen_cert_extensions(struct x509_checker_options *opts)
9393
ws->data, datalen));
9494

9595
if (gcert->raw_akid_size) {
96-
CKINT(asn1_ber_decoder(&x509_akid_decoder,
97-
&ws->pctx, ws->pctx.raw_akid,
96+
CKINT(asn1_ber_decoder(&x509_akid_decoder, &ws->pctx,
97+
ws->pctx.raw_akid,
9898
ws->pctx.raw_akid_size));
9999
}
100100

@@ -151,7 +151,8 @@ static int x509_gen_cert_extensions(struct x509_checker_options *opts)
151151
gcert->san_ip_len, ws->pcert.san_ip_len);
152152
ret = -EINVAL;
153153
} else {
154-
if (memcmp(ws->pcert.san_ip, gcert->san_ip, gcert->san_ip_len)) {
154+
if (memcmp(ws->pcert.san_ip, gcert->san_ip,
155+
gcert->san_ip_len)) {
155156
bin2print(gcert->san_ip, gcert->san_ip_len, stdout,
156157
"SAN IP mismatch original");
157158
bin2print(ws->pcert.san_ip, ws->pcert.san_ip_len,
@@ -507,8 +508,7 @@ int main(int argc, char *argv[])
507508
break;
508509
/* skid */
509510
case 6:
510-
CKINT(x509_enc_skid(&ws->parsed_opts,
511-
optarg));
511+
CKINT(x509_enc_skid(&ws->parsed_opts, optarg));
512512
break;
513513
/* akid */
514514
case 7:

asn1/tests/x509_gen_tester.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,13 +413,11 @@ int main(int argc, char *argv[])
413413
break;
414414
/* skid */
415415
case 6:
416-
CKINT(x509_enc_skid(&ws->parsed_opts,
417-
optarg));
416+
CKINT(x509_enc_skid(&ws->parsed_opts, optarg));
418417
break;
419418
/* akid */
420419
case 7:
421-
CKINT(x509_enc_akid(&ws->parsed_opts,
422-
optarg));
420+
CKINT(x509_enc_akid(&ws->parsed_opts, optarg));
423421
break;
424422
/* valid-from */
425423
case 8:

0 commit comments

Comments
 (0)