Browse Source

Remove parentheses of return.

Since return is inconsistent, I removed unnecessary parentheses and
unified them.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4541)
master
KaoruToda 5 years ago
committed by Matt Caswell
parent
commit
26a7d938c9
220 changed files with 1449 additions and 1449 deletions
  1. +16
    -16
      apps/apps.c
  2. +1
    -1
      apps/asn1pars.c
  3. +8
    -8
      apps/ca.c
  4. +1
    -1
      apps/cms.c
  5. +1
    -1
      apps/crl.c
  6. +2
    -2
      apps/crl2p7.c
  7. +1
    -1
      apps/dgst.c
  8. +1
    -1
      apps/dhparam.c
  9. +1
    -1
      apps/dsa.c
  10. +1
    -1
      apps/dsaparam.c
  11. +1
    -1
      apps/ec.c
  12. +1
    -1
      apps/ecparam.c
  13. +1
    -1
      apps/engine.c
  14. +1
    -1
      apps/errstr.c
  15. +1
    -1
      apps/gendsa.c
  16. +1
    -1
      apps/genrsa.c
  17. +1
    -1
      apps/nseq.c
  18. +1
    -1
      apps/ocsp.c
  19. +4
    -4
      apps/openssl.c
  20. +1
    -1
      apps/passwd.c
  21. +1
    -1
      apps/pkcs7.c
  22. +1
    -1
      apps/rand.c
  23. +1
    -1
      apps/rsa.c
  24. +7
    -7
      apps/s_cb.c
  25. +1
    -1
      apps/s_client.c
  26. +13
    -13
      apps/s_server.c
  27. +2
    -2
      apps/sess_id.c
  28. +1
    -1
      apps/smime.c
  29. +1
    -1
      apps/speed.c
  30. +1
    -1
      apps/spkac.c
  31. +1
    -1
      apps/srp.c
  32. +1
    -1
      apps/ts.c
  33. +1
    -1
      apps/verify.c
  34. +1
    -1
      apps/version.c
  35. +16
    -16
      apps/vms_term_sock.c
  36. +6
    -6
      crypto/asn1/a_bitstr.c
  37. +6
    -6
      crypto/asn1/a_d2i_fp.c
  38. +2
    -2
      crypto/asn1/a_digest.c
  39. +6
    -6
      crypto/asn1/a_dup.c
  40. +8
    -8
      crypto/asn1/a_i2d_fp.c
  41. +4
    -4
      crypto/asn1/a_int.c
  42. +14
    -14
      crypto/asn1/a_object.c
  43. +10
    -10
      crypto/asn1/a_print.c
  44. +2
    -2
      crypto/asn1/a_sign.c
  45. +2
    -2
      crypto/asn1/a_type.c
  46. +1
    -1
      crypto/asn1/a_verify.c
  47. +2
    -2
      crypto/asn1/asn_mime.c
  48. +1
    -1
      crypto/asn1/bio_asn1.c
  49. +3
    -3
      crypto/asn1/d2i_pr.c
  50. +3
    -3
      crypto/asn1/d2i_pu.c
  51. +3
    -3
      crypto/asn1/evp_asn1.c
  52. +3
    -3
      crypto/asn1/f_int.c
  53. +3
    -3
      crypto/asn1/f_string.c
  54. +1
    -1
      crypto/bf/bf_ecb.c
  55. +3
    -3
      crypto/bio/b_print.c
  56. +6
    -6
      crypto/bio/b_sock.c
  57. +30
    -30
      crypto/bio/bf_buff.c
  58. +24
    -24
      crypto/bio/bf_lbuf.c
  59. +17
    -17
      crypto/bio/bf_nbio.c
  60. +16
    -16
      crypto/bio/bf_null.c
  61. +21
    -21
      crypto/bio/bio_lib.c
  62. +14
    -14
      crypto/bio/bss_acpt.c
  63. +16
    -16
      crypto/bio/bss_conn.c
  64. +28
    -28
      crypto/bio/bss_dgram.c
  65. +12
    -12
      crypto/bio/bss_fd.c
  66. +6
    -6
      crypto/bio/bss_log.c
  67. +11
    -11
      crypto/bio/bss_mem.c
  68. +8
    -8
      crypto/bio/bss_null.c
  69. +11
    -11
      crypto/bio/bss_sock.c
  70. +1
    -1
      crypto/blake2/m_blake2b.c
  71. +1
    -1
      crypto/blake2/m_blake2s.c
  72. +6
    -6
      crypto/bn/asm/x86_64-gcc.c
  73. +16
    -16
      crypto/bn/bn_asm.c
  74. +5
    -5
      crypto/bn/bn_blind.c
  75. +6
    -6
      crypto/bn/bn_div.c
  76. +9
    -9
      crypto/bn/bn_exp.c
  77. +2
    -2
      crypto/bn/bn_exp2.c
  78. +5
    -5
      crypto/bn/bn_gcd.c
  79. +1
    -1
      crypto/bn/bn_gf2m.c
  80. +30
    -30
      crypto/bn/bn_lib.c
  81. +1
    -1
      crypto/bn/bn_mod.c
  82. +9
    -9
      crypto/bn/bn_mont.c
  83. +1
    -1
      crypto/bn/bn_mul.c
  84. +5
    -5
      crypto/bn/bn_prime.c
  85. +1
    -1
      crypto/bn/bn_rand.c
  86. +5
    -5
      crypto/bn/bn_recp.c
  87. +5
    -5
      crypto/bn/bn_shift.c
  88. +1
    -1
      crypto/bn/bn_sqr.c
  89. +1
    -1
      crypto/bn/bn_sqrt.c
  90. +5
    -5
      crypto/bn/bn_word.c
  91. +10
    -10
      crypto/buffer/buffer.c
  92. +1
    -1
      crypto/comp/c_zlib.c
  93. +6
    -6
      crypto/comp/comp_lib.c
  94. +12
    -12
      crypto/conf/conf_api.c
  95. +1
    -1
      crypto/conf/conf_lib.c
  96. +8
    -8
      crypto/cversion.c
  97. +1
    -1
      crypto/des/cbc_cksm.c
  98. +2
    -2
      crypto/des/fcrypt.c
  99. +1
    -1
      crypto/des/qud_cksm.c
  100. +1
    -1
      crypto/des/rand_key.c

