typedef struct function_st {
FUNC_TYPE type;
const char *name;
- int (*func)(int argc,char *argv[]);
+ int (*func)(int argc, char *argv[]);
const OPTIONS *help;
} FUNCTION;
{"decrypt", OPT_DECRYPT, '-',
"Time decryption instead of encryption (only EVP)"},
{"mr", OPT_MR, '-', "Produce machine readable output"},
- {"mb", OPT_MB, '-',
+ {"mb", OPT_MB, '-',
"Enable (tls1.1) multi-block mode on evp_cipher requested with -evp"},
{"misalign", OPT_MISALIGN, 'n', "Amount to mis-align buffers"},
{"elapsed", OPT_ELAPSED, '-',
*outlen = SHA_DIGEST_LENGTH;
return SHA1(in, inlen, out);
}
-
#endif /* ndef OPENSSL_NO_EC */
-static int run_benchmark(int async_jobs, int (*loop_function)(void *), loopargs_t *loopargs)
+static int run_benchmark(int async_jobs,
+ int (*loop_function)(void *), loopargs_t *loopargs)
{
int job_op_count = 0;
int total_op_count = 0;
int num_inprogress = 0;
- int error = 0, i = 0, async = 0;
+ int error = 0, i = 0, ret = 0;
OSSL_ASYNC_FD job_fd = 0;
size_t num_job_fds = 0;
}
for (i = 0; i < async_jobs && !error; i++) {
- async = ASYNC_start_job(&(loopargs[i].inprogress_job), loopargs[i].wait_ctx,
- &job_op_count, loop_function,
- (void *)(loopargs + i), sizeof(loopargs_t));
- switch (async) {
+ ret = ASYNC_start_job(&loopargs[i].inprogress_job, loopargs[i].wait_ctx,
+ &job_op_count, loop_function,
+ (void *)(loopargs + i), sizeof(loopargs_t));
+ switch (ret) {
case ASYNC_PAUSE:
++num_inprogress;
break;
continue;
#elif defined(OPENSSL_SYS_WINDOWS)
if (num_job_fds == 1
- && !PeekNamedPipe(job_fd, NULL, 0, NULL, &avail, NULL)
+ && !PeekNamedPipe(job_fd, NULL, 0, NULL, &avail, NULL)
&& avail > 0)
continue;
#endif
- async = ASYNC_start_job(&(loopargs[i].inprogress_job), loopargs[i].wait_ctx,
- &job_op_count, loop_function, (void *)(loopargs + i),
- sizeof(loopargs_t));
- switch (async) {
+ ret = ASYNC_start_job(&loopargs[i].inprogress_job,
+ loopargs[i].wait_ctx, &job_op_count, loop_function,
+ (void *)(loopargs + i), sizeof(loopargs_t));
+ switch (ret) {
case ASYNC_PAUSE:
break;
case ASYNC_FINISH:
if (BIO_CB_RETURN & cmd)
r = ret;
- len = BIO_snprintf(buf,sizeof buf,"BIO[%p]: ",(void *)bio);
+ len = BIO_snprintf(buf, sizeof buf, "BIO[%p]: ", (void *)bio);
/* Ignore errors and continue printing the other information. */
if (len < 0)
static void bn_free_d(BIGNUM *a)
{
- if (BN_get_flags(a,BN_FLG_SECURE))
+ if (BN_get_flags(a, BN_FLG_SECURE))
OPENSSL_secure_free(a->d);
else
OPENSSL_free(a->d);
BNerr(BN_F_BN_EXPAND_INTERNAL, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA);
return (NULL);
}
- if (BN_get_flags(b,BN_FLG_SECURE))
+ if (BN_get_flags(b, BN_FLG_SECURE))
a = A = OPENSSL_secure_zalloc(words * sizeof(*a));
else
a = A = OPENSSL_zalloc(words * sizeof(*a));
int SCT_set_signature_nid(SCT *sct, int nid)
{
- switch (nid) {
+ switch (nid) {
case NID_sha256WithRSAEncryption:
sct->hash_alg = TLSEXT_hash_sha256;
sct->sig_alg = TLSEXT_signature_rsa;
return 1;
}
-size_t EC_KEY_priv2oct(const EC_KEY *eckey,
+size_t EC_KEY_priv2oct(const EC_KEY *eckey,
unsigned char *buf, size_t len)
{
if (eckey->group == NULL || eckey->group->meth == NULL)
{
int num;
- if ((e == NULL) || (cmd_name == NULL)) {
+ if (e == NULL || cmd_name == NULL) {
ENGINEerr(ENGINE_F_ENGINE_CTRL_CMD, ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
- if ((e->ctrl == NULL) || ((num = ENGINE_ctrl(e,
- ENGINE_CTRL_GET_CMD_FROM_NAME,
- 0, (void *)cmd_name,
- NULL)) <= 0)) {
+ if (e->ctrl == NULL
+ || (num = ENGINE_ctrl(e, ENGINE_CTRL_GET_CMD_FROM_NAME,
+ 0, (void *)cmd_name, NULL)) <= 0) {
/*
* If the command didn't *have* to be supported, we fake success.
* This allows certain settings to be specified for multiple ENGINEs
long l;
char *ptr;
- if ((e == NULL) || (cmd_name == NULL)) {
- ENGINEerr(ENGINE_F_ENGINE_CTRL_CMD_STRING,
- ERR_R_PASSED_NULL_PARAMETER);
+ if (e == NULL || cmd_name == NULL) {
+ ENGINEerr(ENGINE_F_ENGINE_CTRL_CMD_STRING, ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
- if (e->ctrl == NULL
+ if (e->ctrl == NULL
|| (num = ENGINE_ctrl(e, ENGINE_CTRL_GET_CMD_FROM_NAME,
0, (void *)cmd_name, NULL)) <= 0) {
/*
case EVP_CTRL_COPY:
if (actx) {
- if ((((EVP_CIPHER_CTX *)ptr)->cipher_data =
- OPENSSL_memdup(actx,sizeof(*actx) + Poly1305_ctx_size()))
- == NULL) {
+ EVP_CIPHER_CTX *dst = (EVP_CIPHER_CTX *)ptr;
+
+ dst->cipher_data =
+ OPENSSL_memdup(actx, sizeof(*actx) + Poly1305_ctx_size());
+ if (dst->cipher_data == NULL) {
EVPerr(EVP_F_CHACHA20_POLY1305_CTRL, EVP_R_COPY_ERROR);
return 0;
}
* the pointer and can't assume that it points to any function in
* particular (such as memset, which it then might further "optimize")
*/
-typedef void *(*memset_t)(void *,int,size_t);
+typedef void *(*memset_t)(void *, int, size_t);
static volatile memset_t memset_func = memset;
int poly1305_init(void *ctx, const unsigned char key[16], void *func[2])
{
if (sizeof(size_t) == 4 && (OPENSSL_ppccap_P & PPC_FPU)) {
- poly1305_init_fpu(ctx,key);
+ poly1305_init_fpu(ctx, key);
func[0] = poly1305_blocks_fpu;
func[1] = poly1305_emit_fpu;
} else {
- poly1305_init_int(ctx,key);
+ poly1305_init_int(ctx, key);
func[0] = poly1305_blocks;
func[1] = poly1305_emit;
}
This is a file descriptor BIO version of "Hello World":
BIO *out;
-
+
out = BIO_new_fd(fileno(stdout), BIO_NOCLOSE);
BIO_printf(out, "Hello World\n");
BIO_free(out);
I<If no function to get the issuer is provided, the internal default
function will be used instead.>
-X509_STORE_set_get_crl() sets the function to get the crl for a given
+X509_STORE_set_get_crl() sets the function to get the crl for a given
certificate B<x>.
When found, the crl must be assigned to B<*crl>.
This function must return 0 on failure and 1 on success.