Skip to content

Commit 20227db

Browse files
committed
apply clang-format
Signed-off-by: Stephan Mueller <smueller@chronox.de>
1 parent db4989e commit 20227db

9 files changed

+43
-41
lines changed

apps/src/lc_x509_generator_print.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,9 @@ static int print_x509_validity(const char *prefix, time64_t valid)
229229
int ret;
230230

231231
CKINT(lc_gmtime(valid, &time_detail));
232-
printf("%s: %d-%.2d-%.2d %.2d:%.2d:%.2dZ\n", prefix,
233-
time_detail.year, time_detail.month + 1,
234-
time_detail.day, time_detail.hour, time_detail.min,
235-
time_detail.sec);
232+
printf("%s: %d-%.2d-%.2d %.2d:%.2d:%.2dZ\n", prefix, time_detail.year,
233+
time_detail.month + 1, time_detail.day, time_detail.hour,
234+
time_detail.min, time_detail.sec);
236235

237236
out:
238237
return ret;

asn1/src/asym_key_dilithium.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,22 +74,23 @@ int public_key_verify_signature_dilithium(
7474
* Select the data to be signed
7575
*/
7676
if (sig->authattrs) {
77-
printf_debug("ML-DSA signature verification of authenticated attributes\n");
77+
printf_debug(
78+
"ML-DSA signature verification of authenticated attributes\n");
7879

7980
/*
8081
* Verify the signature using the authenticated attributes
8182
*/
8283
CKINT(lc_dilithium_verify_init(ctx, &ws->dilithium_pk));
83-
CKINT(lc_dilithium_verify_update(
84-
ctx, &lc_pkcs7_authattr_tag,
85-
sizeof(lc_pkcs7_authattr_tag)));
84+
CKINT(lc_dilithium_verify_update(ctx, &lc_pkcs7_authattr_tag,
85+
sizeof(lc_pkcs7_authattr_tag)));
8686
CKINT(lc_dilithium_verify_update(ctx, sig->authattrs,
8787
sig->authattrs_size));
8888
CKINT(lc_dilithium_verify_final(&ws->dilithium_sig, ctx,
89-
&ws->dilithium_pk));
89+
&ws->dilithium_pk));
9090