+ 16
- 16
apps/apps.c View File

@ -663,7 +663,7 @@ X509 *load_cert(const char *file, int format, const char *cert_descrip)
ERR_print_errors(bio_err);
}
BIO_free(cert);
return (x);
return x;
}
X509_CRL *load_crl(const char *infile, int format)
@ -697,7 +697,7 @@ X509_CRL *load_crl(const char *infile, int format)
end:
BIO_free(in);
return (x);
return x;
}
EVP_PKEY *load_key(const char *file, int format, int maybe_stdin,
@ -769,7 +769,7 @@ EVP_PKEY *load_key(const char *file, int format, int maybe_stdin,
BIO_printf(bio_err, "unable to load %s\n", key_descrip);
ERR_print_errors(bio_err);
}
return (pkey);
return pkey;
}
EVP_PKEY *load_pubkey(const char *file, int format, int maybe_stdin,
@ -855,7 +855,7 @@ EVP_PKEY *load_pubkey(const char *file, int format, int maybe_stdin,
BIO_free(key);
if (pkey == NULL)
BIO_printf(bio_err, "unable to load %s\n", key_descrip);
return (pkey);
return pkey;
}
static int load_certs_crls(const char *file, int format,
@ -1334,7 +1334,7 @@ static int index_serial_cmp(const OPENSSL_CSTRING *a,
for (aa = a[DB_serial]; *aa == '0'; aa++) ;
for (bb = b[DB_serial]; *bb == '0'; bb++) ;
return (strcmp(aa, bb));
return strcmp(aa, bb);
}
static int index_name_qual(char **a)
@ -1349,7 +1349,7 @@ static unsigned long index_name_hash(const OPENSSL_CSTRING *a)
int index_name_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b)
{
return (strcmp(a[DB_name], b[DB_name]));
return strcmp(a[DB_name], b[DB_name]);
}
static IMPLEMENT_LHASH_HASH_FN(index_serial, OPENSSL_CSTRING)
@ -1400,7 +1400,7 @@ BIGNUM *load_serial(const char *serialfile, int create, ASN1_INTEGER **retai)
err:
BIO_free(in);
ASN1_INTEGER_free(ai);
return (ret);
return ret;
}
int save_serial(const char *serialfile, const char *suffix, const BIGNUM *serial,
@ -1450,7 +1450,7 @@ int save_serial(const char *serialfile, const char *suffix, const BIGNUM *serial
err:
BIO_free_all(out);
ASN1_INTEGER_free(ai);
return (ret);
return ret;
}
int rotate_serial(const char *serialfile, const char *new_suffix,
@ -2153,7 +2153,7 @@ double app_tminterval(int stop, int usertime)
ret = (__int64)(tmstop.QuadPart - tmstart.QuadPart) * 1e-7;
}
return (ret);
return ret;
}
#elif defined(OPENSSL_SYSTEM_VXWORKS)
# include <time.h>
@ -2189,7 +2189,7 @@ double app_tminterval(int stop, int usertime)
else
ret = (now - tmstart) / (double)sysClkRateGet();
# endif
return (ret);
return ret;
}
#elif defined(OPENSSL_SYSTEM_VMS)
@ -2223,7 +2223,7 @@ double app_tminterval(int stop, int usertime)
else
ret = (now - tmstart) / (double)(CLK_TCK);
return (ret);
return ret;
}
#elif defined(_SC_CLK_TCK) /* by means of unistd.h */
@ -2246,7 +2246,7 @@ double app_tminterval(int stop, int usertime)
ret = (now - tmstart) / (double)tck;
}
return (ret);
return ret;
}
#else
@ -2371,9 +2371,9 @@ int raw_read_stdin(void *buf, int siz)
{
DWORD n;
if (ReadFile(GetStdHandle(STD_INPUT_HANDLE), buf, siz, &n, NULL))
return (n);
return n;
else
return (-1);
return -1;
}
#elif defined(__VMS)
# include <sys/socket.h>
@ -2394,9 +2394,9 @@ int raw_write_stdout(const void *buf, int siz)
{
DWORD n;
if (WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), buf, siz, &n, NULL))
return (n);
return n;
else
return (-1);
return -1;
}
#else
int raw_write_stdout(const void *buf, int siz)


+ 1
- 1
apps/asn1pars.c View File

@ -306,7 +306,7 @@ int asn1parse_main(int argc, char **argv)
OPENSSL_free(str);
ASN1_TYPE_free(at);
sk_OPENSSL_STRING_free(osk);
return (ret);
return ret;
}
static int do_generate(char *genstr, const char *genconf, BUF_MEM *buf)


+ 8
- 8
apps/ca.c View File

