Skip to content

Commit cf4fa22

Browse files
author
inoguchi
committed
Wrap long lines
1 parent 1328898 commit cf4fa22

File tree

1 file changed

+44
-39
lines changed
  • src/usr.bin/openssl

1 file changed

+44
-39
lines changed

src/usr.bin/openssl/ts.c

Lines changed: 44 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: ts.c,v 1.19 2022/03/24 11:40:07 inoguchi Exp $ */
1+
/* $OpenBSD: ts.c,v 1.20 2022/03/24 12:00:17 inoguchi Exp $ */
22
/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
33
* project 2002.
44
*/
@@ -80,39 +80,34 @@ static ASN1_OBJECT *txt2obj(const char *oid);
8080
static CONF *load_config_file(const char *configfile);
8181

8282
/* Query related functions. */
83-
static int query_command(const char *data, char *digest,
84-
const EVP_MD *md, const char *policy, int no_nonce,
85-
int cert, const char *in, const char *out, int text);
83+
static int query_command(const char *data, char *digest, const EVP_MD *md,
84+
const char *policy, int no_nonce, int cert, const char *in, const char *out,
85+
int text);
8686
static BIO *BIO_open_with_default(const char *file, const char *mode,
8787
FILE *default_fp);
8888
static TS_REQ *create_query(BIO *data_bio, char *digest, const EVP_MD *md,
8989
const char *policy, int no_nonce, int cert);
90-
static int create_digest(BIO *input, char *digest,
91-
const EVP_MD *md, unsigned char **md_value);
90+
static int create_digest(BIO *input, char *digest, const EVP_MD *md,
91+
unsigned char **md_value);
9292
static ASN1_INTEGER *create_nonce(int bits);
9393

9494
/* Reply related functions. */
95-
static int reply_command(CONF *conf, char *section,
96-
char *queryfile, char *passin, char *inkey,
97-
char *signer, char *chain, const char *policy,
98-
char *in, int token_in, char *out, int token_out,
99-
int text);
95+
static int reply_command(CONF *conf, char *section, char *queryfile,
96+
char *passin, char *inkey, char *signer, char *chain, const char *policy,
97+
char *in, int token_in, char *out, int token_out, int text);
10098
static TS_RESP *read_PKCS7(BIO *in_bio);
10199
static TS_RESP *create_response(CONF *conf, const char *section,
102-
char *queryfile, char *passin, char *inkey,
103-
char *signer, char *chain, const char *policy);
100+
char *queryfile, char *passin, char *inkey, char *signer, char *chain,
101+
const char *policy);
104102
static ASN1_INTEGER *serial_cb(TS_RESP_CTX *ctx, void *data);
105103
static ASN1_INTEGER *next_serial(const char *serialfile);
106104
static int save_ts_serial(const char *serialfile, ASN1_INTEGER *serial);
107105

108106
/* Verify related functions. */
109-
static int verify_command(char *data, char *digest, char *queryfile,
110-
char *in, int token_in,
111-
char *ca_path, char *ca_file, char *untrusted);
107+
static int verify_command(char *data, char *digest, char *queryfile, char *in,
108+
int token_in, char *ca_path, char *ca_file, char *untrusted);
112109
static TS_VERIFY_CTX *create_verify_ctx(char *data, char *digest,
113-
char *queryfile,
114-
char *ca_path, char *ca_file,
115-
char *untrusted);
110+
char *queryfile, char *ca_path, char *ca_file, char *untrusted);
116111
static X509_STORE *create_cert_store(char *ca_path, char *ca_file);
117112
static int verify_cb(int ok, X509_STORE_CTX *ctx);
118113

@@ -418,13 +413,16 @@ ts_main(int argc, char **argv)
418413
goto usage;
419414
/* Load the config file for possible policy OIDs. */
420415
conf = load_config_file(ts_config.configfile);
421-
ret = !query_command(ts_config.data, ts_config.digest, ts_config.md, ts_config.policy, ts_config.no_nonce, ts_config.cert,
422-
ts_config.in, ts_config.out, ts_config.text);
416+
ret = !query_command(ts_config.data, ts_config.digest,
417+
ts_config.md, ts_config.policy, ts_config.no_nonce,
418+
ts_config.cert, ts_config.in, ts_config.out,
419+
ts_config.text);
423420
break;
424421
case CMD_REPLY:
425422
conf = load_config_file(ts_config.configfile);
426423
if (ts_config.in == NULL) {
427-
ret = !(ts_config.queryfile != NULL && conf != NULL && !ts_config.token_in);
424+
ret = !(ts_config.queryfile != NULL && conf != NULL &&
425+
!ts_config.token_in);
428426
if (ret)
429427
goto usage;
430428
} else {
@@ -434,18 +432,25 @@ ts_main(int argc, char **argv)
434432
goto usage;
435433
}
436434

