Skip to content

Commit

Permalink
Style fixes
Browse files Browse the repository at this point in the history
No intended functional changes
  • Loading branch information
mtrojnar committed Oct 20, 2024
1 parent fd149ce commit 9b20ef7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
9 changes: 3 additions & 6 deletions src/p11_ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,13 @@
#if OPENSSL_VERSION_NUMBER >= 0x10100002L
#ifndef OPENSSL_NO_EC
static EC_KEY_METHOD *pkcs11_ec_key_method = NULL;
void pkcs11_ec_key_method_free(void);
#endif /* OPENSSL_NO_EC */
#else /* OPENSSL_VERSION_NUMBER */
#ifndef OPENSSL_NO_ECDSA
static ECDSA_METHOD *pkcs11_ecdsa_method = NULL;
void pkcs11_ecdsa_method_free(void);
#endif /* OPENSSL_NO_ECDSA */
#ifndef OPENSSL_NO_ECDH
static ECDH_METHOD *pkcs11_ecdh_method = NULL;
void pkcs11_ecdh_method_free(void);
#endif /* OPENSSL_NO_ECDH */
#endif /* OPENSSL_VERSION_NUMBER */

Expand Down Expand Up @@ -806,7 +803,7 @@ void pkcs11_ec_key_method_free(void)
if (pkcs11_ec_key_method) {
free_ec_ex_index();
EC_KEY_METHOD_free(pkcs11_ec_key_method);
pkcs11_ec_key_method = NULL;
pkcs11_ec_key_method = NULL;
}
}

Expand Down Expand Up @@ -844,7 +841,7 @@ void pkcs11_ecdsa_method_free(void)
if (pkcs11_ecdsa_method) {
free_ec_ex_index();
EC_KEY_METHOD_free(pkcs11_ecdsa_method);
pkcs11_ecdsa_method = NULL;
pkcs11_ecdsa_method = NULL;
}
}

Expand All @@ -864,7 +861,7 @@ void pkcs11_ecdh_method_free(void)
if (pkcs11_ecdh_method) {
free_ec_ex_index();
EC_KEY_METHOD_free(pkcs11_ecdh_method);
pkcs11_ecdh_method = NULL;
pkcs11_ecdh_method = NULL;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/p11_front.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ int PKCS11_store_private_key(PKCS11_TOKEN *token,
}

int PKCS11_store_public_key(PKCS11_TOKEN *token,
EVP_PKEY *pk, char *label, unsigned char *id, size_t id_len)
EVP_PKEY *pk, char *label, unsigned char *id, size_t id_len)
{
PKCS11_SLOT_private *slot = PRIVSLOT(token->slot);
if (check_slot_fork(slot) < 0)
Expand Down
12 changes: 6 additions & 6 deletions src/p11_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
#include <string.h>

/* Global number of active PKCS11_CTX objects */
static int pkcs11_ctx_refs = 0;
static int pkcs11_global_data_refs = 0;

static void pkcs11_global_free(void);
static void pkcs11_global_data_free(void);

/*
* Create a new context
Expand All @@ -47,7 +47,7 @@ PKCS11_CTX *pkcs11_CTX_new(void)
cpriv->forkid = get_forkid();
pthread_mutex_init(&cpriv->fork_lock, 0);

pkcs11_ctx_refs++;
pkcs11_global_data_refs++;

return ctx;
fail:
Expand Down Expand Up @@ -178,11 +178,11 @@ void pkcs11_CTX_free(PKCS11_CTX *ctx)
OPENSSL_free(ctx->_private);
OPENSSL_free(ctx);

if (--pkcs11_ctx_refs == 0)
pkcs11_global_free();
if (--pkcs11_global_data_refs == 0)
pkcs11_global_data_free();
}

static void pkcs11_global_free(void)
static void pkcs11_global_data_free(void)
{
#ifndef OPENSSL_NO_RSA
pkcs11_rsa_method_free();
Expand Down
6 changes: 3 additions & 3 deletions src/p11_rsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,19 +369,19 @@ int (*RSA_meth_get_priv_enc(const RSA_METHOD *meth))
(int flen, const unsigned char *from,
unsigned char *to, RSA *rsa, int padding)
{
return meth->rsa_priv_enc;
return meth->rsa_priv_enc;
}

int (*RSA_meth_get_priv_dec(const RSA_METHOD *meth))
(int flen, const unsigned char *from,
unsigned char *to, RSA *rsa, int padding)
{
return meth->rsa_priv_dec;
return meth->rsa_priv_dec;
}

static int (*RSA_meth_get_finish(const RSA_METHOD *meth)) (RSA *rsa)
{
return meth->finish;
return meth->finish;
}

#endif
Expand Down

0 comments on commit 9b20ef7

Please sign in to comment.