@ -1235,7 +1235,7 @@ end_of_options:
NCONF_free(conf);
NCONF_free(extconf);
release_engine(e);
return (ret);
return ret;
}
static char *lookup_conf(const CONF *conf, const char *section, const char *tag)
@ -1312,7 +1312,7 @@ static int certify(X509 **xret, const char *infile, EVP_PKEY *pkey, X509 *x509,
end:
X509_REQ_free(req);
BIO_free(in);
return (ok);
return ok;
}
static int certify_cert(X509 **xret, const char *infile, EVP_PKEY *pkey, X509 *x509,
@ -1365,7 +1365,7 @@ static int certify_cert(X509 **xret, const char *infile, EVP_PKEY *pkey, X509 *x
end:
X509_REQ_free(rreq);
X509_free(req);
return (ok);
return ok;
}
static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
@ -1866,7 +1866,7 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
X509_free(ret);
else
*xret = ret;
return (ok);
return ok;
}
static void write_new_certificate(BIO *bp, X509 *x, int output_der, int notext)
@ -2013,7 +2013,7 @@ static int certify_spkac(X509 **xret, const char *infile, EVP_PKEY *pkey,
NETSCAPE_SPKI_free(spki);
X509_NAME_ENTRY_free(ne);
return (ok);
return ok;
}
static int check_time_format(const char *str)
@ -2119,7 +2119,7 @@ static int do_revoke(X509 *x509, CA_DB *db, REVINFO_TYPE rev_type,
end:
for (i = 0; i < DB_NUMBER; i++)
OPENSSL_free(row[i]);
return (ok);
return ok;
}
static int get_certificate_status(const char *serial, CA_DB *db)
@ -2186,7 +2186,7 @@ static int get_certificate_status(const char *serial, CA_DB *db)
for (i = 0; i < DB_NUMBER; i++) {
OPENSSL_free(row[i]);
}
return (ok);
return ok;
}
static int do_updatedb(CA_DB *db)
@ -2244,7 +2244,7 @@ static int do_updatedb(CA_DB *db)
ASN1_UTCTIME_free(a_tm);
OPENSSL_free(a_tm_s);
return (cnt);
return cnt;
}
static const char *crl_reasons[] = {


+ 1
- 1
apps/cms.c View File

@ -1103,7 +1103,7 @@ int cms_main(int argc, char **argv)
BIO_free(indata);
BIO_free_all(out);
OPENSSL_free(passin);
return (ret);
return ret;
}
static int save_certs(char *signerfile, STACK_OF(X509) *signers)


+ 1
- 1
apps/crl.c View File

@ -337,5 +337,5 @@ int crl_main(int argc, char **argv)
X509_CRL_free(x);
X509_STORE_CTX_free(ctx);
X509_STORE_free(store);
return (ret);
return ret;
}

+ 2
- 2
apps/crl2p7.c View File

@ -162,7 +162,7 @@ int crl2pkcs7_main(int argc, char **argv)
PKCS7_free(p7);
X509_CRL_free(crl);
return (ret);
return ret;
}
/*-
@ -212,5 +212,5 @@ static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile)
/* never need to OPENSSL_free x */
BIO_free(in);
sk_X509_INFO_free(sk);
return (ret);
return ret;
}

+ 1
- 1
apps/dgst.c View File

@ -398,7 +398,7 @@ int dgst_main(int argc, char **argv)
OPENSSL_free(sigbuf);
BIO_free(bmd);
release_engine(e);
return (ret);
return ret;
}
int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,


+ 1
- 1
apps/dhparam.c View File

@ -364,7 +364,7 @@ int dhparam_main(int argc, char **argv)
BIO_free_all(out);
DH_free(dh);
release_engine(e);
return (ret);
return ret;
}
static int dh_cb(int p, int n, BN_GENCB *cb)


+ 1
- 1
apps/dsa.c View File

@ -256,6 +256,6 @@ int dsa_main(int argc, char **argv)
release_engine(e);
OPENSSL_free(passin);
OPENSSL_free(passout);
return (ret);
return ret;
}
#endif

+ 1
- 1
apps/dsaparam.c View File

@ -230,7 +230,7 @@ int dsaparam_main(int argc, char **argv)
BIO_free_all(out);
DSA_free(dsa);
release_engine(e);
return (ret);
return ret;
}
static int dsa_cb(int p, int n, BN_GENCB *cb)


+ 1
- 1
apps/ec.c View File

@ -277,6 +277,6 @@ int ec_main(int argc, char **argv)
release_engine(e);
OPENSSL_free(passin);
OPENSSL_free(passout);
return (ret);
return ret;
}
#endif

+ 1
- 1
apps/ecparam.c View File

@ -437,7 +437,7 @@ int ecparam_main(int argc, char **argv)
release_engine(e);
BIO_free(in);
BIO_free_all(out);
return (ret);
return ret;
}
#endif

+ 1
- 1
apps/engine.c View File

@ -483,6 +483,6 @@ int engine_main(int argc, char **argv)
sk_OPENSSL_STRING_free(pre_cmds);
sk_OPENSSL_STRING_free(post_cmds);
BIO_free_all(out);
return (ret);
return ret;
}
#endif

+ 1
- 1
apps/errstr.c View File

@ -62,5 +62,5 @@ int errstr_main(int argc, char **argv)
}
}
end:
return (ret);
return ret;
}

+ 1
- 1
apps/gendsa.c View File

@ -133,6 +133,6 @@ int gendsa_main(int argc, char **argv)
DSA_free(dsa);
release_engine(e);
OPENSSL_free(passout);
return (ret);
return ret;
}
#endif

+ 1
- 1
apps/genrsa.c View File