437-
ret = !reply_command(conf, ts_config.section, ts_config.queryfile,
438-
password, ts_config.inkey, ts_config.signer, ts_config.chain, ts_config.policy,
439-
ts_config.in, ts_config.token_in, ts_config.out, ts_config.token_out, ts_config.text);
435+
ret = !reply_command(conf, ts_config.section,
436+
ts_config.queryfile, password, ts_config.inkey,
437+
ts_config.signer, ts_config.chain, ts_config.policy,
438+
ts_config.in, ts_config.token_in, ts_config.out,
439+
ts_config.token_out, ts_config.text);
440440
break;
441441
case CMD_VERIFY:
442-
ret = !(((ts_config.queryfile && !ts_config.data && !ts_config.digest) ||
443-
(!ts_config.queryfile && ts_config.data && !ts_config.digest) ||
444-
(!ts_config.queryfile && !ts_config.data && ts_config.digest)) && ts_config.in != NULL);
442+
ret = !(((ts_config.queryfile && !ts_config.data &&
443+
!ts_config.digest) ||
444+
(!ts_config.queryfile && ts_config.data &&
445+
!ts_config.digest) ||
446+
(!ts_config.queryfile && !ts_config.data &&
447+
ts_config.digest)) &&
448+
ts_config.in != NULL);
445449
if (ret)
446450
goto usage;
447451

448-
ret = !verify_command(ts_config.data, ts_config.digest, ts_config.queryfile, ts_config.in, ts_config.token_in,
452+
ret = !verify_command(ts_config.data, ts_config.digest,
453+
ts_config.queryfile, ts_config.in, ts_config.token_in,
449454
ts_config.ca_path, ts_config.ca_file, ts_config.untrusted);
450455
}
451456

@@ -525,8 +530,8 @@ load_config_file(const char *configfile)
525530

526531
static int
527532
query_command(const char *data, char *digest, const EVP_MD *md,
528-
const char *policy, int no_nonce, int cert, const char *in,
529-
const char *out, int text)
533+
const char *policy, int no_nonce, int cert, const char *in, const char *out,
534+
int text)
530535
{
531536
int ret = 0;
532537
TS_REQ *query = NULL;
@@ -587,8 +592,8 @@ BIO_open_with_default(const char *file, const char *mode, FILE *default_fp)
587592
}
588593

589594
static TS_REQ *
590-
create_query(BIO *data_bio, char *digest, const EVP_MD *md,
591-
const char *policy, int no_nonce, int cert)
595+
create_query(BIO *data_bio, char *digest, const EVP_MD *md, const char *policy,
596+
int no_nonce, int cert)
592597
{
593598
int ret = 0;
594599
TS_REQ *ts_req = NULL;
@@ -747,14 +752,15 @@ create_nonce(int bits)
747752
ASN1_INTEGER_free(nonce);
748753
return NULL;
749754
}
755+
750756
/*
751757
* Reply-related method definitions.
752758
*/
753759

754760
static int
755-
reply_command(CONF *conf, char *section, char *queryfile,
756-
char *passin, char *inkey, char *signer, char *chain, const char *policy,
757-
char *in, int token_in, char *out, int token_out, int text)
761+
reply_command(CONF *conf, char *section, char *queryfile, char *passin,
762+
char *inkey, char *signer, char *chain, const char *policy, char *in,
763+
int token_in, char *out, int token_out, int text)
758764
{
759765
int ret = 0;
760766
TS_RESP *response = NULL;
@@ -877,9 +883,8 @@ read_PKCS7(BIO *in_bio)
877883
}
878884

879885
static TS_RESP *
880-
create_response(CONF *conf, const char *section,
881-
char *queryfile, char *passin, char *inkey,
882-
char *signer, char *chain, const char *policy)
886+
create_response(CONF *conf, const char *section, char *queryfile, char *passin,
887+
char *inkey, char *signer, char *chain, const char *policy)
883888
{
884889
int ret = 0;
885890
TS_RESP *response = NULL;

0 commit comments

Comments
 (0)