Skip to content

Commit

Permalink
pkcs15init/pkcs15-lib.c - fixup codestyle
Browse files Browse the repository at this point in the history
 On branch X25519-improvements-2
 Changes to be committed:
	modified:   src/pkcs15init/pkcs15-lib.c
  • Loading branch information
dengert committed Apr 5, 2024
1 parent ae71812 commit 6bc0d76
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/pkcs15init/pkcs15-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1304,8 +1304,8 @@ sc_pkcs15init_init_prkdf(struct sc_pkcs15_card *p15card, struct sc_profile *prof
keyinfo_gostparams->gostr3411 = keyargs->params.gost.gostr3411;
keyinfo_gostparams->gost28147 = keyargs->params.gost.gost28147;
} else if (key->algorithm == SC_ALGORITHM_EC ||
key->algorithm == SC_ALGORITHM_EDDSA ||
key->algorithm == SC_ALGORITHM_XEDDSA) {
key->algorithm == SC_ALGORITHM_EDDSA ||
key->algorithm == SC_ALGORITHM_XEDDSA) {
/* keyargs->key.u.ec.params.der.value is allocated in keyargs, which is on stack */
struct sc_ec_parameters *ecparams = &keyargs->key.u.ec.params;

Expand Down Expand Up @@ -1606,8 +1606,8 @@ sc_pkcs15init_generate_key(struct sc_pkcs15_card *p15card, struct sc_profile *pr
r = sc_copy_gost_params(&(pubkey_args.key.u.gostr3410.params), &(keygen_args->prkey_args.key.u.gostr3410.params));
LOG_TEST_GOTO_ERR(ctx, r, "Cannot allocate GOST parameters");
} else if (algorithm == SC_ALGORITHM_EC ||
algorithm == SC_ALGORITHM_EDDSA ||
algorithm == SC_ALGORITHM_XEDDSA) {
algorithm == SC_ALGORITHM_EDDSA ||
algorithm == SC_ALGORITHM_XEDDSA) {
/* needs to be freed in case of failure when pubkey is not set yet */
r = sc_copy_ec_params(&pubkey_args.key.u.ec.params, &keygen_args->prkey_args.key.u.ec.params);
LOG_TEST_GOTO_ERR(ctx, r, "Cannot allocate EC parameters");
Expand Down Expand Up @@ -2523,8 +2523,8 @@ check_keygen_params_consistency(struct sc_card *card,
int i, rv;

if (prkey && (alg == SC_ALGORITHM_EC ||
alg == SC_ALGORITHM_EDDSA ||
alg == SC_ALGORITHM_XEDDSA)) {
alg == SC_ALGORITHM_EDDSA ||
alg == SC_ALGORITHM_XEDDSA)) {
struct sc_ec_parameters *ecparams = &prkey->key.u.ec.params;

rv = sc_pkcs15_fix_ec_parameters(ctx, ecparams);
Expand All @@ -2548,8 +2548,8 @@ check_keygen_params_consistency(struct sc_card *card,
}

if (prkey && (alg == SC_ALGORITHM_EC ||
alg == SC_ALGORITHM_EDDSA ||
alg == SC_ALGORITHM_XEDDSA))
alg == SC_ALGORITHM_EDDSA ||
alg == SC_ALGORITHM_XEDDSA))
/* allocated in sc_pkcs15_fix_ec_parameters */
free(prkey->key.u.ec.params.der.value);

Expand Down

0 comments on commit 6bc0d76

Please sign in to comment.