@ -166,7 +166,7 @@ opthelp:
OPENSSL_free(passout);
if (ret != 0)
ERR_print_errors(bio_err);
return (ret);
return ret;
}
static int genrsa_cb(int p, int n, BN_GENCB *cb)


+ 1
- 1
apps/nseq.c View File

@ -109,5 +109,5 @@ int nseq_main(int argc, char **argv)
BIO_free_all(out);
NETSCAPE_CERT_SEQUENCE_free(seq);
return (ret);
return ret;
}

+ 1
- 1
apps/ocsp.c View File

@ -747,7 +747,7 @@ redo_accept:
OPENSSL_free(tport);
OPENSSL_free(tpath);
return (ret);
return ret;
}
static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert,


+ 4
- 4
apps/openssl.c View File

@ -534,7 +534,7 @@ static int do_cmd(LHASH_OF(FUNCTION) *prog, int argc, char *argv[])
FUNCTION f, *fp;
if (argc <= 0 || argv[0] == NULL)
return (0);
return 0;
f.name = argv[0];
fp = lh_FUNCTION_retrieve(prog, &f);
if (fp == NULL) {
@ -549,7 +549,7 @@ static int do_cmd(LHASH_OF(FUNCTION) *prog, int argc, char *argv[])
}
}
if (fp != NULL) {
return (fp->func(argc, argv));
return fp->func(argc, argv);
}
if ((strncmp(argv[0], "no-", 3)) == 0) {
/*
@ -559,7 +559,7 @@ static int do_cmd(LHASH_OF(FUNCTION) *prog, int argc, char *argv[])
f.name = argv[0] + 3;
if (lh_FUNCTION_retrieve(prog, &f) == NULL) {
BIO_printf(bio_out, "%s\n", argv[0]);
return (0);
return 0;
}
BIO_printf(bio_out, "%s\n", argv[0] + 3);
return 1;
@ -790,7 +790,7 @@ static LHASH_OF(FUNCTION) *prog_init(void)
qsort(functions, i, sizeof(*functions), SortFnByName);
if ((ret = lh_FUNCTION_new(function_hash, function_cmp)) == NULL)
return (NULL);
return NULL;
for (f = functions; f->name != NULL; f++)
(void)lh_FUNCTION_insert(ret, f);


+ 1
- 1
apps/passwd.c View File

@ -295,7 +295,7 @@ int passwd_main(int argc, char **argv)
OPENSSL_free(salt_malloc);
OPENSSL_free(passwd_malloc);
BIO_free(in);
return (ret);
return ret;
}
/*


+ 1
- 1
apps/pkcs7.c View File

@ -193,5 +193,5 @@ int pkcs7_main(int argc, char **argv)
release_engine(e);
BIO_free(in);
BIO_free_all(out);
return (ret);
return ret;
}

+ 1
- 1
apps/rand.c View File

@ -128,5 +128,5 @@ int rand_main(int argc, char **argv)
ERR_print_errors(bio_err);
release_engine(e);
BIO_free_all(out);
return (ret);
return ret;
}

+ 1
- 1
apps/rsa.c View File

@ -307,6 +307,6 @@ int rsa_main(int argc, char **argv)
RSA_free(rsa);
OPENSSL_free(passin);
OPENSSL_free(passout);
return (ret);
return ret;
}
#endif

+ 7
- 7
apps/s_cb.c View File

@ -100,7 +100,7 @@ int verify_callback(int ok, X509_STORE_CTX *ctx)
policies_print(ctx);
if (ok && !verify_args.quiet)
BIO_printf(bio_err, "verify return:%d\n", ok);
return (ok);
return ok;
}
int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file)
@ -111,7 +111,7 @@ int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file)
BIO_printf(bio_err, "unable to get certificate from '%s'\n",
cert_file);
ERR_print_errors(bio_err);
return (0);
return 0;
}
if (key_file == NULL)
key_file = cert_file;
@ -119,7 +119,7 @@ int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file)
BIO_printf(bio_err, "unable to get private key from '%s'\n",
key_file);
ERR_print_errors(bio_err);
return (0);
return 0;
}
/*
@ -134,7 +134,7 @@ int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file)
if (!SSL_CTX_check_private_key(ctx)) {
BIO_printf(bio_err,
"Private key does not match the certificate public key\n");
return (0);
return 0;
}
}
return 1;
@ -423,19 +423,19 @@ long bio_dump_callback(BIO *bio, int cmd, const char *argp,
out = (BIO *)BIO_get_callback_arg(bio);
if (out == NULL)
return (ret);
return ret;
if (cmd == (BIO_CB_READ | BIO_CB_RETURN)) {
BIO_printf(out, "read from %p [%p] (%lu bytes => %ld (0x%lX))\n",
(void *)bio, (void *)argp, (unsigned long)argi, ret, ret);
BIO_dump(out, argp, (int)ret);
return (ret);
return ret;
} else if (cmd == (BIO_CB_WRITE | BIO_CB_RETURN)) {
BIO_printf(out, "write to %p [%p] (%lu bytes => %ld (0x%lX))\n",
(void *)bio, (void *)argp, (unsigned long)argi, ret, ret);
BIO_dump(out, argp, (int)ret);
}
return (ret);
return ret;
}
void apps_ssl_info_callback(const SSL *s, int where, int ret)


+ 1
- 1
apps/s_client.c View File

@ -3053,7 +3053,7 @@ int s_client_main(int argc, char **argv)
bio_c_out = NULL;
BIO_free(bio_c_msg);
bio_c_msg = NULL;
return (ret);
return ret;
}
static void print_stuff(BIO *bio, SSL *s, int full)


+ 13
- 13
apps/s_server.c View File

@ -255,7 +255,7 @@ static int ssl_srp_server_param_cb(SSL *s, int *ad, void *arg)
if (p->login == NULL && p->user == NULL) {
p->login = SSL_get_srp_username(s);
BIO_printf(bio_err, "SRP username = \"%s\"\n", p->login);
return (-1);
return -1;
}
if (p->user == NULL) {
@ -355,9 +355,9 @@ static int ebcdic_read(BIO *b, char *out, int outl)
BIO *next = BIO_next(b);
if (out == NULL || outl == 0)
return (0);
return 0;
if (next == NULL)
return (0);
return 0;
ret = BIO_read(next, out, outl);
if (ret > 0)
@ -373,7 +373,7 @@ static int ebcdic_write(BIO *b, const char *in, int inl)
int num;
if ((in == NULL) || (inl <= 0))
return (0);
return 0;
if (next == NULL)
return 0;
@ -396,7 +396,7 @@ static int ebcdic_write(BIO *b, const char *in, int inl)
ret = BIO_write(next, wbuf->buff, inl);
return (ret);
return ret;
}
static long ebcdic_ctrl(BIO *b, int cmd, long num, void *ptr)
@ -405,7 +405,7 @@ static long ebcdic_ctrl(BIO *b, int cmd, long num, void *ptr)
BIO *next = BIO_next(b);
if (next == NULL)
return (0);
return 0;
switch (cmd) {
case BIO_CTRL_DUP:
ret = 0L;
@ -414,7 +414,7 @@ static long ebcdic_ctrl(BIO *b, int cmd, long num, void *ptr)
ret = BIO_ctrl(next, cmd, num, ptr);
break;
}
return (ret);
return ret;
}
static int ebcdic_gets(BIO *bp, char *buf, int size)
@ -2140,7 +2140,7 @@ int s_server_main(int argc, char *argv[])
#ifdef CHARSET_EBCDIC
BIO_meth_free(methods_ebcdic);
#endif
return (ret);
return ret;
}
static void print_stats(BIO *bio, SSL_CTX *ssl_ctx)
@ -2657,7 +2657,7 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
if (ret >= 0)
BIO_printf(bio_s_out, "ACCEPT\n");
(void)BIO_flush(bio_s_out);
return (ret);
return ret;
}
static void close_accept_socket(void)
@ -2772,7 +2772,7 @@ static int init_ssl_connection(SSL *con)
}
/* Always print any error messages */
ERR_print_errors(bio_err);
return (0);
return 0;
}
print_connection_info(con);
@ -2875,7 +2875,7 @@ static DH *load_dh_param(const char *dhfile)
ret = PEM_read_bio_DHparams(bio, NULL, NULL, NULL);
err:
BIO_free(bio);
return (ret);
return ret;
}
#endif
@ -3263,7 +3263,7 @@ static int www_body(int s, int stype, int prot, unsigned char *context)
BIO_printf(bio_s_out, "ACCEPT\n");
OPENSSL_free(buf);
BIO_free_all(io);
return (ret);
return ret;
}
static int rev_body(int s, int stype, int prot, unsigned char *context)
@ -3416,7 +3416,7 @@ static int rev_body(int s, int stype, int prot, unsigned char *context)
OPENSSL_free(buf);
BIO_free_all(io);
return (ret);
return ret;
}
#define MAX_SESSION_ID_ATTEMPTS 10


