Found by running the checkpatch.pl Linux script to enforce coding style.
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21468)
* in the '*sum' checksum programs. This aims to preserve backward
* compatibility.
*/
-static const char *newline_escape_filename(const char *file, int * backslash)
+static const char *newline_escape_filename(const char *file, int *backslash)
{
size_t i, e = 0, length = strlen(file), newline_count = 0, mem_len = 0;
char *file_cpy = NULL;
#define OPT_PARAMETERS() { OPT_PARAM_STR, 1, '-', "Parameters:\n" }
const char *opt_path_end(const char *filename);
-char *opt_init(int ac, char **av, const OPTIONS * o);
+char *opt_init(int ac, char **av, const OPTIONS *o);
char *opt_progname(const char *argv0);
char *opt_appname(const char *argv0);
char *opt_getprog(void);
-void opt_help(const OPTIONS * list);
+void opt_help(const OPTIONS *list);
void opt_begin(void);
int opt_next(void);
void print_format_error(int format, unsigned long flags);
int opt_printf_stderr(const char *fmt, ...);
int opt_string(const char *name, const char **options);
-int opt_pair(const char *arg, const OPT_PAIR * pairs, int *result);
+int opt_pair(const char *arg, const OPT_PAIR *pairs, int *result);
int opt_verify(int i, X509_VERIFY_PARAM *vpm);
int opt_rand(int i);
} NAME_EX_TBL;
static int set_table_opts(unsigned long *flags, const char *arg,
- const NAME_EX_TBL * in_tbl);
+ const NAME_EX_TBL *in_tbl);
static int set_multi_opts(unsigned long *flags, const char *arg,
- const NAME_EX_TBL * in_tbl);
+ const NAME_EX_TBL *in_tbl);
int app_init(long mesgwin);
int chopup_args(ARGS *arg, char *buf)
}
static int set_multi_opts(unsigned long *flags, const char *arg,
- const NAME_EX_TBL * in_tbl)
+ const NAME_EX_TBL *in_tbl)
{
STACK_OF(CONF_VALUE) *vals;
CONF_VALUE *val;
}
static int set_table_opts(unsigned long *flags, const char *arg,
- const NAME_EX_TBL * in_tbl)
+ const NAME_EX_TBL *in_tbl)
{
char c;
const NAME_EX_TBL *ptbl;
return 1;
}
-static int function_cmp(const FUNCTION * a, const FUNCTION * b)
+static int function_cmp(const FUNCTION *a, const FUNCTION *b)
{
return strncmp(a->name, b->name, 8);
}
-static unsigned long function_hash(const FUNCTION * a)
+static unsigned long function_hash(const FUNCTION *a)
{
return OPENSSL_LH_strhash(a->name);
}
unsigned char *sig_sig[MAX_KEM_NUM];
} loopargs_t;
static int run_benchmark(int async_jobs, int (*loop_function) (void *),
- loopargs_t * loopargs);
+ loopargs_t *loopargs);
static unsigned int testnum;
}
static int run_benchmark(int async_jobs,
- int (*loop_function) (void *), loopargs_t * loopargs)
+ int (*loop_function) (void *), loopargs_t *loopargs)
{
int job_op_count = 0;
int total_op_count = 0;
static int is_keytype(const CONF *conf, char c, unsigned short type)
{
- const unsigned short * keytypes = (const unsigned short *) conf->meth_data;
+ const unsigned short *keytypes = (const unsigned short *) conf->meth_data;
unsigned char key = (unsigned char)c;
#ifdef CHARSET_EBCDIC
* There are also assembler versions of this function.
*/
# undef CRYPTO_memcmp
-int CRYPTO_memcmp(const void * in_a, const void * in_b, size_t len)
+int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len)
{
size_t i;
const volatile unsigned char *a = in_a;
}
static ossl_inline void constant_time_lookup_niels(niels_s * RESTRICT ni,
- const niels_t * table,
+ const niels_t *table,
int nelts, int idx)
{
constant_time_lookup(ni, table, sizeof(niels_s), nelts, idx);
void
ossl_curve448_precomputed_scalarmul(curve448_point_t out,
- const curve448_precomputed_s * table,
+ const curve448_precomputed_s *table,
const curve448_scalar_t scalar)
{
unsigned int i, j, k;
return n - 1;
}
-static void prepare_wnaf_table(pniels_t * output,
+static void prepare_wnaf_table(pniels_t *output,
const curve448_point_t working,
unsigned int tbits)
{
*/
void
ossl_curve448_precomputed_scalarmul(curve448_point_t scaled,
- const curve448_precomputed_s * base,
+ const curve448_precomputed_s *base,
const curve448_scalar_t scalar);
/*
return 1;
}
-static int chacha_cipher(EVP_CIPHER_CTX * ctx, unsigned char *out,
+static int chacha_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
const unsigned char *inp, size_t len)
{
EVP_CHACHA_KEY *key = data(ctx);
BIO *headerB = NULL, *dataB = NULL;
char *name = NULL;
int len, taillen, headerlen, ret = 0;
- BUF_MEM * buf_mem;
+ BUF_MEM *buf_mem;
*len_out = 0;
*name_out = *header = NULL;
return channel;
}
-void OSSL_trace_end(int category, BIO * channel)
+void OSSL_trace_end(int category, BIO *channel)
{
#ifndef OPENSSL_NO_TRACE
char *suffix = NULL;
static int i2r_NAMING_AUTHORITY(const struct v3_ext_method *method, void *in,
BIO *bp, int ind)
{
- NAMING_AUTHORITY * namingAuthority = (NAMING_AUTHORITY*) in;
+ NAMING_AUTHORITY *namingAuthority = (NAMING_AUTHORITY*) in;
if (namingAuthority == NULL)
return 0;
static int i2r_ADMISSION_SYNTAX(const struct v3_ext_method *method, void *in,
BIO *bp, int ind)
{
- ADMISSION_SYNTAX * admission = (ADMISSION_SYNTAX *)in;
+ ADMISSION_SYNTAX *admission = (ADMISSION_SYNTAX *)in;
int i, j, k;
if (admission->admissionAuthority != NULL) {
* The default digest is SHA3-512
*/
-int main(int argc, char * argv[])
+int main(int argc, char *argv[])
{
int ret = EXIT_FAILURE;
OSSL_LIB_CTX *library_context = NULL;
* more than once.
*/
-const char * hamlet_1 =
+const char *hamlet_1 =
"To be, or not to be, that is the question,\n"
"Whether tis nobler in the minde to suffer\n"
"The Å¿lings and arrowes of outragious fortune,\n"
"The oppressor's wrong, the proud man's Contumely,\n"
"The pangs of dispised love, the Law's delay,\n"
;
-const char * hamlet_2 =
+const char *hamlet_2 =
"The insolence of Office, and the spurns\n"
"That patient merit of the'unworthy takes,\n"
"When he himself might his Quietas make\n"
{
OSSL_LIB_CTX *library_context = NULL;
int ret = 0;
- const char * option_properties = NULL;
+ const char *option_properties = NULL;
EVP_MD *message_digest = NULL;
EVP_MD_CTX *digest_context = NULL;
unsigned int digest_length;
ASYNC_JOB *job;
ASYNC_WAIT_CTX *waitctx;
ASYNC_callback_fn callback;
- void * callback_arg;
+ void *callback_arg;
OSSL_ASYNC_FD pipefds[2] = {0, 0};
OSSL_ASYNC_FD *writefd;
#if defined(ASYNC_WIN)
(gctx)->gcm.funcs.ghash==gcm_ghash_v8)
/* The [unroll8_eor3_]aes_gcm_(enc|dec)_(128|192|256)_kernel() functions
* take input length in BITS and return number of BYTES processed */
-size_t aes_gcm_enc_128_kernel(const uint8_t * plaintext, uint64_t plaintext_length, uint8_t * ciphertext,
+size_t aes_gcm_enc_128_kernel(const uint8_t *plaintext, uint64_t plaintext_length, uint8_t *ciphertext,
uint64_t *Xi, unsigned char ivec[16], const void *key);
-size_t aes_gcm_enc_192_kernel(const uint8_t * plaintext, uint64_t plaintext_length, uint8_t * ciphertext,
+size_t aes_gcm_enc_192_kernel(const uint8_t *plaintext, uint64_t plaintext_length, uint8_t *ciphertext,
uint64_t *Xi, unsigned char ivec[16], const void *key);
-size_t aes_gcm_enc_256_kernel(const uint8_t * plaintext, uint64_t plaintext_length, uint8_t * ciphertext,
+size_t aes_gcm_enc_256_kernel(const uint8_t *plaintext, uint64_t plaintext_length, uint8_t *ciphertext,
uint64_t *Xi, unsigned char ivec[16], const void *key);
-size_t aes_gcm_dec_128_kernel(const uint8_t * ciphertext, uint64_t plaintext_length, uint8_t * plaintext,
+size_t aes_gcm_dec_128_kernel(const uint8_t *ciphertext, uint64_t plaintext_length, uint8_t *plaintext,
uint64_t *Xi, unsigned char ivec[16], const void *key);
-size_t aes_gcm_dec_192_kernel(const uint8_t * ciphertext, uint64_t plaintext_length, uint8_t * plaintext,
+size_t aes_gcm_dec_192_kernel(const uint8_t *ciphertext, uint64_t plaintext_length, uint8_t *plaintext,
uint64_t *Xi, unsigned char ivec[16], const void *key);
-size_t aes_gcm_dec_256_kernel(const uint8_t * ciphertext, uint64_t plaintext_length, uint8_t * plaintext,
+size_t aes_gcm_dec_256_kernel(const uint8_t *ciphertext, uint64_t plaintext_length, uint8_t *plaintext,
uint64_t *Xi, unsigned char ivec[16], const void *key);
-size_t unroll8_eor3_aes_gcm_enc_128_kernel(const uint8_t * plaintext, uint64_t plaintext_length, uint8_t * ciphertext,
+size_t unroll8_eor3_aes_gcm_enc_128_kernel(const uint8_t *plaintext, uint64_t plaintext_length, uint8_t *ciphertext,
uint64_t *Xi, unsigned char ivec[16], const void *key);
-size_t unroll8_eor3_aes_gcm_enc_192_kernel(const uint8_t * plaintext, uint64_t plaintext_length, uint8_t * ciphertext,
+size_t unroll8_eor3_aes_gcm_enc_192_kernel(const uint8_t *plaintext, uint64_t plaintext_length, uint8_t *ciphertext,
uint64_t *Xi, unsigned char ivec[16], const void *key);
-size_t unroll8_eor3_aes_gcm_enc_256_kernel(const uint8_t * plaintext, uint64_t plaintext_length, uint8_t * ciphertext,
+size_t unroll8_eor3_aes_gcm_enc_256_kernel(const uint8_t *plaintext, uint64_t plaintext_length, uint8_t *ciphertext,
uint64_t *Xi, unsigned char ivec[16], const void *key);
-size_t unroll8_eor3_aes_gcm_dec_128_kernel(const uint8_t * ciphertext, uint64_t plaintext_length, uint8_t * plaintext,
+size_t unroll8_eor3_aes_gcm_dec_128_kernel(const uint8_t *ciphertext, uint64_t plaintext_length, uint8_t *plaintext,
uint64_t *Xi, unsigned char ivec[16], const void *key);
-size_t unroll8_eor3_aes_gcm_dec_192_kernel(const uint8_t * ciphertext, uint64_t plaintext_length, uint8_t * plaintext,
+size_t unroll8_eor3_aes_gcm_dec_192_kernel(const uint8_t *ciphertext, uint64_t plaintext_length, uint8_t *plaintext,
uint64_t *Xi, unsigned char ivec[16], const void *key);
-size_t unroll8_eor3_aes_gcm_dec_256_kernel(const uint8_t * ciphertext, uint64_t plaintext_length, uint8_t * plaintext,
+size_t unroll8_eor3_aes_gcm_dec_256_kernel(const uint8_t *ciphertext, uint64_t plaintext_length, uint8_t *plaintext,
uint64_t *Xi, unsigned char ivec[16], const void *key);
size_t armv8_aes_gcm_encrypt(const unsigned char *in, unsigned char *out, size_t len, const void *key,
unsigned char ivec[16], u64 *Xi);
int ossl_x509_algor_md_to_mgf1(X509_ALGOR **palg, const EVP_MD *mgf1md);
int ossl_asn1_time_print_ex(BIO *bp, const ASN1_TIME *tm, unsigned long flags);
-EVP_PKEY * ossl_d2i_PrivateKey_legacy(int keytype, EVP_PKEY **a,
- const unsigned char **pp, long length,
- OSSL_LIB_CTX *libctx, const char *propq);
+EVP_PKEY *ossl_d2i_PrivateKey_legacy(int keytype, EVP_PKEY **a,
+ const unsigned char **pp, long length,
+ OSSL_LIB_CTX *libctx, const char *propq);
X509_ALGOR *ossl_X509_ALGOR_from_nid(int nid, int ptype, void *pval);
time_t ossl_asn1_string_to_time_t(const char *asn1_string);
OSSL_DEPRECATEDIN_3_0
const ENGINE *OSSL_STORE_LOADER_get0_engine(const OSSL_STORE_LOADER *loader);
OSSL_DEPRECATEDIN_3_0
-const char * OSSL_STORE_LOADER_get0_scheme(const OSSL_STORE_LOADER *loader);
+const char *OSSL_STORE_LOADER_get0_scheme(const OSSL_STORE_LOADER *loader);
OSSL_DEPRECATEDIN_3_0
int OSSL_STORE_register_loader(OSSL_STORE_LOADER *loader);
OSSL_DEPRECATEDIN_3_0
return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
flags, kbits, blkbits, ivbits); \
} \
-static void * ossl_##alg##kbits##_##lc##_newctx(void *provctx) \
+static void *ossl_##alg##kbits##_##lc##_newctx(void *provctx) \
{ \
return ossl_##alg##_##lc##_newctx(provctx, kbits); \
} \
return ossl_cipher_generic_get_params(params, EVP_CIPH_##UCMODE##_MODE, \
flags, 2*kbits, blkbits, ivbits); \
} \
-static void * alg##kbits##lc##_newctx(void *provctx) \
+static void *alg##kbits##lc##_newctx(void *provctx) \
{ \
return alg##_##lc##_newctx(provctx, 2*kbits, EVP_CIPH_##UCMODE##_MODE, \
flags); \
flags, kbits, blkbits, ivbits); \
} \
static OSSL_FUNC_cipher_newctx_fn alg##_##kbits##_##lcmode##_newctx; \
-static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \
+static void *alg##_##kbits##_##lcmode##_newctx(void *provctx) \
{ \
PROV_##UCALG##_CTX *ctx; \
if (!ossl_prov_is_running()) \
kbits, blkbits, ivbits); \
} \
static OSSL_FUNC_cipher_newctx_fn alg##_##kbits##_newctx; \
-static void * alg##_##kbits##_newctx(void *provctx) \
+static void *alg##_##kbits##_newctx(void *provctx) \
{ \
PROV_##UCALG##_CTX *ctx; \
if (!ossl_prov_is_running()) \
flags, kbits, blkbits, ivbits); \
} \
static OSSL_FUNC_cipher_newctx_fn alg##_##kbits##_##lcmode##_newctx; \
-static void * alg##_##kbits##_##lcmode##_newctx(void *provctx) \
+static void *alg##_##kbits##_##lcmode##_newctx(void *provctx) \
{ \
PROV_##UCALG##_CTX *ctx; \
if (!ossl_prov_is_running()) \
* So the handle might have been closed or even reused for opening
* another file.
*/
-static int check_random_device(struct random_device * rd)
+static int check_random_device(struct random_device *rd)
{
struct stat st;
static int get_random_device(size_t n)
{
struct stat st;
- struct random_device * rd = &random_devices[n];
+ struct random_device *rd = &random_devices[n];
/* reuse existing file descriptor if it is (still) valid */
if (check_random_device(rd))
*/
static void close_random_device(size_t n)
{
- struct random_device * rd = &random_devices[n];
+ struct random_device *rd = &random_devices[n];
if (check_random_device(rd))
close(rd->fd);
return ret;
}
-static void dtls1_bio_set_next_timeout(BIO * bio, const DTLS1_STATE *d1)
+static void dtls1_bio_set_next_timeout(BIO *bio, const DTLS1_STATE *d1)
{
struct timeval tv = ossl_time_to_timeval(d1->next_timeout);
/* *INDENT-ON* */
/* Utility function for table lookup */
-static int ssl_cipher_info_find(const ssl_cipher_table * table,
+static int ssl_cipher_info_find(const ssl_cipher_table *table,
size_t table_cnt, uint32_t mask)
{
size_t i;
}
/* Determine if a command is allowed according to cctx flags */
-static int ssl_conf_cmd_allowed(SSL_CONF_CTX *cctx, const ssl_conf_cmd_tbl * t)
+static int ssl_conf_cmd_allowed(SSL_CONF_CTX *cctx, const ssl_conf_cmd_tbl *t)
{
unsigned int tfl = t->flags;
unsigned int cfl = cctx->flags;
return NULL;
}
-static int ctrl_switch_option(SSL_CONF_CTX *cctx, const ssl_conf_cmd_tbl * cmd)
+static int ctrl_switch_option(SSL_CONF_CTX *cctx, const ssl_conf_cmd_tbl *cmd)
{
/* Find index of command in table */
size_t idx = cmd - ssl_conf_cmds;
* called prior to any threads making calls to any OpenSSL functions,
* i.e. passing a non-null settings value is assumed to be single-threaded.
*/
-int OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS * settings)
+int OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings)
{
static int stoperrset = 0;
return NULL;
}
-static int ct_permissive(const CT_POLICY_EVAL_CTX * ctx,
+static int ct_permissive(const CT_POLICY_EVAL_CTX *ctx,
const STACK_OF(SCT) *scts, void *unused_arg)
{
return 1;
}
-static int ct_strict(const CT_POLICY_EVAL_CTX * ctx,
+static int ct_strict(const CT_POLICY_EVAL_CTX *ctx,
const STACK_OF(SCT) *scts, void *unused_arg)
{
int count = scts != NULL ? sk_SCT_num(scts) : 0;
return CTLOG_STORE_load_file(ctx->ctlog_store, path);
}
-void SSL_CTX_set0_ctlog_store(SSL_CTX *ctx, CTLOG_STORE * logs)
+void SSL_CTX_set0_ctlog_store(SSL_CTX *ctx, CTLOG_STORE *logs)
{
CTLOG_STORE_free(ctx->ctlog_store);
ctx->ctlog_store = logs;
int ossl_gost_ukm(const SSL_CONNECTION *s, unsigned char *dgst_buf)
{
- EVP_MD_CTX * hash = NULL;
+ EVP_MD_CTX *hash = NULL;
unsigned int md_len;
SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
const EVP_MD *md = ssl_evp_md_fetch(sctx->libctx, NID_id_GostR3411_2012_256,
static int test_pr16743(void)
{
int ret = 0;
- const EVP_CIPHER * cipher;
+ const EVP_CIPHER *cipher;
EVP_CIPHER_CTX *ctx;
if (!TEST_true(ENGINE_init(e)))
* This simplifies finding duplicate random output and makes
* the printout in case of an error more readable.
*/
-static int compare_drbg_fork_result(const void * left, const void * right)
+static int compare_drbg_fork_result(const void *left, const void *right)
{
int result;
const drbg_fork_result *l = left;
*
* Used for finding collisions in two-byte chunks
*/
-static int compare_rand_chunk(const void * left, const void * right)
+static int compare_rand_chunk(const void *left, const void *right)
{
return memcmp(left, right, 2);
}
EC_GROUP *group = NULL;
const EC_POINT *G = NULL;
EC_POINT *P = NULL;
- BN_CTX * bnctx = NULL;
+ BN_CTX *bnctx = NULL;
/* Do some setup */
nid = curves[id].nid;
/* Name of test as it appears in file */
const char *name;
/* Initialise test for "alg" */
- int (*init) (EVP_TEST * t, const char *alg);
+ int (*init) (EVP_TEST *t, const char *alg);
/* Clean up method */
- void (*cleanup) (EVP_TEST * t);
+ void (*cleanup) (EVP_TEST *t);
/* Test specific name value pair processing */
- int (*parse) (EVP_TEST * t, const char *name, const char *value);
+ int (*parse) (EVP_TEST *t, const char *name, const char *value);
/* Run the test itself */
- int (*run_test) (EVP_TEST * t);
+ int (*run_test) (EVP_TEST *t);
};
/* Linked list of named keys. */
};
X509 *issuer = NULL;
- X509_EXTENSION * ext = NULL;
+ X509_EXTENSION *ext = NULL;
int ret = 0;
if (!TEST_true(get_cert(&issuer)))
*/
static int create_cert_key(int idx, char *certfilename, char *privkeyfilename)
{
- EVP_PKEY_CTX * evpctx = EVP_PKEY_CTX_new_from_name(libctx,
+ EVP_PKEY_CTX *evpctx = EVP_PKEY_CTX_new_from_name(libctx,
(idx == 0) ? "xorhmacsig" : "xorhmacsha2sig", NULL);
EVP_PKEY *pkey = NULL;
X509 *x509 = X509_new();