Skip to content

Commit

Permalink
card-openpgp.c - codestyle long if stat3ments
Browse files Browse the repository at this point in the history
 On branch X25519-improvements-2
 Changes to be committed:
	modified:   card-openpgp.c
  • Loading branch information
dengert committed Apr 5, 2024
1 parent edf10e8 commit 56e89c3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/libopensc/card-openpgp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1768,7 +1768,9 @@ pgp_get_pubkey_pem(sc_card_t *card, unsigned int tag, u8 *buf, size_t buf_len)
p15pubkey.u.rsa.modulus.len = 0;
p15pubkey.u.rsa.exponent.data = NULL;
p15pubkey.u.rsa.exponent.len = 0;
} else if (p15pubkey.algorithm == SC_ALGORITHM_EC || p15pubkey.algorithm == SC_ALGORITHM_EDDSA || p15pubkey.algorithm == SC_ALGORITHM_XEDDSA) {
} else if (p15pubkey.algorithm == SC_ALGORITHM_EC ||
p15pubkey.algorithm == SC_ALGORITHM_EDDSA ||
p15pubkey.algorithm == SC_ALGORITHM_XEDDSA) {
p15pubkey.u.ec.ecpointQ.value = NULL;
p15pubkey.u.ec.ecpointQ.len = 0;
/* p15pubkey.u.ec.params.der and named_curve will be freed by sc_pkcs15_erase_pubkey */
Expand Down Expand Up @@ -3052,7 +3054,9 @@ pgp_gen_key(sc_card_t *card, sc_cardctl_openpgp_keygen_info_t *key_info)
LOG_FUNC_CALLED(card->ctx);

/* protect incompatible cards against non-RSA */
if (key_info->algorithm != SC_OPENPGP_KEYALGO_RSA && card->type != SC_CARD_TYPE_OPENPGP_GNUK && priv->bcd_version < OPENPGP_CARD_3_0)
if (key_info->algorithm != SC_OPENPGP_KEYALGO_RSA &&
card->type != SC_CARD_TYPE_OPENPGP_GNUK &&
priv->bcd_version < OPENPGP_CARD_3_0)
LOG_FUNC_RETURN(card->ctx, SC_ERROR_NOT_SUPPORTED);

/* set Control Reference Template for key */
Expand Down

0 comments on commit 56e89c3

Please sign in to comment.