+ 2
- 2
apps/sess_id.c View File

@ -163,7 +163,7 @@ int sess_id_main(int argc, char **argv)
end:
BIO_free_all(out);
SSL_SESSION_free(x);
return (ret);
return ret;
}
static SSL_SESSION *load_sess_id(char *infile, int format)
@ -186,5 +186,5 @@ static SSL_SESSION *load_sess_id(char *infile, int format)
end:
BIO_free(in);
return (x);
return x;
}

+ 1
- 1
apps/smime.c View File

@ -609,7 +609,7 @@ int smime_main(int argc, char **argv)
BIO_free(indata);
BIO_free_all(out);
OPENSSL_free(passin);
return (ret);
return ret;
}
static int save_certs(char *signerfile, STACK_OF(X509) *signers)


+ 1
- 1
apps/speed.c View File

@ -2938,7 +2938,7 @@ int speed_main(int argc, char **argv)
}
OPENSSL_free(loopargs);
release_engine(e);
return (ret);
return ret;
}
static void print_message(const char *s, long num, int length)


+ 1
- 1
apps/spkac.c View File

@ -197,5 +197,5 @@ int spkac_main(int argc, char **argv)
EVP_PKEY_free(pkey);
release_engine(e);
OPENSSL_free(passin);
return (ret);
return ret;
}

+ 1
- 1
apps/srp.c View File

@ -603,6 +603,6 @@ int srp_main(int argc, char **argv)
NCONF_free(conf);
free_index(db);
release_engine(e);
return (ret);
return ret;
}
#endif

+ 1
- 1
apps/ts.c View File