9191
} else if (sig->digest_size) {
92-
printf_debug("ML-DSA signature verification of pre-hashed data\n");
92+
printf_debug(
93+
"ML-DSA signature verification of pre-hashed data\n");
9394

9495
CKINT(public_key_set_prehash_dilithium(sig, ctx));
9596

@@ -138,7 +139,8 @@ int public_key_generate_signature_dilithium(
138139
* Select the data to be signed
139140
*/
140141
if (sig->authattrs) {
141-
printf_debug("ML-DSA signature generation of authenticated attributes\n");
142+
printf_debug(
143+
"ML-DSA signature generation of authenticated attributes\n");
142144

143145
/*
144146
* Sign the authenticated attributes data
@@ -147,7 +149,8 @@ int public_key_generate_signature_dilithium(
147149
sig->authattrs, sig->authattrs_size,
148150
dilithium_sk, lc_seeded_rng));
149151
} else if (sig->digest_size) {
150-
printf_debug("ML-DSA signature generation of pre-hashed data\n");
152+
printf_debug(
153+
"ML-DSA signature generation of pre-hashed data\n");
151154

152155
CKINT(public_key_set_prehash_dilithium(sig, ctx));
153156

asn1/src/asym_key_dilithium_ed25519.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,9 @@ int public_key_decode_dilithium_ed25519(
271271
return ret;
272272
}
273273

274-
static int public_key_dilithium_ed448_get_data(
275-
const uint8_t **data_ptr, size_t *data_len,
276-
const struct lc_public_key_signature *sig)
274+
static int
275+
public_key_dilithium_ed448_get_data(const uint8_t **data_ptr, size_t *data_len,
276+
const struct lc_public_key_signature *sig)
277277
{
278278
/*
279279
* Select the data to be signed
@@ -524,9 +524,9 @@ int asym_set_dilithium_ed25519_keypair(struct lc_x509_key_data *gen_data,
524524
return ret;
525525
}
526526

527-
int asym_keypair_gen_dilithium_ed25519(
528-
struct lc_x509_certificate *cert, struct lc_x509_key_data *keys,
529-
enum lc_dilithium_type dilithium_key_type)
527+
int asym_keypair_gen_dilithium_ed25519(struct lc_x509_certificate *cert,
528+
struct lc_x509_key_data *keys,
529+
enum lc_dilithium_type dilithium_key_type)
530530
{
531531
struct workspace {
532532
struct lc_dilithium_pk pk;

asn1/src/asym_key_dilithium_ed25519_null.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ int asym_set_dilithium_ed25519_keypair(struct lc_x509_key_data *gen_data,
7878
return -ENOPKG;
7979
}
8080

81-
int asym_keypair_gen_dilithium_ed25519(
82-
struct lc_x509_certificate *cert, struct lc_x509_key_data *keys,
83-
enum lc_dilithium_type dilithium_key_type)
81+
int asym_keypair_gen_dilithium_ed25519(struct lc_x509_certificate *cert,
82+
struct lc_x509_key_data *keys,
83+
enum lc_dilithium_type dilithium_key_type)
8484
{
8585
(void)cert;
8686
(void)keys;

asn1/src/asym_key_dilithium_ed448.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,9 @@ int public_key_decode_dilithium_ed448(
282282
return ret;
283283
}
284284

285-
static int public_key_dilithium_ed448_get_data(
286-
const uint8_t **data_ptr, size_t *data_len,
287-
const struct lc_public_key_signature *sig)
285+
static int
286+
public_key_dilithium_ed448_get_data(const uint8_t **data_ptr, size_t *data_len,
287+
const struct lc_public_key_signature *sig)
288288
{
289289
/*
290290
* Select the data to be signed

asn1/src/asym_key_sphincs.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ int public_key_verify_signature_sphincs(
9191
goto out;
9292
}
9393

94-
printf_debug("SLH-DSA signature verification of authenticated attributes\n");
94+
printf_debug(
95+
"SLH-DSA signature verification of authenticated attributes\n");
9596

9697
/*
9798
* SLH-DSA init/update/final operates like a pre-hash variant
@@ -100,11 +101,12 @@ int public_key_verify_signature_sphincs(
100101
*/
101102
aa[0] = lc_pkcs7_authattr_tag;
102103
memcpy(aa + 1, sig->authattrs, sig->authattrs_size);
103-
CKINT(lc_sphincs_verify_ctx(&ws->sphincs_sig, ctx,
104-
aa, sig->authattrs_size + 1,
104+
CKINT(lc_sphincs_verify_ctx(&ws->sphincs_sig, ctx, aa,
105+
sig->authattrs_size + 1,
105106
&ws->sphincs_pk));
106107
} else if (sig->digest_size) {
107-
printf_debug("SLH-DSA signature verification of pre-hashed data\n");
108+
printf_debug(
109+
"SLH-DSA signature verification of pre-hashed data\n");
108110

109111
CKINT(public_key_set_prehash_sphincs(sig, ctx));
110112

@@ -160,7 +162,8 @@ int public_key_generate_signature_sphincs(
160162
* Select the data to be signed
161163
*/
162164
if (sig->authattrs) {
163-
printf_debug("SLH-DSA signature generation of authenticated attributes\n");
165+
printf_debug(
166+
"SLH-DSA signature generation of authenticated attributes\n");
164167

165168
/*
166169
* Sign the authenticated attributes data
@@ -169,7 +172,8 @@ int public_key_generate_signature_sphincs(
169172
sig->authattrs_size, sphincs_sk,
170173
lc_seeded_rng));
171174
} else if (sig->digest_size) {
172-
printf_debug("SLH-DSA signature generation of pre-hashed data\n");
175+
printf_debug(
176+
"SLH-DSA signature generation of pre-hashed data\n");
173177

174178
CKINT(public_key_set_prehash_sphincs(sig, ctx));
175179

@@ -341,8 +345,8 @@ int asym_set_sphincs_keypair(struct lc_x509_key_data *gen_data,
341345
}
342346

343347
int asym_keypair_gen_sphincs(struct lc_x509_certificate *cert,
344-
struct lc_x509_key_data *keys,
345-
enum lc_sphincs_type sphincs_key_type)
348+
struct lc_x509_key_data *keys,
349+
enum lc_sphincs_type sphincs_key_type)
346350
{
347351
int ret;
348352

asn1/src/asym_key_sphincs_null.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,10 @@ int asym_set_sphincs_keypair(struct lc_x509_key_data *gen_data,
7070
}
7171

7272
int asym_keypair_gen_sphincs(struct lc_x509_certificate *cert,
73-
struct lc_x509_key_data *keys,
74-
enum lc_sphincs_type sphincs_key_type)
73+
struct lc_x509_key_data *keys,
74+
enum lc_sphincs_type sphincs_key_type)
7575
{
7676
(void)cert;
7777
(void)keys;
78-
(void)sphincs_key_type
79-
return -ENOPKG;
78+
(void)sphincs_key_type return -ENOPKG;
8079
}

asn1/src/pkcs7_generator.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,7 @@ int pkcs7_external_aa_OID_enc(void *context, uint8_t *data,
531531

532532
(void)tag;
533533

534-
if (pkcs7_authenticated_attr_unprocessed(
535-
ctx, sinfo_has_content_type)) {
534+
if (pkcs7_authenticated_attr_unprocessed(ctx, sinfo_has_content_type)) {
536535
CKINT(OID_to_data(OID_contentType, &oid_data, &oid_datalen));
537536
bin2print_debug(oid_data, oid_datalen, stdout, "OID data type");
538537
} else if (pkcs7_authenticated_attr_unprocessed(
@@ -668,8 +667,7 @@ int pkcs7_external_aa_enc(void *context, uint8_t *data, size_t *avail_datalen,
668667

669668
(void)tag;
670669

671-
if (pkcs7_authenticated_attr_unprocessed(
672-
ctx, sinfo_has_content_type)) {
670+
if (pkcs7_authenticated_attr_unprocessed(ctx, sinfo_has_content_type)) {
673671
const uint8_t *oid_data = NULL;
674672
size_t oid_datalen = 0;
675673

asn1/src/pkcs7_verify.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ static int pkcs7_digest(struct lc_pkcs7_message *pkcs7,
136136
*/
137137
sig->authattrs = sinfo->authattrs;
138138
sig->authattrs_size = sinfo->authattrs_len;
139-
140139
}
141140

142141
out:

0 commit comments

Comments
 (0)