@ -320,7 +320,7 @@ int ts_main(int argc, char **argv)
X509_VERIFY_PARAM_free(vpm);
NCONF_free(conf);
OPENSSL_free(password);
return (ret);
return ret;
}
/*


+ 1
- 1
apps/verify.c View File

@ -313,5 +313,5 @@ static int cb(int ok, X509_STORE_CTX *ctx)
policies_print(ctx);
if (!v_verbose)
ERR_clear_error();
return (ok);
return ok;
}

+ 1
- 1
apps/version.c View File

@ -188,5 +188,5 @@ opthelp:
}
ret = 0;
end:
return (ret);
return ret;
}

+ 16
- 16
apps/vms_term_sock.c View File

@ -184,7 +184,7 @@ int TerminalSocket (int FunctionCode, int *ReturnSocket)
close (TerminalSocketPair[0]);
if (TerminalSocketPair[1])
close (TerminalSocketPair[1]);
return (TERM_SOCK_FAILURE);
return TERM_SOCK_FAILURE;
}
/*
@ -197,7 +197,7 @@ int TerminalSocket (int FunctionCode, int *ReturnSocket)
LogMessage ("TerminalSocket: SYS$ASSIGN () - %08X", status);
close (TerminalSocketPair[0]);
close (TerminalSocketPair[1]);
return (TERM_SOCK_FAILURE);
return TERM_SOCK_FAILURE;
}
/*
@ -216,7 +216,7 @@ int TerminalSocket (int FunctionCode, int *ReturnSocket)
LogMessage ("TerminalSocket: SYS$QIO () - %08X", status);
close (TerminalSocketPair[0]);
close (TerminalSocketPair[1]);
return (TERM_SOCK_FAILURE);
return TERM_SOCK_FAILURE;
}
/*
@ -234,7 +234,7 @@ int TerminalSocket (int FunctionCode, int *ReturnSocket)
LogMessage ("TerminalSocket: SYS$CANCEL () - %08X", status);
close (TerminalSocketPair[0]);
close (TerminalSocketPair[1]);
return (TERM_SOCK_FAILURE);
return TERM_SOCK_FAILURE;
}
/*
@ -245,7 +245,7 @@ int TerminalSocket (int FunctionCode, int *ReturnSocket)
LogMessage ("TerminalSocket: SYS$DASSGN () - %08X", status);
close (TerminalSocketPair[0]);
close (TerminalSocketPair[1]);
return (TERM_SOCK_FAILURE);
return TERM_SOCK_FAILURE;
}
/*
@ -265,14 +265,14 @@ int TerminalSocket (int FunctionCode, int *ReturnSocket)
** Invalid function code
*/
LogMessage ("TerminalSocket: Invalid Function Code - %d", FunctionCode);
return (TERM_SOCK_FAILURE);
return TERM_SOCK_FAILURE;
break;
}
/*
** Return success
*/
return (TERM_SOCK_SUCCESS);
return TERM_SOCK_SUCCESS;
}
@ -312,7 +312,7 @@ static int CreateSocketPair (int SocketFamily,
SockDesc1 = socket (SocketFamily, SocketType, 0);
if (SockDesc1 < 0) {
LogMessage ("CreateSocketPair: socket () - %d", errno);
return (-1);
return -1;
}
/*
@ -331,7 +331,7 @@ static int CreateSocketPair (int SocketFamily,
if (status < 0) {
LogMessage ("CreateSocketPair: bind () - %d", errno);
close (SockDesc1);
return (-1);
return -1;
}
/*
@ -341,7 +341,7 @@ static int CreateSocketPair (int SocketFamily,
if (status < 0) {
LogMessage ("CreateSocketPair: getsockname () - %d", errno);
close (SockDesc1);
return (-1);
return -1;
} else
LocalHostPort = sin.sin_port;
@ -360,7 +360,7 @@ static int CreateSocketPair (int SocketFamily,
if (! (status & 1)) {
LogMessage ("CreateSocketPair: SYS$BINTIM () - %08X", status);
close (SockDesc1);
return (-1);
return -1;
}
/*
@ -371,7 +371,7 @@ static int CreateSocketPair (int SocketFamily,
if (! (status & 1)) {
LogMessage ("CreateSocketPair: SYS$ASSIGN () - %08X", status);
close (SockDesc1);
return (-1);
return -1;
}
/*
@ -393,7 +393,7 @@ static int CreateSocketPair (int SocketFamily,
LogMessage ("CreateSocketPair: SYS$QIO () - %08X", status);
close (SockDesc1);
sys$dassgn (TcpDeviceChan);
return (-1);
return -1;
}
/*
@ -429,7 +429,7 @@ static int CreateSocketPair (int SocketFamily,
close (SockDesc1);
close (SockDesc2);
sys$dassgn (TcpDeviceChan);
return (-1);
return -1;
}
/*
@ -448,7 +448,7 @@ static int CreateSocketPair (int SocketFamily,
close (SockDesc1);
close (SockDesc2);
sys$dassgn (TcpDeviceChan);
return (-1);
return -1;
}
/*
@ -468,7 +468,7 @@ static int CreateSocketPair (int SocketFamily,
close (SockDesc1);
close (SockDesc2);
sys$dassgn (TcpDeviceChan);
return (-1);
return -1;
}
/*


+ 6
- 6
crypto/asn1/a_bitstr.c View File

@ -61,7 +61,7 @@ int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
ret = 1 + len;
if (pp == NULL)
return (ret);
return ret;
p = *pp;
@ -73,7 +73,7 @@ int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
p[-1] &= (0xff << bits);
}
*pp = p;
return (ret);
return ret;
}
ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,
@ -96,7 +96,7 @@ ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,
if ((a == NULL) || ((*a) == NULL)) {
if ((ret = ASN1_BIT_STRING_new()) == NULL)
return (NULL);
return NULL;
} else
ret = (*a);
@ -132,12 +132,12 @@ ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,
if (a != NULL)
(*a) = ret;
*pp = p;
return (ret);
return ret;
err:
ASN1err(ASN1_F_C2I_ASN1_BIT_STRING, i);
if ((a == NULL) || (*a != ret))
ASN1_BIT_STRING_free(ret);
return (NULL);
return NULL;
}
/*
@ -161,7 +161,7 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
if ((a->length < (w + 1)) || (a->data == NULL)) {
if (!value)
return (1); /* Don't need to set */
return 1; /* Don't need to set */
c = OPENSSL_clear_realloc(a->data, a->length, w + 1);
if (c == NULL) {
ASN1err(ASN1_F_ASN1_BIT_STRING_SET_BIT, ERR_R_MALLOC_FAILURE);


+ 6
- 6
crypto/asn1/a_d2i_fp.c View File

@ -25,12 +25,12 @@ void *ASN1_d2i_fp(void *(*xnew) (void), d2i_of_void *d2i, FILE *in, void **x)
if ((b = BIO_new(BIO_s_file())) == NULL) {
ASN1err(ASN1_F_ASN1_D2I_FP, ERR_R_BUF_LIB);
return (NULL);
return NULL;
}
BIO_set_fp(b, in, BIO_NOCLOSE);
ret = ASN1_d2i_bio(xnew, d2i, b, x);
BIO_free(b);
return (ret);
return ret;
}
# endif
@ -49,7 +49,7 @@ void *ASN1_d2i_bio(void *(*xnew) (void), d2i_of_void *d2i, BIO *in, void **x)
ret = d2i(x, &p, len);
err:
BUF_MEM_free(b);
return (ret);
return ret;
}
#endif
@ -69,7 +69,7 @@ void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x)
ret = ASN1_item_d2i(x, &p, len, it);
err:
BUF_MEM_free(b);
return (ret);
return ret;
}
#ifndef OPENSSL_NO_STDIO
@ -80,12 +80,12 @@ void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x)
if ((b = BIO_new(BIO_s_file())) == NULL) {
ASN1err(ASN1_F_ASN1_ITEM_D2I_FP, ERR_R_BUF_LIB);
return (NULL);
return NULL;
}
BIO_set_fp(b, in, BIO_NOCLOSE);
ret = ASN1_item_d2i_bio(it, b, x);
BIO_free(b);
return (ret);
return ret;
}
#endif


+ 2
- 2
crypto/asn1/a_digest.c View File

@ -29,7 +29,7 @@ int ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data,
i = i2d(data, NULL);
if ((str = OPENSSL_malloc(i)) == NULL) {
ASN1err(ASN1_F_ASN1_DIGEST, ERR_R_MALLOC_FAILURE);
return (0);
return 0;
}
p = str;
i2d(data, &p);
@ -52,7 +52,7 @@ int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *asn,
i = ASN1_item_i2d(asn, &str, it);
if (!str)
return (0);
return 0;
if (!EVP_Digest(str, i, md, len, type, NULL)) {
OPENSSL_free(str);


+ 6
- 6
crypto/asn1/a_dup.c View File

@ -21,20 +21,20 @@ void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x)
char *ret;
if (x == NULL)
return (NULL);
return NULL;
i = i2d(x, NULL);
b = OPENSSL_malloc(i + 10);
if (b == NULL) {
ASN1err(ASN1_F_ASN1_DUP, ERR_R_MALLOC_FAILURE);
return (NULL);
return NULL;
}
p = b;
i = i2d(x, &p);
p2 = b;
ret = d2i(NULL, &p2, i);
OPENSSL_free(b);
return (ret);
return ret;
}
#endif
@ -54,15 +54,15 @@ void *ASN1_item_dup(const ASN1_ITEM *it, void *x)
void *ret;
if (x == NULL)
return (NULL);
return NULL;
i = ASN1_item_i2d(x, &b, it);
if (b == NULL) {
ASN1err(ASN1_F_ASN1_ITEM_DUP, ERR_R_MALLOC_FAILURE);
return (NULL);
return NULL;
}
p = b;
ret = ASN1_item_d2i(NULL, &p, i, it);
OPENSSL_free(b);
return (ret);
return ret;
}

+ 8
- 8
crypto/asn1/a_i2d_fp.c View File

@ -22,12 +22,12 @@ int ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, void *x)
if ((b = BIO_new(BIO_s_file())) == NULL) {
ASN1err(ASN1_F_ASN1_I2D_FP, ERR_R_BUF_LIB);
return (0);
return 0;
}
BIO_set_fp(b, out, BIO_NOCLOSE);
ret = ASN1_i2d_bio(i2d, b, x);
BIO_free(b);
return (ret);
return ret;
}
# endif
@ -41,7 +41,7 @@ int ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, unsigned char *x)
b = OPENSSL_malloc(n);
if (b == NULL) {
ASN1err(ASN1_F_ASN1_I2D_BIO, ERR_R_MALLOC_FAILURE);
return (0);
return 0;
}
p = (unsigned char *)b;
@ -59,7 +59,7 @@ int ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, unsigned char *x)
n -= i;
}
OPENSSL_free(b);
return (ret);
return ret;
}
#endif
@ -72,12 +72,12 @@ int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x)
if ((b = BIO_new(BIO_s_file())) == NULL) {
ASN1err(ASN1_F_ASN1_ITEM_I2D_FP, ERR_R_BUF_LIB);
return (0);
return 0;
}
BIO_set_fp(b, out, BIO_NOCLOSE);
ret = ASN1_item_i2d_bio(it, b, x);
BIO_free(b);
return (ret);
return ret;
}
#endif
@ -89,7 +89,7 @@ int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x)
n = ASN1_item_i2d(x, &b, it);
if (b == NULL) {
ASN1err(ASN1_F_ASN1_ITEM_I2D_BIO, ERR_R_MALLOC_FAILURE);
return (0);
return 0;
}
for (;;) {
@ -104,5 +104,5 @@ int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x)
n -= i;
}
OPENSSL_free(b);
return (ret);
return ret;
}

+ 4
- 4
crypto/asn1/a_int.c View File

@ -396,7 +396,7 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
if ((a == NULL) || ((*a) == NULL)) {
if ((ret = ASN1_INTEGER_new()) == NULL)
return (NULL);
return NULL;
ret->type = V_ASN1_INTEGER;
} else
ret = (*a);
@ -438,12 +438,12 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
if (a != NULL)
(*a) = ret;
*pp = p;
return (ret);
return ret;
err:
ASN1err(ASN1_F_D2I_ASN1_UINTEGER, i);
if ((a == NULL) || (*a != ret))
ASN1_INTEGER_free(ret);
return (NULL);
return NULL;
}
static ASN1_STRING *bn_to_asn1_string(const BIGNUM *bn, ASN1_STRING *ai,
@ -487,7 +487,7 @@ static ASN1_STRING *bn_to_asn1_string(const BIGNUM *bn, ASN1_STRING *ai,
err:
if (ret != ai)
ASN1_INTEGER_free(ret);
return (NULL);
return NULL;
}
static BIGNUM *asn1_string_to_bn(const ASN1_INTEGER *ai, BIGNUM *bn,


+ 14
- 14
crypto/asn1/a_object.c View File

@ -24,7 +24,7 @@ int i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp)
int objsize;
if ((a == NULL) || (a->data == NULL))
return (0);
return 0;
objsize = ASN1_object_size(0, a->length, V_ASN1_OBJECT);
if (pp == NULL || objsize == -1)
@ -36,7 +36,7 @@ int i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp)
p += a->length;
*pp = p;
return (objsize);
return objsize;
}
int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num)
@ -49,7 +49,7 @@ int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num)
BIGNUM *bl = NULL;
if (num == 0)
return (0);
return 0;
else if (num == -1)
num = strlen(buf);
@ -158,12 +158,12 @@ int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num)
if (tmp != ftmp)
OPENSSL_free(tmp);
BN_free(bl);
return (len);
return len;
err:
if (tmp != ftmp)
OPENSSL_free(tmp);
BN_free(bl);
return (0);
return 0;
}
int i2t_ASN1_OBJECT(char *buf, int buf_len, const ASN1_OBJECT *a)
@ -177,7 +177,7 @@ int i2a_ASN1_OBJECT(BIO *bp, const ASN1_OBJECT *a)
int i;
if ((a == NULL) || (a->data == NULL))
return (BIO_write(bp, "NULL", 4));
return BIO_write(bp, "NULL", 4);
i = i2t_ASN1_OBJECT(buf, sizeof buf, a);
if (i > (int)(sizeof(buf) - 1)) {
p = OPENSSL_malloc(i + 1);
@ -193,7 +193,7 @@ int i2a_ASN1_OBJECT(BIO *bp, const ASN1_OBJECT *a)
BIO_write(bp, p, i);
if (p != buf)
OPENSSL_free(p);
return (i);
return i;
}
ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
@ -221,7 +221,7 @@ ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
return ret;
err:
ASN1err(ASN1_F_D2I_ASN1_OBJECT, i);
return (NULL);
return NULL;
}
ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
@ -281,7 +281,7 @@ ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
if ((a == NULL) || ((*a) == NULL) ||
!((*a)->flags & ASN1_OBJECT_FLAG_DYNAMIC)) {
if ((ret = ASN1_OBJECT_new()) == NULL)
return (NULL);
return NULL;
} else
ret = (*a);
@ -312,12 +312,12 @@ ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
if (a != NULL)
(*a) = ret;
*pp = p;
return (ret);
return ret;
err:
ASN1err(ASN1_F_C2I_ASN1_OBJECT, i);
if ((a == NULL) || (*a != ret))
ASN1_OBJECT_free(ret);
return (NULL);
return NULL;
}
ASN1_OBJECT *ASN1_OBJECT_new(void)
@ -327,10 +327,10 @@ ASN1_OBJECT *ASN1_OBJECT_new(void)
ret = OPENSSL_zalloc(sizeof(*ret));
if (ret == NULL) {
ASN1err(ASN1_F_ASN1_OBJECT_NEW, ERR_R_MALLOC_FAILURE);
return (NULL);
return NULL;
}
ret->flags = ASN1_OBJECT_FLAG_DYNAMIC;
return (ret);
return ret;
}
void ASN1_OBJECT_free(ASN1_OBJECT *a)
@ -367,5 +367,5 @@ ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len,
o.length = len;
o.flags = ASN1_OBJECT_FLAG_DYNAMIC | ASN1_OBJECT_FLAG_DYNAMIC_STRINGS |
ASN1_OBJECT_FLAG_DYNAMIC_DATA;
return (OBJ_dup(&o));
return OBJ_dup(&o);
}

+ 10
- 10
crypto/asn1/a_print.c View File

@ -21,7 +21,7 @@ int ASN1_PRINTABLE_type(const unsigned char *s, int len)
if (len <= 0)
len = -1;
if (s == NULL)
return (V_ASN1_PRINTABLESTRING);
return V_ASN1_PRINTABLESTRING;
while ((*s) && (len-- != 0)) {
c = *(s++);